README.md

September 3, 2026 ยท View on GitHub

Steer, Don't Solve: Training Small Critic Models for Large Code Agents

arXiv Hugging Face Collection

Code, configs, and launch scripts for training and running a small critic model next to a large coding agent. The critic reads the agent's trajectory every k steps and returns a short structured critique: detected error categories, evidence, a recovery action, task status, and one line of guidance. It steers the agent and never writes the patch. A 4B or 8B critic trained this way improves six different coding agents on SWE-bench Verified, at a small fraction of the cost of using a frontier model as the critic.

Inference setup: a frozen coding agent takes actions; every k steps a critic reads the trajectory and returns high-level feedback.

How the critics are trained

SFT. A frozen coding agent runs on 500 R2E-Gym tasks from matplotlib, moto, and sympy (disjoint from SWE-bench Verified). Every 5 steps, Claude Opus 4.6 writes a critique of the trajectory so far under a high-level prompt that forbids code and asks for one or two sentences of guidance. The (trajectory prefix, critique) pairs are the SFT data for a Qwen3-4B or Qwen3-8B critic.

SFT pipeline: agent trajectories are critiqued by a teacher every k steps; the pairs train a small critic.

DPO. The SFT critic samples ten critiques at each critique point, an LLM judge picks the best and the worst, and the resulting preference pairs are used for DPO on top of the 4B SFT critic.

DPO pipeline: the SFT critic samples N critiques, a judge picks best and worst, pairs train the critic with DPO.

Released models and data

Everything the paper reports is under the code-critic-model organization on Hugging Face. <base>-Critic-SFT is the critic trained on the full mixed corpus; a suffix names the one thing an ablation changes.

ModelBaseTrained onPaper
Qwen3-8B-Critic-SFTQwen3-8Bcritic-sft-cwm-qwenmain 8B critic (Tables 1 to 4)
Qwen3-4B-Critic-SFTQwen3-4B-Instruct-2507critic-sft-cwm-qwen4B SFT critic (Tables 1, 3)
Qwen3-4B-Critic-SFT-DPOQwen3-4B-Critic-SFT1,409 preference pairs4B SFT + DPO critic (Table 1)
Qwen3-8B-Critic-SFT-CWM-onlyQwen3-8Bcritic-sft-cwm-onlycorpus ablation (Table 3)
Qwen3-8B-Critic-SFT-Qwen-onlyQwen3-8Bcritic-sft-qwen-onlycorpus ablation (Table 3)
Qwen3-4B-Critic-SFT-Qwen-onlyQwen3-4B-Instruct-2507critic-sft-qwen-onlycorpus ablation (Table 3)
Qwen3-8B-Critic-SFT-Detailed-PromptQwen3-8Bcritic-sft-cwm-only-detailed-promptprompt ablation (Table 4)
DatasetRecordsAgent trajectoriesTeacher prompt
critic-sft-cwm-qwen6,447CWM-32B + Qwen3-Next-80B-A3Bhigh-level
critic-sft-cwm-only4,532CWM-32Bhigh-level
critic-sft-qwen-only1,915Qwen3-Next-80B-A3Bhigh-level
critic-sft-cwm-only-detailed-prompt3,135CWM-32Bdetailed

Each model card lists the exact paper rows it backs, its training data and hyperparameters, and the serving command. The local copies of the SFT corpora live in finetuning/prm_sft_*/.

Main results

Resolve rate, localization rate, non-empty patch rate, and non-loop rate on SWE-bench Verified (500 instances). Each configuration reports the better of k=5 and k=10. Qwen3-4B and Qwen3-8B alone are the untrained base models used as critics. Bold marks the best non-Opus value in each column of an agent block.

Coding agentCriticResolved %Localized %Non-Empty %Non-Loop %
Qwen3-32BNo critic8.849.274.892.0
Qwen3-4B10.255.490.095.2
Qwen3-4B + SFT11.452.474.690.4
Qwen3-4B + SFT + DPO14.452.269.295.0
Qwen3-8B10.049.473.093.0
Qwen3-8B + SFT13.849.865.893.0
Opus 4.6 (upper bound)26.867.882.492.4
Qwen3-Next-80B-A3BNo critic20.069.892.695.0
Qwen3-4B20.270.499.897.8
Qwen3-4B + SFT24.276.899.298.2
Qwen3-4B + SFT + DPO26.278.499.298.4
Qwen3-8B20.669.497.694.8
Qwen3-8B + SFT25.275.699.896.2
Opus 4.6 (upper bound)38.281.4100.099.4
GPT-OSS-20BNo critic3.011.858.41.4
Qwen3-4B6.836.698.83.0
Qwen3-4B + SFT9.852.699.65.0
Qwen3-4B + SFT + DPO14.855.099.65.6
Qwen3-8B + SFT13.052.099.45.4
GLM-4.7-Flash-30B-A3BNo critic21.634.836.054.8
Qwen3-4B29.862.270.467.2
Qwen3-4B + SFT35.269.679.674.2
Qwen3-4B + SFT + DPO35.871.079.275.0
Qwen3-8B + SFT37.673.483.470.6
GPT-OSS-120B (medium reasoning)No critic20.457.495.294.2
Qwen3-4B16.846.6100.099.2
Qwen3-4B + SFT31.275.299.898.0
Qwen3-4B + SFT + DPO34.875.899.297.2
Qwen3-8B + SFT31.474.899.296.8
o3-miniNo critic19.069.499.4100.0
Qwen3-4B20.464.4100.0100.0
Qwen3-4B + SFT27.673.2100.099.6
Qwen3-4B + SFT + DPO28.275.2100.099.4
Qwen3-8B + SFT29.471.0100.098.8

Cost against resolve rate for the same six agents. Circles are the agents alone, stars add the 8B SFT critic, and hollow circles add the Opus 4.6 teacher as critic. Cost covers the agent plus the critic.

Cost versus resolve rate on SWE-bench Verified for six agents, alone and with the 8B SFT critic.

Multi-SWE-bench. Resolve rate on 300 Multi-SWE-bench instances with the 8B critic at k=5. The critic saw only Python during training.

Coding agentNo critic+ Qwen3-8B-Critic-SFT
Qwen3-Next-80B-A3B9.711.7
Qwen3-32B1.33.3

Training corpus. Resolve rate for critics trained on the three SFT corpora.

Critic sizeCorpusQwen3-Next-80B-A3BQwen3-32B
none20.08.8
4BQwen-only24.610.8
4BQwen + CWM24.211.4
8BCWM-only23.611.4
8BQwen-only26.210.6
8BQwen + CWM25.213.8

Teacher prompt. Resolve rate for 8B critics trained on detailed versus high-level teacher critiques. Both use the same high-level prompt at inference.

CriticQwen3-Next-80B-A3BQwen3-32B
No critic20.08.8
8B + SFT (detailed-prompt critiques)24.612.6
8B + SFT (high-level critiques, ours)25.213.8

Using this repository

  • QUICKSTART.md: clone, install, serve a critic, run an agent on SWE-bench Verified, and retrain the critic, in a handful of commands.
  • HANDOVER.md: directory map, where data lives on the cluster, naming conventions, the LiteLLM path for running without AWS, and end-to-end commands for training and inference.

The agent loop is a fork of mini-swe-agent with hooks that call the critic every k steps (mini-swe-agent/src/minisweagent/agents/default_prm.py). Critic training uses LLaMA-Factory with the configs in finetuning/.

Citation

@misc{gandhi2026steerdontsolvetraining,
  title={Steer, Don't Solve: Training Small Critic Models for Large Code Agents},
  author={Shubham Gandhi and Yiqing Xie and Atharva Naik and Ruichen Zhu and Carolyn Rose},
  year={2026},
  eprint={2606.21811},
  archivePrefix={arXiv},
  primaryClass={cs.SE},
  url={https://arxiv.org/abs/2606.21811}
}