One to More, More to One: Category-Aware Iterative Expert Training for Software Engineering Agents
Organizations: Alibaba Group Model · Logics-SWE-Qwen3.6-27B
Abstract
Repository-level software engineering (SWE) comprises heterogeneous task categories, whose progress under pooled agentic reinforcement learning can be uneven: gains in some categories coincide with regressions in others, while aggregate resolution obscures these changes. Motivated by this category see-saw, we develop a category-aware expert-training and policy-integration framework. Executable task construction and SWE Labeler, an evidence-grounded multi-axis labeling system, organize the training pools. Initial category-specific RL improves average training success while leaving uneven instance-level progress, motivating explicit consolidation of successful behavior and policy-adaptive task selection. Same-origin category experts alternate long-horizon Agentic-miniRL with Refresh-Repair-Expand (RRE): the updated policy refreshes instance mastery, reuses its own verified successful trajectories for Repair SFT, and reselects tasks for further RL. Label-routed multi-teacher on-policy distillation (MOPD) consolidates the experts into one deployable student, with ReLU-gated reward extrapolation keeping only each teacher's improving direction over the reference. Expert training and policy integration require no external model to provide solution trajectories or action targets. We evaluate Pooled RL and Balanced RL, expert development, and single-model integration through aggregate and per-category resolution, the minimum category lift over each joint-RL baseline, and expert-gain recovery. The final MOPD policy achieves mean resolution of 58.04% on Pro-618 and 59.00% on SWE-bench Multilingual, improving over the base model by 5.39 and 2.78 percentage points, respectively.
Figures & tables
| Full gain | Interpretation relative to our objective | ||
|---|---|---|---|
| Aligned improvement: overall and minimum gains rise while the gap narrows. | |||
| Shared improvement with a stable gap: overall and minimum gains rise together, with unchanged separation. | |||
| Shared improvement with a wider gap: both gains rise, but overall gain increases faster than minimum gain. | |||
| / | Aggregate improvement without minimum-gain improvement: overall gain rises while minimum gain stays unchanged or declines. | ||
| / | Gap reduction through aggregate decline: the gap narrows without improving the minimum gain; this does not meet our improvement objective. | ||
| Minimum–aggregate trade-off: the minimum gain improves and the gap narrows at the cost of overall gain. |
| Labeling corpus | Langs. | Leading Task Type | Leading Repository Domain | Scale signature | |
|---|---|---|---|---|---|
| SWE-bench Verified | 500 | 1 | bug-fix (87.0%) | web_backend (46.4%) | 86.2% single-file |
| SWE-bench Pro | 731 | 3 | bug-fix (47.3%) | devops_infra (33.2%) | 59.2% cross-module |
| SWE-bench Multilingual | 300 | 8 | bug-fix (89.3%) | lang_runtime (24.7%) | 66.0% single-file |
| Setting | Pro-618 | SWE-bench Multilingual |
|---|---|---|
| Instances | 618 | 300 |
| A/B/C/U | 221/201/196/0 | 72/25/176/27 |
| Agent framework | R2E-Gym | SWE-agent |
| Context limit (tokens) | 200,000 | 200,000 |
| Output limit per call (tokens) | 25,600 | 12,280 |
| Maximum actions/iterations | 150 | 150 |
| Category | |||||
| Phase | Quantity | A | B | C | Total |
| Pooled RL | training instances | — | — | — | 6,723 |
| Balanced RL | training instances | 516 | 516 | 516 | 1,548 |
| Initial expert RL | training records | 601 | 516 | 1,652 | 2,769 |
| First Repair SFT | repairable instances | 571 | 501 | 1,498 | 2,570 |
| sampled preceding-RL trajectories | 1,623 | 1,481 | 4,384 | 7,488 | |
| Current successes | Target trajectories | Sampling emphasis |
|---|---|---|
| 0 or 1 of 4 | 4 | strongest repair pressure |
| 2 of 4 | 3 | unstable frontier |
| 3 of 4 | 2 | consolidation |
| 4 of 4 | 1 | retention |
| Setting | Agentic RL | Repair SFT |
|---|---|---|
| Objective | Agentic-miniRL with group-relative advantages | full-parameter, response-only cross-entropy |
| Context | 131,072 tokens; 150 actions; 12,288 generated tokens/action | 131,072 tokens |
| Batch | 16 tasks/update, ; 128 trajectories | micro-batch 1, accumulation 16; effective batch 64/64/128 |
| Optimization | lr ; weight decay .01; cosine; 20 warmup steps | Adam, lr ; weight decay .01; cosine; 5% warmup |
| Stabilization | ; importance ratio ; KL coefficient .001; grad norm 20 | bf16; grad norm 1 |
| Generation | temperature 1.0; top- .95; top- 20 | — |
| Risk surface | Control | Integrity condition |
|---|---|---|
| Problem-statement leakage | Separate fix and test patches; reject generated statements that reveal source/test paths or patch-added code. | The agent receives the issue-style specification and base repository, not the reference implementation or held-out test patch. |
| Future repository state | Reset to the base revision; remove remotes, non-current branches, post-base tags, reflogs, and unreachable objects. Pro-618 removes all tags in the rollout sandbox. | Future fixes cannot be recovered through local git log , git show , tags, or dangling objects. |
| Verifier and environment tampering | Defer held-out test injection; export only a sanitized source patch and replay it in a fresh instance sandbox. | Reward depends on the replayed patch under evaluator-controlled tests, not on rollout-side files, processes, packages, or test edits. |
| External answer retrieval | Inspect the full action trajectory for target-repository search, clone/fetch, patch/raw downloads, and exact fix-SHA access. | Confirmed retrieval is an integrity failure, receives a score of zero, and remains in the fixed evaluation denominator. |
| Training-process mean | ||||
|---|---|---|---|---|
| Training mixture | Full gain | Final Full gain | ||
| Pooled RL | 1.13 | 0.08 | 1.05 | +2.86 |
| Balanced RL | 1.37 | 0.19 | 1.18 | +2.70 |
| Expert | Base | Initial RL | Repair SFT | |||
|---|---|---|---|---|---|---|
| A | 601 | 38.79 | 46.05 | 56.28 | ||
| B | 516 | 38.78 | 45.54 | 59.59 | ||
| C | 1,652 | 38.68 | 43.28 | 52.75 |
| Expert | Stage | Higher | Equal | Lower | |
|---|---|---|---|---|---|
| A | Initial RL | 601 | 259 | 151 | 191 |
| A | Repair SFT | 601 | 336 ( ) | 161 ( ) | 104 ( ) |
| B | Initial RL | 516 | 216 | 154 | 146 |
| B | Repair SFT | 516 | 314 ( ) | 121 ( ) | 81 ( ) |
| C | Initial RL | 1,652 | 633 | 517 | 502 |
| C | Repair SFT | 1,652 | 877 ( ) | 398 ( ) | 377 ( ) |
| Training stage | Expert A / Pro-A | Expert B / Pro-B | Expert C / Pro-C |
|---|---|---|---|
| Base | |||
| Initial RL | [-1pt] | [-1pt] | [-1pt] |
| First Repair SFT | [-1pt] | [-1pt] | [-1pt] |
| Expanded RL | [-1pt] | [-1pt] | [-1pt] |
| Second Repair SFT | [-1pt] | [-1pt] | [-1pt] |
| Policy | Full | Pro-A | Pro-B | Pro-C |
|---|---|---|---|---|
| Base model | ||||
| Pooled RL | [-1pt] (+2.86) | [-1pt] (+3.02) | [-1pt] (+2.32) | [-1pt] (+3.23) |
| Balanced RL | [-1pt] (+2.70) | [-1pt] (+2.71) | [-1pt] (+2.65) | [-1pt] (+2.72) |
| Category-routed experts (3 models) | — | [-1pt] (+7.84) | [-1pt] (+4.48) | [-1pt] (+5.61) |
| MOPD | [-1pt] (+5.39) | [-1pt] (+6.33) | [-1pt] (+4.98) | [-1pt] (+4.76) |
| Policy | Full gain | ||
|---|---|---|---|
| Pooled RL | 2.86 | 2.32 | 0.54 |
| Balanced RL | 2.70 | 2.65 | 0.04 |
| MOPD | 5.39 | 4.76 | 0.63 |
| Policy | Full | A | B | C | U |
|---|---|---|---|---|---|
| Base model | 44.91 | 56.00 | 61.74 | 50.62 | |
| Pooled RL | 47.69 | 53.33 | 58.52 | 59.26 | |
| Balanced RL | 48.61 | 56.00 | 59.66 | 62.96 | |
| MOPD | 51.39 | 64.00 | 61.74 | 56.79 |
Appendix figures & tables8 assets
Supplementary material from the paper’s appendix.
Appendix
| Construction stage | Instances |
|---|---|
| Full SWE-bench Pro | 731 |
| Public audit: mechanically evidenced specification/determinacy issue | |
| Public audit: two-model-family underspecification finding | |
| Public audit: reference patch fails isolated grader replay | |
| Official OpenAI audit: prompt–test mismatch | |
| Pro-618 | 618 |
| Audit item | Final value |
|---|---|
| Task Type L1 / L2 inventory | 26 / 119 |
| Domain L1 / L2 inventory | 21 / 108 |
| Orthogonal dimensions / levels | 3 / 12 |
| Task-L2 unspecified | 70 (4.6%) |
| Domain-L2 unspecified | 35 (2.3%) |
| Consistent nonempty Domain L1 by repository | 58/64 (90.6%) |
| Route | Engineering context | Domain L1 whitelist |
|---|---|---|
| A | Service/data/security | web_backend , database_storage , data_engineering , data_science , cms_ecommerce , security_auth , blockchain_web3 |
| B | User-facing applications | web_frontend , desktop_gui , mobile_dev , media_graphics , game_dev |
| C | Systems/tooling/runtimes | devops_infra , devtools_test , pkg_manager_cli , os_system , iot_embedded , lang_runtime |
| Expert | Base | Post-RL | Up | Same | Down | ||
|---|---|---|---|---|---|---|---|
| A | 601 | 38.79 | 46.05 | 259 | 151 | 191 | |
| B | 516 | 38.78 | 45.54 | 216 | 154 | 146 | |
| C | 1,652 | 38.68 | 43.28 | 633 | 517 | 502 |
| Previously regressed training records included in Repair SFT | |||
|---|---|---|---|
| Outcome after Repair SFT | A ( ) | B ( ) | C ( ) |
| At or above Base | 125 (69.8%) | 103 (73.0%) | 264 (61.3%) |
| Above RL but below Base | 7 (3.9%) | 5 (3.5%) | 30 (7.0%) |
| At or below RL | 47 (26.3%) | 33 (23.4%) | 137 (31.8%) |
| Initial-RL gains followed by a decline after SFT | |||
| Outcome after Repair SFT | A ( ) | B ( ) | C ( ) |
| Expert | Stage | Positive | Negative | Net |
|---|---|---|---|---|
| A | Initial RL | |||
| A | Repair SFT | |||
| B | Initial RL | |||
| B | Repair SFT | |||
| C | Initial RL | |||
| C | Repair SFT |
Software Engineering Agents
Software Engineering Agents are AI systems that use code, tools, and feedback to perform software development tasks.
See all 344 papers