GRU (Gated Recurrent Unit) is a simplified LSTM variant with only two gates. The update gate
zt=σ(Wz[ht−1,xt]+bz) decides how much history to keep vs how much new information to write; the reset gate
rt=σ(Wr[ht−1,xt]+br) decides how much of the history to discard; the candidate hidden state is
h~t=tanh(Wh[rt⊙ht−1,xt]+bh); and the output is
ht=(1−zt)⊙ht−1+zt⊙h~t (
⊙ elementwise). Compared with LSTM: there is no separate cell state, the forget and input gates merge into the update gate, and weights drop from 4 sets to 3 (roughly 25% fewer parameters). When
zt≈0,
ht≈ht−1 — the same additive shortcut as LSTM's
ft≈1 that keeps long-range memory; when
rt≈0, the candidate ignores history and depends only on the current input, capturing short-term dependencies.