TL;DR
When you differentiate through an iterative optimization algorithm—a staple technique in meta-learning and hyperparameter tuning—a bizarre thing happens: even as the algorithm smoothly approaches the right answer, its derivatives can initially diverge wildly before finally settling down. This paper cracks open the math behind this "curse of unrolling" for general nonlinear problems. Better yet, it shows how simply ignoring the earliest iterations during backpropagation tames the error spike while saving precious memory.
What Problem Does This Paper Address?
Many modern machine learning tasks, like meta-learning or neural architecture search, are framed as bilevel optimization problems: an outer loop tunes hyperparameters $u$, which depend on the solution $x^\star(u)$ of an inner optimization problem. To update $u$ via gradient descent, you need to know how changing $u$ changes $x^\star(u)$—that is, you need the Jacobian $Dx^\star(u)$.
Because we rarely have an exact formula for $x^\star(u)$, we run an iterative solver (like gradient descent) for $K$ steps and use automatic differentiation (AD) to backpropagate right through those steps. This is called algorithm unrolling.
We know that as $K \to \infty$, unrolled derivatives converge to the true Jacobian at the same geometric rate as the algorithm itself. However, in the real world of finite compute, researchers recently noticed a catch: in the early steps, the derivative error often grows before it decays. Prior work only explained this "curse of unrolling" for simple quadratic problems. Why does this happen in general settings, what governs its severity, and how do we fix it without slowing down our solvers?
Methods
Instead of looking at asymptotic behavior ($k \to \infty$), the authors perform a non-asymptotic analysis (finite $k$) on general, smooth fixed-point iterations $x^{(k+1)} = \mathcal{A}(x^{(k)}, u)$ where $\mathcal{A}$ is a contraction (meaning each step brings $x$ closer to the solution by at least a factor $\rho < 1$).
- Non-Asymptotic Error Bounds: While standard analyses just prove eventual convergence, the authors derive explicit upper bounds for the derivative error at any step $k$. They uncover a tug-of-war between a purely decaying term $\mathcal{O}(\rho^k)$ and a transient, growing-then-decaying term $\mathcal{O}(k\rho^{k-1})$ driven by accumulated forward-pass errors.
- Truncated Unrolling (Late-Start): Because early forward steps have the largest errors, differentiating through them injects massive noise into the derivative recursion. The authors formalize truncation: running the inner solver "idly" (without tracking gradients) for $T'$ steps, and only differentiating the remaining steps.
- Budget Reallocation: Since tracking gradients costs extra compute (by a factor $\omega > 1$), skipping differentiation on early steps frees up budget to run more total forward steps ($K' = K + \omega T$). They formulate a convex optimization problem to find the sweet-spot truncation index.
Datasets
- Synthetic Problems: Deterministic quadratic least-squares problems (with condition numbers $\kappa \approx 325$ and $\kappa \approx 7000$) and regularized logistic regression problems. No new benchmarks are introduced here; synthetic setups are chosen because closed-form or high-precision ground-truth Jacobians allow exact error tracking.
- Omniglot: A standard few-shot image classification dataset used for episodic meta-learning experiments, where a neural feature extractor is meta-trained over a regularized multiclass logistic regression inner problem.
Key Insights and Ideas
- The Anatomy of the Curse: That pesky $k\rho^{k-1}$ term is the culprit. Early on, linear growth ($k$) beats geometric decay ($\rho^{k-1}$), causing derivative errors to swell. Three things make the curse worse: slower convergence ($\rho$ close to 1), poor initialization (large initial forward error $e^{(0)}$), and less smooth update maps (large Lipschitz constants for $D\mathcal{A}$, which happens when using large, aggressive step sizes).
- Step Size vs. Truncation: Lowering the step size shrinks the Lipschitz constant and calms the curse, but it slows down convergence. Truncation gives you the best of both worlds: you can keep fast, optimal step sizes and simply multiply the curse term by $\rho^{T'}$, squashing the transient spike while slashing Reverse-Mode AD memory usage.
- Warm-Starting is "Implicit Truncation": Reusing a previous solution to initialize $x^{(0)}$ shrinks $e^{(0)}$. Mathematically, this dampens the exact same $k\rho^{k-1}$ term, bypassing the early transient regime without touching the computational graph.
Key Results
- Quadratic Least-Squares: With an optimal step size $\alpha = 2/(L+m)$, unrolling exhibits a massive derivative error spike, especially on ill-conditioned problems ($\kappa \approx 7000$). Applying truncation across $K=1000$ base iterations substantially suppresses this spike without needing fussy tuning—a wide range of truncation indices ($T \in \{0.1K, \dots, 0.8K\}$) beats full unrolling. Conversely, a conservative step size $\alpha = 1/(3L)$ avoids the spike naturally, but crawls toward the solution.
- Meta-Learning Trade-offs (Omniglot): Testing Gradient Descent (GD) and Heavy-Ball (HB) with $K=150$ inner steps and truncation $T \in \{0, 25, 50, 75\}$, HB achieves orders-of-magnitude lower outer-objective error ($\sim 10^{-5}$ to $10^{-6}$) and relative hypergradient error ($\sim 10^{-3}$) than GD ($\sim 10^{-2}$ and $\sim 4 \times 10^{-1}$). Surprisingly, increasing truncation $T$ on HB actually worsened hypergradient error (climbing toward $10^{-2}$) despite improving forward accuracy, likely because HB converges so fast that the curse is already mild and cutting differentiated steps starves the Jacobian recursion.
Limitations and Future Work
- Contraction Framework vs. Accelerated Methods: The theoretical proofs rely on global contractivity and global Lipschitz derivatives. Empirically, the authors show the curse also strikes Nesterov’s Accelerated Gradient (NAG) and Heavy-Ball methods, which fall outside strict contraction theory.
- Severe Ill-Conditioning & Short Horizons: Truncation isn't a silver bullet. If a problem is severely ill-conditioned or the iteration budget $K$ is too small, the forward pass never gets close enough to $x^\star(u)$ for late-starting to pay off, leaving a tricky practical trade-off between forward convergence and keeping enough differentiated steps. Future directions are not explicitly outlined in the main text.
Summary updated