How AI Chatbots Actually Work · Part 2 of 5
How AI Reads: Attention, Explained Without the Math
How a large language model reads, in plain English: attention is close reading, several heads at once, and each layer adds a note instead of erasing the page.
11 Nov 2026

Each layer revises a running draft of what the context means — like margin notes that accumulate rather than a page that is erased and rewritten.
Inside the stack, two kinds of work alternate. Attention lets each position look at other positions and borrow from them — a soft, weighted close reading. A feed-forward network then processes each position alone, like consulting a vast key–value memory of patterns and facts. Residual connections add each block's contribution back onto a shared stream; normalization keeps those numbers from exploding or vanishing.
Similarity is the primitive. A score of how aligned two lists of numbers are becomes a way to ask: given what I am focusing on, which earlier words seem relevant? Attention builds three views of each token — query, key, and value. Queries ask; keys advertise; values carry what will be mixed in. Softmax turns match scores into weights that sum to one. Multi-head attention runs several such readings in parallel.
Focusing on mat: most attention falls on cat (35%) and sat (25%).
Order matters. Modern models often encode position by rotating pairs of numbers in the query and key views (rotary position embeddings), so relative distance shapes the matches. Causal masking ensures that when predicting the next token, the model cannot peek at the future.

Most parameters often live in the feed-forward layers. One useful picture treats them as memory addressed by the residual stream: patterns that match strongly write particular directions back. Attention moves information between places in the sentence; feed-forward layers enrich what each place contains.