On paper, a standard Pre-Norm residual block $h_t = h_{t-1} + \Delta_t$ preserves an unimpeded identity shortcut $I$ from output back to input, which initially made it look immune to vanishing gradients. In practice, however, training an 80-to-100-layer untied Transformer or unrolling a weight-tied recurrent Transformer to $32\text{–}64$ passes with standard Pre-Norm routinely leads to stalled deep representations or sudden numerical divergence.
The issue is not the residual shortcut itself, but the fact that Pre-Norm normalizes only the branch input while leaving the residual stream's overall norm completely unconstrained. When the same block parameters repeat dozens of times in sequence, residual norms grow even faster than in untied networks, weakening late-pass contributions in the forward pass and compressing gradients through the final output norm in the backward pass. Mitigating this requires coupling residual scaling (DeepLoop / Loop-$\mu$P), Sandwich Normalization, or learned residual routing with persistent input injection and truncated backpropagation—each of which introduces its own structural tradeoffs.
1. The Dual Failure of Pre-Norm: Visual Illusion, Norm Drift, and the Four Insurances#
Writing h = h + block(RMSNorm(h)) creates a common visual illusion: because RMSNorm sits at every block entrance, activations look safely bounded. In reality, RMSNorm clamps only the branch input, never the residual trunk $h$ itself. Taking the squared Euclidean norm of the step-$t$ Pre-Norm update $h_t = h_{t-1} + \Delta_t$, where $\Delta_t = f_\theta(\mathrm{RMSNorm}(h_{t-1}))$, isolates how stream magnitude evolves with depth:
Because $\mathrm{RMSNorm}(h_{t-1}) = \frac{\sqrt{d}\,h_{t-1}}{\|h_{t-1}\|_2}$ fixes the radius entering the sublayer weights at $\sqrt{d}$ (assuming unit scale parameters), the branch increment $\|\Delta_t\|_2$ stays roughly $\Theta(1)$ at every step regardless of how large the main stream has grown. Stream growth therefore hinges entirely on the inner product cross-term $2\langle h_{t-1}, \Delta_t\rangle$, creating a sharp divide between untied and weight-tied depths:
Untied layers: Adjacent layers carry independent weights whose outputs are nearly orthogonal to the incoming stream at initialization, so $\mathbb{E}\langle h_{t-1}, \Delta_t\rangle \approx 0$. Squared norm accumulates like a random walk ($\|h_t\|_2^2 \propto t$), yielding gentle $\Theta(\sqrt{t})$ norm growth. Crucially, even if the trunk at layer 60 reaches $10\times$ initial scale, untied layer 60 owns independent parameters $W^{(60)}$ that can scale up ~10× during training to stay commensurate with the trunk, and once settled its scale stays stationary.
Weight-tied repeated loops: Calling the exact same operator $f_\theta$ consecutively aligns successive updates along eigenvectors with positive real parts, producing positive correlation $\langle h_{t-1}, \Delta_t\rangle > 0$. Consider an elementary 2D illustration starting at $h_0 = [1, 1]$ and adding an aligned increment $[1, 1]$ per pass: by step $32$, the residual state reaches $[33, 33]$. Norm grows linearly at $\Theta(t)$, shrinking the step-33 incremental contribution relative to the stream down to $1/33 \approx \mathbf{3.03\%}$. Because every pass shares the exact same $W$, boosting $W$ by $10\times$ to rescue pass 60 would blow up pass 1; without boosting, passes 20–64 degrade into ~3% near-idling perturbations.
Moreover, BF16 shares FP32's 8-bit exponent with a dynamic range up to $\approx 3.4 \times 10^{38}$. Rather than failing abruptly with an immediate NaN, Pre-Norm loops silently suffer from late-pass dilution (analyzed as the "Curse of Depth" by Sun et al., 2025) long before overflowing. In the backward pass, differentiating $\mathrm{RMSNorm}(h)$ via the quotient rule exposes the exact scaling factor applied to incoming gradients:
Figure 1: Standard Pre-LN (a) vs. depth-scaled LayerNorm Scaling by $1/\sqrt{l}$ (b) and parameter scaling curves (arXiv:2502.05795). (Source: Sun et al., 2025, Fig. 1)
Panel (b) mitigates this dilution in untied stacks by inserting an explicit $\times 1/\sqrt{l}$ scaling block right after each Layer Norm, matching Pre-LN validation loss with 66% Fewer Params on the Model Parameter Scaling curve ($10^7$ to $7\times 10^9$). However, explicitly indexing layer depth $l$ works only for fixed-depth untied stacks ($1 \dots L$) and cannot generalize to stepless depth-extrapolating loops, where the shared core receives no step index $l$ and must remain autonomous across $r_{\text{test}} > r_{\text{train}}$.
Two subtle misconceptions frequently arise around this derivative:
Why do gradients shrink when the overall block Jacobian contains $I$? While the residual spine itself carries gradients backward across steps without multiplying by small branch Jacobians, the network ends with a final global normalization $\mathrm{RMSNorm}(h_K)$ right before lm_head. By the derivative above, that exit norm scales the entire backpropagated signal by $1/\|h_K\|_2$; meanwhile, later branch Jacobians attenuate proportional to $1/\|h_{t-1}\|_2$, weakening branch weight updates relative to the trunk.
Why do the "four insurances" of an 80-layer untied Pre-Norm model fail on variable-depth loops? A static 80-layer untied model relies on four cooperating properties: layer-specific $W^{(l)}$ scaling, orthogonal $\Theta(\sqrt{L})$ random-walk growth, fixed $1/\sqrt{2L}$ residual initialization scaling, and AdamW's second-moment EMA absorbing a stationary global scale. In dynamic-depth loop training ($r = 4\text{–}64$), shared weights turn growth into coherent $\Theta(t)$ drift, static $1/\sqrt{2L}$ init cannot match both $r=4$ and $r=64$, and batch-to-batch jumps in $r$ swing $\|h_r\|_2$ faster than AdamW's EMA can track.
Architecture Regime
Trunk Norm Growth
Per-Layer Amplitude Tuning
Static Init & AdamW Fit
Failure Mode
80L Untied Pre-Norm
$\Theta(\sqrt{L})$
Yes · independent $W^{(l)}$
High · fixed $L$, $1/\sqrt{2L}$ + EMA
Late-layer dilution, generally stable
Shallow Fixed Loop · $K=2\text{–}4$
Mild $\Theta(t)$
Limited · small $K$ manageable
Moderate · fixed unroll depth
Degrades once extrapolated past $K>4$
Deep Dynamic Loop · $r=4\text{–}64$
Coherent $\Theta(t)$
None · single shared $W$
Broken · $r$ jumps destabilize EMA
Passes 20–64 stall at ~3% idling
2. Residual Scaling Laws, Sandwich Norm, and Gated Routing#
Researchers have primarily tackled norm growth along three architectural axes: residual scaling laws, double-sided stream clamping, and gated or attention-based residual routing.
The first approach recalibrates residual multipliers and initialization scales to account for coherent updates. For $N$ untied layers under pure Post-LN $\mathrm{Norm}(\alpha h + \Delta)$, DeepNet (Wang et al., 2022) sets $\alpha = (2N)^{1/4}$ and $\beta = (8N)^{-1/4}$ so total output change $\|\Delta F\|$ per parameter update stays bounded under $\Theta(\sqrt{N})$ uncorrelated increments. Observing that weight-tied parameters accumulate coherently across $N = KR$ unrolled block visits ($\Theta(N)$ instead of $\Theta(\sqrt{N})$), DeepLoop (Li et al., 2026) tightens the exponents to $\alpha = (2N)^{1/2},\; \beta = (8N)^{-1/2}$ with a spine-outer Pre+Post Norm sublayer: $\mathbf{x}_{i+1} = \mathrm{Norm}\!\big(\alpha \mathbf{x}_i + f_j(\mathrm{Norm}(\mathbf{x}_i); \phi_j)\big)$.
In the Pre-Norm Maximal Update Parameterization ($\mu\text{P}$) infinite-width limit, Loop-$\mu$P (Wang et al., 2026) derives the corresponding rule: scaling residual branches by $\Theta(1/N) \cdot m_L^{-1/2}$ (where $m_L$ is the depth/loop multiplier) cancels coherent linear accumulation and enables zero-shot learning-rate transfer across $N=1\text{–}8$ (up to 384 effective layers). During BF16 / FP8 training, keeping the residual stream accumulator in FP32 also prevents mantissa rounding from swamping small $\Theta(1/N)$ increments.
⤢ Zoom
Figure 2: DeepLoop shared physical blocks (a), unrolled execution (b), residual sublayer with skip multiplier α, and scaling rule α = (2N)^(1/2), β = (8N)^(-1/2) (c–d) (arXiv:2607.13491). (Source: Li et al., 2026, Fig. 1)
Walking panels (a)–(d) clarifies the exact symbol mapping: panel (a) shows $K = 2$ shared physical blocks ($\phi_1, \phi_2$) stored once; panel (b) unrolls $R = 3$ rounds into unrolled block depth $N = KR = 6$ ($M = 2N = 12$ sublayer visits); panel (c) prints the Pre+Post (Sandwich) Norm update $\mathbf{x}_{i+1} = \mathrm{Norm}(\alpha \mathbf{x}_i + f_j(\mathrm{Norm}(\mathbf{x}_i); \phi_j))$ with skip multiplier $\alpha$ and init gain $\beta$; and panel (d) summarizes the $p = 1/2$ scaling rule $\alpha = (2N)^{1/2},\; \beta = (8N)^{-1/2}$.
The second approach applies Sandwich Norm, where two fundamentally different wiring patterns must be kept distinct. Untied models such as Gemma 2 / 3 place $\mathrm{RMSNorm}_{\text{post}}$ inside the residual branch ($h + \mathrm{RMSNorm}_{\text{post}}(F(\tilde{h}))$), bounding sublayer output magnitude while preserving an uncontracted identity highway (orthogonal layers still grow gently as $\Theta(\sqrt{t})$). By contrast, Huginn-0125 (Geiping et al., 2025) and DeepLoop place $\mathrm{RMSNorm}_{\text{post}}$ outside the residual addition on the main spine, resetting the entire stream RMS to 1.0 after every addition; to prevent attention logit drift, Huginn-0125 pairs outer Sandwich Norm with learnable QK-Bias (not QK-Norm), whereas Gemma 2, Qwen3, and Ouro adopt QK-Norm (ViT-22B, Dehghani et al., 2023) to clamp $Q$ and $K$ directly:
Spine-outer Sandwich Norm completely eliminates forward norm explosion—locking stream RMS at 1.0 whether unrolled to 32 or 100 steps—at a steep backward cost. When incoming $h_{t-1}$ has $\mathrm{RMS}=1$ and an orthogonal branch increment has $\mathrm{RMS}(\Delta_t)=\sigma$, the pre-norm sum has RMS $\sqrt{1+\sigma^2}$, so outer $\mathrm{RMSNorm}_{\text{post}}$ divides by $\sqrt{1+\sigma^2}$: each residual node contracts orthogonal trunk gradients by $1/\sqrt{1+\sigma^2}$ and projects out radial components (even producing negative 1-step sensitivity).
Calculation
Worked Verification · 32-Node Contraction Under Spine-Outer Sandwich Norm: Each Transformer layer has 2 sublayer residual nodes (Attention and FFN). At orthogonal scale $\sigma = 0.4$, each node multiplies orthogonal trunk gradients by $1/\sqrt{1+0.4^2} \approx \mathbf{0.9285}$; across 32 sublayer nodes (16 full layers), orthogonal gradient norm shrinks to $0.9285^{32} \approx \mathbf{0.093}$ while 1-step radial gradient prints -0.3202. Spine-outer Sandwich Norm therefore requires an explicit input-injection bypass and TBPTT rather than standalone Full BPTT.
Figure 3: Wiring comparison (Pre-Norm vs. Gemma inner vs. Huginn outer) and 32-step residual RMS trajectories.
This runnable 32-step PyTorch check over 64 dimensions compares Pre-Norm (coherent vs. orthogonal), Gemma branch-inner, and Huginn spine-outer side by side (see also David Louapre's interactive Looped Transformers Space):
PYTHON
importmath, torch
rms = lambda x: x / x.pow(2).mean().sqrt()
d, steps, sig = 64, 32, 0.4
e0 = torch.eye(1, d).squeeze() * math.sqrt(d)
h_coh, h_orth, h_gem = e0.clone(), e0.clone(), e0.clone()
h0 = e0.clone().requires_grad_(True)
h_hug = h0
for i inrange(1, steps + 1):
o = torch.zeros(d); o[i] = sig * math.sqrt(d)
h_coh = h_coh + sig * e0
h_orth = h_orth + o
h_gem = h_gem + sig * rms(o)
h_hug = rms(h_hug + o)
h_hug[33].backward()
s = e0.clone().requires_grad_(True)
o0 = torch.zeros(d); o0[1] = sig * math.sqrt(d)
rms(s + o0)[1].backward()
print("Pre(coh/orth):", round(h_coh.pow(2).mean().sqrt().item(), 1),
round(h_orth.pow(2).mean().sqrt().item(), 2))
print("Gemma/Huginn:", round(h_gem.pow(2).mean().sqrt().item(), 2),
round(h_hug.pow(2).mean().sqrt().item(), 1))
print("Orth grad:", round(h0.grad[33].item(), 4),
"th:", round(1.16 ** -16, 4),
"rad:", round(s.grad[0].item(), 4))
The third axis modifies the residual topology directly:
Per-token write gate (GLM-5.4): When folding 28 middle layers twice inside a ~750B backbone, a per-token sigmoid gate gradually mixes the second loop pass onto the stream—though practitioners warn that under near-zero negative-bias initializations, weak early gradients can trap the gate near low open fractions (reported around ~0.06), leaving the second pass underutilized.
Depth-wise Attention & doubly-stochastic lanes (Block AttnRes & mHC): Block AttnRes (Chen et al., 2026) replaces fixed sums with online Softmax attention across $N$ coarse blocks (cutting cross-layer I/O from $\mathcal{O}(L^2)$ to $\mathcal{O}(N^2)$) to prevent $\sqrt{l}$ dilution, while mHC (Xie et al., 2025) widens the residual stream into parallel lanes mixed via Sinkhorn-Knopp doubly-stochastic matrices to bound depth signal gain.
3. Autonomous Input Injection, TBPTT($k$), and Limit Cycles#
To decouple input representation learning from long contracted recurrent chains, Huginn-0125 (seal-rg/recurrent-pretraining) replaces Universal Transformer step embeddings with an untied Prelude (P) extracting a fixed conditioning tensor $e$, a stepless weight-tied Recurrent Block (R) (retaining horizontal RoPE inside self-attention and concatenating $e$ with $s_{t-1}$ at every step via a linear adapter), and a final Coda (C):
⤢ Zoom
Figure 4: Huginn Prelude (P) – Recurrent Block (R) – Coda (C) architecture with persistent input injection e at every recurrent step (arXiv:2502.05171). (Source: Geiping et al., 2025, Fig. 2)
Notice the two distinct signal paths in the diagram: the solid residual spine $s_0 \to s_1 \to \dots \to s_R$ passing through each green block R, and the dashed e bypass arrows (Input Injection) running from Prelude P directly into every recurrent iteration. Because those dashed e arrows enter the trailing R blocks directly, P still receives uncontracted gradients during the final $k$ tracked steps under truncated backpropagation. Structurally, dropping step indices vertically mirrors dropping positional indices horizontally:
Re-injecting $e$ on every iteration turns the forward loop into a conditioned dynamical system $s_t = F_\theta(s_{t-1}; e)$. Here it helps to reconcile the Gaussian state initialization $\mathcal{N}(0, \sigma^2 I_{n\cdot h})$ drawn in Huginn's original Fig. 2 (above) and used in the released Huginn-0125 prototype with subsequent empirical ablations: persistent input injection ($e$) reliably improves loop optimization and stability, whereas random noise initialization ($s_0 \sim \mathcal{N}$) raises early variance and slows backbone convergence compared to zero or prelude initialization ($s_0 = 0$ or $s_0 = e$), even though noise init was originally motivated by encouraging path-independent attractors.
If one models $F_\theta(\cdot; e)$ as a contraction mapping ($\rho(J_F) < 1$) converging to a unique fixed point $s^* = F_\theta(s^*; e)$, the implicit function theorem (Deep Equilibrium Models, Bai et al., 2019) expresses the exact equilibrium parameter gradient as an infinite Neumann series:
A 1D fixed-point trace illustrates why late steps dominate near an attractor. Solving $\sqrt{100}$ via Newton's update $s_{t+1} = \frac{1}{2}(s_t + 100/s_t)$ from $s_0 = 2$ yields 2 → 26 → 14.9 → 10.8 → 10.03 → 10.00005. Because the derivative vanishes near $s^* = 10$, perturbations from step 1 decay rapidly while the trailing steps govern local sensitivity.
Huginn trains with TBPTT($k=8$): the first $r - k$ iterations run inside torch.no_grad(), and gradients backpropagate only through the final $k = 8$ passes. Choosing the truncation window $k$ trades constant activation memory against gradient horizon (at mean $r=32$, total step cost $r + 2k$ spans $40\times, 48\times, 64\times$ forward equivalents across $k = 4, 8, 16$, with $k=8$ serving as Huginn's default operating point):
Why an untied 80-layer model cannot use TBPTT: In an untied stack, layers $1\text{–}56$ have distinct weights $\theta_1 \dots \theta_{56}$; wrapping them in no_grad() would freeze those layers with zero gradient forever. TBPTT only works because a looped core reuses the same $\theta_{\text{core}}$ during the trailing $k$ steps while the Prelude receives fresh, uncontracted gradients through the dashed e bypass arrows in Huginn's original Fig. 2 injected inside those trailing $k$ steps.
Short-step ($r \le 8$) fallback via Activation Checkpointing: When unroll depth is shallow (such as $r \le 8$ in Ouro $T=4$ or SMELT $K=2\text{–}4$), standard practice uses Activation Checkpointing: storing only inter-loop boundary states and recomputing intra-block activations during backward, trading +33% compute ($4r$ vs. $3r$) for 100% exact, unbiased gradients.
The step-1→20 blind spot: At $r=32, k=8$, the trailing 8 steps see no gradient paths back to steps $1\text{–}24$. TBPTT therefore suffers from a step-1→20 horizon blind spot: it trains the shared core primarily as a local refinement operator rather than learning long-horizon plans that only pay off 20+ steps later.
Figure 5: Unrolled Huginn TBPTT(k=8) truncated backprop wall with persistent forward e bypass.
Training depth $r$ is drawn stochastically from a log-normal Poisson distribution:
Setting $\bar{r} = 31$ gives $\mathbb{E}[e^\tau] = 31$ and mean depth $\mathbb{E}[r] = 32$ (in data-parallel training, ranks synchronize the sampled $r$ per step to avoid straggler stalls).
Caveat
Caveat · Limit Cycles and Truncation Bias: Geiping et al. (2025) report an important empirical nuance when inspecting actual latent trajectories in high dimensions: hidden states often settle into limit cycles or periodic orbits rather than a strict point attractor $s^*$. Where a unique fixed point does not hold strictly, the Neumann-series picture is only an informative local approximation. Operationally, randomized-$r$ plus TBPTT($k=8$) trains the shared block as a locally stabilizing refinement operator across arbitrary prefix depths, trading constant activation memory against a controllable short-horizon truncation bias.
At $r=32, k=8$, forward execution runs 32 core passes (24 inside no_grad(), 8 tracked) and backward spans the last $k=8$ passes ($\approx 2k = 16$ forward-equivalents), totaling $r + 2k = 48$ forward-equivalents—so the 24 no_grad() steps account for 50% of total training compute (75% of forward compute):
Backprop Mode
Activation VRAM
Step Cost (Fwd=1×)
Main Tradeoff
Full BPTT
$\mathcal{O}(r \cdot M_{\text{core}})$
$3r$
Unbiased; VRAM scales linearly in $r$
Activation Checkpointing
$\mathcal{O}(M_{\text{core}} + r \cdot \mathrm{Bnd})$
$4r$ · $+33\%$ compute
100% exact grads; standard at $K=2\text{–}4$ (Ouro / SMELT)
Stabilizing deep stepless loops rests on a fragile three-way compromise: spine-outer clamping (or Loop-$\mu$P scaling) to stop forward blowup, Prelude injection to preserve short uncontracted gradients, and stochastic unroll depths under TBPTT($k$) to cap activation VRAM. That compromise is expensive—at $r=32, k=8$, half of all training FLOPs run under no_grad() while leaving steps 1–24 without direct long-horizon supervision—which helps explain why frontier practice has shifted toward shallow $K=2$ middle-stack folding rather than pushing r to hundreds of steps. Whether that compute cost beats compute-matched untied baselines is tested in Are Looped Transformers Worth It at Equal Compute? Huginn, Ouro, and SMELT.
Rui-Jie Zhu et al. (2025). Scaling Latent Reasoning via Looped Language Models (Ouro). arXiv:2510.25741
Z.ai (2026). GLM-5.4: Toward Generalized Coding with Our First Loop Transformer. z.ai/blog/glm-5.4
Guangyu Chen, Jianlin Su, Yu Zhang et al. / Kimi Team (2026). Attention Residuals (Block AttnRes). arXiv:2603.15031 · Companion blog by Jianlin Su: kexue.fm/archives/11664
Zhenda Xie, Yixuan Wei, Huanqi Cao et al. / DeepSeek-AI (2025). mHC: Manifold-Constrained Hyper-Connections. arXiv:2512.24880