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.


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

0
下载
关闭预览

相关内容

代码(Code)是专知网的一个重要知识资料文档板块,旨在整理收录论文源代码、复现代码,经典工程代码等,便于用户查阅下载使用。
【ICML2022】时序自监督视频transformer
专知会员服务
31+阅读 · 2022年7月28日
【Google】高效Transformer综述,Efficient Transformers: A Survey
专知会员服务
66+阅读 · 2022年3月17日
英伟达Faster Transformer:作者带你揭秘BERT优化
机器之心
14+阅读 · 2019年9月18日
深度学习的下一步:Transformer和注意力机制
云头条
56+阅读 · 2019年9月14日
百闻不如一码!手把手教你用Python搭一个Transformer
大数据文摘
18+阅读 · 2019年4月22日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
VIP会员
最新内容
美国从乌克兰无人机战争中学习经验
专知会员服务
1+阅读 · 今天15:03
ICML 2026 | 面向视觉语言模型的语义鲁棒性认证
专知会员服务
0+阅读 · 今天14:31
学习数据的几何:形状空间分析数学综述
专知会员服务
8+阅读 · 6月17日
定向能反无人机系统最新发展动态
专知会员服务
10+阅读 · 6月17日
相关基金
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
Top
微信扫码咨询专知VIP会员