Paper 2606.18023
LoopCoder-v2: Only Loop Once for Efficient Test-Time Computation Scaling
- Published
- Jun 2026
- Research lab
- Independent
- Citations
- 1
- GitHub
- Not linked
01 In brief
Summary
The paper investigates loop-count selection in Parallel Loop Transformers (PLT), which use cross-loop position offsets (CLP) and shared-KV gated sliding-window attention to keep latency and memory constant regardless of loop count.
The authors train LoopCoder-v2, a 7B PLT coder, from scratch on 18T tokens with loop counts R=1,2,3,4, under matched training and evaluation.
Results show a non-monotonic performance curve: the two-loop variant (R=2) improves SWE-bench Verified from 43.0 to 64.4 and Multi-SWE from 14.0 to 31.0, while R=3 and R=4 regress.
Per-loop diagnostics reveal that loop 2 provides the main productive refinement, with coherent hidden-state updates, increased attention re-routing, and peak effective rank.
Later loops show diminishing, oscillatory updates and reduced representational diversity.
The CLP-induced offset cost remains roughly constant across loops, so as gains shrink, this fixed cost dominates, explaining saturation at R=2.
The study also finds that explicit chain-of-thought reasoning complements latent loop refinement, with super-additive gains at R=2.
The authors propose effective-rank trajectory as a lightweight diagnostic for loop-count selection without exhaustive sweeps.
02 From the paper
Abstract
Looped Transformers scale latent computation by repeatedly applying shared blocks, but sequential looping increases latency and KV-cache memory with the loop count. Parallel loop Transformers (PLT) alleviate this cost through cross-loop position offsets (CLP) and shared-KV gated sliding-window attention, making loop count a practical design choice. We therefore study PLT loop-count selection through a gain--cost view: an extra loop may refine representations, but CLP also introduces a positional mismatch at each loop boundary. We instantiate this study by training LoopCoder-v2, a family of 7B PLT coders with different loop counts, from scratch on 18T tokens, followed by matched instruction tuning and evaluation. Empirically, the two-loop variant delivers broad gains over the non-looped baseline across code generation, code reasoning, agentic software engineering, and tool-use benchmarks, improving SWE-bench Verified from 43.0 to 64.4 points and Multi-SWE from 14.0 to 31.0 points. In contrast, variants with three or more loops regress, revealing a strongly non-monotonic loop-count effect. Our diagnostics show that loop 2 provides the main productive refinement, while later loops yield diminishing, oscillatory updates and reduced representational diversity. Because the CLP-induced mismatch remains roughly fixed as refinement gains shrink, the offset cost increasingly dominates. This gain--cost trade-off explains PLT's saturation at two loops and provides diagnostics for loop-count selection.