What does attention look up in a Transformer?
A lesson on Attention Is All You Need (arXiv paper). Computing, college level.
Attention is a kind of lookup.
You start with a query, which is what you are looking for.
You also have a set of pairs.
Each pair has a key, a label to match against, and a value, the content it holds.
The query, keys, values and the answer are all vectors, which means lists of numbers.
Attention takes the query and these pairs and gives back one output.
Questions in this lesson
- You type a search into a library catalogue. Each book has a short label and the full book behind it. What do you think the catalogue matches your search against?
- In your own words, how does attention work as a lookup? Say what the query, the keys and the values each do.