AIAny
Icon for item

LoopCoder-v2: Only Loop Once for Efficient Test-Time Computation Scaling

Uses Parallel Looped Transformers (PLT) to make loop count a practical knob for code models, finding two loops give the best test-time gains. Trains 7B models on 18T tokens and attributes saturation beyond two loops to a gain–cost tradeoff from positional mismatch.

Introduction

Looped Transformer designs promise extra iterative computation without adding unique parameters, but sequential looping raises latency and KV-cache memory. Parallel Looped Transformers (PLT) sidestep those deployment costs by executing loops in parallel with cross-loop position offsets (CLP) and shared-KV gated sliding-window attention. That makes loop count a real design choice at inference time—but it also introduces a boundary-induced positional mismatch whose cost can outweigh later refinement gains.

Key Findings
  • Two-loop PLT yields the bulk of productive refinement: a family of 7B LoopCoder-v2 models trained on 18T tokens shows consistent improvements on code generation, code reasoning, agentic software-engineering and tool-use benchmarks (notably large gains on SWE-bench and Multi-SWE).
  • Non-monotonic loop-count effect: adding a third or more loops often degrades performance. Diagnostics show early loops provide diverse, useful updates while later loops produce smaller, oscillatory refinements.
  • Gain–cost explanation: CLP gives a roughly fixed positional-offset cost per loop boundary while refinement gains shrink with later iterations; once cost exceeds marginal benefit, additional loops hurt overall quality.
  • Practical implication: for PLT-style coders, selecting a small loop count (two in these experiments) is a Pareto win for test-time compute, latency and accuracy.
Who this helps and trade-offs

Great fit if you need configurable test-time compute for code models and want to avoid the sequential-latency and growing KV memory of recurrent looping. LoopCoder-v2-style PLT is attractive when you can accept a modest architectural offset (CLP) in exchange for parallel inference and lower memory. Look elsewhere if your workload requires many small, guaranteed monotonic iterative refinements per token or if absolute parity with fully sequential looped transformers (without positional offsets) is mandatory.

Where it fits

This work sits between fully sequential looped transformers (which can offer more per-loop fidelity but incur latency/memory costs) and single-pass depth‑matched Transformers. It shows a practical middle ground: parallelize iterations to reclaim latency/memory while tuning loop count empirically to avoid CLP-induced regressions.

Methods & diagnostics (brief)

The paper trains matched 7B PLT code models with differing loop counts and applies instruction tuning before evaluation. Empirical analysis inspects per-loop representational diversity and update dynamics, linking oscillatory late-loop behavior and decreasing marginal gains to the observed performance drop beyond two loops. The study frames loop selection as an explicit gain–cost optimization for PLT design.

Information

  • Websitearxiv.org
  • AuthorsJian Yang, Shawn Guo, Wei Zhang, Tianyu Zheng, Yaxin Du, Haau-Sing Li, Jiajun Wu, Yue Song, Yan Xing, Qingsong Cai
  • Published date2026/06/16

More Items

Co-evolves a solver skill and a rubric-generator skill for text-space LLM optimization under decoupled objectives to avoid rubric gaming without using gold rubrics. Solver updates use criterion-level feedback; generator updates use independent audits of requirement coverage and response discrimination.

Real-time streaming multimodal foundation model that uses a codec-native tokenizer (Mage-ViT) to encode motion- and residual-rich regions from video I/P frames, reducing visual token usage by over 75% and enabling up to ~3.5× wall-clock inference speedup after training on ~560M images and 100M video frames.

Presents a 2.8T-parameter Mixture-of-Experts multimodal model with a 1-million-token context window and 104 billion activated parameters, targeting long-horizon agentic RL, coding, reasoning, and vision. Key innovations include Kimi Delta Attention, Attention Residuals, Stable LatentMoE (16 of 896 experts active per token), ~2.5× scaling efficiency over Kimi K2, and a public weight release.