Weaving interdependent specs into coding tasks: RL data from Xiaomi lifts DeepSWE by 13 points

When Requirements Interact: Scaling Long-Horizon Coding via Interdependent Specifications

Yishuo Cai, Minzheng Wang, Liang Zhao, Linghao Zhang, Lei Li, Shicheng Li, Xu Sun, Fuli Luo

cs.SE, cs.CL

2026-10-29

Xiaomi's CodeSpecWeave builds 4,670 coding tasks with interdependent specs for RL, lifting DeepSWE-v1.1 from 12.4 to 25.3; its 100-task bench leaves GPT-6 Astra at 74%.

What problem this solves

Real software engineering is rarely single-threaded. A change has to keep old callers working, handle concurrency and rollback, and leave existing dependencies intact. Yet most SWE training tasks are mined from issues and pull requests. The paper measures four popular datasets (Scale-SWE, SWE-rebench V2, SWE-Lego, R2E-Gym) and finds only 1.33 to 4.38 specifications per task spread over 1.28 to 1.83 behavioral categories, essentially one main goal plus a couple of loose rules. Agents trained on that never practice joint decisions where several constraints bind at once.

Piling on specifications does not fix it. When specs are independent, the task collapses into a checklist that a model satisfies item by item. Verification is the harder problem: interactions between requirements make it easy for generated tests to miss hidden flaws or reject valid implementations. In the authors' pilot batch, 73.9% of 3,067 candidate tasks had test-alignment defects. Reliable verification, not task generation, is the real bottleneck.

Method

CodeSpecWeave, from Xiaomi's LLM Core with Peking University and HKU, runs in two stages.

Task synthesis. Specification seeds are mined from commit histories, issue threads, and pull requests, then filtered and deduplicated into 104,182 candidate units across six natural languages. Given a repository, a synthesis agent drafts the request, fine-grained specifications, and executable tests together in a loop, running the tests inside the repo and refining them on runtime feedback. The central design choice is interdependence: complementary requirements are anchored to the same state transition or core component, so input validation, transactional rollback, and backward compatibility end up in one contract that no isolated edit satisfies. Additive specifications factorize, and each choice can be made greedily in isolation; interdependent ones break that factorization, since one choice shrinks the feasible options for the others and forces joint reasoning. The resulting training tasks average 8.36 specifications over 4.08 behavioral categories, two to six times denser than existing datasets.

Validation and repair. Tests generated alongside the task do not necessarily align with intent, and the defects only surface when code actually runs. Multiple independent models attempt each task, and a review agent inspects the request, tests, patches, and execution trajectories: runs that violate requirements expose missing checks, while valid runs that fail expose over-strict tests. Flawed candidates go to a repair agent, then face execution checks and fresh solver trials again. The yield is brutal: of one batch of 14,905 tasks, difficulty filtering kept 3,275 and review approved 766, about 5%. The full pipeline produced 4,670 training tasks across 2,865 repositories, plus a manually curated CodeSpecWeave-Bench of 100 tasks and 1,044 specifications, averaging 10.44 per task (median 9, range 3 to 31).

Results

On the benchmark, pass rates for leading agents range from 44.0% to 74.0%. GPT-6 Astra inside Codex tops the board at 74.0% with the shortest mean output (17.2k tokens), and still fails 26% of the tasks. Across Codex's four GPT models, pass rate falls monotonically as output grows, from 74.0% at 17.2k tokens to 66.0% at 31.8k. Claude Opus 5 beats Qwen3.8-Max by 6.1 points with roughly 47% fewer output tokens. Length looks like thrashing around interacting constraints, not effort.

For RL, two MoE models (310B total, 15B active) were trained on three datasets. MiMo-V2.5 results:

Training dataBenchDeepSWE-v1.1SWE-bench VerifiedSWE-bench ProAvg
Vanilla47.0012.3969.2750.1144.69
SWE-PI (30,128 tasks)44.006.7868.0049.4342.05
MiMo Coding50.0018.6273.6353.8149.01
CodeSpecWeave52.0025.3072.0051.3050.15

4,670 tasks beat the 30,128-task SWE-PI mixture, which even transfers negatively on this backbone (DeepSWE drops from 12.39 to 6.78). MiMo-V2.6-Flash-SFT tells the same story: average 60.54 to 67.60, DeepSWE 54.42 to 62.98, while MiMo Coding falls to 50.74 there. The gains are not uniform; on SWE-bench Verified for MiMo-V2.5, MiMo Coding scores higher (73.63 vs 72.00). Improvement concentrates exactly where long-horizon, interacting constraints live, which matches the paper's claim.

Training also changes behavior. Thinking tokens grow 4.8x on MiMo-V2.5 (29.7k to 141.6k) and 3.0x on Flash-SFT, changed lines jump from 451 to 3,632 as patches shift toward cross-file refactoring, and edit-test loops per trajectory rise from 3.48 to 4.34 (2.96 to 4.90 on Flash-SFT), with over 70% of trajectories sustaining two or more loops. Grouped by specification count, Flash-SFT gains 10.2, 12.5, and 12.5 points across the 3-8, 9-11, and 12-31 spec buckets, with policy entropy stable at 0.29-0.40 throughout. Two failure patterns dominate: patches that target a spec but cover only part of its input boundaries or execution paths, and patches that satisfy one requirement while breaking another that constrains the same state.

Why it matters

For anyone training coding agents, the message is blunt: the bottleneck in SWE RL data is specification density and verifier reliability, not volume. The 73.9% alignment-defect rate is a warning for every pipeline that auto-generates tasks and tests; without auditing solver trajectories from multiple models, most generated verifiers are probably broken. CodeSpecWeave-Bench also works standalone, spreading frontier agents across a 30-point band, and the inverse relation between output length and pass rate is a handy diagnostic: verbosity on constraint-heavy tasks signals thrashing, not diligence.

Limitations

The authors list three: RL training is compute-heavy; every task needs a container image running in a Kubernetes pod; and quality depends on strong models plus multi-round filtering that discards roughly 95% of candidates.

A few caveats from this reading. The benchmark and the training set come from the same synthesis pipeline, so gains on CodeSpecWeave-Bench are partly in-distribution; the DeepSWE-v1.1 gains are the more convincing external evidence. RL ran only on Xiaomi's own MiMo backbones, so transfer to other model families is untested. The specification statistics for competing datasets use the paper's own extraction method, which may favor its format. The bench has just 100 tasks, so pass rates move in coarse steps. And on standard SWE benchmarks the method trades wins and losses, so treat it as filling a structural gap rather than replacing general SWE data.

Terms

Source

Related papers

All paper explainers