Attention and Paradigms: A Worked Example
How a query, keys, and values can model a Kuhnian revolution (companion to Final Project Option 1)
Why add attention?
In the Week 10 simulation and your Week 12 project, the network judged evidence with fixed weights. The epicycle count always got the same weight, whoever was looking and whatever else was on the table. The only way to change a weight was backpropagation: get an answer wrong, send blame backward, and nudge the weights a little, epoch after epoch.
That model misses something Kuhn cares about. In his account, a revolution is not a slow adjustment of how much each fact counts. It is a change in what the community is looking for. After the change, the same observations mean something different. In the Postscript he puts it this way: people who receive the same stimuli can still see different things, because training shapes the route from stimulus to perception (pp. 192-193).
Attention gives us a way to model that. In attention, how much a piece of evidence counts is not fixed. It is computed fresh each time, from how well the evidence matches what the observer is looking for. Change what the observer is looking for, and the same evidence gets weighted differently, all at once.
The three roles
Recall from the attention slides that every item plays three roles. Here is how they translate into the language of paradigms.
| Role | In a transformer | In our model of a revolution |
|---|---|---|
| Query | what a word is looking for | what the paradigm looks for in evidence |
| Key | what a word offers, so others can find it | what kind of evidence this is |
| Value | the information a word hands over if chosen | how much this evidence strains the old model |
The idea in one sentence: the paradigm is the query. An anomaly is evidence whose key does not match the paradigm’s query, so the paradigm pays it almost no attention.
The setup
We use evidence from the Copernican crisis, which you know from Week 10.
Keys: what kind of evidence is it?
Each key is a list of two numbers. Each number scores one feature of the evidence:
- Does it threaten the perfect-heavens model? Positive means yes; negative means it seems to support the old model.
- Does it depend on the new instrument (the telescope)? 1 means yes, 0 means no.
Values: how much strain does it carry?
Each value is a single number: how much this evidence, if taken seriously, strains the old model. Bigger means more strain.
| Evidence | Key (threat, telescope) | Value (strain) | Why these numbers |
|---|---|---|---|
| Calendar drift | (0.2, 0) | 1 | A mild threat, seen without a telescope, modest strain |
| Jupiter’s moons | (1, 1) | 5 | A direct threat (bodies orbiting something other than Earth), seen only by telescope, large strain |
| Moon’s mountains | (0.8, 1) | 4 | A strong threat to celestial perfection, seen only by telescope |
| Epicycle count | (−0.5, 0) | 0.5 | Read by the old paradigm as a sign of precision, so it seems to support the model; little strain |
These numbers are chosen by hand to make the example clear. In a real transformer, keys and values are produced by learned weights, not chosen by anyone.
Queries: what is each paradigm looking for?
A query uses the same two features as the keys.
- Ptolemaic query: (−1, −2). It favors evidence that does not threaten the model (−1 on the first feature) and it strongly distrusts the telescope (−2 on the second). This is the astronomer who suspects the lens is producing illusions.
- Galilean query: (2, 1). It looks hard for threats to the old model (2) and trusts the telescope (1).
Notice what stays the same in both cases: the four pieces of evidence, their keys, and their values. Only the query changes.
Step 1: Match each key to the query (the dot product)
To measure how well a key matches a query, multiply the two lists number by number and add the results. This is called the dot product.
\[\text{score} = (\text{query}_1 \times \text{key}_1) + (\text{query}_2 \times \text{key}_2)\]
The dot product is large and positive when the two lists “point the same way,” near zero when they are unrelated, and negative when they point in opposite directions.
Ptolemaic query (−1, −2)
| Evidence | Key | Calculation | Score |
|---|---|---|---|
| Calendar drift | (0.2, 0) | (−1)(0.2) + (−2)(0) | −0.2 |
| Jupiter’s moons | (1, 1) | (−1)(1) + (−2)(1) | −3.0 |
| Moon’s mountains | (0.8, 1) | (−1)(0.8) + (−2)(1) | −2.8 |
| Epicycle count | (−0.5, 0) | (−1)(−0.5) + (−2)(0) | 0.5 |
The epicycle count is the only positive match: the old paradigm finds it reassuring. The telescope evidence scores very low.
Galilean query (2, 1)
| Evidence | Key | Calculation | Score |
|---|---|---|---|
| Calendar drift | (0.2, 0) | (2)(0.2) + (1)(0) | 0.4 |
| Jupiter’s moons | (1, 1) | (2)(1) + (1)(1) | 3.0 |
| Moon’s mountains | (0.8, 1) | (2)(0.8) + (1)(1) | 2.6 |
| Epicycle count | (−0.5, 0) | (2)(−0.5) + (1)(0) | −1.0 |
Now the order is reversed. Jupiter’s moons and the Moon’s mountains match best.
Step 3: Blend the values (a weighted sum)
Each paradigm’s perceived strain is a weighted sum of the four values, using its attention shares as the weights. This is exactly the operation a node performs in your Week 12 network. The difference is where the weights come from.
Ptolemaic query
\[\begin{aligned} \text{strain} &= (0.3176)(1) + (0.0193)(5) + (0.0236)(4) + (0.6395)(0.5) \\ &= 0.3176 + 0.0966 + 0.0944 + 0.3198 \\ &= 0.83 \end{aligned}\]
Galilean query
\[\begin{aligned} \text{strain} &= (0.0421)(1) + (0.5672)(5) + (0.3802)(4) + (0.0104)(0.5) \\ &= 0.0421 + 2.8362 + 1.5209 + 0.0052 \\ &= 4.40 \end{aligned}\]
Step 4: The verdict
We use the rule strain > 3 means paradigm shift; otherwise normal science.
| Observer | Strain | Verdict |
|---|---|---|
| Ptolemaic | 0.83 | Normal science |
| Galilean | 4.40 | Paradigm shift |
Why a threshold of 3, not the 5 we used in Week 10? Because the shares add up to 100%, the strain is a weighted average of the values. It can never be lower than the smallest value (0.5) or higher than the largest (5). A threshold of 3 sits in that range and means “attention is mostly on high-strain evidence.”

What changed, and what did not
Look at what was the same in both calculations: the evidence, its keys, its values, and the rule for the verdict. Only the query was different. Yet the two observers reached opposite conclusions in a single pass, with no epochs of correction.
That is the point of the model. It captures three ideas from Kuhn:
- Anomalies are ignored, not refuted. The old paradigm never assigns Jupiter’s moons a negative weight. It simply gives them 2% of its attention, because they do not match what it is looking for. Compare the Week 10 network, where the old paradigm needed a negative weight to cancel inconvenient evidence.
- The same data, seen differently. Both observers receive identical evidence. They differ in what they look for, which Kuhn says is learned through training and exemplars.
- Revolutions are switches, not slides. Backpropagation changes weights gradually, which looks like the cumulative progress Kuhn argues against. Changing the query flips the verdict at once, closer to his “gestalt switch.”
Where the analogy is loose
A good poster names the limits of its own model.
- We chose the query by hand. In a real transformer, the query is produced by learned weights, so a change of query is itself learned gradually by backpropagation. Is a revolution, then, really sudden? That is a good question for your poster.
- Real models use many attention heads. Each head runs its own query, so a transformer always has several “viewpoints” at once. You could model factions (an astronomer, a calendar reformer, a Church authority) as separate heads.
- Real models have many more numbers. Keys and queries have hundreds of features, not two, and the scores are divided by a scaling factor before softmax. The method is the same.
- All the numbers here are invented. They are chosen to show the mechanism clearly, not measured from history.
Try it yourself
A calendar reformer cares about the drift and is mildly suspicious of the telescope. Model this observer with the query (1, −1).
- Compute the four dot-product scores.
- Apply softmax to get the attention shares.
- Compute the perceived strain and give the verdict.
Scores: calendar drift 0.2, Jupiter’s moons 0.0, Moon’s mountains −0.2, epicycle count −0.5.
Exponentials: 1.2214, 1.0000, 0.8187, 0.6065. Total 3.6467.
Shares: 33%, 27%, 22%, 17%.
Strain: (0.3349)(1) + (0.2742)(5) + (0.2245)(4) + (0.1663)(0.5) = 2.69. Just under 3, so normal science, but much closer to a shift than the Ptolemaic observer. This query spreads its attention evenly, so no single piece of evidence dominates. Is this observer a likely convert?
Building your own for Option 1
Start from the revolution and network you built in Week 12.
- List your evidence. Use the same inputs as your Week 12 network.
- Choose two or three key features that capture what kind of evidence each item is. Good features describe things a paradigm might care about or distrust: does it threaten the core theory, does it come from a new instrument or method, does it come from outsiders?
- Give each item a key and a value, and justify each number in a sentence.
- Write a query for the old paradigm and one for the new, and explain what each is looking for.
- Work through the four steps (dot product, softmax, weighted sum, verdict) and show the arithmetic.
- Make a heatmap like the one above for your poster: one row per query, one column per piece of evidence.
- Compare with your Week 12 model. Which captures your revolution better: gradual weight correction by backpropagation, or a change of query? What does each one miss?
A spreadsheet handles all of this: one column for keys, one for values, =EXP() for the exponentials, and =SUM() for the totals.