Back to Deep Learning Mind Map
中文·English
🧠 Deep LearningID: gru

GRU

🎯Core Definition
GRU (Gated Recurrent Unit) is a simplified LSTM variant with only two gates. The update gate zt=σ(Wz[ht1,xt]+bz)z_t = \sigma(W_z[h_{t-1}, x_t] + b_z) decides how much history to keep vs how much new information to write; the reset gate rt=σ(Wr[ht1,xt]+br)r_t = \sigma(W_r[h_{t-1}, x_t] + b_r) decides how much of the history to discard; the candidate hidden state is h~t=tanh(Wh[rtht1,xt]+bh)\tilde{h}_t = \tanh(W_h[r_t \odot h_{t-1}, x_t] + b_h); and the output is ht=(1zt)ht1+zth~th_t = (1 - z_t) \odot h_{t-1} + z_t \odot \tilde{h}_t (\odot 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 zt0z_t \approx 0, htht1h_t \approx h_{t-1} — the same additive shortcut as LSTM's ft1f_t \approx 1 that keeps long-range memory; when rt0r_t \approx 0, the candidate ignores history and depends only on the current input, capturing short-term dependencies.
💡Use Cases
the recurrent unit of choice for parameter-sensitive, small-data, or real-time inference settings (speech, forecasting, lightweight sequence models); in interviews it is a staple comparison question — GRU vs LSTM formulas, parameter count, capacity and training efficiency.
Key Problems Solved
LSTM's four gated components are redundant on most tasks; GRU achieves nearly the same long-term memory with 3 weight sets — about 25% fewer parameters and cheaper per-step computation, so it trains faster and overfits less on small data and edge devices. The cost: no dedicated cell state, so stored information is coupled with the output in one hth_t, a coarser memory granularity.
🎯5 High-Frequency Exam Points
1
Write out GRU's update gate ztz_t, reset gate rtr_t, candidate h~t\tilde{h}_t and output ht=(1zt)ht1+zth~th_t = (1 - z_t)h_{t-1} + z_t\tilde{h}_t; explain the role of each gate.
2
Structural differences: why does GRU have ~25% fewer parameters (3 vs 4 weight sets)? How does the absence of a cell state affect memory granularity?
3
What happens when zt0z_t \approx 0 (htht1h_t \approx h_{t-1} additive shortcut)? How does this correspond to LSTM's forget gate ft1f_t \approx 1?
4
Role of the reset gate: when rt0r_t \approx 0 the candidate h~t\tilde{h}_t depends only on the current input — why does this help capture short-term dependencies and discard irrelevant history?
5
When to pick GRU over LSTM (data size, parameter budget, inference latency)? Why is the accuracy gap between them usually small on typical tasks?
Updated 2026-08-12
🎯
Test Your Knowledge: Practice Questions for "GRU"
Single choice pitfall questions with instant feedback and mistake tracking.
🚀 Start Card Practice
Previous CardLSTM GatingNext CardSSM & Mamba

🔗 More Deep Learning Knowledge Cards

Activation FunctionsAdam & AdamWAutograd Compute GraphBatch Normalization