For a GRU with , what is the direct term in , and why does a small let gradients survive many steps? If at every step, what does that direct path contribute over steps?
Sequence models and transformers, Recurrent networks
Level L3 Intermediate. Length Medium. Nature Mat Mathematical.
What's being asked
Whether you can find the identity-like path in the GRU Jacobian and compare it with a vanilla RNN.
Key idea
. When the first term is nearly , so the state is copied.
Steps
- Write as a function of in three ways: directly, through , and through (and ).
- The direct path gives , since when holding fixed.
- The other paths give terms such as . These involve weight matrices and sigmoid or tanh derivatives, which can shrink.
- Across steps the gradient contains the product . If the model learns near , this product is near , so error signals pass through unchanged. This is the same idea as the LSTM forget gate near .
- Numbers: with , each step multiplies the direct path by . After steps, .
- Compare: a vanilla RNN whose per-step factor is gives . So the gated path decays far more slowly.
Common mistakes
- Treating as a constant and ignoring the other two paths when claiming the full Jacobian is .
- Mixing conventions: some papers write , which swaps the roles of and .
- Claiming gates remove vanishing gradients completely; they only make a short path available.
How long your answer should be
Half a page; 4–5 minutes.
Last checked on 4 December 2026.
Read this
Previous in Sequence models and transformers: How does the GloVe objective arise from the idea that meaning is carried by ratios of co-occurrence probabilities? What is the role of ?
Next in Sequence models and transformers: Count the matrix-multiply FLOPs of one transformer layer's forward pass for sequence length , model width and feed-forward width (one sequence, ignoring softmax, layer norm and biases). Which part dominates, and at what does attention's term equal the linear-in- part?