Deep Equilibrium Models: How Implicit Layers and Root-Finding Eliminate Activation Memory in Deep Learning
Deep neural networks derive their expressive capacity from composition. In conventional architectures, depth is explicit: an input vector is transformed sequentially through a chain of discrete layers, each parameterized by dedicated weights. While effective, this paradigm creates a fundamental computational dependency where training memory scales linearly with network depth () because standard backpropagation requires caching intermediate activations across every layer.
Deep Equilibrium Models (DEQs), introduced by Bai, Kolter, and Koltun (2019), present an alternative formulation known as implicit deep learning. Instead of stacking discrete layers, a DEQ formulates the forward pass as finding the fixed-point equilibrium of a single non-linear transformation. By decoupling the definition of a model's state from the algorithmic process used to compute it, DEQs compute exact analytical gradients via the Implicit Function Theorem (IFT). This mechanism eliminates intermediate activation caching entirely, enabling constant memory consumption regardless of effective receptive field or representation depth.

1. The Mathematical Limitation of Explicit Depth
In a standard feedforward neural network or stacked Transformer, the hidden representations evolve according to a discrete recurrence relation:
where represents the input context, denotes the feature representation at layer , and represents layer-specific parameters.
When training via backpropagation, the loss gradient with respect to parameter tensor depends directly on the activation tensor :
To compute this product during the reverse pass, the automatic differentiation engine must retain in GPU High Bandwidth Memory (HBM). For modern sequence models operating at long context lengths, activation memory dwarfs parameter memory, necessitating engineering mitigations such as activation checkpointing, sequence parallelism, and offloading.
Weight-Tied Limits and Fixed-Point Convergence
Empirical research in weight-tied models—such as ALBERT (Lan et al., 2019) and TrellisNet (Bai et al., 2019)—demonstrated that repeatedly applying the same layer transformation causes hidden activations to stabilize:
Deep Equilibrium Models formalize this stationary behavior mathematically. Rather than computing an arbitrary number of discrete steps, a DEQ defines the network output directly as the infinite-depth equilibrium state :
Under this formulation, the model does not specify how many layers to execute; it specifies the equilibrium conditions that the final representation must satisfy.
2. Forward Pass: Root-Finding in Non-Linear Vector Fields
Computing the forward activation of a DEQ requires finding a state vector that satisfies the fixed-point equation. This can be framed equivalently as finding the root of an objective residual function :
+-------------------------------------------------------------+
| DEQ Forward Pass |
| |
| Input x ────> [ Root-Finding Algorithm ] ────> Output z* |
| ▲ │ |
| │ Iterative │ |
| └── Update ◄────┘ |
| (Broyden / Anderson Acceleration) |
| |
| Satisfies: g_θ(z*; x) = f_θ(z*; x) - z* = 0 |
+-------------------------------------------------------------+Limitations of Picard Iteration
The simplest approach to finding is Picard fixed-point iteration (repeated forward evaluation):
By the Banach Fixed-Point Theorem, Picard iteration is guaranteed to converge to a unique fixed point if is a strict contraction mapping (its Lipschitz constant ). However, enforcing strict contraction constraints restricts parameter expressivity. Furthermore, Picard iteration exhibits linear convergence rates, often requiring dozens of iterations to reach numerical tolerance.
Quasi-Newton Solvers: Broyden's Method and Anderson Acceleration
To achieve practical efficiency, DEQs decouple the model architecture from the numerical solver. Production DEQ implementations employ accelerated root-finding algorithms:
- Broyden's Method (Broyden, 1965): A quasi-Newton technique that iteratively updates a low-rank approximation of the inverse Jacobian . Using the Sherman-Morrison formula, Broyden's method achieves superlinear convergence without computing or factorizing the full Jacobian matrix:
- Anderson Acceleration (Anderson, 1965): Computes as an optimal linear combination of the previous iterates that minimizes the norm of the linear residual, accelerating convergence in multi-dimensional vector spaces.
Because forward evaluation is treated as a black-box numerical search, the forward solver operates entirely under torch.no_grad(). Intermediate solver states are discarded immediately after convergence.
3. Backward Pass: Implicit Differentiation via the Implicit Function Theorem
If training a DEQ required unrolling the numerical root-finder and backpropagating through time (BPTT), the memory footprint would scale linearly with solver iterations (), negating the efficiency benefits of the implicit formulation.
DEQs resolve this by deriving analytical gradients directly at the equilibrium point using the Implicit Function Theorem (IFT) (Krantz & Parks, 2002).
+-------------------------------------------------------------+
| DEQ Backward Pass |
| |
| Loss Gradient ∂L/∂z* ───> [ Linear Solver ] ───> Vector v |
| |
| Solves: v^T = v^T (∂f_θ/∂z*) + ∂L/∂z* |
| |
| |
| Parameter Update: |
| ∂L/∂θ = v^T (∂f_θ(z*, x)/∂θ) |
| |
| Activation Memory Stored: O(1) (Only z* and x retained) |
+-------------------------------------------------------------+Derivation of Equilibrium Gradients
Let denote the implicit function mapping parameters to the unique equilibrium point satisfying . Differentiating both sides of the identity with respect to via the multivariate chain rule yields:
Factoring out the total derivative :
Assuming the Jacobian matrix is non-singular, inverting yields:
The Adjoint Fixed-Point System
For a scalar loss function , applying the chain rule gives the total gradient:
Computing the matrix inverse explicitly is computationally intractable (). Instead, DEQs define the adjoint vector :
Multiplying both sides by and rearranging terms yields a linear fixed-point system:
This equation is a linear system of the exact same form as the forward pass. It can be solved iteratively for using Broyden's method, GMRES, or Richardson iteration. Crucially, evaluating requires only a single vector-Jacobian product (VJP), which standard autodiff frameworks evaluate in time via backward automatic differentiation through a single layer evaluation at .
Once is computed, the final parameter gradient is obtained by backpropagating through :
Because this calculation requires only the converged state , the input , and the model parameters , memory consumption during training is strictly .
4. Architectural Paradigms: Vision and Sequence Modeling
The implicit formulation extends beyond single-layer vector representations to complex multi-dimensional modalities.
Explicit Layered Network:
Input ──> [ Layer 1 ] ──> [ Layer 2 ] ──> ... ──> [ Layer L ] ──> Output
Act Mem: z_1 z_2 z_L Total: O(L)
Deep Equilibrium Network:
Input x ──┐
▼
┌─> [ Non-Linear Transformation f_θ ] ──┐
│ ▲ │
│ └─────────────────────┘
│ Iterative Convergence
└────────────────> Equilibrium State z* ──> Output
Act Mem: z* only Total: O(1)Multiscale Deep Equilibrium Models (MDEQ)
In computer vision tasks such as semantic segmentation and object detection, explicit networks (e.g., HRNet, U-Net) maintain feature representations at multiple spatial resolutions simultaneously.
Bai et al. (2020) extended DEQs to multi-scale feature hierarchies by formulating the equilibrium state as a tuple of feature maps at varying spatial resolutions:
where represents feature maps downsampled by . The transformation function executes intra-resolution residual convolutions and inter-resolution cross-scale message passing. Solving for the joint equilibrium forces all resolution scales to reach simultaneous consistency, matching state-of-the-art vision backbones while consuming a fraction of activation memory.
Equilibrium Transformers (MDEQ-Transformer)
Standard Transformers stack self-attention and feed-forward network (FFN) blocks. Bai et al. (2021) formulated the Equilibrium Transformer, where sequence representations converge under an equilibrium multi-head self-attention layer:
By driving self-attention updates to fixed points, Equilibrium Transformers capture deep contextual dependencies across long sequence horizons without instantiating multi-layer KV-cache checkpoints during training.
Monotone Operator Equilibrium Networks (MonDEQ)
A theoretical vulnerability of unconstrained DEQs is that a fixed point is not mathematically guaranteed to exist or remain unique for arbitrary parameter configurations.
To guarantee well-posedness, Winston and Kolter (2020) introduced MonDEQ, parameterizing via strongly monotone operators. By structuring the layer Jacobian to satisfy a negative definite constraint:
MonDEQ guarantees that the root-finding problem possesses a unique, globally stable equilibrium that can be found via forward-backward operator splitting (e.g., Peaceman-Rachford or Douglas-Rachford splitting) without numerical divergence.
5. Architectural Comparison
Explicit Deep Networks (ResNets / Standard Transformers)
- Mathematical Formulation: Discrete layer composition: across physical layers.
- Depth Parameterization: Explicit integer depth fixed prior to training and inference.
- Training Memory Complexity: scaling linearly with layer count, requiring intermediate activation retention for backpropagation.
- Backward Pass Mechanism: Standard reverse-mode automatic differentiation (Backpropagation Through Time) unrolled across all layers.
- Inference Execution: Fixed deterministic computation requiring exactly sequential layer evaluations.
Neural Ordinary Differential Equations (Neural ODEs)
- Mathematical Formulation: Continuous parameterization: over continuous depth .
- Depth Parameterization: Continuous integration time horizon.
- Training Memory Complexity: memory achieved via the continuous Adjoint Sensitivity Method integrating backward in time.
- Backward Pass Mechanism: Reverse-time numerical integration of the joint adjoint state differential equation.
- Inference Execution: Adaptive step size numerical ODE solvers (such as Dormand-Prince / RK45).
Deep Equilibrium Models (DEQs)
- Mathematical Formulation: Non-linear root-finding: finding equilibrium state satisfying .
- Depth Parameterization: Implicit infinite depth () defined by stationary fixed-point convergence.
- Training Memory Complexity: constant memory via the Implicit Function Theorem, retaining only input and equilibrium state .
- Backward Pass Mechanism: Direct linear fixed-point solver: $v^\top = v^\top \left(\frac{\partial f_\theta}{\partial z^\star}\right) + \frac{\partial \mathcal{L}}{\partial z^\star}$.
- Inference Execution: Accelerated quasi-Newton root-finding (Broyden's method or Anderson acceleration) until .
6. Engineering Challenges and Practical Bottlenecks
While DEQs resolve the activation memory bottleneck, deploying implicit models in production environments introduces distinct engineering trade-offs:
- Computational Overhead (Compute vs. Memory Trade-Off): While explicit models evaluate a layer exactly once, DEQ root-finding typically requires 15 to 35 solver iterations during the forward pass and 10 to 20 iterations during the backward adjoint solve. On compute-bound workloads, DEQs run 2x to 4x slower than equivalent-parameter explicit networks.
- Jacobian Conditioning and Spectral Norm Drift: If the Jacobian matrix develops eigenvalues with magnitude , the linear system becomes ill-conditioned, leading to numerical divergence in Broyden's solver. Mitigating this requires explicit Jacobian regularization (Geng et al., 2021), penalizing the Frobenius norm or applying weight normalization to constrain the spectral radius .
- Hardware Vectorization and Dynamic Halting: In batched GPU inference, different batch items converge to numerical tolerance in different numbers of iterations. Naive batching forces all samples to wait for the slowest converging sample (the tail-latency problem). Efficient deployment requires asynchronous execution kernels or fixed-iteration warm-starting.
Summary
Deep Equilibrium Models demonstrate that architectural depth does not require stacking discrete physical layers. By reframing feature extraction as numerical root-finding and computing gradients via the Implicit Function Theorem, DEQs achieve the representational capacity of infinite-depth networks with constant activation memory. As memory bandwidth remains a primary constraint in large-scale machine learning hardware, implicit formulations offer a mathematically rigorous path toward training ultra-deep architectures within fixed hardware budgets.
Sources
- Bai, Kolter, & Koltun (2019) - Deep Equilibrium Models
- Bai, Koltun, & Kolter (2020) - Multiscale Deep Equilibrium Models
- Bai, Koltun, & Kolter (2021) - Transformers are Deep Equilibrium Models
- Winston & Kolter (2020) - Monotone Operator Equilibrium Networks
- Broyden (1965) - A Class of Methods for Solving Nonlinear Simultaneous Equations
- Anderson (1965) - Iterative Procedures for Nonlinear Integral Equations
- Krantz & Parks (2002) - The Implicit Function Theorem: History, Theory, and Applications
- Geng et al. (2021) - On Training Implicit Models
- Chen et al. (2018) - Neural Ordinary Differential Equations



