Skip to content
Navigation
Dashboard
🎬Video•35 min

Sequence Models (RNN, LSTM)

Learn about recurrent neural networks and their evolution.

Sequence Models

Recurrent Neural Networks (RNN)

Process sequences by maintaining hidden state: h_t = tanh(W_h × h_{t-1} + W_x × x_t)

Problem: Vanishing gradients for long sequences

Long Short-Term Memory (LSTM)

Solves vanishing gradient with gates:

  • Forget gate: What to remove from memory
  • Input gate: What to add to memory
  • Output gate: What to output
  • Gated Recurrent Unit (GRU)

    Simplified LSTM:

  • Fewer parameters
  • Often similar performance
  • Combines forget and input gates
  • Limitations

  • Sequential processing (slow)
  • Limited context window
  • Attention helps but doesn't solve all issues
  • This led to → Transformers

    🎯 Key Takeaways

    • ✓RNNs process sequences with hidden state
    • ✓LSTMs solve vanishing gradients with gates
    • ✓GRUs are simplified LSTMs
    • ✓Sequential processing limits parallelization

    📚 Additional Resources