Cognitive Psychology

Human Attention versus AI Attention

The word "attention" appears in two literatures that have almost nothing in common. In one it names a set of experimental findings about selection, capacity and awareness. In the other it names an arithmetic operation: a normalised similarity between one position in a sequence and every other position. This page has you do both, on the same sentence, so the difference is something you have produced rather than been told.

The numbers here are chosen by hand to be legible — no model was run, and nothing was learned

Learning objective

By the end you should be able to say precisely what a transformer attention weight is, and why a weight map is not an explanation of a model's output.

About 15 minutes. Nothing is timed. Nothing you do here is saved or sent anywhere.

Before you start — the language problem

A weight is a number, not a noticing. Throughout this page, the computational side is described in arithmetic terms only. A high weight on a position does not mean the system "focused on" or "cared about" or "was drawn to" that word. It means a dot product came out large and the softmax normalised it upwards. The habit of saying otherwise is the single commonest error in writing about these models, and it is easier to avoid here than anywhere else because you can see the arithmetic.

Nothing on the machine side is aware of anything. There is no experience, no report, no effort and no cost of the kind the human literature measures. The absence is the finding.

  1. Answer the prediction below — it unlocks the first stage.
  2. Stage 1: read two sentences that differ by three words and say what "it" refers to in each.
  3. Stage 2: compute attention weights over the same sentence, by choosing a query position, a head, a temperature and a mask.
  4. Stage 3: compare the two things you have just done, in the sorting challenge.
  5. Read the debrief, which is where the one real rhyme and the divergences either side of it are set out.

First, a prediction

You are about to do two quite different things with the same sentence. Before you do either, commit to a view about what the relationship between them will turn out to be.

If a transformer's attention weights for the word "it" land on the same noun you chose, what would that show?

Stage 3 — sort the statements

Eight statements. For each, decide whether it describes the human experimental literature on attention, the transformer operation you have just run, both, or neither. Two of them are true of both, and two are true of neither — those four are the ones worth arguing about.

Complete stage 1 and stage 2 first — several of these are much easier once you have done both.

Eight statements, each to be sorted into human attention, transformer attention, both, or neither
Statement True of…

What this demonstrates

A transformer attention weight is a softmax over query–key similarities: a set of positive numbers summing to one, deciding how much each position contributes to the next representation. It rhymes with selective attention in that both allocate limited influence, and diverges in almost every other way — there is no capacity limit, no serial bottleneck, no cost of switching, and nothing it feels like. The shared word is a useful metaphor and a poor argument.

Download activity HTML

For teaching elsewhere: take this activity as one self-contained block of HTML, on the clipboard or as a file. Either way it is styled so that it will not disturb the page you put it into.