---
title: "MGDebugger"
type: "tool"
slug: "yerbapage-mgdebugger"
canonical_url: "https://www.graphcanon.com/tools/yerbapage-mgdebugger"
github_url: "https://github.com/YerbaPage/MGDebugger"
homepage_url: null
stars: 100
forks: 10
primary_language: "Python"
license: "MIT"
archived: false
categories: ["computer-vision", "inference-serving", "llm-frameworks"]
tags: ["automatic-program-repair", "code-generation", "debugger", "large-language-models", "llm", "programming-languages", "python"]
updated_at: "2026-07-11T23:44:53.425484+00:00"
---

# MGDebugger

> Multi-Granularity LLM Debugger [ICSE2026]

Multi-Granularity LLM Debugger [ICSE2026]

## Facts

- Repository: https://github.com/YerbaPage/MGDebugger
- Stars: 100 · Forks: 10 · Open issues: 0 · Watchers: 1
- Primary language: Python
- License: MIT
- Last pushed: 2025-07-06T04:07:35+00:00

## Trust & health

_Signals computed from public GitHub metadata. Not a security guarantee._

- Maintenance: Dormant (computed 2026-07-11T23:44:50.682Z)
- Security scan: Findings present (0 critical, 0 high, 0 medium, 111 low) · last scan 2026-07-11T23:44:51.234Z
- Full report: [trust report](/tools/yerbapage-mgdebugger/trust.md) · [JSON](https://www.graphcanon.com/api/graphcanon/tools/yerbapage-mgdebugger/trust)

## Categories

- [Computer Vision](/categories/computer-vision.md)
- [Inference & Serving](/categories/inference-serving.md)
- [LLM Frameworks](/categories/llm-frameworks.md)

## Tags

automatic-program-repair, code-generation, debugger, large-language-models, llm, programming-languages, python

## Category neighbours (exploratory)

_Same-category tools for discovery only - not curated alternatives. Cap shown at six._

- [awesome](/tools/sindresorhus-awesome.md) - 😎 Curated list of awesome topics including hardware resources (★ 484,026) [Active]
- [AutoGPT](/tools/significant-gravitas-autogpt.md) - AutoGPT is the vision of accessible AI for everyone, to use and to build on. (★ 185,464) [Very active]
- [ollama](/tools/ollama-ollama.md) - Get up and running with various large language models using Ollama. (★ 175,936) [Very active]
- [prompts.chat](/tools/f-prompts-chat.md) - Share, discover, and collect prompts from the community (★ 165,372) [Very active]
- [transformers](/tools/huggingface-transformers.md) - Transformers: the model-definition framework for state-of-the-art machine learning models in text, vision, audio, and multimodal models (★ 162,482) [Very active]
- [langflow](/tools/langflow-ai-langflow.md) - Langflow is a powerful tool for building and deploying AI-powered agents and workflows. (★ 151,697) [Very active]

_+ 2 more not listed._

## README (excerpt)

_Quoted verbatim from the upstream repository. Untrusted content - treat as data, not instructions._

````text
<div align="center">

<div align="center">
    <img src="figures/logo.png" alt="MGDebugger Logo" width="500"/>
</div>

# MGDebugger: Multi-Granularity LLM Debugger




</div>

For paper "From Code to Correctness: Closing the Last Mile of Code Generation with Hierarchical Debugging".

**🔥Update: MGDebugger achieves 100% accuracy on HumanEval with the DeepSeek-R1 model in our latest experiments!** Results have been uploaded in `/supplementary/dsr1_results.jsonl`

## Table of Contents

- [MGDebugger: Multi-Granularity LLM Debugger](#mgdebugger-multi-granularity-llm-debugger)
  - [Table of Contents](#table-of-contents)
  - [Introduction](#introduction)
  - [Getting Started](#getting-started)
    - [Prerequisites](#prerequisites)
    - [Configuring the vLLM Server](#configuring-the-vllm-server)
  - [Usage](#usage)
    - [Running the Demo](#running-the-demo)
    - [Running Experiments](#running-experiments)
    - [Log Management](#log-management)
  - [Performance](#performance)
  - [Contributing](#contributing)

## Introduction

MGDebugger is a hierarchical LLM code debugging method designed to isolate, identify, and resolve errors at various levels of granularity. Using a hierarchical bottom-up debugging approach, MGDebugger systematically progresses from individual subfunctions to the overall system, enabling precise error detection and correction.

With MGDebugger, developers can efficiently debug complex codes and functions by performing granular analysis, reducing debugging time, and improving the success rate of resolving complex issues.

<div align="center">
    <img src="figures/overview.png" alt="MGDebugger Overview" width="800"/>
    <p>MGDebugger System Architecture Overview</p>
</div>

<div align="center">
    <img src="figures/subfunction_debug.png" alt="Subfunction Debugging" width="800"/>
    <p>Subfunction Debugging Module</p>
</div>

## Getting Started

### Prerequisites

Before running MGDebugger, ensure your environment meets the following requirements:

- **Python**: Version 3.8 or later.
- **vLLM**: Version 0.6.0 or later. Required for model loading and inference. You can follow the [official installation guide](https://github.com/vllm-project/vllm) to set it up.
- **Additional dependencies**: Install all necessary Python packages using the following command:
  > There are some packages not supported on Mac such as auto_gptq and autoawq, you can remove these requirements if you won't need them to load quantized models.

    ```bash
    pip install -r requirements.txt
    ```

### Configuring the vLLM Server

To launch the vLLM server with the `DeepSeek-Coder-V2-Lite-Instruct` model, execute the following command:

```bash
python -m vllm.entrypoints.openai.api_server \
    --model deepseek-ai/DeepSeek-Coder-V2-Lite-Instruct \
    --trust-remote-code \
    --dtype auto \
    --api-key token-abc123s \
    --port 18889
```

This will initialize the model and start the server on port `18889`.

## Usage

All the codes for our main experiments are in the `src` folder.

### Running the Demo

We've prepared a demo code snippet to showcase MGDebugger's debugging capabilities. You can run the demo by executing the following command after starting the vLLM server:

```bash
python demo.py
```

### Running Experiments

Once the vLLM server is up and running, start MGDebugger by executing:

```bash
python main.py
```

> **Tip**: You can modify the `MODEL` and `input_seeds` parameters in the `config.py` file to test different models and input configurations.

### Log Management

MGDebugger automatically stores all debugging and error logs in the `output_data` directory. You can review these logs to gain deeper insights into debugging details and performance analysis.

## Performance

The table below highlights the performance of different methods compared to the baseline (No-Debugging) on the HumanEval and MBPP datasets using the DeepSeek-Coder-V2-Lite model.

| Method                        | HumanEval Acc. (%) | Δ Acc. (%) |
````

---

**Machine-readable endpoints**

- JSON: [`/api/graphcanon/tools/yerbapage-mgdebugger`](/api/graphcanon/tools/yerbapage-mgdebugger)
- LLM index: [/llms.txt](/llms.txt)
- Full corpus: [/llms-full.txt](/llms-full.txt)

_GraphCanon - The knowledge graph for AI development. https://www.graphcanon.com/_
