Deep Equilibrium Models
A deep network need not be a fixed stack of layers; it can be a single weight-tied layer iterated to convergence, its output defined implicitly as the fixed point . The forward pass becomes root-finding and the backward pass becomes implicit differentiation, so training costs O(1) memory regardless of effective depth.
╌╌╌╌
Every architecture so far has been a recipe: an ordered list of layers, each applied once, the output read off the top of the stack. A residual block, an LSTM cell, a transformer block — all are functions you run. A deep equilibrium model (DEQ) instead defines a layer not by what it computes but by a condition its output must satisfy, and lets a black-box solver find whatever output meets the condition.1
A layer that calls itself
Take a single weight-tied transformation (one layer's worth of parameters, conditioned on the input ) and apply it over and over to its own output. If the iteration settles, it settles at a point that the layer maps to itself.
This describes an infinite-depth weight-tied network run to convergence. Stack the same block times and you compute ; as , if the iteration converges, independent of . The infinitely deep stack and the self-referential layer are two descriptions of one object.
The payoff is structural. A conventional -layer net stores sets of activations for the backward pass; the DEQ stores one, at any effective depth — provided we can solve and differentiate the fixed-point condition, which is the rest of this lesson.
Forward pass = root-finding
Finding is solving a nonlinear system. Rearrange the fixed-point condition into a residual whose zero is the equilibrium:
Any root-finder applies. The simplest is fixed-point iteration (literally re-running the layer), which converges when is a contraction.2
The contraction constant is governed by the Jacobian of : the iteration converges locally when the spectral radius , where evaluated near . Each step of plain fixed-point iteration multiplies the error by roughly , so convergence is linear and can be slow when is close to .
For example, take the one-dimensional layer , a contraction with . Its fixed point solves , so . Start at and iterate:
| step | error | ratio to previous | |
|---|---|---|---|
| — | |||
The error halves every step, exactly the predicted geometric decay : reaching a tolerance of takes about steps (). Now sharpen the map to , still a contraction but with . Its fixed point is as well, but the error now shrinks by only per step, so the same tolerance needs about iterations — two orders of magnitude slower. This is why the slope of the map at , not just the fact that it is below , decides whether plain iteration is practical, and why the Newton and Broyden solvers below justify their extra per-step cost.
Plain iteration is rarely the fastest route. Treating as a general root-finding problem licenses quasi-Newton solvers (Newton and Broyden) that use (an approximation of) the Jacobian to take superlinear steps.3 The forward solver is genuinely a black box: the rest of the model needs only a point that satisfies the residual to tolerance, however it was found.
| Solver | Update | Per-step cost | Convergence |
|---|---|---|---|
| Fixed-point iteration | one layer eval | linear, rate | |
| Newton | solve a linear system | quadratic (local) | |
| Broyden | , | low-rank update | superlinear |
- 1any initial guess, e.g. zeros
- 2repeat
- 3re-run the weight-tied layer (or a Newton/Broyden step)
- 4residual norm
- 5
- 6untilconverged to the equilibrium
- 7returnthis is
Backward pass = implicit differentiation
To train the DEQ we need — how the equilibrium moves when the weights move. The naive route is to backprop through every solver iteration, storing each intermediate ; that destroys the memory advantage and ties the gradient to an arbitrary solver trajectory. The implicit function theorem lets us skip the solver entirely and differentiate the condition instead.4
The fixed point satisfies as an identity in . Differentiate both sides with respect to any quantity , whether or the input , and apply the chain rule, remembering that itself depends on :
Collect the terms on the left and factor:
This is a closed form for the layer's Jacobian that mentions only the fixed point and the local Jacobian — not a single solver iterate. The matrix is invertible exactly when , the same condition that made the forward pass converge.
For example, return to from the forward-pass trace, but read as a parameter: with , whose fixed point is . Here and , so the implicit-gradient formula gives
Check it directly: , so . The implicit formula and the explicit
derivative agree exactly, and the factor is precisely the
that a naive one-step derivative would miss — it accounts for the
fact that changing moves the whole equilibrium, not just one application of
. In many dimensions this scalar reciprocal becomes the matrix inverse
, and the same the equilibrium shifts too
correction is what the
adjoint solve below recovers without ever forming that inverse.
In practice we never form : it is a huge dense matrix. We need only a vector–Jacobian product: the upstream gradient times the inverse. Define the adjoint by
which is itself a fixed-point equation — solvable with the same black-box solver used in the forward pass, since acts on a vector through one reverse-mode autodiff call on .5 Once is found, every parameter gradient is the cheap product .
- 1initialize the adjoint,
- 2repeat
- 3computes by one autodiff call
- 4
- 5
- 6untiladjoint fixed point reached
- 7returnparameter gradient
Explicit deep net vs DEQ
The two designs compute related functions but the cost of depth falls in different places. The explicit net spends memory (one activation buffer per layer) and parameters (one weight set per layer); the DEQ spends solver iterations at run time and stores only a single equilibrium.
| Property | Explicit deep net | DEQ |
|---|---|---|
| Depth | fixed layers | effectively infinite (run to convergence) |
| Parameters | distinct weight sets | one weight-tied |
| Forward cost | layer evals | variable: solver iterations to tolerance |
| Training memory | — store every activation | — store only |
| Backward pass | backprop through stored layers | implicit diff: one adjoint solve |
| Depth–memory coupling | linear (deeper more memory) | decoupled (depth is free) |
Convergence in practice
Because the forward pass is a solver, training surfaces a diagnostic the explicit net never had: the residual , which a healthy DEQ drives toward zero each step. A residual that stalls or grows signals — the layer is not contractive, the fixed point is not being reached, and gradients computed from a non-equilibrium are wrong. Stabilizing (via spectral normalization or a Jacobian regularizer) is the central engineering concern.
Tradeoffs and uses
The DEQ gains constant memory and infinite effective depth at the cost of solver time and stability:
| Gain | Cost |
|---|---|
| training memory regardless of depth | forward/backward each run an iterative solver |
| infinite effective depth from one weight set | wall-clock cost varies with input difficulty |
| decoupling depth from parameter count | requires ; can diverge if not |
| a single uniform module to tune | gradients invalid if the solver hasn't converged |
The natural fit is settings where depth helps but memory is the bottleneck and a single repeated transformation is a reasonable inductive bias: sequence models (a weight-tied recurrence iterated to equilibrium) and graph models (message passing run to a steady state over the graph). In both, a DEQ matches the accuracy of a deep explicit stack while training within a fixed memory budget.
Implicit layers as a family
DEQ is one member of a broader implicit-layer family, all of which replace run these operations
with return the output satisfying this condition,
and all of
which train through the condition rather than the computation. The public literature
gives three landmarks.
Deep equilibrium models (Bai, Kolter & Koltun, 2019) introduced the construction above and showed a single weight-tied DEQ block matches deep transformers and weight-tied LSTMs on sequence tasks at constant memory. The follow-up multiscale DEQ (Bai, Koltun & Kolter, 2020) drove a single implicit block to competitive ImageNet accuracy by solving for equilibria at several resolutions at once, evidence that the constant-memory trick scales beyond toy settings.
The open problem noted above — that nothing guarantees , so the solver can diverge — is what monotone DEQ (Winston & Kolter, 2020) addresses. By parameterizing the layer so the residual operator is provably monotone, it guarantees a unique fixed point and a convergent solver by construction, trading a little expressiveness for a stability certificate. This is the DEQ analogue of the certified defenses from adversarial robustness: prove the property rather than hope for it.
The closest cousin is the neural ODE (Chen et al., 2018), which takes the opposite limit of the same idea. Where a DEQ is a weight-tied layer iterated to a fixed point, a neural ODE is a residual block whose step size shrinks to zero, so the forward pass integrates and the backward pass solves an adjoint ODE — again memory, again differentiating a solver rather than storing its trace. Fixed-point equations and differential equations are two routes to the same infinite effective depth.
| Implicit model | Output defined by | Forward solver | Backward |
|---|---|---|---|
| DEQ | fixed point | root-find (Broyden/Newton) | implicit-function adjoint |
| Monotone DEQ | fixed point, monotone operator | provably convergent split | implicit adjoint, guaranteed |
| Neural ODE | ODE flow | numerical integrator | adjoint ODE (reverse-time) |
| Optimization layer | inner optimizer | KKT differentiation |
The last row, the optimization layer (OptNet, Amos & Kolter, 2017), closes the circle: its output is the argmin of an inner objective, differentiated through the optimality (KKT) conditions — the same implicit-function move, applied to a minimizer instead of a fixed point. All four share one design: define the output by a condition, make the condition differentiable, and let a solver and the implicit-function theorem do the rest.
Closing the loop
DEQ postdates Goodfellow
(present it as a frontier method), but it is built entirely from machinery the
course has already laid down: the autodiff of
backpropagation, the
fixed-point and Newton ideas from the
optimization landscape,
and the weight tying of recurrent
networks. And it returns us to
the very first idea of the course. We opened by saying a deep network is the
composition of simple differentiable pieces learned by following the gradient; the
DEQ shows that deep
need not mean many stacked layers
at all — a layer can be a
condition a single transformation satisfies, run to convergence, differentiated
through its own definition. From the perceptron's
weighted sum to an infinite-depth network that fits in constant memory, the same
principle applies: define what the output should satisfy, make it differentiable,
and let the gradient do the learning.
Footnotes
- Deep equilibrium models (Bai, Kolter & Koltun, 2019) postdate Goodfellow (2016), which covers the components a DEQ is assembled from — feedforward layers (Ch. 6) and fixed-point/Newton methods (Ch. 8) — but not the implicit-layer construction itself. ↩
- Goodfellow, Deep Learning, §8.2 — fixed-point iteration and the contraction condition under which converges to a unique equilibrium. ↩
- Goodfellow, Deep Learning, §4.3 / §8.6 — Newton's method and curvature-based updates: using the Jacobian/Hessian to take superlinear root-finding steps. ↩
- Goodfellow, Deep Learning, §6.5 — Back-Propagation: reverse-mode differentiation over the computational graph, here replaced by implicit differentiation of the fixed-point condition. ↩
- Goodfellow, Deep Learning, §6.5.9 — vector–Jacobian products: backprop computes with one reverse-mode pass, never materializing the full Jacobian. ↩
╌╌ END ╌╌