PRism reviewer (Qwen2.5-Coder-3B, fine-tuned)
Built with Qwen. This model is a fine-tune of
Qwen/Qwen2.5-Coder-3B-Instruct and is
released under the Qwen Research License (see LICENSE): research and other
non-commercial use only.
It is the first-pass reviewer of PRism, a repo-aware code
reviewer: given one diff hunk, it writes the single most useful review comment as
{"comment": "..."}. In PRism, Claude then verifies every comment against the code before
anything is posted.
Files
prism-reviewer-3b.Q4_K_M.gguf: the merged model, quantized to Q4_K_M (about 1.9 GB), for Ollama or llama.cpp.Modelfile: the Ollama settings PRism uses (chat template, system prompt, greedy decoding).adapter/: the LoRA adapter (PEFT), to apply to the base model in Transformers.
Use with Ollama
huggingface-cli download Maverick0824/prism-reviewer-3b --local-dir prism-reviewer-3b
cd prism-reviewer-3b && ollama create prism-reviewer:v2 -f Modelfile
Then set PRISM_REVIEWER_MODEL=prism-reviewer:v2 for PRism, or call it directly:
ollama run prism-reviewer:v2 "@@ -10,3 +10,3 @@
- if total > limit:
+ if total >= limit:"
Model
- Base model:
Qwen/Qwen2.5-Coder-3B-Instruct, loaded asunsloth/Qwen2.5-Coder-3B-Instruct-bnb-4bit - Method: QLoRA (4-bit NF4 base, 16-bit LoRA adapter), 29.9M trainable parameters (0.96%)
- Task: write one review comment for one diff hunk
- Input: the hunk after
normalize_hunk, in the chat format ofprism/models/reviewer.py - Output:
{"comment": "..."};anchor_linepicks the line afterwards (ADR 0009) - Serving: merged and quantised to GGUF Q4_K_M (1.93 GB), Ollama, greedy decoding, at most 128 new tokens
- Run: commit
833cbad, 2026-11-13, Kaggle, one Tesla T4 (Unsloth uses one GPU), training 214 min, seed 13. Python 3.13.16, torch 2.11.0+cu130, transformers 5.17.0, Unsloth 2026.11.4
Data
- CodeReviewer comment generation, Zenodo record 6900648 (CC BY 4.0); see
docs/datasets.md - Train: 117,739 rows read, 95,284 kept, 40,000 sampled
- Dropped from train: 10,937 vague, 7,572 duplicates, 3,354 linter or bot output, 320 repeated comment text, 226 comments over 120 words, 26 hunks too long, 20 non-English comments
- 21 of the 40,000 were over 1,024 tokens and dropped by the trainer: 39,979 trained on
- Valid: 500 sampled from 8,951 kept, filtered like train
- Test: 500 from the dataset's test split, not filtered beyond length and duplicates, the same rows as run 1 and the base model
"Vague" is a comment under 8 words that shares no identifier with the hunk and has no
backtick, number, snake_case, camelCase or call in it ("Is this really necessary?"). Linter
output is matched by a regex in training/sft/format.py (RuboCop cops, checkpatch "(style)",
line length, whitespace, quote style).
Training
| Setting | Value |
|---|---|
| LoRA rank, alpha, dropout | 16, 16, 0 |
| Target modules | q, k, v, o, gate, up, down projections |
| Batch size | 8 x 2 accumulation = 16 |
| Learning rate, schedule, warmup | 2e-4, cosine, 3% |
| Weight decay | 0.01 |
| Max length | 1,024 tokens |
| Epochs, steps | 1, 2,499 |
| Loss | on the reply only |
| Final train loss | 2.220 |
Validation loss every 250 steps:
| Step | Loss |
|---|---|
| 250 | 2.244 |
| 500 | 2.241 |
| 750 | 2.228 |
| 1,000 | 2.223 |
| 1,250 | 2.215 |
| 1,500 | 2.212 |
| 1,750 | 2.206 |
| 2,000 | 2.202 |
| 2,250 | 2.202 |
| 2,499 | 2.202 |
It was still falling slowly until step 2,000 and flat after. A second epoch would not change much.
Results
On the 500 test hunks (eval/reports/sft.md):
| Base | This model | |
|---|---|---|
| BLEU-4 | 5.36 | 5.56 |
| ROUGE-L | 13.20 | 14.21 |
| Valid JSON | 98.8% | 99.8% |
| Mean words | 16.2 | 12.0 |
| Blinded judge (Claude Sonnet, 500 pairs): share of decided pairs won | 48.6% (95% interval 43.2 to 54.0) |
The judge cannot tell it from the base model on usefulness. It is used as the default because its replies are shorter and almost always valid JSON, not because its comments are better.
Speed on CPU (Core Ultra 7 155H, Ollama, 4 slots): about 20 hunks per minute one at a time, and
34 to 46 per minute with 4 in flight. Measurements on this laptop move by up to a factor of two
between sessions (eval/reports/reviewer_throughput.jsonl).
Limits
- It does not know more about bugs than the base model. Fine-tuning changed how comments are phrased, not what they find.
- It sounds sure when it is wrong. It suggests renames, removals and missing fields in a reviewer's voice, often about code it cannot see. The verifier is meant to catch these.
- Every comment sounds alike. 89% start with "I think" and 1% ask a question, against 3% and
43% for human reviewers. This comes from greedy decoding always taking the most common opener,
not from the training data (
eval/reports/sft.md). - It sees one hunk. It was trained without repository context and is served without it. BugBench tests whether context helps it.
- Scores are for the Kaggle version. The served Q4_K_M model writes different text for the same hunk (0 of 20 identical, all 20 valid JSON); it was not scored separately.
- The labels are what reviewers wrote on open-source projects in 2022 and earlier. Comments about project habits and code outside the hunk are part of the data.
- Licence. The base model and these weights are under the Qwen Research License:
non-commercial use only (see
LICENSE).