GRU Architecture › The Reset Gate: Controlling Past Influence

Michael BrenndoerferMay 14, 20256 min read
Language AI HandbookAll chapters
Part 11 of 67Recurrent Neural Networks
Chapter 80GRU Architecture › The Reset Gate: Controlling Past Influence
Reading section 3 of 15 · The Reset Gate: Controlling Past Influence · 6 minSection 3 of 15 · 6 min

Book contents

Section 3 of 15 · 6 min read

GRU Architecture › The Reset Gate: Controlling Past InfluenceOne section · Sections in this chapter3 / 15 ↓
Reading tools Definitions & inline links

Choose your expertise level to adjust how many terms are explained. Beginners see more tooltips, experts see fewer to maintain reading flow. Hover over underlined terms for instant definitions.

Article links

Make inline references clickable

The reset gate determines how much of the previous hidden state should influence the computation of the new candidate hidden state. Think of it as asking: "How relevant is what I was thinking about to what I'm seeing now?"

When the reset gate outputs values close to 0, the GRU essentially ignores the previous hidden state and computes a new candidate based primarily on the current input. When it outputs values close to 1, the previous hidden state fully participates in computing the candidate. This mechanism allows the GRU to learn when to start fresh versus when to build on past context.

Out[5]:
Visualization
Flow diagram for reset gate value 0.1, showing a faded previous hidden state multiplied by the low gate value and a strongly attenuated result.
A low reset value attenuates the previous hidden state before candidate computation. The GRU focuses on current input and can start fresh when past context is irrelevant.
Flow diagram for reset gate value 0.9, showing the previous hidden state multiplied by the high gate value and a strongly preserved result.
A high reset value passes most of the previous hidden state into candidate computation. The GRU incorporates past context and builds on its existing state.

The reset gate computation follows the familiar gating pattern. It takes the previous hidden state and current input, concatenates them, applies a linear transformation, and passes the result through a sigmoid activation:

rt=σ(Wr⋅[ht−1,xt]+br)r_t = \sigma(W_r \cdot [h_{t-1}, x_t] + b_r)

where:

  • rtr_t: the reset gate output, a vector of dimension hh with values in [0,1][0, 1]
  • WrW_r: the reset gate's weight matrix of shape (h,d+h)(h, d + h), where dd is the input dimension and hh is the hidden dimension
  • [ht−1,xt][h_{t-1}, x_t]: concatenation of previous hidden state and current input, producing a vector of dimension d+hd + h
  • brb_r: the reset gate's bias vector of dimension hh
  • σ\sigma: the sigmoid activation function, which squashes any real value to the range [0,1][0, 1]

The sigmoid activation is necessary here: it ensures every element of rtr_t lies between 0 and 1, making it suitable for element-wise multiplication as a "soft switch." Values near 0 effectively block information, while values near 1 allow information to pass through unchanged.

Out[6]:
Visualization
Plot showing sigmoid function mapping inputs to the 0-1 range.
The sigmoid activation function outputs values in [0, 1], making it ideal for gates that control information flow. Values near 0 block information while values near 1 allow it to pass.
Plot showing tanh function mapping inputs to the -1 to 1 range.
The tanh activation function outputs values in [-1, 1], centering activations around zero. This is used for the candidate hidden state computation.

The reset gate examines both what the model was thinking about (ht−1h_{t-1}) and what it's currently seeing (xtx_t) to decide how to weight past information. In language modeling, for instance, the reset gate might learn to output values near 0 when encountering a period or paragraph break, signaling that the previous context is no longer relevant and the model should begin fresh.