AI for Normal People #2 | LLMs from Back-to-Front — Language

Home | Back to Blog Index | Prev

2026-07-20

In the last entry, I discussed what a model is in machine learning, using an example of a model trained to classify images of birds. The most important idea was that to make good use of any model, we must ensure that the questions we ask the model and the questions the model is trained to answer are aligned. Now, we're going to move to the middle letter of LLM and discuss what it means to model language.

Why Model Language?

You have almost certainly encountered language modeling in the wild, whether you were aware of it or not. Language models are the engines behind services like ChatGPT, but they also can or do power Google's AI summaries [1], translation apps, spam email filters, smart home assistants like Alexa, and a massive number of other places you might not expect. Language modeling is so ubiquitous because language gives us a very compact, high-level understanding of the world. It would take thousands of pixels to depict even a single bird, let alone all the various species and individuals of those species, but I can capture them all abstractly with just a single word. This makes language a fantastic way to provide people with a description of parts of the world or events that we care about.

The problem for computers is that language is also horrifically complicated. Language is absolutely packed with patterns, often patterns nested inside each other, which is necessary for people to understand one another at all. To communicate ideas effectively, we have to (mostly) share a set of rules about what words mean and how other words in a sentence, and their order, changes their meanings. Because we use language to discuss reality, and reality is complex, the patterns in language must also be very complex, making it difficult for conventional computer programs (which are typically bad at pattern recognition) to make much sense of them.

Still, we do have to communicate our intentions to computers for them to be of any use to us, so there is a lot of value in developing models to interpret the language we use. But how might we do that, given the complexity of language and the reality it reflects?

"Measuring" Words

The first step is to remember that computers only deal in numbers. Converting images to numbers is surprisingly easy because that's how computers already represent them (recall from last time that an image is a grid of pixels, and each pixel is a number representing its colour). Similar pixels are already similar numbers. For words, though, this is more difficult because two words can mean similar things but have very different letters in them. "Big" and "gargantuan" are two words with similar meanings, but their spellings are totally different. As with everything, computers represent letters using numbers, but the letters don't tell you anything about what a word actually means. What we want to do is somehow measure their meanings.

This seems like a pretty absurd task, but the image below shows how you might measure a handful of words on two axes: "aliveness" and speed.

Speed → Aliveness → Mountain Cloud River Car Aeroplane Bacterium Tree Snail Tortoise Person Hare Bird Cheetah

Fast animals like cheetahs score highly for both aliveness and speed. Aeroplanes have a low aliveness but a very high speed. Bacteria don't feel quite as "alive" as animals, but they are a little bit alive, and are quite slow by our standards. Mountains are certainly not alive and not mobile at all [2]. Thinking about words in this way means we can, to a certain extent, measure their meanings, but only as long as we remember we're measuring relative to other words. There is no absolute number you could assign to "aliveness".

There are lots of words we could plot on this chart, but there are also many that we couldn't. Where would you put "blue" or "indomitable"? When we only have two axes to measure in, there's only so much we can describe about any given word. We call these axes dimensions; the above chart is 2-dimensional because it only has two measurements you can use to describe anything on it. There is no way on the above chart to distinguish between two objects by colour, because colour is not one of the dimensions we're measuring along.

The way language models solve this issue is by using many, many more dimensions for measurement. LLMs typically have several thousand dimensions to represent words with. This can be a bit tricky to get your head around, and is impossible to picture because we are only 3-dimensional creatures. In regular space, you use three different numbers to describe an object's position or size (its coordinates, or its height, width, and length). Fortunately, the maths works just the same in 8,000 dimensions as it does in two or three.

Many words will have low scores on many or most dimensions — asking how "alive" the word "blue" is doesn't make much sense, so we give it a low score. Asking how "blue" the word "hungry" is doesn't make sense either, so if we had a "blue" dimension, we would give "hungry" a low score on that as well, while we might give "red" a negative score because it can be meaningfully compared to "blue", but is very different from it.

Blue (1) (-1) Alive (1) (-1) Hungry Blue Red

We run into another problem in that there are a huge number of concepts we could think to measure, and it's too difficult to list them all out and then argue about where every single word we can think of belongs on every concept. Instead, we leave this up to the model to learn. We provide it with the space for, say, 8,000 dimensions, and leave it to learn which concepts are actually useful and which ones aren't. Most of these dimensions won't cleanly correspond to human-understandable concepts, and many may map onto multiple concepts, so we can't look into the model and understand the weights directly. We also can't expect to understand why any given word is in the place it's in ("why is 'blue' represented with the numbers [-1.55, 2.94, 0.81] and not [-1.50, 3.1, -0.81]?") but we can expect that multiple similar words should be close to each other. "Big" and "gargantuan" should have roughly close numbers representing them, even if we don't know what those numbers mean.

In fact, because token representations are all just numbers, we can actually add and subtract them from each other. In our example here, if you subtracted the token for "slow" from the token for "tortoise", and then added the token for "fast", you might end up with something close to "hare", since the tortoise and the hare are often used to represent a slow and a fast animal, respectively [4].

Speed → Aliveness → Tortoise - "slow" + "fast" Hare

The reason that we want words with similar meanings to end up close to one another numerically is because this allows the model to generalise what it has learned. If it sees some new, useful information about "dog", like that dogs have four legs and like to wag their tails, then that knowledge can also help it to make sensible predictions about "puppy" and "wolf", because their numeric representations are already close together. Conversely, the model does not strongly change its knowledge about car engines, because they will mostly not be represented similarly to canines.

Tokens, Not Words

One small clarification before we move on. If you've heard people talking about LLMs or AI in the past, you may have heard them use the term token. AI companies typically bill by the token, you might hear about "token budgets" or "token efficiency". That's because language models don't actually take words as we understand them as input. While the smallest input you can give to an image classification model is a pixel, the smallest input for a language model is called a token.

Recall that models in machine learning typically start with their weights randomised. This is important for learning, but many pairs of words that are obviously similar to us can start out very far apart in the model. For example, "bird" and "birds" are almost identical words, one is just a plural, but a language model would probably start by representing them with very different sets of numbers and would need to learn that they are closely related from scratch.

Instead, we allow ourselves to break words up into their component pieces. We might end up with one token for the word "bird" and then another for the letter "s". If we do this with many different nouns, the model will almost certainly learn that if the letter "s" follows a noun, the noun represents more than one object. This same pattern applies to many different words, so learning this way saves the model a lot of time. You don't need to independently learn "matter" and "antimatter", "clockwise" and "anticlockwise", and "thesis" and "antithesis". You can have a separate token for "anti", which nearly always means "opposite", and now you know that putting it in front of "matter", "clockwise", and "thesis" gives you their opposites.

Most uncommon words can be broken down into smaller parts, so this time saving applies all through language. It also means that you can get away with teaching the model far fewer tokens because it learns how to combine them on the fly.

anti dis establish ment arian ism

It is very important to remember that tokens are totally indivisible. Below are the tokens that make up the word "strawberry" [5]. The model only ever sees the numeric identifiers, not the letters themselves. This is why LLMs struggle with counting letters in words (famously, most LLMs would miscount the number of 'r's in "strawberry", sometimes saying "two" or "four"). They don't always have reliable access to that information [6]. To a language model, asking what letters are in a word would be like asking an English speaker what the middle bar in a capital "A" means — we just don't divide down any further than that.

What we see: What the model sees: Str aw berry 3504 1134 19772

Patterns in Language

So, we can represent individual tokens, which may be whole words or parts of words, with language models, all well and good. But language is more than just the meaning of individual words. Most patterns we want to learn about are the result of combining words.

Grammar is an example of a group of low-level patterns which we would want to capture. Grammar is made up of patterns which describe how words relate to each other in a sentence, and these relationships carry meaning. For example, despite having identical words in them, the sentences "The dog bit the man" and "The man bit the dog" have very different meanings. Thanks to English grammar we know that, in the first sentence, it was the dog's teeth on the man because "the dog" is the subject of the sentence (the entity doing the action) and "the man" is the object of the sentence (the entity to which the action is done). English grammar rules usually require the subject of the sentence to come before the verb (bit) and the object to come after it, so grammar is what distinguishes between these two very different situations, and its rules are the patterns a language model will aim to detect.

Beyond just word order, we can learn about when an event occurred based on the tense of the sentence (the dog "bit" in the past, the dog "bites" in the present), or we can go even further and learn patterns that reflect information in language, like facts, opinions, or clichés.

Again, we have to ask ourselves "what questions do we want to answer?". If you run a movie review website, you might want to know whether a review was positive or negative. If you are a spam filter, you want to know whether the email looks like a real email or just garbage. If you are a home assistant, you want to know whether someone just gave a command or is just chatting to their friend.

These are all different, difficult questions, and you could train a new language model for each of them, but that's a lot of effort. For more complex tasks, just answering one question might not be enough. Thus, we want to pick a single question for our language models that captures as many of these tasks as possible.

The Only Question Language Models Answer

That question, the only question a language model can answer at all, is:

"Which token comes next?"

This might strike you as a very simple question to ask. It's the sort of thing your phone's autocomplete has been doing for years, but most people have tried to get their autocomplete to write an entire sentence from scratch, and you would know that they're pretty bad at it. Technically, phone autocomplete usually uses a kind of statistical model too, but they're very simple compared to the kinds of language models we're talking about, so their results aren't terribly impressive most of the time.

In fact, you may have heard people call language models "glorified autocomplete". This is fair in terms of their mechanics: at their core, they do much the same thing as autocomplete. But in truth, autocomplete is a surprisingly hard problem to solve if you really want it to write full sentences for you.

The real trick is what the input to our model is. For regular autocomplete, the input will usually only be the last few words, maybe three or four of them. That's why they aren't good for generating coherent sentences: they're not looking far enough back to have a good idea of what you're trying to say. LLMs, conversely, take a great deal more text to predict the next token. Instead of only a couple words, we can give them the entire sentence from which to predict the next token, or even more than that. A more precise way of describing the question LLMs answer might be: "Given all the tokens so far, which token comes next?".

A prominent AI researcher and co-founder of OpenAI, Ilya Sutskever, explains it like this [7]:

Say you read a detective novel. It's like a complicated plot, a storyline with different characters, lots of events — mysteries like clues. It's unclear. Then, let's say that on the last page of the book, the detective has gathered all the clues, gathered all the people, and is saying "Okay, I'm going to reveal the identity of whoever committed the crime, and that person's name is... — Predict that word."

Wait, Just Next-Token Prediction?

So, how does a very good autocomplete give us something useful? To begin with, the technical term for autocomplete is auto-regression, and it is a surprisingly simple process. We start with some text, predict which token should come next, add that token to the end of the sentence, and then repeat. The most prominent language models, and the ones you notice day-to-day, are auto-regressive language models [8]. They simply predict the next token over and over and over again. Typically they will go until they predict that there is no next token and that they should stop, at which point we stop making predictions and show the output to the user.

Input: Brevity Predicts: "is" Input: Brevity is Predicts: "the" Input: Brevity is the Predicts: "soul" Input: Brevity is the soul Predicts: "of" Input: Brevity is the soul of Predicts: "wit" Final Complete Sentence "Brevity is the soul of wit."

This fact is so important that I want to spend some extra time emphasising it, because it really is quite remarkable. The core of the entire AI boom we are experiencing is largely built around programs which simply predict the next token in a sentence. It is not simply predicting a single token, as tall a task as this may be, that has led to the boom, but building entirely new passages of text from the tokens that are predicted.

This has led to quite a bit of consternation from a pair of camps that take opposing philosophical positions. The first camp says that because "all" that LLMs are doing is predicting the next token, this demonstrates that they are not intelligent, do not have a strong concept of the world, and are not a path to "true" AI. This is the "glorified autocomplete" crowd. The second camp (including Sutskever), claims that the ability to accurately predict the next token in very complex sequences of tokens demands intelligence and a strong understanding of the world, and that, in principle, this is what humans do when they speak, write, or do anything [9].

Much of this debate circles around what actually constitutes intelligence and "understanding" of the world. Without staking too strong a claim for myself (though I have opinions), I think that both sides would agree that for a surprising number of tasks, LLMs don't need to deeply understand the world to be extremely useful, regardless of whether they actually are or are not "truly intelligent". Language is so thoroughly filled with patterns, and we as people have done such a good job codifying what those patterns mean, that just completing relatively simple patterns is enough to be extremely useful.

A Brief Aside — Generative AI

You may have heard people talk about "generative AI", referring to LLMs (among other things, including image generators, text-to-speech models, video generators, etc.). This term can give the impression that these models are somehow technically a different type of AI than simpler examples, like bird classifiers or spam filters. The truth is that this term is more about what we do with the model rather than the model itself. There's nothing about an LLM that forces us to perform auto-regression and generate sentences; we could just predict the next token once and be on our merry way. All that the models do is predict the next token. I find that "generative AI" produces more confusion than it does clarity, so I will avoid the term in future.

What Models Really Give You

To add another wrinkle to things, I've actually lied to you a little bit. Language models don't actually give you the single token which will come next, instead they give you what's called a probability distribution over all the tokens which possibly could come next.

This is essentially a list of every token the model knows and the model's estimate of the likelihood that it is really the one that comes next. Sometimes, the model will be very sure about the next token; this happens most often with auxiliary words which are necessary for a sentence to make sense, like "the", "and", or "to". Sometimes, though, several tokens may have roughly similar probabilities.

Given context: "Brevity is the..." soul 70.0% essence 12.0% key 6.0% answer 4.0% perf 3.0% </ 2.0% _1 1.5% ious 1.0% Amazon 0.5%

If we just picked the most likely token every time, we would generally end up with a very stilted, bland sentence, which we don't always want, so what we generally do is sample from the tokens. This means that we pick a token at random, but let the model load the dice. If the model predicts that a token is almost guaranteed to be next, then it will probably be picked, but if it's not, then we could end up with one of several possibilities. The model decides the likelihood of any token coming next, and we roll the dice and find out which one we get.

The Trillion-Dollar Question

From deep within the guts of it, this language modeling sounds surprisingly simple (though the maths is not). A language model just asks its one and only question, "which token comes next?" again and again and again. Why, then, is the estimated cost of the global AI build-out measured in the trillions of dollars? Why are people declaring the start of a transformation on the scale of the internet revolution itself? How did an LLM solve a decades-old maths problem [10], why are software engineers adopting them to write so much code, and how do they pass legal exams?

We'll discuss the answer in the next post in this series: they are Large, in every sense. The computers they run on are large. The models are large. The training data is large. The LLM is the backbone of a very strange industry that only works because of a truly massive scale.


[1] And in Google search itself, even without the AI summary.

[2] Yes, I know about plate tectonics. Humour me. [3]

[3] For the truly pedantic: remember that LLMs model language, not reality itself. In language we often use mountains as a stand-in for things that don't move ("He was as stoic as a mountain"), so it is quite likely that most LLMs will have a strong association between mountains and immovability, and there may even be more metaphorical use of mountains as completely still than there is detailed descriptions of seismology.

[4] For modern LLMs, the maths does not necessarily work out like this, but it is a useful illustration, and was generally true for older language modeling approaches like word2vec.

[5] Using GPT-5's word-to-token converter, called a tokeniser.

[6] It is often easier for an LLM to write a small program that manually counts the letters for it.

[7] Found here, touched up for readability

[8] There are language models which use approaches other than auto-regression. The most prominent of these are "masked language modeling", in which we hide a word in the middle of a sentence rather than at the end, and ask the model to predict the hidden word, and "text diffusion", which generates text by masking an entire sentence and then repeatedly un-masks words until the sentence is complete. Auto-regression is more common among chatbots that you will likely encounter, though, so I will leave these for another article.

[9] I have massively simplified both sides here for the sake of brevity, but I hope neither would feel I have misrepresented them here, or at least that I have misrepresented both equally.

[10] https://openai.com/index/model-disproves-discrete-geometry-conjecture/