When Requirements Interact: Scaling Long-Horizon Coding via Interdependent Specifications
Organizations: LLM Core, Xiaomi · Peking University · University of Hong Kong
Abstract
To succeed in real-world long-horizon software development, coding agents must satisfy multi-dimensional task specifications, such as interface compatibility and error handling, and do so without breaking existing dependencies. However, current works lack specification in both quantity and diversity, often emphasizing primary goals while ignoring complex constraints. Synthesizing tasks to bridge this gap presents two challenges: naively adding specifications risks reducing tasks to trivial checklists rather than compelling joint reasoning, and verifying these subtle interactions risks overlooking hidden flaws or rejecting valid alternatives. To address these challenges, we introduce CodeSpecWeave, a framework for synthesizing tasks with rich, interdependent specifications. Grounded in real developer seeds, a synthesis agent iteratively develops both coupled task requirements and executable tests, while a review agent audits solution trajectories from multiple models to guarantee test reliability. Using this pipeline, we construct 4,670 training tasks across 2,865 repositories. Applying Reinforcement learning on these tasks significantly improves performance over the base model on DeepSWE-v1.1, largely outperforming existing baselines. Furthermore, we curate CodeSpecWeave-Bench, a rigorous benchmark comprising 100 tasks and 1,044 specifications, which clearly separates frontier models and reveals significant headroom in handling interdependent engineering constraints.
Figures & tables
| Issue | Tasks | % |
|---|---|---|
| False positives only | 1,548 | 50.5 |
| False negatives only | 426 | 13.9 |
| Both | 293 | 9.6 |
| None observed | 800 | 26.1 |
| Total with issues | 2,267 | 73.9 |
| Training Settings | CodeSpecWeave - Bench | DeepSWE- v1.1 | SWE-bench Verified | SWE-bench Pro | Avg |
|---|---|---|---|---|---|
| MiMo-V2.5 | |||||
| w/ Vanilla | 47.00 | 12.39 | 69.27 | 50.11 | 44.69 |
| w/ SWE-PI | 44.00 | 6.78 | 68.00 | 49.43 | 42.05 |
| w/ MiMo Coding | 50.00 | 18.62 | 73.63 | 53.81 | 49.01 |
| w/ CodeSpecWeave | 52.00 | 25.30 | 72.00 | 51.30 | 50.15 |
| MiMo-V2.6-Flash-SFT | |||||
| Measure | MiMo-V2.5 | MiMo-V2.6-Flash-SFT | ||
|---|---|---|---|---|
| Vanilla | CodeSpecWeave | Vanilla | CodeSpecWeave | |
| Thinking tokens (k) | 29.7 | 141.6 | 22.8 | 69.5 |
| Modified files | 4.47 | 9.79 | 4.09 | 6.17 |
| Changed lines | 451 | 3,632 | 350 | 667 |
| Edit–test loops | 3.48 | 4.34 | 2.96 | 4.90 |
| Trajectories with loops (%) | 63.0 | 72.7 | 69.0 | 78.3 |
Appendix figures & tables7 assets
Supplementary material from the paper’s appendix.
Appendix
| Setting | Value |
|---|---|
| Training batch size | 128 |
| Mini-batch size | 128 |
| Samples per task | 16 |
| Sampling temperature | 1.0 |
| Top- | 0.97 |
| Prompt token limit | 8,192 |
| Specification Type | Scope | Count |
|---|---|---|
| Functional Semantics | End-to-end data transformation and algorithmic logic | 470 |
| Parsing & Representation | Syntax matching, encoding, and format serialization | 182 |
| Computation & Algorithms | Mathematical calculations and core algorithmic logic | 145 |
| Domain & Protocol Rules | Business constraints and protocol-specific semantics | 143 |
| Interface & I/O Contracts | Public APIs, argument types and defaults, input/output schemas | 108 |
| Control Flow & Ordering | Conditional branching, execution order, and concurrency | 98 |
| Requirement | Expected behavior |
|---|---|
| Proportionality | Without change, allocate post-fee hours proportionally and resolve rounding ties by request order. |
| Change allocation | Split post-fee hours 50/50 between recipients and change, assigning the odd hour to change. |
| Minimum allocation | Give each recipient at least one hour whenever the recipient share permits it. |
| Output order | Keep recipients in request order and append non-zero-coin change last. |
| Compatibility | Preserve the single-recipient cap and its existing output values. |
| Model | Vanilla | CodeSpecWeave |
|---|---|---|
| MiMo-V2.5 | 77.1 | 86.0 |
| Flash-SFT | 77.7 | 87.1 |
Code Generation
Code generation studies methods for turning natural-language, visual, or formal specifications into executable programs and code edits.
See all 322 papers