Papers
Topics
Authors
Recent
Search
2000 character limit reached

DeepLoop: Depth Scaling for Looped Transformers

Published 15 Jul 2026 in cs.LG and cs.AI | (2607.13491v1)

Abstract: 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, \textbf{DeepLoop}, keeps the Post-LN DeepNorm architecture and sets $α=(2N){1/2}$ and $β=(8N){-1/2}$ for unrolled depth $N$. On GPT-style looped LLMs 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.

Summary

  • The paper presents DeepLoop, a new analytic scaling rule for looped transformers that stabilizes training by adjusting residual and initialization parameters.
  • It details a theoretical framework incorporating the visit-alignment coefficient to account for gradient sharing across recurrent layers, ensuring robust optimization.
  • Empirical results on language modeling and downstream tasks validate that DeepLoop outperforms standard parameterizations, especially at increased recurrent depths.

DeepLoop: A Loop-Aware Residual Parameterization for Looped Transformers

Motivation and Problem Formulation

Looped Transformers extend standard architectures by decoupling depth from parameter count, repeatedly applying a compact set of KK physical blocks for RR rounds and achieving an effective depth of N=KRN=KR. This paradigm enables parameter-efficient scaling through sequential computation, relating closely to ideas in Universal Transformers, ALBERT, and recent recurrent-depth or test-time-compute models. However, scaling recurrent depth in this manner necessitates a reconsideration of residual-scaling mechanisms, as parameter sharing introduces novel coupling between forward and backward passes that are inapplicable to traditional untied depth analyses.

Standard residual-scaling theory (e.g., DeepNorm) ensures optimization stability in deep Transformers by selecting skip connection and residual-branch initialization scales (α,β)(\alpha,\beta), given M=2NM=2N residual sublayer applications. The untied assumption, however, presumes mutually independent updates across all depthwise sublayers. In looped models, each parameter is shared across RR visits, aggregating gradients and being read multiple times in subsequent forward passes. Consequently, the first-order effect of parameter updates is governed not simply by nominal layer count, but by both the structure of parameter sharing and the degree of alignment between per-visit gradient directions.

The paper formalizes this with a visit-alignment coefficient κR\kappa_R, refining the first-order stability condition from M(β/α)2=O(1)M(\beta/\alpha)^2=O(1) to MκR(β/α)2=O(1)M\kappa_R(\beta/\alpha)^2=O(1). In the aligned regime (κR=O(R)\kappa_R=O(R)), the exponent in the scaling rule must increase from RR0 (DeepNorm) to RR1 as RR2 increases at fixed RR3. The resulting prescription, DeepLoop, proposes a universal, analytic scaling for looped Transformers: RR4, RR5.

(Figure 1)

Figure 1: Overview of the DeepLoop framework. (a) The model shares RR6 physical blocks, (b) which are unrolled for RR7 rounds, giving an effective depth of RR8, (c) with each residual sublayer applying RMSNorm and scaled skip/branch paths, (d) and DeepLoop specifying loop-aware analytic scaling.

Formal Analysis of Looped Depth Effects

Let RR9 and N=KRN=KR0 represent, respectively, the per-visit gradient and linearized output sensitivity for visit N=KRN=KR1 to physical sublayer N=KRN=KR2. For untied architectures, the cumulative effect sums over N=KRN=KR3 independent terms, yielding stability when N=KRN=KR4 under local N=KRN=KR5 sensitivities [wang2024deepnet].

When parameters are tied across looped visits, each parameter accumulates gradients from all visits, and all N=KRN=KR6 visits in subsequent steps are influenced by the same shared update. The perturbation therefore scales with N=KRN=KR7 (capturing alignment across visits): fully decorrelated visits recover the original untied scaling (N=KRN=KR8), while fully aligned visits, the conservative regime considered here, require N=KRN=KR9, amplifying the effect of shared updates.

This yields a loop-aware stability threshold that, for the scaling family (α,β)(\alpha,\beta)0, (α,β)(\alpha,\beta)1, is satisfied when (α,β)(\alpha,\beta)2, where (α,β)(\alpha,\beta)3 controls cross-round correlation ((α,β)(\alpha,\beta)4: decorrelated; (α,β)(\alpha,\beta)5: fully aligned). DeepLoop sets (α,β)(\alpha,\beta)6, ensuring stability in the worst-case aligned regime at any practical loop count.

Empirical Validation

Language Modeling: Validation Loss

DeepLoop and a baseline (tied-only, (α,β)(\alpha,\beta)7, (α,β)(\alpha,\beta)8) are tested on GPT-2 small and medium variants, trained on FineWeb-Edu for 50B tokens. At (α,β)(\alpha,\beta)9, both configurations perform identically—demonstrating parameterization neutrality when no sharing occurs. For all M=2NM=2N0, DeepLoop consistently outperforms baseline in final validation loss, with the gap increasing with M=2NM=2N1, confirming theoretical predictions. Figure 2

Figure 2: Final validation loss at step 100,000 on FineWeb-Edu 50BT (GPT-2 small/medium) for various loop counts. DeepLoop's advantage increases with recurrent depth.

Downstream Generalization: LM Evaluation Suite

On the lm-evaluation-harness suite (arc_challenge, arc_easy, hellaswag, etc.), DeepLoop achieves superior or equal average zero- and one-shot accuracies at M=2NM=2N2, with per-task improvements on seven out of eight tasks at M=2NM=2N3. These results, robust across scales, demonstrate that loop-aware scaling not only boosts language modeling but robustly transfers to downstream tasks. Figure 3

Figure 3: Per-task 1-shot accuracy versus loop count M=2NM=2N4 for base vs DeepLoop (GPT-2 medium). DeepLoop achieves consistently higher accuracy at high M=2NM=2N5 on most tasks.

Figure 4

Figure 4: Eight-task 1-shot average accuracy versus M=2NM=2N6 (GPT-2 small), confirming DeepLoop's monotonic performance gains with increased recurrent depth.

Figure 5

Figure 5: Per-task 1-shot accuracy vs M=2NM=2N7 for base and DeepLoop (GPT-2 small); DeepLoop outperforms or matches across tasks as depth increases.

M=2NM=2N8-Sweep: Empirical Stability Threshold

A direct grid search over exponent M=2NM=2N9 in the DeepLoop scaling rule (at fixed RR0) confirms a sharp training-stability phase transition near RR1. All seeds diverge for RR2; training is reliable only for RR3. Thus, RR4 is the empirically minimal stable exponent, matching the theoretical bound. Figure 6

Figure 6: Validation loss snapshot at step 2000 on FineWeb-Edu 50BT (GPT-2 small, RR5), sweeping exponent RR6. Training is consistently stable for RR7.

Hierarchical Looped Transformers / Reasoners

Extending the analysis, DeepLoop is successfully applied to hierarchical recurrent architectures such as the Hierarchical Reasoning Model (HRM) on ARC-AGI-1. Here, the same loop-aware scaling improves the headline two-vote accuracy by RR8 points over vanilla HRM, with gains spanning all vote budgets. This supports the claim that RR9 is required for aligned inner modules operating at fixed physical depth, even with truncated training gradients.

Practical and Theoretical Implications

DeepLoop demonstrates that correct residual and initialization scaling is essential when parameter sharing is employed across circuitous or recurrent depth in Transformers. The analytic scaling rule

ÎşR\kappa_R0

is plug-and-play for any Post-LN looped backbone and robustly stabilizes very deep unrolled computation without architectural modification or new hyperparameters.

Theoretically, the visit-alignment coefficient ÎşR\kappa_R1 elegantly captures the risk of over-aggressive parameterization in the presence of parameter tying. Empirically, the conservative choice ÎşR\kappa_R2 is safe for a wide range of architectures, loop depths, and downstream evaluations, supporting its adoption as a default, loop-aware parameterization. The analysis exposes the importance of not only counting nominal layers but critically modeling how effective depth is realized.

Future Directions

  • Measuring Alignment: Directly monitoring ÎşR\kappa_R3 or empirically quantifying inter-visit gradient alignment would provide further guidance for adaptive or less conservative scaling.
  • Optimizing for Decorrelation: If visit decorrelation can be induced or detected, it may be possible to interpolate exponents ÎşR\kappa_R4 between the DeepNorm (ÎşR\kappa_R5) and DeepLoop (ÎşR\kappa_R6) regimes, trading off stability and learning signal.
  • Scale and Architecture Extensions: Investigation into the behavior at larger ÎşR\kappa_R7, scale, varying normalization strategies, and implications for hyperparameter transfer (as in ÎşR\kappa_R8P/Depth-ÎşR\kappa_R9P) would further elucidate the universality of the approach.

Conclusion

DeepLoop offers a principled and empirically validated residual parameterization for looped Transformers, ensuring robust training and improved generalization wherever residual-branch weight sharing is employed. The loop-aware analysis and its sharp stability boundary exemplify how careful theoretical modeling of parameter interactions is critical to advancing efficient and scalable deep sequence models (2607.13491).

Paper to Video (Beta)

No one has generated a video about this paper yet.

Whiteboard

No one has generated a whiteboard explanation for this paper yet.

Open Problems

We haven't generated a list of open problems mentioned in this paper yet.

Collections

Sign up for free to add this paper to one or more collections.

Tweets

Sign up for free to view the 3 tweets with 159 likes about this paper.