ChatPaper.aiChatPaper

DeepLoop: 循環Transformer的深度縮放

DeepLoop: Depth Scaling for Looped Transformers

July 15, 2026
作者: Shuzhen Li, Yifan Zhang, Jiacheng Guo, Quanquan Gu, Mengdi Wang
cs.AI

摘要

循環Transformer通過將一組緊湊的物理區塊多次應用,來擴展序列計算,從而增加展開深度而不增加儲存參數。這種重複使用改變了殘差縮放問題:在非共享Transformer中,每個殘差分支會接收並應用自身的參數更新;而在循環Transformer中,一個共享更新會聚合來自多次訪問的梯度,並在下次線性化前向傳遞中被相同的訪問再次讀取。我們透過一個由「訪問對齊係數」κ_R 控制的一階擾動界限,將這種綁定深度效應形式化。當訪問之間失去相關性時,此界限恢復了 DeepNorm 指數;但在保守的對齊狀態下,隨著固定物理深度中循環次數增加,需要將指數從 1/4 提升至 1/2。由此產生的方法 DeepLoop 保留了 Post-LN DeepNorm 架構,並針對展開深度 N 設定 α=(2N)^{1/2} 及 β=(8N)^{-1/2}。在 GPT-2 小規模與中規模的 GPT 風格循環語言模型中,當沒有物理區塊被重新訪問時,DeepLoop 表現為中性;一旦啟動循環深度,則能改善驗證損失與下游任務準確率。這些結果顯示,穩定的循環深度需要考慮參數訪問的殘差縮放規則,而不僅是名義上的層數。
English
Looped Transformers scale sequential computation by applying a compact stack of physical blocks for multiple rounds, increasing unrolled depth without increasing stored parameters. This reuse changes the residual-scaling problem: in an untied Transformer, each residual branch receives and applies its own parameter update, whereas in a looped Transformer one shared update aggregates gradients from repeated visits and is read back by those same visits in the next linearized forward pass. We formalize this tied-depth effect through a first-order perturbation bound controlled by a visit-alignment coefficient κ_R. The bound recovers the DeepNorm exponent when visits decorrelate, but in the conservative aligned regime it requires the exponent to increase from 1/4 to 1/2 as loop count grows at fixed physical depth. The resulting method, DeepLoop, keeps the Post-LN DeepNorm architecture and sets α=(2N)^{1/2} and β=(8N)^{-1/2} for unrolled depth N. On GPT-style looped language models at GPT-2 small and GPT-2 medium scale, DeepLoop is neutral when no physical block is revisited and improves validation loss and downstream accuracy once recurrent depth is activated. These results show that stable recurrent depth requires residual scaling rules that account for parameter visits, not only nominal layer count.