Qwen3.5-9B SWE-GRPO
This branch: iter79 = GRPO step 79.
Qwen/Qwen3.5-9B trained with GRPO as a software-engineering agent on the 1000 tasks of mliu444/swe-rl-curated-1k (500 SWE-rebench-V2 + 500 R2E-Gym, curated after Arctic-SWE Sec. 4.1), with execution-based rewards from the hidden tests. Each checkpoint is a branch of this repository:
| branch | GRPO step |
|---|---|
main, iter79 | 79 |
iter69 | 69 |
iter59 | 59 |
iter49 | 49 |
from transformers import AutoModelForCausalLM, AutoTokenizer
model = AutoModelForCausalLM.from_pretrained("mliu444/qwen3.5-9b-swe-grpo", revision="iter59", dtype="auto")
tokenizer = AutoTokenizer.from_pretrained("mliu444/qwen3.5-9b-swe-grpo", revision="iter59")
The files are those of Qwen3.5-9B (config, tokenizer, chat template, the same 775 tensors in the same dtypes), so
SGLang and vLLM load them as they load the base model. Only the language model was trained. The vision tower
(model.visual.*) and the MTP head (mtp.*) are the base model's own, unchanged.
Training
- Agent: a single-tool-call-per-turn harness (reasoning, then one call:
execute_bash, file edits,submit) in a sandbox of the task's repository, up to 100 turns (200 from step 40), 32k tokens a response, a 131k-token trajectory budget. - Reward: 1 if every FAIL_TO_PASS and PASS_TO_PASS test passes after the submitted diff, else 0. A malformed turn ends the rollout with -1 (training mode); a rollout that ends on a budget without submitting scores 0.
- Algorithm: GRPO with group-centred advantages (no std normalization), no KL, no entropy term, PPO clip 0.2 / 0.28, mean over every trained token, groups whose rewards are all equal left out of the step.
- Batch: 16 tasks x 8 rollouts per step, one optimizer step per batch. AdamW at a constant lr 1e-6, beta2 0.98, eps 1e-15, no weight decay, gradient clipping 1.0.
- Infrastructure: Megatron trainer (TP 2 x DP 4) and SGLang on one 8 x B300 node; rollouts from an agent service with sandboxed repositories.
On the training tasks, the solve rate rose from 18% (steps 0-7) to about 70% (steps 40-63). Malformed turns fell from 62% of rollouts to 1-2%.
SWE-bench Verified
The same harness, on_invalid=feedback (a malformed turn gets an error message and the model answers again), up
to 200 turns, temperature 1.0. Grading uses network access, as the official harness does, and the swebench 4.0.3
re-grade agreed with ours on every graded log.
| model | 500 tasks, 1 sample | 493 tasks whose gold patch passes here | 200-task subset, 2 samples |
|---|---|---|---|
| Qwen3.5-9B (base) | 57.0% | 57.8% | 66.2% |
| step 49 | not evaluated | ||
| step 59 | 60.6% | 61.5% | 65.0% |
| step 69 | not evaluated | ||
| step 79 | 59.2% | 60.0% | 64.0% |
On the 493 tasks graded for both models, step 59 is +3.7 points over base (95% CI +0.2 to +7.1) and step 79 is +2.2 points (CI -1.3 to +5.8). On the 200-task subset (stratified by repository, seed 0), the gains in solve rate are within noise. What GRPO changed most is the format and efficiency:
- format errors per trajectory fell from 4.4 to about 0.03;
- rollouts that ran into the 200-turn limit fell from 38/400 to 3/400;
- the median trajectory fell from 26.6k to 19.7k tokens.
Limitations
Trained for 80 steps on 1000 Python repositories, and evaluated only on SWE-bench Verified with this harness's tool format; the chat template and tool-call format are Qwen3.5's. Single seeds, single samples: differences of a few points are not significant.