Open Institute of Technology Reveals Gates Secretly Act as Adaptive Optimizers
A new paper proves that RNN gates secretly act as adaptive optimizers, inducing per-neuron learning rates even under plain SGD -- with implications for how we design and train sequence models.
ProTakeaways
- Gates in RNNs secretly act as adaptive optimizers, inducing per-neuron, lag-dependent effective learning rates even under plain SGD with a fixed step size.
- The paper derives exact Jacobians for leaky-integrator, scalar-gated, and multi-gated RNNs, showing formal analogies to learning-rate schedules, momentum, and Adam.
- Gated SGD produces dramatically more concentrated gradient geometry than plain+Adam: on psMNIST, anisotropy index is ~2280 vs. ~22; on delay-sum, ~421 vs. ~6.4.
- Gates and optimizers shape complementary aspects of learning: gates align gradient transport with task-relevant directions; optimizers rescale parameter-space updates.
- The framework suggests architecture-optimizer co-design could reduce redundancy, since multi-gated RNNs with Adam may be doing similar work twice.
- Code is publicly available on GitHub; a follow-up paper extends the theory to LSTMs, GRUs, and learnability horizons.
There is a long-standing mystery in deep learning: why do gated recurrent networks like LSTMs and GRUs train so reliably, even when paired with a plain, fixed-step optimizer? The conventional answer points to gradient flow -- gates prevent gradients from vanishing or exploding as they travel backward through time. But a new paper from Lorenzo Livi at the Open Institute of Technology argues that this explanation is only half the story. The paper shows that gates do something far more interesting: they secretly function as adaptive optimizers, reshaping the effective learning rate for every neuron and every time lag, all without any explicit optimizer machinery.
The problem nobody was asking about
Training recurrent networks has traditionally been analyzed through two separate lenses. The first is the state-space view: how does information flow forward through the hidden states, and do gradients survive the backward pass? The second is the optimizer view: how does SGD, Adam, or momentum shape the parameter update trajectory? These two worlds have been treated as largely independent. But they are not.
The core issue is that when you run backpropagation through time (BPTT) -- the standard algorithm for training RNNs -- the gradient flowing back from a loss at time t to a parameter at time k is multiplied by a long chain of Jacobian matrices, one per time step. These Jacobian products govern both how much gradient survives with lag (magnitude) and how it is distributed across directions (geometry). The gate values are baked directly into those Jacobians. So any time the gates change, they are also changing how the optimizer effectively behaves -- even if the optimizer itself is just plain SGD with a fixed step size.
Gates as hidden optimizers: the math
The paper derives exact Jacobian formulas for three types of gated RNNs and then applies a first-order perturbative expansion (a standard technique for approximating products of matrices with small perturbations) to make the coupling explicit. The three architectures analyzed are:
- Leaky-integrator RNN: a constant gate value
alphathat uniformly slows down state updates - Scalar-gated RNN: a single time-varying gate shared across all neurons, driven by the current input and state
- Multi-gated RNN: a separate gate per neuron, giving each unit its own time-varying update rate
In the constant gate case, the dominant multiplicative factor in the backward product over (t-k) steps is alpha^(t-k), independent of the input sequence or hidden state trajectory. This is analogous to a fixed preconditioning factor in gradient descent, where every parameter update is scaled by the same precomputed value. In other words, even the simplest leaky integrator is already doing something an optimizer would normally do.
Things get richer with learned gates. With a scalar gate, the gradient is modulated by a global, input-driven attenuation factor that varies over time -- conceptually similar to a learning rate schedule, with the key difference that the modulation emerges from the network's own state dynamics rather than from an externally prescribed schedule. And with per-neuron gates, each neuron has its own effective learning rate, determined by the trajectory of its gate values -- mirroring adaptive optimizers such as Adam or RMSProp, which assign each parameter a distinct, dynamically adjusted step size.
The paper summarizes these analogies in a clean table:
| Gating type | Gradient modulation | Optimizer analogy |
|---|---|---|
| Constant gate (alpha) | Fixed scaling by lag distance | SGD with constant preconditioning |
| Scalar time-varying gate | Global, input-driven attenuation | SGD with learning rate schedule |
| Per-neuron gates | Per-neuron diagonal scaling | Adam / RMSProp |
| Perturbative corrections | Directional modulation (rank-1 or full-rank) | Momentum / adaptive preconditioning |
Two complementary roles, not one
One of the subtler findings is that gating and optimizers shape different aspects of the learning geometry. To measure this, the paper introduces two complementary metrics applied to the Jacobian products and gradient covariance matrices:
- Anisotropy Index (AI): the ratio of the largest to the r-th singular value of the Jacobian product -- how much one direction dominates over others in gradient transport
- Cumulative Energy (CE): the fraction of total gradient energy concentrated in the top-r directions -- how low-dimensional the effective gradient subspace is
The experimental comparison pits a plain RNN trained with Adam against scalar- and multi-gated RNNs trained with plain SGD. This pairing is deliberate: it isolates optimizer-driven anisotropy from gate-driven anisotropy. Plain+Adam often exhibits the largest Jacobian AI at long lags, largely because the smaller singular values collapse. But gradient-covariance analysis gives the opposite picture: gated models consistently induce stronger update anisotropy than plain+Adam.

The key distinction: Jacobian spectra describe what the dynamics could amplify, whereas gradient covariance reveals what optimization actually uses. Adam can yield highly anisotropic Jacobian transport without comparably concentrated update geometry, while gating reshapes the recurrent dynamics so that realized gradients concentrate into much more coherent low-dimensional parameter subspaces.
The numbers
Experiments run across five sequence tasks -- adding, AR(2), delay-sum, moving-average, and permuted sequential MNIST (psMNIST, sequence length 784) -- with 20 random seeds each. The update anisotropy gap between gated SGD and plain Adam is striking:
- Delay-sum: AI of ~421 (scalar gate) and ~392 (multi-gate) vs. ~6.4 for plain+Adam
- Moving-average: ~252 and ~299 vs. ~21 for plain+Adam
- psMNIST: ~2280 and ~1880 vs. ~22 for plain+Adam
- Adding: ~33 and ~30 vs. ~24 for plain+Adam (narrowest gap)
The gap is order-of-magnitude on delay-sum, moving-average, and psMNIST; on adding it is narrower but preserved across every seed. The gated models also show that CE of the gradient covariance is approximately 0.99--1.00 for gated models versus 0.92--1.00 for plain+Adam, meaning gated SGD concentrates nearly all gradient energy into a tiny subspace.

What this actually means for practitioners
The practical implications cut in several directions. First, if you are using a gated RNN (LSTM, GRU, or any modern state-space model with input-dependent gates), you already have a form of adaptive optimization built into your architecture -- even if you are using vanilla SGD. This may explain why practitioners often find that simpler optimizers work surprisingly well with gated architectures.
Second, the finding suggests that architectures and optimizers should be understood as jointly shaping the magnitude and geometry of temporal credit assignment, rather than as independent design choices. Pairing a multi-gated RNN with Adam may be partially redundant -- both are doing similar things to the gradient geometry, just at different levels. Conversely, a plain RNN with Adam may be compensating for missing architectural structure.
Third, the framework opens a path toward more principled architecture-optimizer co-design. Instead of treating architecture and optimizer as separate components, one may seek joint designs in which optimization methods explicitly exploit the time-scale structure induced by the network dynamics.
Limitations and what comes next
The analysis relies on a first-order perturbative expansion, which holds well when the gate-induced correction terms are small relative to the dominant Jacobian factors. The perturbative assumption may break down when off-diagonal interactions dominate the Jacobian structure -- for example, when strong recurrent mixing causes gradient transport to propagate across many neurons before returning to the original coordinate. The paper validates the approximation empirically (median perturbative ratio ~0.15 for scalar gates, ~0.04 for multi-gates), but it is not a universal guarantee.
The analysis also focuses on simplified gated RNNs rather than full LSTMs or GRUs, which have multiple interacting gates. A follow-up paper by the same author builds on this time-scale coupling analysis and extends the perspective by developing a quantitative theory of finite-horizon learnability that explicitly connects the structure of gating to the statistics of gradient transport, including closed-form expressions for LSTMs and GRUs.
The author also notes that the underlying mechanism is not specific to recurrent networks. In Transformers, attention weights act as input-dependent gating mechanisms, and residual connections contribute structured components to the Jacobian. Extending the framework in this direction may provide a unified dynamical perspective on gradient transport and optimization across modern deep learning models. The code to reproduce all experiments is publicly available on GitHub.