Loading slide

What Attention Means

  1. 01What Attention Means
  2. 02What attention is for
  3. 03Memory card
  4. 04Which word matters right now?
  5. 05It's just a weighted blend
  6. 06Looking, advertising, offering
  7. 07Catch your breath
  8. 08Watch it lean
  9. 09Take a breath
  10. 10All at once, not one at a time
  11. 11More than one kind of relevance
  12. 12Reinforce your understanding
  13. 13Question: Computing relevance
  14. 14Question: Why parallel matters
  15. 15Question: The distance problem, gone
  16. 16Quiz: answer
  17. 17What to carry out of this chapter
  18. 18Want to go deeper?
6 / 17
BackNext

Looking, advertising, offering

So where do the weights come from? How does the machine decide, on its own, that "trophy" matters to "it" and "because" does not? The trick is to give every word three little jobs to do. They have technical names we will meet at the end, but for now, think of them as three plain roles.

Picture a room full of people, one person per word, each holding two small cards and a folder.

The card you hold up to look around with. This is what this word is searching for. When the machine is working on "it," that word holds up a card that says, in effect, "I'm a pronoun, I'm hunting for the thing I stand for, probably an object mentioned earlier." It is a little want-ad, describing what would be relevant.

The card you wear on your chest. This is what each word advertises about itself to anyone looking. "Trophy" wears a card saying "I'm an object, a noun, I showed up earlier in the sentence." "Because" wears a card saying "I'm just a connector, nothing to see here."

Now the matching is obvious. "It" holds up its want-ad and glances around the room, comparing it against every chest-card. "Trophy"'s chest-card is a near-perfect match for what "it" is hunting for, so it scores high. "Because"'s card matches almost nothing, so it scores low. Those match scores are exactly the weights from the last slide. The good matches get a big pour into the blend; the poor ones barely a drop.

The folder you hand over. And what actually gets poured? Not the chest-card, but the folder, the word's real contents, its meaning. When "trophy" scores a strong match, it hands its folder into "it"'s blend. A strong match means "give me your folder"; a weak match means "keep it."

So three roles per word: a want-ad for looking, a chest-card for being found, and a folder of contents to hand over when matched. Looking, advertising, offering. The match between one word's want-ad and another's chest-card sets the weight; the weight decides how much of that word's folder pours into the blend. That loop, run for every word against every other word at once, is the entire attention mechanism.

The real names

These three roles are usually given database names. The want-ad you hold up is the . The chest-card you wear is the . The folder you hand over is the . Query, key, value. The words come from looking things up in a database: you bring a query, match it against keys, and pull back the value that fits. Same idea, aimed at words in a sentence.
Citations(2)↓
  1. 1. arxiv.org
  2. 2. research.google
Citations(2)↓
  1. 1. arxiv.org
  2. 2. research.google