Seq2seq & attention
Step 6 of 10 in NLP · Concept · Medium
An encoder compresses the input, a decoder generates the output. Attention lets the decoder look back at every input position instead of one fixed vector.
Build it
Attention heatmap
Train a small seq2seq with attention to reverse or sort digit strings; plot the attention weights.
Done when: Heatmap shows the expected alignment.
Case study: Google Neural Machine Translation (2016)
- Replaced phrase-based translation with one LSTM seq2seq with attention.
- Cut translation errors by about 60% on some language pairs.
- Shipped to production for hundreds of millions of users.
Resources
Earn this star
On the map, you log what you built. Finish the step and its star lights.
Open this step on the map