Attention

A word's meaning in a sentence can depend on words some distance away. Attention gives each position a way to compare the available information and combine the parts most relevant to its current representation.

10 sections · 10 questions · 3 coding challenges

1 / 10

Why Must a Translator Remember the Whole Sentence in One Summary?

BOTIE

Imagine translating a long sentence after reading it once, while being allowed to keep only one short note. Different output words may depend on different parts of the original sentence. The note has to preserve everything that might later matter.

Bahdanau, Cho and Bengio's 2014 work challenged this fixed-summary bottleneck in neural translation. Their decoder could use a weighted combination of source representations at each output step. The part of the source contributing most strongly could change as the translation progressed.

Attention gives us a way to ask for relevant information. We compare a current request with the available items, turn the comparison scores into weights, and combine the information those items carry. The query, key, and value formulation used in the 2017 Transformer makes these roles explicit. We will separate those roles before calculating the scores, so the matrix operations have a purpose we can follow.

Sources for this history