Topic

How AI Actually Works

The mechanism behind large language models, explained for people who run businesses rather than build them.

Evergreen 12 min read11 articles in this topic

Questions this answers

  • What is AI actually doing when it answers a question?
  • Why does it sound so confident when it is wrong?
  • Why does it forget things halfway through a conversation?
  • Why does it know nothing about my business?
  • What decides what it costs?

Almost everything confusing about AI stops being confusing once you know what it is doing underneath. Not the mathematics — you will never need that. Just the shape of the thing: what it takes in, what it produces, and what it is optimising for. That single piece of understanding is what separates people who use AI well from people who are alternately amazed and betrayed by it.

This page is the whole picture in one place. It links out to the detailed treatment of each part, but you can read it start to finish and come away able to explain AI to somebody else, which is a decent test of whether an explanation worked.

It predicts text. That is the whole trick.

A large language model does one thing: given some text, it predicts what should come next. Then it does it again, with the text it just produced now part of the input. Word by word — fragment by fragment, really — an answer assembles itself out of several hundred repetitions of that single operation.

That sounds far too simple to produce what it produces, and the surprise is the entire story of the last few years. It turns out that predicting text well, across a large enough body of text, requires learning an enormous amount about how the world is described. To predict the end of "the contract was void because the party had not reached the age of", a system has to have absorbed something about contracts. The capability is a side effect of the prediction getting very good.

The consequence to hold ontoEverything the model produces is a prediction about what text should come next — including the parts that are true. There is no separate step where it checks a fact. Accuracy and fluency come from the same process, which is why they can come apart so completely and so convincingly.

It reads in fragments, not words

The model does not see characters or words. It sees tokens: chunks of text produced by a fixed vocabulary built during training. Common words get a slot of their own, so "the" is one token. Anything unusual gets assembled from pieces, which is why a surname or a part number can cost four or five tokens where a common verb costs one.

DefinitionToken
The unit of text an AI model actually processes — roughly three-quarters of a word in English. It is also the unit you are billed in, which is why an abstract technical detail turns up on your invoice. Full definition
See it happen
Try:
24tokens
57characters
2.4chars / token
$0.79per 1,000 sends
Send the John son quote by Frid ay and follow up next week .

Approximate Real tokenizers differ slightly between models, and the cost figure is illustrative — check current rate cards before budgeting. The pattern holds regardless: common words are one token, rare words split apart, and punctuation counts.

Type anything and watch where the boundaries fall. Try a name, then a common word, and notice the difference.

Tokens matter commercially for two reasons. They are the billing unit, so the shape of your text determines your bill — and text dense with names, code, or identifiers costs meaningfully more than ordinary prose of the same length. And they are the unit of the memory limit, which is the next thing that trips people up.

It has no memory between calls

This is the most counterintuitive part, and it explains a great deal of otherwise baffling behaviour. The model does not remember your previous message. It does not remember anything. Each call is independent, and the only reason a conversation feels continuous is that the entire history is re-sent every single time you press enter.

That history has to fit in the context window: the total working space for one call. Everything shares it — your document, the standing instructions the operator wrote, the conversation so far, the retrieved reference material, and the space needed for the answer itself. When the conversation grows past it, the earliest parts fall out, and the model loses them completely rather than gracefully.

Watch it overflow
Context window 0 / 400 tokens
Step through a conversation and see the earliest messages drop out of memory.

Two things follow directly, and both surprise people:

  • Long conversations cost far more than short ones — turn ten pays for turns one through nine all over again, so cost grows with the square of the length rather than in step with it
  • Quality degrades in the middle of very long inputs before you ever hit the limit, because models attend less reliably to material buried far from the start and the end

What it knows, it learned once, from text

Training happens once, on a fixed snapshot of text, and then stops. Everything the model appears to know came from that snapshot. This has three consequences that matter more than any benchmark.

  1. There is a cutoff, and it does not announce it

    Anything after the training snapshot simply is not there. Asked about it anyway, the model will often produce something plausible rather than admitting the gap — which is the hardest kind of error to catch, because it looks exactly like the answers that are right.

  2. Coverage is wildly uneven

    Software, law, medicine and marketing generated enormous volumes of public text. Specialist trades, regional regulation, and niche manufacturing generated very little. The model is equally fluent across all of them and reliable only in some, and nothing in its tone distinguishes the two.

  3. It knows nothing about your business

    Your prices, policies, processes, and client history were never in the training data. No amount of prompting recovers information that was never there — which is what retrieval exists to solve.

Retrieval: how it works with information it never learned

Since the model cannot know your documents and cannot hold everything at once, the standard solution is to look things up at question time. Index your material, find the passages relevant to the question being asked, put those passages into the prompt, and let the model answer from them. That is retrieval-augmented generation, and it is the architecture behind essentially every "AI that knows your business" product.

Retrieve, augment, generate
Ask something:

“How much do you charge if I live outside town?”

  1. 1

    Retrieve

    Search the knowledge base for passages that look related to the question.

  2. 2

    Augment

    Paste those passages into the prompt, above the original question.

  3. 3

    Generate

    The model answers using the passages, not its training data.

Walked through on a small knowledge base — including what happens when retrieval finds nothing.

The important property is that correcting an answer means editing a document rather than retraining anything. That is what makes it practical for a business whose facts change. It is not a guarantee of correctness — retrieval can fetch the wrong passage, and the model can still summarise a right passage badly — but it largely removes invention, which is the failure that damages trust fastest.

Why it fails in exactly the ways it does

Every characteristic failure follows from the mechanism, which is why understanding the mechanism is worth twenty tips about prompting.

What you seeWhat is actually happening
Confidently states something falsePrediction produced a fluent continuation. There is no fact-checking step to fail, so nothing flags it.
Forgets what you told it earlierThat part of the conversation fell out of the context window, and the model has no way to know it is missing.
Invents a citation, statistic, or caseIt has learned the shape of citations extremely well. The shape is what it reproduces when it lacks the specific.
Great on general questions, wrong on your industryUneven training coverage. Fluency is constant; reliability is not.
Different answer to the same questionGeneration samples from a probability distribution rather than picking one fixed answer.
Agrees when you push back on a correct answerAgreement is also a well-represented pattern in the training text. A retraction is not evidence.
The mechanism predicts the failure modes, which is why it is worth knowing.
Why the same question gives different answers

Prompt “The shipment has been ___

Medium: the default range. Natural-sounding, still on topic.

  • delayed54%
  • ready24%
  • delivered11%
  • approved6%
  • cancelled3%
  • reconsidered1%
  • incandescent1%
Drag the sampling temperature and watch the distribution reshape.

What follows for using it well

The mechanism points directly at what works.

Plays to the mechanism

  • Give it the source material rather than relying on recall
  • Ask for shorter outputs — output is the expensive, error-prone side
  • Start fresh conversations rather than letting one run for hours
  • Verify anything specific: numbers, names, dates, citations
  • Use it where being wrong is cheap and recoverable

Fights the mechanism

  • Expecting it to know your prices, policies, or history
  • Trusting a confident tone as a signal of accuracy
  • Asking "are you sure?" instead of checking a source
  • Letting one conversation run indefinitely and expecting recall
  • Assuming a better model will fix a missing-information problem
How does AI actually work, in simple terms?

It predicts what text should come next, one fragment at a time, based on patterns learned from an enormous amount of writing. Each fragment it produces becomes part of the input for the next prediction, so a full answer assembles from hundreds of repetitions of that one operation. Everything else — the apparent reasoning, the knowledge, the tone — is a consequence of that prediction becoming very good.

Does AI understand what it is saying?

Not in the way a person does, and the honest answer is that the question is harder than either camp admits. What is definitely true and practically useful: it has no beliefs about the world, no way to check a claim against reality, and no internal sense of confidence separate from how well the text fits the pattern. Whatever it is doing, it is not verification — and that is the part that changes how you should use it.

Why does AI make things up?

Because inventing and recalling are the same operation. When the training data contained the fact, prediction reproduces it; when it did not, prediction produces something that fits the pattern anyway. There is no internal switch between "I know this" and "this sounds right", which is precisely why fabrications arrive in the same confident register as facts.

What is the difference between AI, machine learning, and an LLM?

AI is the broad field. Machine learning is the approach where systems learn patterns from data rather than following rules someone wrote. A large language model is one kind of machine learning system — trained on text, predicting text. When a business tool says "AI", it almost always means an LLM, usually somebody else's, reached over an API.

Do I need to understand how AI works to use it?

You need this much and no more. Knowing that it predicts rather than retrieves tells you to verify specifics. Knowing about the context window tells you why it forgets. Knowing about training data tells you why it does not know your business. Those three facts prevent most of the ways people get burned, and none of them require any technical background.

The whole thing in six lines

  • It predicts the next fragment of text, repeatedly. That is the entire mechanism.
  • It reads in tokens, which is what you are billed in and what the memory limit is measured in.
  • It has no memory between calls — conversations work by re-sending the whole history each time.
  • It learned once, from a fixed snapshot, so it has a cutoff, uneven coverage, and no knowledge of your business.
  • Retrieval is how you give it information it never learned, and it is correctable by editing a document.
  • Fluency and accuracy come from the same process, so a confident tone tells you nothing about whether it is right.

Everything we have written on this

The structured version

Same ground as a free course — objectives, sequence, and a record of what you have finished.

  • What AI Actually Is The one idea that makes every other AI behaviour make sense: these systems predict the next likely piece of text, very well, at enormous scale.
  • Tokens and the Context Window Tokens are what AI reads and what you pay for. The context window is how many it can hold at once. Together they explain cost, limits, and memory loss.
  • Why AI Gets Things Wrong Where made-up answers come from, which tasks are most at risk, and the handful of habits that catch almost all of them.
  • Agents: When AI Stops Answering and Starts Doing An agent is a model given tools, permission, and a loop. That is the whole idea — and each of those three words is where the risk lives.

Tools for this