What are the two gates of a GRU and what does each control? How is a GRU different from an LSTM?

Sequence models and transformers, Recurrent networks
Level L2 Elementary. Length Short. Nature Th Theoretical.

What's being asked

Whether you can name the update and reset gates of a GRU (gated recurrent unit), say what they do, and compare them with an LSTM (long short-term memory).

Key idea

A GRU has an update gate zt (how much of the old state is replaced by new information) and a reset gate rt (how much of the old state to use when proposing a new one). It has no separate cell state.

Steps

  1. Update gate zt=σ(Wzxt+Uzht−1+bz) (where σ is the sigmoid function) decides, per unit, how much of the previous hidden state ht−1 is replaced by the new candidate.
  2. Reset gate rt=σ(Wrxt+Urht−1+br) decides how much of ht−1 is shown to the candidate state h~t. If rt≈0, the unit ignores the past.
  3. The new state mixes old and candidate using element-wise multiplication ⊙: ht=(1−zt)⊙ht−1+zt⊙h~t.
  4. LSTM has three gates (input, forget, output) and a separate cell state ct. GRU merges the forget and input gates into one gate and merges the cell and hidden states.
  5. So a GRU has fewer parameters (three weight blocks instead of four) and is quicker to train, with similar accuracy on many tasks.

Common mistakes

How long your answer should be

5 sentences.

Read this

Previous in Sequence models and transformers: The corpus word counts are: hug ×10, pug ×5, pun ×12, bun ×4, hugs ×5. Starting from single characters, what are the first three merges of byte-pair encoding (BPE), done by hand? How are the words "bugs" and "mug" then tokenised?
Next in Sequence models and transformers: A training corpus has three sentences: "⟨s⟩ i like tea ⟨/s⟩", "⟨s⟩ i like coffee ⟨/s⟩" and "⟨s⟩ you like tea ⟨/s⟩". The vocabulary of predicted words is {i, you, like, tea, coffee, ⟨/s⟩}, so V=6. Using add-one smoothing, what is the bigram probability of the sentence "⟨s⟩ you like coffee ⟨/s⟩", and what does the unsmoothed MLE give?