Explaining LLMs to Your Grandma
Your grandma has probably already talked to an LLM. She requested a cake recipe from ChatGPT, asked her phone’s assistant if it would rain, and left thinking she spoke to a tiny person trapped inside the device – or the devil, depending on the grandma.
And the funny part is that most people who use these tools every day don’t know much more than grandma. They know it works. They have no idea how. It’s just a black box that spits out text.
Let’s open the box. Without that brain-melting math and with analogies that fit into a Sunday lunch. If by the end you can explain this to your grandma without her making the sign of the cross, mission accomplished.
Almost everything you’ll read here boils down to one thing: modern LLMs are, practically speaking, blocks called transformers stacked one on top of another like pancakes. Understand one pancake, you understand the whole cake.
Tokens: Grandma Doesn’t Read Whole Words
First uncomfortable truth: the model doesn’t read text. It reads whole numbers.
When you send “good morning”, a step called tokenization takes this string and breaks it into little pieces, each piece becomes a number (a token ID) that points to an entry in a fixed dictionary. This dictionary usually has anywhere from tens of thousands to a few hundred thousand pieces.
Grandma’s Glossary - token: it’s the little piece of text that the model sees. And for it, that little piece is just an identity number, not the written word.
The tricky detail is that tokens are rarely whole words. They’re usually pieces of a word. “Tokenization” can turn into [“token”, “ização”]. “Running” can turn into [“run”, “ning”]. It’s grandma cutting bread: slicing it into pieces that are easy to chew.
Why this way? Because a whole word dictionary is too large and can’t handle new words. A letter-by-letter dictionary is too small and forces the model to learn everything from scratch. A piece of a word is the sweet spot between laziness and effort, which is where we all wish to live.
And here lies the reason behind a viral trick: ask an LLM how many Rs are in “rice”. For a long time, they flubbed this badly. It’s not that the model is bad at counting – it’s that it has never seen the letters r-i-c-e. It has seen the token “rice” as a whole block. Asking it to count the letters is like asking you to count how many grains are in the pot without letting you look inside.
Now we have a row of numbers. But numbers alone mean nothing. We need to give them meaning.
Embeddings: Grandma’s Mental Map
A token ID like 1024 is just an [[index]]. It’s the house number, not the house. What gives meaning is a giant table called the embedding matrix.
It works like this: each word in the dictionary has a line in this table, and each line is a long list of numbers – a vector. When the tokenizer delivers a number, the model goes and swaps it for the corresponding vector. This vector is what the model understands as the “meaning” of that word, and it learned this on its own by reading a truckload of text.
Grandma’s Glossary - vector: a little list of numbers. In the transformer, each word becomes one of these little lists so the model can do math with it.
What makes this interesting is that similar words end up with similar vectors. “King” is close to “queen”. “Paris” is next to “France”. Nobody programmed this by hand – it emerges from training, because being close helps the model get the text right.
It’s your grandma’s mental map. In her brain, “telenovela” is linked to “Globo”, which is linked to “gossip”, which is two blocks away from “nosey neighbor who sits in her chair in the yard all day”. She never drew this map. It formed over the years.
And there’s a geometric magic that’s downright scary: you can do math with the vectors. The classic example is king - man + woman ≈ queen. Try doing that subtraction in your grandma’s head, and she’ll ask if you’ve been eating right.
But there’s a hole here. The vector of “dog” is the same vector whether “dog” is the first word of the sentence or the fifth. The meaning is there, but the order is lost. And order matters.
Position and Attention: Who Bit Whom at Sunday Lunch
“The dog bit the man” and “The man bit the dog” use the exact same words. Only the order changes. And it changes everything – including the newspaper headline and the neighborhood’s level of concern.
Raw attention (I’ll get to it) has no notion of embedded order. So the model needs an extra piece to inject the position of each token into the calculation. This is called positional encoding.
Grandma’s Glossary - positional encoding: it’s how the model figures out the order of the words. It tells it where in line each token is sitting.
The original transformer paper (VASWANI et al., 2017) did this by adding a little pattern of numbers to each word’s position – position 1 had one pattern, position 100 had another, all based on sine and cosine waves. It worked, but there were two annoying problems: the vector needed to carry both meaning and position in the same package, and the scheme didn’t generalize well to texts longer than it had seen in training.
Modern models (LLaMA, Mistral, Gemma, Qwen, and nearly the whole gang) use a different scheme called RoPE - Rotary Position Embeddings (SU et al., 2021). Instead of adding the position, it rotates the vectors. A word in position 1 gets a small twist, while a word in position 100 gets a larger twist. When two words are compared later, what matters is the difference between the twists – that is, how far apart one is from the other.
Grandma’s Glossary - RoPE: instead of sticking a position label on each word, it twists the words. The difference between the twists represents the distance between them.
And what’s curious is that even with good positioning, LLMs have a documented problem of “getting lost in the middle” (LIU et al., 2023). They make better use of information at the beginning and end of a long text than they do in the middle. It’s like your grandma telling a story: she remembers how it started, remembers the dramatic ending, but the middle becomes “oh, and then stuff happened”. That’s why that prompt tip – “put the important stuff at the beginning or repeat it at the end” – really works.
We’ve arrived at the piece that named this whole thing: Attention. Attention.
Within each layer, attention does one thing only: it allows each word to look at the other words it’s allowed to see and decide which ones matter.
To do this, each word takes on three roles at the same time, transforming into three vectors: Query, Key, and Value (Q, K, V).
Grandma’s Glossary - Q, K, V: Query is “what am I looking for”, Key is “what do I combine with”, and Value is “the information that gets copied when the combination is strong enough”.
The word “Query” asks: “what am I searching for in the others?” The “Key” responds: “this is what I’m offering to whoever looks at me”. And the “Value” carries: “this is what’s passed on when there’s a match”. The same word performs all three roles simultaneously, just like your aunt at lunch who asks, answers, and still passes the message to the kitchen.
Take the sentence “The cat I saw yesterday was sleeping”. When the model processes “was”, it needs to discover what was sleeping. The Query of “was” is compared to the Keys of the other words. The match with “cat” is high (a verb needs a subject), the match with “yesterday” is low. Then comes the softmax, which transforms these scores into weights that sum to 1, and “cat” gets the heavy weight.
Grandma’s Glossary - softmax: transforms raw scores into weights that total 1. High score becomes high weight, low score becomes low weight. It’s grandma deciding who to listen to at the table.
It’s literally like a family lunch where someone blames “he who started it” and everyone needs to figure out who “he” is at a table with twelve relatives. Attention is the uncle who looks back at the conversation, finds the reference, and resolves the drama after making jokes about the dessert.
There’s a specific rule for GPT-style models: they generate text from left to right, so a word in position 5 can only look at positions 1 to 5. It can’t peek at 6, 7, or 8 – they don’t exist yet. This is called causal masking. Your grandma can’t comment on gossip that hasn’t happened yet (no matter how much she wants).
Grandma’s Glossary - causal masking: hides future words so the model can’t cheat while guessing the next one.
An intriguing research finding: there are specialized attention heads called induction heads, discovered by a team at Anthropic (OLSSON et al., 2022). They learn to notice patterns like “A B … A” and predict that “B” is coming again. It’s one of the clearest mechanisms behind in-context learning – the LLM’s ability to pick up a pattern from your prompt and continue.
The attention calculation has a nasty cost: each word compares to all the others, so doubling the size of the text nearly quadruples the work. This is why giant prompts are costly and many people are researching how to make this lighter.
Multi-head: Grandma Watching Three Soap Operas at Once
One pass of attention provides only one view of which words matter. It’s not enough. Language has various relationships happening simultaneously: subject and verb, pronoun and noun, references between distant sentences, order of words.
Multi-head attention solves this by running attention multiple times in parallel, each pass in a smaller space. Each of these passes is a head.
Grandma’s Glossary - attention head: an independent pass of attention, with its own way of looking at the sentence.
And here’s a detail that half the tutorials get wrong: each head does not get a sliced piece of the original vector. Each has its own matrices that project the entire vector into a smaller space. They’re views of the same word, not different pieces of it. It’s the difference between slicing the cake into pieces and taking eight photos of the entire cake from different angles.
It’s grandma following three soap operas, a football game, and a WhatsApp gossip all at once – each “head” of hers tracks a plot: one only pays attention to who’s cheating whom, another only to the lost child, the other to the inheritance. Nobody told her to specialize this way. It happened over the years.
The model is also not informed about what each head should do. The specialization emerges in training. Researchers have found heads that track grammar, heads that link pronouns to nouns, positional heads, those nifty induction heads. One layer can have 32 heads. A state-of-the-art model has dozens of layers. Result: thousands of heads, each with its own charm.
There’s a cost here too. Each head needs to store its Keys and Values in memory to avoid recalculating everything with each new word – this is the KV cache, the main memory expenditure of running an LLM on long text. To save on this, modern models use a variation called GQA (Grouped-Query Attention), where groups of heads share the same Keys and Values. The LLaMA-2 70B has 64 Query heads but only 8 for Key/Value. Almost the same precision, much less weight.
Feed-forward: Grandma’s Medicine Cabinet
Once attention has finished making the words talk to each other, we move to the step nobody mentions: the feed-forward network (FFN).
If attention is about words talking to one another, the FFN is about each word, alone, thinking a bit more. It does three things in order: expands the vector to a larger size, applies a non-linear function, and compresses it back.
Grandma’s Glossary - non-linearity: a function that “bends” the input. Without it, stacking a hundred layers results in the same outcome as having just one – it ends up being a dumb multiplication.
This bending part is what prevents the model from turning into a glorified calculator. Without it, two linear layers in sequence are mathematically equivalent to one, and a hundred layers are still valid as just one. The non-linearity is what saves the game.
Here lies the most surprising part: the majority of a model’s parameters are in the FFN, not in attention. And these parameters aren’t generic – it’s where a lot of the model’s knowledge is stored. Researchers found neurons that fire strongly in text about the Eiffel Tower, others in programming languages, others in past verbs. When the model “knows” that Paris is the capital of France, this fact is spread across the weights of the FFN.
It’s your grandma’s medicine cabinet. Everything has its drawer, and she knows exactly where everything is – and God (or Shiva) help you if you mess with the order.
The detail worthy of a sci-fi movie: it’s possible to edit facts directly in the model without retraining it. Methods like ROME can swap “the Eiffel Tower is in Paris” for “the Eiffel Tower is in Rome” by surgically altering a specific matrix. It’s a precision lobotomy. The model will then swear that the Tower is Italian and sleep soundly.
And newer models have begun to turn the single FFN into a Mixture of Experts (MoE): instead of one network, several parallel networks (the “experts”) and a little router that decides which to process each word. The Mixtral 8x7B has 8 experts per layer, but only activates 2 per token. It’s grandma delegating: a cake question goes to the aunt who cooks, a high blood pressure question goes to the nurse aunt. No need to wake the whole family for every question.
Grandma’s Glossary - MoE: the model has several experts and sends each word to only a few of them. It grows in size without bursting the cost.
Residual Stream and Next Token: The Pot That Never Starts Over
This is the plumbing without glamour that holds everything up.
The residual stream is what makes the model “additive” rather than “substitutive”. When attention runs, or when FFN runs, the result generally doesn’t replace the word vector – it’s added to it. New vector = old vector + what the block produced.
Grandma’s Glossary - residual connection: adds the output of a block back to what was fed in. It provides a shortcut for information to cross the entire network without getting lost.
Over thirty, fifty, a hundred layers, each contribution accumulates rather than erasing the previous one. It’s like the Sunday pot: you don’t throw the soup away and start over with each new spice. You keep adding, tasting, adjusting. The base broth from the start is still there, mixed with everything that came after.
This trick didn’t even originate with transformers – it came from ResNet (HE et al., 2015), made for image recognition. The problem was that very deep networks were impossible to train: the learning signal got too faint back there. The shortcut solved this, and suddenly it was possible to train networks with hundreds of layers.
The second piece is the layer normalization (layer norm), which exists for a very practical reason: without it, the numbers in the residual stream either explode to infinity or collapse to zero over so many sums. Layer norm rescales the vector to a controlled range between blocks. It’s grandma lowering the heat so the soup doesn’t overflow or cool down. Modern models use a cheaper version called RMSNorm, which does almost the same thing while spending less.
Without residual connection, deep models don’t train. Without normalization, the broth overflows. With both, you can stack a hundred layers and sleep soundly.
After all the layers, the model has a vector for each word. To predict the next one, it only takes the vector of the last word and converts it into a number for every possible word in the dictionary. If the dictionary has 100,000 words, that’s 100,000 numbers. These raw numbers are called logits.
Grandma’s Glossary - logits: raw scores for each word that could come next. They only turn into probabilities after softmax.
The softmax (here it is again) transforms these logits into a probability distribution. Then the model does not always choose the most probable word – otherwise, it would be boringly predictable. The one controlling this is the temperature: low makes the model conservative, high makes it creative (and often a bit wild).
Grandma’s Glossary - temperature: the control of how risky the model’s choices are. Low = predictable, high = unpredictable.
The temperature is how many shots of liquor grandma had at lunch. Temperature zero: “have a little more, my child”. High temperature: she spills every truth about your cousin’s marriage and the whole table goes silent. Same grandma, different levels of filter.
Once the word is chosen, it enters the queue, and the model runs everything again for the next one. And again. And again. A whole paragraph is just this loop, one word at a time.
And here’s the point that confuses everyone: the base model is not trained to tell the truth, nor to reason, nor to be nice. It’s trained to guess the next word in an ocean of text. That’s why it sometimes invents with the utmost confidence – it’s your grandma telling the story of your birth, which changes details every time but is always narrated with the same conviction. Sympathy, confidence, and good behavior come later, in a fine-tuning process called post-training.
Oh, and there’s a neat speed trick called speculative decoding: a small and fast model guesses the next words, and the big one just checks if it accepts them. It’s the teenage grandkid buttering up grandma, and grandma just nodding yes.
In the End, It’s All the Same Skeleton
At this point, the obvious question is: so what’s the difference between GPT, Claude, Gemini, and LLaMA? We don’t know all the closed details, but at the level we’ve seen here, they all live in the same architectural neighborhood.
They all use the same structure: tokenization, embeddings, position, stacked layers of attention and feed-forward, residual stream, normalization, and the next-token loop. What changes from one to another is basically: the trained weights (different data, different scales), the configuration (number of layers, dictionary size, MoE or dense), and the post-training (instruction tuning, human feedback, safety controls).
Grandma’s Glossary - weights: the learned numbers within the model. Training keeps tweaking them until the model gets the text right.
The most curious thing is that the “modern transformer” of 2023 to 2025 has converged towards a similar set of choices – pre-norm, RMSNorm, RoPE, SwiGLU, GQA, MoE in the biggest models – even with different teams arriving at that point independently. None of these pieces were invented all at once. It took five years to refine the original 2017 design.
And it could change. The state-space models like Mamba are serious alternatives for very long texts. Hybrid architectures are being tested. But the basic mechanisms we’ve seen – turning text into numbers, giving it meaning, marking position, letting words look at each other, processing each one, summing everything into a broth, and guessing the next – are the durable part. Any sequence model will have to solve those same problems somehow.
In the end, all the “artificial intelligence” that haunts your grandma is this: a dictionary of little pieces, a map of meanings, a bunch of matrix math, and a stubborn desire to guess the next word. The answer to life, the universe, and everything else maybe is 42, but the answer to “how does this thing work” is, disappointingly, “a lot of multiplication”.

Your grandma will continue to think there are people trapped in her phone. And honestly, after explaining all this, I’m not so sure she’s wrong.








