← Explore the PDF demos
THE IDEAS BEHIND AI

What does AI pay attention to?

Fifteen pages of research. One idea that changes how you think about language. Hear Nemonic explain attention, starting with the original Transformer paper.

Attention Is All You Need

Vaswani and colleagues · 2017 · 15-page research paper

Read the original PDF ↗
START WITH THE IDEA

A word gets its meaning from its company.

Consider two phrases: a bank beside a river, and a bank that approves a loan. The word is the same; the surrounding words change what it means. Self-attention lets a model combine information from positions in a sequence when building its representations. This is an illustrative example, not a measured attention pattern from the paper.

One word · different context
a bank beside a river
a bank approving a loan
01

How much should each word contribute?

The paper describes attention as a weighted combination of values. A query is compared with keys to calculate the weights. Those weights determine how much each value contributes to the result. The names sound abstract; the useful idea is that different pieces of context can contribute by different amounts. The filing-cabinet comparison in the audio is an analogy: queries, keys and values are learned numerical representations, not literal grammar labels.

Sections 3.2–3.2.1 in the original PDF

02

One view is not the whole picture.

Multi-head attention performs several learned projections in parallel, then combines their outputs. The paper describes this as attending to different representation subspaces at different positions. That does not mean every head has a fixed, human-readable job.

Section 3.2.2 in the original PDF

03

Order still matters.

Attention alone does not supply the order of the sequence. The original Transformer adds positional encodings to its input embeddings. It also masks future positions in the decoder so that generating a word cannot depend on words that have not been generated yet.

Sections 3.1 and 3.5 in the original PDF

The recording starts with “its” and “Law,” a sentence example from Figure 4 of the paper. It then walks through the calculation and how multiple attention heads work together.

HEAR IT FOR YOURSELF

Press play. Follow the idea.

2 selected lessons · 5:55 total.
Open a transcript to follow along.

LESSON 01 · 2:46

Queries, Keys, and Values

Read the transcript
The whole answer to how its finds Law fits in one line of math. Attention of Q, K, and V equals softmax of Q times K transposed, divided by the square root of d k, all multiplied by V. Today we read that line out loud, piece by piece. Every word in the sentence gets three vectors, which are just lists of numbers. The first is the query. A query is what a word is actively looking for. When the model processes its, the query works like a search for a singular noun. The second is the key. A key is the label on a file folder. The word Law projects a key that advertises what it is: a singular noun, something a pronoun could point to. The third is the value. The value is what is inside the folder, the actual information the word carries. Query, key, value. Search, label, contents. Now the scoring. The model takes the query from its and compares it against the key of every word in the sentence, including its own. The comparison is a dot product, which multiplies the two lists of numbers and adds them up. Keys that match the query give a big number. Keys that don't give a small one. Law's key matches, so Law scores high. Then comes the part that looks like a fussy detail. The paper divides every score by the square root of d k. Here d k is the length of the key vectors, 64 in the paper, so each score gets divided by 8. Why? With long vectors the dot products grow large, and the authors suspect that pushes the next step into a zone where learning nearly stalls. Dividing by the square root of d k keeps the scores in a sensible range. That is the scaled in Scaled Dot-Product Attention. The next step is softmax, which turns the scores into weights that add up to one. Think of it as dividing a single pie among all the words. Law gets the biggest slice. Remember that sharp attention in the paper's Figure 4? This is where the sharpness comes from. Finally, the model uses those weights to take a weighted sum of the values. Mostly the value of Law, with slivers from everything else, gets mixed into the new representation of its. So the output for its now carries the meaning of Law inside it. In self-attention, the queries, keys, and values all come from the same sentence, and the paper packs them into three matrices, Q, K, and V. One matrix multiplication scores every word against every other word at the same moment. That is why this runs in parallel, and why it is so fast on a GPU. Nothing in there understands grammar. It is multiplication, tuned by training until the right keys match the right queries. But a single attention pass averages everything into one view, and it also has no idea which word came first. Next time we fix both: eight heads attending in parallel, and the sine and cosine trick the paper uses to tell the model where each word sits.
LESSON 02 · 3:08

Multiple Perspectives and Knowing Your Place

Read the transcript
Shuffle the words of a sentence, and a bare self-attention layer would score every pair exactly as before. It has no idea who came first. Last time I promised two fixes, so let's take them in order. The first fix is multi-head attention. Multi-head attention means the model runs several attention passes side by side instead of one. A single pass blends everything into one averaged view, and the paper says that with a single head, averaging inhibits the model from looking at different things at once. Here is the setup. The model projects the queries, keys, and values h times, and the paper sets h equal to 8. Eight heads. Each head has its own learned projection and works in 64 dimensions, because the full width of 512 divided by 8 is 64. Since every head is small, the total cost stays close to one big head. Each head can pick up a different job. In Figure 4, heads 5 and 6 in layer 5 send its straight to Law. In Figure 3, other heads connect making to more difficult across a long sentence. The paper says of Figure 5 that the heads clearly learned to perform different tasks. Then the eight outputs get concatenated, which means glued end to end, and projected once more, leaving one richer map of the sentence. Does the count matter? Table 3 says yes. Eight heads scored 25.8 BLEU. One head scored 24.9, the 0.9 drop the authors mention. And more is not always better, because thirty-two heads slipped back to 25.4. Now the catch. Self-attention compares all words at once, so nothing in its arithmetic records order, and The Law will never be perfect looks the same as any scrambled version of those words. The second fix is positional encoding. Positional encoding means adding a signal to each word's embedding that says where in the sentence the word sits. The paper builds that signal from sine and cosine functions of different frequencies. Each dimension is a wave, and the wavelengths stretch from 2 pi all the way up to 10000 times 2 pi. Picture a short wave and a long wave sampled at the same word. The short wave changes sharply from one word to the next. The long wave barely moves. Put hundreds of waves together, and every position gets a pattern no other position shares, a mathematical timestamp. The encoding has the same 512 dimensions as the embedding, so the two simply add. The authors had a reason for sines and cosines. For any fixed offset k, the encoding at position pos plus k is a linear function of the encoding at pos. That should make it easy for the model to attend by relative distance, like three words back. They also tried learned position embeddings and got nearly identical results, 25.7 against 25.8 BLEU. They kept the sinusoids because those might extend to sentences longer than any seen in training. So here is the full picture of its finding Law. Positional encoding stamps every word with its place. Multi-head attention then lets eight heads, each working in 64 dimensions, look at that stamped sentence from eight angles at once. Eight heads at 25.8 BLEU, one head at 24.9. That gap is the case for multiple perspectives.
SEE WHAT STUCK

Could you explain it back?

Try a review question from this course. Choose an answer, then check the explanation.

What does softmax do to the scores?
Source, scope and how this demo was made

We uploaded the full paper and asked for an introduction to self-attention, queries, keys, values, multiple heads and position. This is a conceptual introduction, not a derivation of every equation or a reproduction of the experiments.

Our learning goal: Explain the attached Attention Is All You Need paper for a curious adult. Focus on self-attention, queries/keys/values, multiple heads, and position. Use a clearly labeled original sentence example. Explain without equations or claims of human understanding.

Generated October 26, 2026 through Nemonic’s iPhone simulator app and local development backend. The uploaded PDF was passed into course generation. Settings: a ten-minute target, Alice voice, Lecture; no personality or public-library sharing. This page presents selected lessons from the generated course. Audio and review questions are application outputs. The lengths shown are actual recording durations; the requested length is a target.

This demonstration uses local PDF-upload and source-extraction fixes. It does not establish that those fixes are available in the released App Store build. AI-generated explanations were checked against the source but may still contain mistakes. Page explanations and diagrams are editorial additions; the recordings and their transcripts are unedited application outputs. Source authors and publishers have not endorsed this demonstration.