回环Transformer:迈向残差循环Transformer的统一视角
研究论文 · 2026/11/16
循环Transformer通过重复应用共享块来减少参数数量,但仅靠参数共享并不能决定重复计算结果如何被重用。我们从残差连接深度记忆的角度出发,分析每次块应用后存储了哪种表示,以及后续读取如何对其加权。完整的块输出同时包含其输入和新的更新,因此对该输出加权也会重新加权输入已携带的历史。相反,如果读取单个更新,并将共享堆栈的输入保持在单独路径上,则可以对输入强度、总更新权重以及更新间的分配进行独立控制。Loopback Transformer实现了这些控制:几何衰减设定总更新权重并提供近因先验,注意力学习如何分配该权重。在ClimbMix上,Loopback在参考规模从191M到3B时,以标准Transformer基线40-75%的参数(不包括token嵌入和输出头)达到更低的验证损失,且训练token和执行深度匹配。在1.4B和3B规模上,它在十三个下游任务上的平均准确率也更高。在191M、374M和778M规模上,它在标准Transformer和七种循环残差设计中具有最低的验证损失和最高的十三任务平均准确率。
该文章提出了对循环Transformer中残差连接的新视角,并通过Loopback Transformer实现了更高效的计算重用,在多个规模上以更少参数达到更低损失和更高下游准确率,对参数高效模型设计有重要参考价值。
Looped Transformers reduce parameter count by repeatedly applying shared blocks, but parameter sharing alone does not determine how the results of repeated computation are reused. We take the depth-memory view of residual connections and analyze which representation is stored after each block application and how later reads weight it. A full block output contains both its input and its new update, so weighting that output also reweights the history already carried by the input. Reading individual updates instead, with the shared stack's input kept on a separate path, gives separate controls over input strength, total update weight, and allocation across updates. The Loopback Transformer implements these controls: geometric decay sets the total update weight and supplies a recency prior, and attention learns how to allocate that weight. On ClimbMix, Loopback reaches lower validation loss than standard Transformer baselines with 40-75% of their Transformer parameters (excluding token embeddings and the output head) at reference scales from 191M to 3B, with training tokens and executed depth matched. It also has higher mean accuracy over thirteen downstream tasks at 1.4B and 3B. At 191M, 374M, and 778M, it has the lowest validation loss and the highest thirteen-task mean among the standard Transformer and seven looped residual designs.