The LSTM solves the vanishing-gradient barrier of vanilla RNNs at a precise cost: four affine maps per cell instead of one, and two separate states ( for storage, for read-out) instead of one. The Gated Recurrent Unit (Cho et al., 2014) asks a sharp question: how much of that machinery is actually load-bearing, and how much can be removed without losing the gradient-flow property that made the LSTM trainable in the first place?

The GRU answers by keeping the additive gated update that fixes the gradient, while compressing the rest:

  • one state () instead of two;
  • three affine maps instead of four;
  • two gates instead of three.

The result is an architecture with the parameters of the LSTM at the same hidden width, comparable empirical performance on most sequence tasks, and a forward pass that reads as a single line of vector arithmetic.

Definition

Given and , the GRU cell computes

and returns .

There is no separate cell state and no output gate. The single hidden vector plays both the role that played in the LSTM (long-term memory) and the role that played there (externally visible output).

Dimensions used in this note

symbolrolesingle examplemini-batch ()
current input
hidden state
reset gate
update gate
candidate state
input-to-hidden weights, idem
hidden-to-hidden weightsidem
bias (broadcast across columns)

All element-wise products in the cell act on operands of identical shape: no broadcasting is involved in the .

The architectural compression of the LSTM, in three moves

The GRU can be read most cleanly as three deliberate simplifications of the LSTM, each one motivated by a specific observation.

Move 1: drop the cell-state / hidden-state distinction

The LSTM maintains (unbounded, archive) and (bounded, dispatch) precisely because the two play incompatible roles inside a single vector. The GRU collapses them by bounding the hidden state directly: is now a convex combination of two bounded operands, (already bounded by induction) and , so it stays bounded without an output gate or a final on the read-out.

This is a strict expressivity loss: the GRU cannot hold an unbounded private memory whose effect on downstream computation is independently masked. Empirically it matters less than the LSTM literature once suggested, but on tasks that benefit from “remember privately, report selectively” the LSTM still has the edge.

Move 2: replace forget + input by their convex combination

In the LSTM, the forget gate and the input gate are independent: the network can keep nothing and write nothing, keep everything and write a lot, or any combination of the two. The GRU forces by reparameterizing both with a single update gate:

Reading the update rule with these substitutions makes the parallel explicit:

Convex combination is what bounds the GRU state

Because coordinate-wise, the update is a convex combination of and at every coordinate. A convex combination of two values in stays in , so for all by induction (starting from ).

This is the structural reason the GRU does not need an output gate: boundedness is built into the recurrence. The price is that the network cannot keep one component of the past and add new content to that same component in the same step; the budget is fixed at per coordinate, and the update gate decides how to split it.

One knob instead of two: a fixed memory budget

With the update gate held fixed, , unrolling one coordinate of the update gives

Each slot is an exponentially weighted moving average of its candidate history, the same object the LSTM cell state computes, with the decay playing the role of the forget gate. The candidate from steps back enters with weight , and these weights sum to (the convex combination of Move 2), so the slot is a genuine weighted average that stays bounded, with a memory horizon of about steps. Under the identification , this is exactly the LSTM horizon .

The difference is the constraint. The LSTM keeps with the gate and writes with an independent gate , so it can keep a slot in full and still write to it strongly in the same step. The GRU ties the two, per coordinate, giving each slot a fixed budget of one: remembering more of the past forces writing less of the present, and the reverse. That single constraint is the GRU’s central economy and its central limitation at once.

Move 3: the reset gate inside the candidate

The LSTM’s candidate depends on the full . The GRU’s candidate depends on a gated version, :

The reset gate lets the network selectively discard the past when computing fresh content. Two limiting cases clarify the design:

  • : the candidate sees the full previous state. The update behaves like a soft interpolation between “keep the old memory” and “absorb a context-aware update”. This is the regime in which the GRU resembles a smoothed LSTM.
  • : the candidate ignores the past entirely and becomes a pure function of the current input . The next state is then a convex blend of “the old state, untouched” and “a fresh hypothesis based only on what just arrived”.

The reset gate is therefore the GRU’s mechanism for breaking continuity when the past is no longer informative. The LSTM achieves the same effect indirectly through the forget gate closing on ; the GRU exposes the decision as its own learned variable.

The gradient picture

The whole reason the LSTM works on long sequences is the diagonal Jacobian derived in Cell state. The GRU inherits the same property, in a slightly more involved form, through the convex-combination update.

The direct contribution to , holding the gates and the candidate fixed, is

This is the GRU’s analogue of the constant error carousel: when , the recurrent Jacobian on the direct path is close to the identity, so gradient flows back across the step essentially undisturbed. When , the past is overwritten and the gradient stops.

The GRU as a learned gated residual

A small rearrangement of the update equation exposes the deepest structural reading of the GRU:

In this form the GRU is a residual stream to which a learned, gated increment is added at every step. The update gate is exactly the learned gate on the residual, and is the candidate direction of movement in state space.

Recurrence as ResNet, made explicit

The form with is the temporal analogue of a ResNet block: an identity carry plus a learned, gated additive perturbation. The Jacobian on the identity carry is ; the Jacobian on the additive perturbation is small whenever is small.

The LSTM cell state is the same idea expressed differently: the carry there is rather than , but the structural intent is identical. Three recurrent architectures (LSTM, GRU, and the later Highway Networks of Srivastava et al. 2015) all settled on gated additive updates around an identity backbone, six years before residual connections were introduced in feedforward networks. The fact that all three converged on the same shape is not a coincidence: it is the only shape that fixes the vanishing-gradient barrier without imposing a knife-edge on the recurrent spectrum, the vanilla RNN’s requirement that the recurrent weights’ eigenvalues sit right at for gradients to neither vanish nor explode.

Parameter count

Each of the three affine maps (reset, update, candidate) has the same shape as a single vanilla-RNN affine map:

Mini-batch form

For a mini-batch of examples, per-example vectors become matrices with one column per example. Weights are shared across the batch (and across the unrolled time axis), so their shapes are unchanged. The cell becomes

The biases broadcast across the columns; the element-wise products act on matrices of identical shape with no broadcasting; the three affine maps can be fused into a single matrix multiplication (one GEMM) exactly as in the LSTM implementation note. The initial state is conventionally .

When to prefer GRU over LSTM

The decision is mostly empirical, but the architectural differences point to a useful default.

  • Prefer GRU when the model needs to be small or fast (mobile, real-time, edge deployment), when the dataset is moderate and the regularization budget is tight ( fewer parameters means less to overfit with), and when the task has no obvious benefit from separating storage from read-out.
  • Prefer LSTM when the task needs the network to keep information in memory without exposing it in its output. This is what “holding privately” means: the cell state can store a value for many steps while the output gate keeps it out of the visible hidden state , so the network can remember something now, emit unrelated outputs in the meantime, and surface it only when it becomes relevant. The GRU cannot separate the two, because its single state is at once the memory and the output. Prefer LSTM also when the dataset is large enough to train the extra parameters, and when fine-grained, independent control of forgetting versus writing matters.

In practice, on most tasks of moderate complexity, careful tuning matters far more than the choice between LSTM and GRU. Both have been overshadowed for large-scale sequence modelling by attention-based architectures, which dispose of the recurrent bottleneck entirely; the next section develops that idea.

Brief history

The GRU was introduced by Cho et al. in 2014 in the context of statistical machine translation, inside the very paper that introduced the RNN encoder-decoder architecture (the name sequence to sequence learning arrived months later, with Sutskever et al.’s LSTM-based scaling of the same design). The motivation was practical: encoder and decoder both needed a recurrent cell that trained reliably on long sequences but cost less than an LSTM, since translation models of the time were already large. The convex-combination update was inspired by earlier work on gated recurrent networks, but the specific form (one update gate doubling as forget+input, plus one reset gate inside the candidate) is the GRU’s own.

The architecture has aged well. It is still the default recurrent cell in many sequence-modelling libraries, still competitive with LSTM on most benchmarks where pure recurrence is appropriate, and still the cleanest single-line illustration of how a recurrent network can be both stateful and well-behaved under backpropagation through time.