几乎免费地更好解码循环Transformer
研究论文 · 2026/10/02
循环Transformer通过重复执行共享块实现参数效率,每次循环产生可解码的中间表示,但标准解码丢弃早期状态。由于早期循环计算较少,循环自然提供对齐的弱强预测对,无需辅助模型或外部训练。我们提出LoopCD,一种无需训练的对比解码框架,通过对比最终预测与早期循环传递来指导token选择,可在logit空间(LoopCD-Logits,需额外输出传递)或隐藏状态空间(LoopCD-Hidden,无输出开销)操作。在四个循环Transformer家族中,LoopCD在全循环深度下带来显著且一致的提升:LoopCD-Logits将Ouro-2.6B-Thinking的AIME 2024 pass@1从61.88%提升至73.33%,LoopCD-Hidden将Huginn的HumanEval pass@1从22.56%提升至31.71%。关键的是,这些性能提升使得循环次数减半仍能匹配或超过全深度无引导基线,减少前向FLOPs 22.5%至48.2%。通过将中间循环状态转化为有效指导信号,LoopCD在显著减少推理计算的同时实现了更优的解码质量。
该工作提出了一种无需训练、几乎无额外开销的对比解码方法,显著提升了循环Transformer的解码质量,并大幅减少推理计算,对高效推理和模型部署具有重要价值。
Looped Transformers achieve parameter efficiency by repeatedly executing a shared block across recurrent loops. Each loop yields an intermediate representation decodable for the same next token, yet standard decoding discards earlier states. Because earlier loops embody less computation, recurrence inherently supplies aligned weak-and-strong prediction pairs without auxiliary models or external training. We introduce LoopCD, a training-free contrastive decoding framework that guides token selection by contrasting the final prediction with an earlier recurrent pass, operating either in logit space with one extra output pass (LoopCD-Logits) or in hidden-state space with zero output overhead (LoopCD-Hidden). Across four looped Transformer families, LoopCD delivers substantial, consistent gains at full recurrent depth: LoopCD-Logits raises Ouro-2.6B-Thinking's AIME 2024 pass@1 from 61.88% to 73.33%, while LoopCD-Hidden lifts Huginn's HumanEval pass@1 from 22.56% to 31.71%. Crucially, these performance gains enable halving the number of recurrent loops while still matching or exceeding full-depth unguided baselines, reducing forward FLOPs by 22.5% to 48.2%. By transforming intermediate recurrent states into effective guidance signals, LoopCD achieves superior decoding quality while substantially reducing inference compute.