arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2606.18023cs.LGcs.AI
收藏

LoopCoder-v2: 仅循环一次以实现高效的测试时计算扩展

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

Beihang University(北京航空航天大学);IQuest Research;Langboat(浪波);Renmin University of China(中国人民大学)
Jian Yang, Shawn Guo, Wei Zhang, Tianyu Zheng, Yaxin Du, Haau-Sing Li, Jiajun Wu, Yue Song, Yan Xing, Qingsong Cai, Zelong Huang, Chuan Hao, Ran Tao, Xianglong … 展开作者

Jian Yang, Shawn Guo, Wei Zhang, Tianyu Zheng, Yaxin Du, Haau-Sing Li, Jiajun Wu, Yue Song, Yan Xing, Qingsong Cai, Zelong Huang, Chuan Hao, Ran Tao, Xianglong Liu, Wayne Xin Zhao, Mingjie Tang, Weifeng Lv, Ming Zhou, Bryan Dai

AI总结:

本文提出并行循环Transformer(PLT)并研究循环次数选择,发现两循环变体在代码生成等任务上显著提升,而三循环以上性能下降,揭示了增益-成本权衡。

摘要:

循环Transformer通过重复应用共享块来扩展潜在计算,但顺序循环会随着循环次数增加延迟和KV缓存内存。并行循环Transformer(PLT)通过跨循环位置偏移(CLP)和共享KV门控滑动窗口注意力来缓解这一成本,使循环次数成为实际设计选择。因此,我们通过增益-成本视角研究PLT循环次数选择:额外的循环可能细化表示,但CLP在每个循环边界引入位置不匹配。我们通过从头训练LoopCoder-v2(一组具有不同循环次数的7B PLT编码器)在18T token上,随后进行匹配的指令调优和评估来实例化这项研究。经验上,两循环变体在代码生成、代码推理、代理软件工程和工具使用基准上比无循环基线带来广泛提升,将SWE-bench Verified从43.0提高到64.4分,Multi-SWE从14.0提高到31.0分。相比之下,三循环或更多循环的变体性能下降,揭示了强烈的非单调循环次数效应。我们的诊断表明,循环2提供了主要的生产性细化,而后续循环产生递减、振荡的更新和降低的表示多样性。由于CLP引起的不匹配在细化收益缩小时大致固定,偏移成本日益占主导。这种增益-成本权衡解释了PLT在两循环处饱和,并为循环次数选择提供了诊断。

英文摘要:

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.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑