# LoopCoder-v2：仅循环一次实现高效测试时计算扩展

- 来源：HuggingFace Daily Papers（社区热门论文）
- 发布时间：2026-06-16 08:00
- AIHOT 分数：51
- AIHOT 链接：https://aihot.virxact.com/items/cmqhgiko2046zsle1eiash74l
- 原文链接：https://arxiv.org/abs/2606.18023

## AI 摘要

LoopCoder-v2 是一族 7B 参数的并行循环 Transformer（PLT）代码模型，从零在 18T tokens 上预训练。与无循环基线相比，两循环变体在代码生成、推理、智能体软件工程和工具使用基准上广泛提升，SWE-bench Verified 从 43.0 到 64.4，Multi-SWE 从 14.0 到 31.0。三循环及以上变体性能下降，揭示循环计数的非单调效应：循环 2 提供主要改进，后续循环产生递减振荡更新，而 CLP 引入的位置偏移代价固定，导致两循环饱和。

## 正文

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.
