Bahdanau Attention › Summary
Language AI HandbookAll chapters Bahdanau Attention › SummaryOne section · Sections in this chapter9 / 11 ↓
Reading tools Definitions & inline links
Choose your expertise level to adjust how many terms are explained. Beginners see more tooltips, experts see fewer to maintain reading flow. Hover over underlined terms for instant definitions.
Article links
Make inline references clickable
Bahdanau attention solves the bottleneck problem in encoder-decoder models by allowing the decoder to dynamically focus on relevant parts of the input at each generation step. The mechanism works through a learned alignment model that scores how well each encoder position matches the current decoder state.
The key components are:
- Additive score function: computes alignment scores by projecting the decoder state and encoder states into a shared alignment space, combining them additively, and reducing to a scalar
- Softmax normalization: converts raw scores to attention weights that form a probability distribution over encoder positions
- Context vector: computes a weighted sum of encoder states, where the weights determine how much each position contributes to the context for generating output
The attention weights are interpretable, showing which input positions the model considers relevant for each output position. This interpretability, combined with strong empirical performance, made Bahdanau attention a foundational technique in neural machine translation and sequence-to-sequence modeling more broadly.
In the next chapter, we'll explore Luong attention, which offers alternative score functions with different computational trade-offs.