Downloads · 30 days
12
13% of all-time downloads
Pilestin/qwen2.5-3b-debug-v2-GGUF
qwen2.5-3b-debug-v2-GGUF is a text generation model from Pilestin. Use it when you need the model to write or continue text. The card lists the license as other.
A Q4KM GGUF build of a Qwen2.5-3B-Instruct model fine-tuned to fix buggy Python programs. You give it a broken program (plus its error message and stdin), and it returns the corrected program in a single python bash o…
Downloads · 30 days
12
13% of all-time downloads
All-time downloads
92
Public
Repo size
1.9 GB
Likes
0
Public
Click a slice to open those files.
.gguf1.9 GB · 100%
From the Hugging Face model README
A Q4_K_M GGUF build of a Qwen2.5-3B-Instruct model fine-tuned to fix buggy Python
programs. You give it a broken program (plus its error message and stdin), and it returns the corrected
program in a single ```python block.
This is variant v2 (code + error) of a three-way ablation. The ablation tests whether giving a small model a dynamic execution trace (from FocusTracer) helps it repair code.
| Variant | Model input | pass@1 |
|---|---|---|
| v1 | buggy code | 64.8% |
| v2 | buggy code + error message / stderr + stdin | 69.1% |
| v3 | buggy code + error + FocusTracer execution trace summary | 68.4% |
The LoRA adapter this file was built from is at Pilestin/qwen2.5-3b-debug-v2-lora.
| File | Quant | Size |
|---|---|---|
qwen2.5-3b-debug-v2-q4_k_m.gguf | Q4_K_M | 1.80 GB |
Run it directly from the Hub:
ollama run hf.co/Pilestin/qwen2.5-3b-debug-v2-GGUF
The system prompt matters: the model was trained with the system prompt below, so pass it
yourself. The simplest way is to download the Modelfile in this repo, which already sets
the system prompt, chat template and sampling parameters:
hf download Pilestin/qwen2.5-3b-debug-v2-GGUF --local-dir .
ollama create qwen-debug-v2 -f Modelfile
ollama run qwen-debug-v2
llama-cli -m qwen2.5-3b-debug-v2-q4_k_m.gguf -cnv --temp 0 \
-sys "You are an expert Python debugging assistant. The user gives you a buggy Python program (and optionally its runtime error and an execution trace). Reply with the corrected program in a single \`\`\`python code block. Do not add explanations."
The system prompt is:
You are an expert Python debugging assistant. The user gives you a buggy Python program (and optionally its runtime error and an execution trace). Reply with the corrected program in a single ```python code block. Do not add explanations.
The user message is built step by step. Each variant adds a section to the one before it:
Fix the following buggy Python program.
```python
<buggy program>
```
── v1 ends here
Runtime error:
<exception message + last 4 lines of stderr>
(if there is no exception, this whole section is replaced by one of:
"The program runs without crashing but produces WRONG OUTPUT for the given input."
"The program is too slow / never terminates (time limit exceeded).")
Program input (stdin):
```
<stdin, if ≤ 400 chars>
```
── v2 ends here
Execution trace (FocusTracer, last steps before failure):
```
L3: for i in range[0:3]:
!! EXCEPTION at L3: TypeError: 'type' object is not subscriptable
```
── v3 ends here
The trace summary is the last 25 line events before the failure, capped at 1,800 characters.
Each line has the form L<line>: <source> [var=value, ...]: the line number (matching the
buggy program), its source, and the variables that changed on that line. Any exception is
shown as an !! EXCEPTION line.
The assistant reply is always the whole fixed program in a single ```python block.
The benchmark set is 960 held-out CodeNetPy Python bug-fix pairs. The test problems do not appear in training: training covers 466 problems, test covers 306 different ones.
| Input variant | Base Qwen2.5-3B-Instruct (same prompt) | Fine-tuned | Δ |
|---|---|---|---|
| v1 · code only | 59.8% | 64.8% | +5.0 |
| v2 · code + error | 57.2% | 69.1% | +11.9 |
| v3 · code + error + trace | 59.2% | 68.4% | +9.2 |
Fine-tuned models, by bug category (pass@1):
| Model | runtime exception | wrong answer | time limit exceeded | exact | tok/s | J/query |
|---|---|---|---|---|---|---|
| FT-v1 | 49.4% | 73.6% | 77.9% | 14.4% | 80.7 | 71.7 |
| FT-v2 | 57.0% | 81.0% | 74.6% | 16.4% | 85.0 | 69.6 |
| FT-v3 | 60.3% | 77.3% | 71.1% | 18.4% | 86.2 | 65.9 |
Key findings:
The training dataset is not published. This section summarizes how it was built.
ast.parse.
The result is 1,959 train / 960 test pairs, with no problem overlap between the splits.bug_category (runtime_exception / wrong_answer /
time_limit_exceeded), an error_class (e.g. TypeError, IndexError) and diff line ranges.
About 1/3 of the pairs fall in each category.error_class label in
96–99 % of cases. For training, each trace was shrunk to the compact summary shown in
Prompt format.QLoRA with TRL SFTTrainer, sized to fit in 8 GB of VRAM.
| Setting | Value |
|---|---|
| Base model | Qwen/Qwen2.5-3B-Instruct (4-bit NF4, double quant, bf16 compute) |
| LoRA | r = 16, alpha = 32, dropout = 0.05, bias none |
| Target modules | q, k, v, o, gate, up, down projections |
| Max sequence length | 2048 |
| Epochs | 3 (best eval-loss checkpoint kept) |
| Effective batch size | 8 (1 × 8 gradient accumulation) |
| Optimizer / LR | paged AdamW 8-bit, 2e-4, cosine, 50 warmup steps, weight decay 0.01 |
| Other | gradient checkpointing, no packing |