GRU Architecture › The Candidate Hidden State
Language AI HandbookAll chapters GRU Architecture › The Candidate Hidden StateOne section · Sections in this chapter5 / 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
Before the update gate can blend old and new information, we need to compute the proposed "new" information. The candidate hidden state represents what the hidden state would become if we completely ignored the update gate's blending.
This is where the reset gate comes into play. The candidate computation uses the reset-gated version of the previous hidden state, not the raw hidden state:
where:
- : the candidate hidden state, a vector of dimension with values in
- : the reset gate output from the previous computation
- : the reset-gated previous hidden state, where denotes element-wise multiplication
- : concatenation of the reset-gated hidden state and current input
- : the candidate's weight matrix of shape
- : the candidate's bias vector of dimension
- : hyperbolic tangent activation function, outputting values in
The tanh activation serves two important purposes. First, it bounds the candidate values to a reasonable range , preventing any single dimension from growing unboundedly. Second, it centers the values around zero, which helps with gradient flow during training and allows the hidden state to both increase and decrease in value.
The reset gate's role is clearer now. By gating before it enters the candidate computation, the reset gate controls how much the previous context influences the new candidate:
- When : the term , so the candidate depends primarily on the current input
- When : the term , so the candidate incorporates the full previous context
This gives the GRU two distinct ways to control information flow: the reset gate decides how much past context influences the proposal for the new state, while the update gate decides how much of that proposal to accept.
