Faragiri

Learn How models workAI

A model produces one token at a time, never sees a letter, and remembers nothing. Four facts about the machinery, and the failures each one predicts.

7Sections
7Min read
2Depth

One pass, left to right

The frame that decided the answer is the second one

Each frame is the likeliest continuation of the frame before it, and no frame can reach back and change one.

  1. 01Is 4181 prime? Answer yes or no first.The request, and nothing has been divided yet
  2. 02YesOne word, with no arithmetic anywhere behind it
  3. 034181 is a prime number.The sentence now has to be defended
  4. 04It has no divisors besides 1 and itself,The likeliest continuation of a yes
  5. 05as trial division confirms.A method named, and not run

Nothing here is a lie being told. By the second frame there is nothing left to continue except a defence, and the defence is written in the same sentences a conclusion would be.

Ask a model whether 4181 is a prime number, require the verdict before the working, and it answers Yes and then spends a paragraph defending a number it never divided. 4181 divides by 37, and the other factor is 113.

That is not a gap in its knowledge. It is the mechanism doing exactly what it does, and the useful thing about knowing the mechanism is that the paragraph above was predictable before anyone ran it. This page is the part of the machinery that pays for itself in predictions.

The sentence is built forwards and cannot be unbuilt

A model commits to each token before it has seen the next one. There is no draft held somewhere and revised; the text you read is produced in one pass, left to right, each piece chosen as the likeliest continuation of everything already on the page, including its own previous pieces.

So the order of the request decides the answer. Asked for the verdict first, the model produces Yes at a point where no arithmetic exists anywhere in the text. Everything after that word is now the likeliest continuation of a yes, which is why the reply goes on 4181 is a prime number. It has no divisors besides 1 and itself, as trial division confirms. Trial division is named and not run. An answer given before its working is a defence, not a conclusion, and it will read exactly like a conclusion, because defences and conclusions are written in the same sentences.

Turn the request over, ask for the divisions listed up to sixty five and the verdict after them, and the same model gets it right, because now the tokens that have to be produced before the verdict are the ones that constrain it. The number is a good test precisely because it survives so much: 4181 is odd, its digits sum to fourteen, it ends in a one, and it is not divisible by seven, eleven, thirteen, seventeen, nineteen, twenty three, twenty nine or thirty one. Eleven trial divisions go by before the twelfth catches it, which is about ten more than a plausible guess is willing to do.

The model never sees a letter

Text is cut into tokens before the model sees a letter of it. A token is a common chunk of characters, roughly a short word or a piece of a longer one, and the letters inside it are not visible to the thing doing the predicting any more than the grain of the paper is visible to a reader.

Which predicts a whole family of failures. Ask for a sentence in which every word has exactly five letters and back comes Boats drift past those grand stone walls, six of the seven right and past with four, offered with no hesitation at all. Point it out and the next attempt has the same species of error somewhere else. The constraint was stated in units the model cannot observe, so it was satisfied by resemblance to sentences that satisfy it, which is the only way it could have been satisfied.

The same fact decides what a conversation costs. Common English words are one token each; a rarer script costs more tokens, so Persian runs out of room sooner than English, and the same passage translated fills more of the window in one language than the other. A reader who assumes the two are equivalent will conclude that the model is worse at the second language when part of what happened is that it was given less room to work in.

The order

The layer with the news in it is the one holding nothing up

Read downwards this is a reading list. Read upwards it is what carries what, and only the second reading explains anything.

  1. The landscapeWho makes what. The only slab that will be wrong in a yearwhere everyone starts
  2. The limitsStructural failures, unreadable until the slabs below exist
  3. The architecturesThe designs behind the current generation. Skippable on a first pass
  4. Tokens and embeddingsHow text becomes numbers, and why letters are invisible
  5. The ideaOne token at a time, each the likeliest continuationcarries the rest

Nothing here is numbered, because none of it is a step. A reader can hold the top slab alone for a year and predict nothing with it.

There is no memory, only the transcript read again

Between one turn and the next, nothing persists inside the model. The whole conversation is read again on every turn, or it is not there at all: what looks like remembering is the previous exchange being resent as part of the new request, and what looks like forgetting is that transcript growing past what fits.

Two predictions fall out of that. A long conversation gets slower and more expensive with every turn, because every turn re-reads all of it. And remember this for later is not an instruction that does anything, unless something outside the model writes it down and puts it back in front of the next request, which is the whole of what a stored instruction slot or a retrieval step is for.

Sampling, and why turning it down is not being right

At each step the model has a score for every token it could produce next, and one is drawn from that distribution rather than picked off the top. That is why the same request answers differently on Tuesday, and it is a setting rather than a flaw.

The setting is worth understanding backwards. Turning the sampling down makes a model repeat itself, not be right. A near-zero setting on the 4181 question returns the same confident wrong answer every time, and the steadiness reads as certainty to anyone who has not been told what the dial does. Variation between two answers is information, and its absence is not.

The stall is knowing the words

People stop making progress on this subject at the point where the vocabulary arrives. Token, embedding, attention, context window: a fortnight of reading hands over all four, and not one of them predicts anything by itself. It does not feel like stopping, because the vocabulary makes every article about models suddenly readable, so the reading gets easier at the exact moment the predicting stops improving.

The test is not whether you can define a context window. It is whether the five-letter sentence was already unsurprising before this page explained it, and whether you can say now, without trying it, what comes back from a request for a paragraph in which no word contains the letter e. A person who can define a token and is still surprised by that answer has the words and not the mechanism, and the words are the half that will not help on a Tuesday.

What a drawing of it can say

Every picture of the inside is this honest and no more

Numbers go in on the left, a score for every possible next token comes out on the right, and the middle is not labelled because nobody can label it.

  • The tokens you sentPieces of words, already numbers
  • Layers that mix themTens of them, each looking at all the others
  • More of the sameNo layer here has a job you could name
  • A score for every tokenTens of thousands of them, one per candidate
  • One token, drawnSampled, not picked off the top

The one structural claim this drawing makes is that everything in a layer reaches everything in the next. It cannot tell you why the answer was yes, and no better drawing of the same thing can either.

The order of learning runs bottom up

Almost everybody starts at the top of this subject, with who makes what, and how to choose, because that is the layer with news in it. It is also the only layer that will be wrong within a year, and it explains nothing: knowing which company shipped which model does not predict a single thing about how any of them behaves.

Underneath it, the failures that are structural, not bugs is where the return is, and it is only readable once the layers below it exist. Read cold it is a list of complaints; read after how text becomes numbers, the letter-counting failure stops being a complaint and becomes an entailment. The designs behind the current generation sits between them and is the layer most safely skipped on a first pass, since almost none of the behaviour a reader is trying to explain needs it.

The slab at the bottom is what a language model is actually doing, and taking the subject in the other direction is what produces the reader who can name four architectures and cannot say why the sentence about 4181 came out the way it did.

What to open in 2026

A tokenizer is the one piece of this you can hold. tiktoken, free and open source as of 2026, splits a string exactly the way the model will and hands back the pieces, which replaced counting words and hoping. Run a paragraph of English and the same paragraph in Persian through it once and the window arithmetic stops being an abstraction.

Hugging Face is where the weights, the tokenizer and the model card live together as of 2026, and it replaced the paper with no artefact attached to it. Free to browse and to download; the trap is reading open weights as open permission, because a good number of the licences there forbid commercial use in plain language.

Ollama runs a small model on your own machine, free and open source as of 2026, and it replaced compiling the runtime by hand. It earns its place on this page for one reason: it is where the sampling setting is a number you type rather than a thing you read about, and watching the same request answer differently at two settings teaches the previous section in about four minutes.

None of which answers the question that follows from all of it. If the mechanism explains the failures, it should also say which of them get smaller with a larger model and which are the shape of the thing and will still be here in ten years. Some of the second kind are currently sold as the first kind. The place that question has been asked for longest is models learned from data rather than written by hand, which is the older half of this subject and the half with measurements in it, and it stops being a question about reading at all at the point where nothing is read by a person, which is a model given tools and allowed to act.

Alongside this

Above this