使用自适应循环Transformer改进测试时扩展
研究论文 · 2026/09/29
循环Transformer通过复用层进行潜在计算,展现出参数效率。先前研究在匹配参数或每token FLOPs下比较循环与非循环模型,但循环是否随输出变长而改善测试时扩展仍未被充分探索。我们通过后训练循环Transformer,研究准确率-计算斜率(测试时解码FLOPs每翻倍带来的准确率增益)。发现现有循环Transformer通常比非循环基线有更陡的斜率,但在匹配计算下表现不如基线。固定深度循环在每个token上花费额外迭代,但分析表明许多token并未从额外迭代中受益。因此提出TaH2,让模型将额外迭代集中在受益于循环的token上。它通过前瞻深度监督联合后训练骨干和迭代决策器,使用在线标签指示进一步迭代是否改善预测。TaH2提升了测试时扩展的效率和可达准确率。在AIME基准上,TaH2将准确率-计算斜率相比非循环基线提升53%(2.74 vs. 1.79),在匹配测试时计算下超过基线峰值准确率约3.4分。随着最大迭代深度增加,现有循环模型基本停滞,而TaH2相对非循环基线的增益从深度2的+2.8分持续增长到深度8的+3.9分。代码见https://github.com/thu-nics/TaH。
该研究揭示了循环Transformer在测试时扩展中的关键局限,并提出TaH2方法显著提升效率与准确率,对理解与改进测试时计算扩展具有重要价值。
Looped transformers have demonstrated promising parameter efficiency by reusing layers for latent computation. Prior studies compare looped and non-looped models at matched parameters or per-token FLOPs. However, to the best of our knowledge, whether looping improves test-time scaling as outputs grow longer remains underexplored. Through post-training looped transformers, we study the accuracy-compute slope, measured as the accuracy gain per doubling of test-time decoding FLOPs. We find that existing looped transformers often yield steeper slopes than their non-looped baseline, yet underperform it at matched compute. While fixed-depth looping spends extra iterations on every token, our analysis shows that many tokens do not benefit from extra iterations. We therefore propose TaH2, which enables the model to focus extra iterations on the tokens that benefit from looping. It jointly post-trains the backbone and an iteration decider through lookahead depth supervision, which uses online labels indicating whether further iteration improves the prediction. TaH2 improves both the efficiency and attainable accuracy of test-time scaling. On challenging AIME benchmarks, TaH2 improves the accuracy-compute slope by 53% (2.74 vs. 1.79) over the non-looped baseline, exceeding the baseline's peak accuracy by about 3.4 points at matched test-time compute. As the maximum iteration depth increases, existing looped models largely plateau, while TaH2's gain over the non-looped baseline continues to grow from +2.8 points at depth 2 to +3.9 points at depth 8. Our code is available at https://github.com/thu-nics/TaH.