Luong Attention › Luong vs Bahdanau: A Complete Comparison

Michael BrenndoerferMay 18, 20251 min read
Language AI HandbookAll chapters
Part 12 of 67Sequence-to-Sequence
Chapter 88Luong Attention › Luong vs Bahdanau: A Complete Comparison
Reading section 5 of 11 · Luong vs Bahdanau: A Complete Comparison · 1 minSection 5 of 11 · 1 min

Book contents

Section 5 of 11 · 1 min read

Luong Attention › Luong vs Bahdanau: A Complete ComparisonOne section · Sections in this chapter5 / 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

Let's consolidate the differences between these two influential attention mechanisms:

Comparison of Bahdanau and Luong attention mechanisms.
AspectBahdanauLuong
Score functionAdditive (concat with tanh)Dot, general, or concat
Decoder state usedPrevious (ht−1h_{t-1})Current (hth_t)
Attention placementBefore RNN (input)After RNN (output)
Context integrationConcatenated with inputCombined via learned layer
Encoder architectureBidirectional RNNUnidirectional (stacked)
ParametersMore (additive scoring)Fewer (dot product option)

Both mechanisms compute attention weights via softmax and produce a context vector as a weighted sum of encoder states. The differences lie in the details of scoring, timing, and integration.

In practice, the choice between Bahdanau and Luong attention often matters less than other architectural decisions like model size, number of layers, and training procedure. Modern transformer architectures have largely superseded both, but understanding these mechanisms provides essential intuition for how attention works.