How to Build and Train Your Recurrent-Depth Model: A Fixed-Point Perspective

Summary (Overview)

  • Key theoretical contribution: The paper establishes that additive input injection in recurrent-depth models (e.g., Huginn-0125) is exactly equivalent to Halpern iteration with a fixed stepsize (β = 1/2), providing a rigorous theoretical foundation for why truncated backpropagation (TBPTT) works in these architectures.

  • Provable convergence guarantees: The authors show that fixed-step Halpern iteration makes the update a contraction even when the underlying operator is mildly expansive (L < 1/(1−β)), enabling depth-independent TBPTT windows, while a slowly vanishing (logarithmic) stepsize schedule achieves closest-point selection with only polylogarithmic TBPTT windows.

  • Novel Lipschitz certificates: For SwiGLU blocks, the Lipschitz constant depends on a product of row and spectral norms of gate and value matrices, requiring joint constraints in both norms. Gates alone only require row-norm constraints. This reveals that pre-norm (input normalization) is essential for SwiGLU/ReLU² and attention blocks.

  • Sparrow optimizer: A drop-in replacement for Muon/MuonH that applies the spectral oracle at most once per step (no computational overhead), with predetermined constraint radii (κ = min{1, √(d/m)}) requiring no retuning.

  • Empirical validation: Sparrow speeds up training of small language models over Muon both with and without looping, achieves 1.2× the certified robustness radius of spectral-only constraints on synthetic tasks, and improves gated attention training when gates are tall matrices.

Introduction and Theoretical Foundation

Background

Recurrent-depth models scale test-time computation by repeatedly applying a shared block to a latent state. They are trained with truncated backpropagation (TBPTT), differentiating through only the last few iterations. The paper addresses a fundamental puzzle: why does TBPTT work when the truncated gradient ignores how earlier iterations depend on parameters?

Core Theoretical Framework

The paper formulates three desiderata for a recurrent forward pass:

  1. Desideratum 1 (Existence and multiple solutions): The fixed-point set Cθ:=Fix(Tθ)\mathcal{C}_\theta := \text{Fix}(\mathbb{T}_\theta) is nonempty and permits multiple points (so different queries can select different solutions).

  2. Desideratum 2 (Closest-point selection): Iterates converge to the projection of the query onto the fixed-point set:

zk⟶PCθ(u):=arg⁡min⁡z∈Cθ12∥z−u∥2z^k \longrightarrow \mathbb{P}_{\mathcal{C}_\theta}(u) := \arg\min_{z \in \mathcal{C}_\theta} \frac{1}{2}\|z - u\|^2
  1. Desideratum 3 (Polylogarithmic-window TBPTT): A backward window of size H=polylog(K,1/ε)H = \text{polylog}(K, 1/\varepsilon) suffices to ensure:
∥∂θzK−(∂θzK)TBPTT(H)∥≤ε\left\|\partial_\theta z^K - (\partial_\theta z^K)_{\text{TBPTT}(H)}\right\| \leq \varepsilon

Key Insight: Input Injection = Halpern Iteration

The paper shows that additive input injection, commonly used in recurrent architectures, is exactly Halpern iteration. Given the update xk+1=Sθ(u+xk)x^{k+1} = \mathbb{S}_\theta(u + x^k), defining zk:=(u+xk)/2z^k := (u + x^k)/2 and Tθ(z):=Sθ(2z)\mathbb{T}_\theta(z) := \mathbb{S}_\theta(2z) yields:

zk+1=12u+12Tθ(zk)=H1/2,u(zk)z^{k+1} = \frac{1}{2}u + \frac{1}{2}\mathbb{T}_\theta(z^k) = \mathbb{H}_{1/2,u}(z^k)

This is Halpern iteration with βk≡1/2\beta_k \equiv 1/2.

Methodology

Halpern Iteration Analysis

Fixed-step Halpern (Proposition 4.1): With βk≡β\beta_k \equiv \beta and q:=(1−β)L<1q := (1-\beta)L < 1:

  • The update is a contraction with modulus qq, converging linearly to a unique fixed point
  • TBPTT window: H=O(log⁡(1/ε))H = O(\log(1/\varepsilon)), depth-independent
  • The limit is a biased solution with residual ∥zβ−Tθ(zβ)∥=β1−β∥u−zβ∥\|z_\beta - \mathbb{T}_\theta(z_\beta)\| = \frac{\beta}{1-\beta}\|u - z_\beta\|

Logarithmic-step Halpern (Proposition 4.2): With βk=1/log⁡(k+3)\beta_k = 1/\log(k+3):

  • Achieves closest-point selection: zk→PCθ(u)z^k \to \mathbb{P}_{\mathcal{C}_\theta}(u)
  • TBPTT error bound:
∥∂θzK−(∂θzK)TBPTT(H)∥≤Mlog⁡(K+2)exp⁡(−Hlog⁡(K+2))\left\|\partial_\theta z^K - (\partial_\theta z^K)_{\text{TBPTT}(H)}\right\| \leq M \log(K+2) \exp\left(-\frac{H}{\log(K+2)}\right)
  • Window: H=O(log⁡K[log⁡log⁡K+log⁡(1/ε)])H = O(\log K[\log\log K + \log(1/\varepsilon)])

Lipschitz Certificates for Neural Blocks

The paper derives Lipschitz bounds for various architectural blocks:

Theorem 5.1 (Lipschitz MLP block):

Lip(FMLP)≤∥W2∥opLσ∥W1∥op\text{Lip}(\mathbb{F}_{\text{MLP}}) \leq \|W_2\|_{\text{op}} L_\sigma \|W_1\|_{\text{op}}

Theorem 5.3 (Lipschitz SwiGLU block):

Lip(MSwiGLU)≤dω∥Wo∥op[LSiLU∥Wv∥2→∞∥Wg∥op+∥Wg∥2→∞∥Wv∥op]\text{Lip}(\mathbb{M}_{\text{SwiGLU}}) \leq \sqrt{d}\omega\|W_o\|_{\text{op}}\left[L_{\text{SiLU}}\|W_v\|_{2\to\infty}\|W_g\|_{\text{op}} + \|W_g\|_{2\to\infty}\|W_v\|_{\text{op}}\right]

This reveals that SwiGLU requires joint row-norm and spectral-norm constraints on WgW_g and WvW_v, with the constraint set:

Kr,s:={W∈Rm×d:∥W∥2→∞≤r,∥W∥op≤s}\mathcal{K}_{r,s} := \{W \in \mathbb{R}^{m\times d}: \|W\|_{2\to\infty} \leq r, \|W\|_{\text{op}} \leq s\}

Sparrow Optimizer

The paper develops the Sparrow optimizer (Algorithm 1) with three parameter-group-specific update directions:

  1. SwiGLU gate/value matrices (m>dm > d): (RowClipr∘Spectrals∘Rowr)(G)(\text{RowClip}_r \circ \text{Spectral}_s \circ \text{Row}_r)(G)
  2. Attention-gate/SSM-gate matrices: Rowr(G)\text{Row}_r(G)
  3. All other matrices: Spectrals(G)\text{Spectral}_s(G)

The recommended radius split is κ=r/s=min⁡{1,d/m}\kappa = r/s = \min\{1, \sqrt{d/m}\}, derived from the geometry of saturated matrices.

Empirical Validation / Results

Robustness-Accuracy Pareto Frontier (Section 7.1)

Synthetic experiments with SwiGLU blocks (d=64d=64, m=4dm=4d) comparing spectral vs. joint constraints:

  • Spectral constraint: Certifies 1.6× larger radii than Adam at 70% accuracy
  • Joint constraint: Dominates Muon at every accuracy level on the "spread" teacher (1.2× radius at 70% accuracy, higher maximal accuracy: 0.793 vs 0.771)
  • Concentrated teacher (κ* ≈ 0.90): The two methods have matching Pareto fronts
  • Teacher-free split κ = √(d/m) peaks near the optimal performance, validating the recommended choice

Language Model Training (Section 7.2)

Character-level Shakespeare model (nanoGPT, 4 layers, d=128, SwiGLU width m=4d):

MethodStep sizeLoss improvement vs MuonSpeedup
Sparrow1× Muon−0.013 ± 0.0021.07×
Sparrow2× Muon−0.020 ± 0.0021.11×
Aurora2× Muon−0.017 ± 0.0031.09×

Wall-clock time: Sparrow takes the same 2.6 ms per step as Muon (row normalization is essentially free), while Aurora doubles the cost.

Gated Attention Results

  • Square gate (128×128): Sparrow on gate alone has no effect (+0.002 ± 0.002)
  • Tall gate (512×128): Sparrow improves over Aurora by 1.5× (0.024 vs 0.015), confirming row-norm is the appropriate constraint for gates
  • Weight normalization (MuonH): Sparrow + weight normalization further improves by 0.007–0.009 even without update-direction normalization

Looped Models

Sparrow lowers final validation loss for every loop count N and truncation window H on all seeds, by 0.012–0.027.

Theoretical and Practical Implications

Theoretical Contributions

  1. Fixed-point foundation for recurrent-depth models: The paper provides the first rigorous explanation for why input injection + TBPTT works, grounding it in Halpern iteration theory.

  2. Trade-off characterization: Fixed-step Halpern admits expansive operators (L < 1/(1−β)) with depth-independent TBPTT but biased solutions; logarithmic-step Halpern achieves unbiased closest-point selection at the cost of requiring nonexpansiveness.

  3. Novel Lipschitz certificates: The joint row-norm/spectral-norm constraint for SwiGLU is a new result that departs from the traditional spectral-only approach in Lipschitz neural networks.

  4. Robustness guarantees: Theorem 4.3 provides query robustness for all finite iterates, even for expansive operators with a floor on the stepsize.

Practical Implications

  1. Optimizer design: Sparrow provides a principled, parameter-group-dependent optimizer that respects the geometry implied by Lipschitz certificates, serving as a drop-in replacement for Muon/MuonH with no overhead.

  2. Architecture guidance: The theory reveals that pre-norm is essential for SwiGLU/ReLU² and attention, and that gates should be constrained in row norm only (not spectral norm).

  3. Training efficiency: The polylogarithmic TBPTT window justifies the common practice of differentiating through only a few iterations.

Conclusion

The paper establishes a rigorous theoretical foundation for recurrent-depth models by connecting input injection to Halpern iteration. Key takeaways:

  1. Input injection is Halpern iteration with fixed stepsize β = 1/2, providing contraction even for mildly expansive operators and enabling depth-independent TBPTT.

  2. Lipschitz certificates guide optimization: SwiGLU requires joint row-norm and spectral-norm constraints on gate/value matrices, while gates alone need only row-norm constraints.

  3. Sparrow optimizer provides a principled, parameter-group-dependent update that respects these constraints with no computational overhead over Muon.

Future Directions

The paper identifies several open questions:

  • Can Lipschitz certificates guide optimizer design for Mixture-of-Experts (MoE) modules?
  • Is there a recurrence that converges to a fixed point like slowly vanishing Halpern while tolerating non-nonexpansive operators like fixed-step Halpern?
  • Is it worthwhile abandoning TBPTT to support the accelerated schedule β_k = 1/(k+2)?
  • How should models be scaled with optimizers that properly utilize tall matrix parameters?

Related papers