Stage 2 · Teens · Foundations

What Is a Language Model?

The core idea behind every LLM: predicting the next token.

A large language model (LLM) is, at its core, a system trained to do one thing extremely well: predict what text comes next, given some text so far.

That's it. Everything else — writing essays, answering questions, generating code, holding a conversation — is that same capability, applied over and over, one token at a time.

Next-Token Prediction
"The cat sat on the ___"
mat
42%
floor
21%
sofa
14%
roof
9%
moon
2%

The model assigns a probability to every possible next token, then one is sampled.

Lookup vs. Next-Token Guess
"Capital of France?"
DATABASE
ParisBerlinTokyo
Exact hit
LLM
Paris
Seen thousands of times — the continuation is extremely peaked.

A database either has the row or it doesn't. The model always generates something that looks like an answer.

The model doesn't "know" facts the way a database does. A database stores exact records and either has an entry for your query or doesn't — it never guesses. An LLM has instead learned statistical patterns from enormous amounts of text — which words tend to follow which other words, in which contexts — and it generates plausible continuations from those patterns.

This is why LLMs can sometimes be confidently wrong: they're not looking anything up in a table, they're predicting what sounds right based on patterns learned during training. On common, heavily-repeated facts ("the capital of France"), that pattern is extremely reliable because the model has seen it thousands of times. On obscure or made-up specifics it has never actually seen, the model can still produce a specific-sounding, confident answer — a hallucination — because generating a plausible-shaped response is exactly what it was trained to do, regardless of whether the underlying fact exists.

Scale & Reliability
Small / on-device (on the order of 1B params)
Typical of compact models that can run on a phone or laptop.
Capable open-weight (tens to hundreds of billions)
A common range for strong publicly released models — exact counts vary by family and year.
Frontier-scale (hundreds of billions to ~1T+, estimated)
Labs rarely publish exact counts, and the numbers shift every generation. Treat this as an order-of-magnitude sketch, not a spec sheet.
A "parameter" is one adjustable number in the model's weights — learned during training to help predict the next token. Bar lengths above are on a log scale: a jump from ~1B to ~1T is a thousand-fold increase, not a thousand-times-taller bar. Published sizes change quickly; the useful idea is the scale gap, not any particular headline number. More parameters generally means more capacity — and more compute for both training and inference.

Compare model scale, and see the same model be reliable on one question and confidently wrong on another.

What "large" actually means. The "large" in LLM refers to the number of parameters — individual adjustable numbers in the model's weights, tuned during training to help it predict the next token well. Each parameter is small on its own (a single float), but there are a lot of them.

Published sizes change every generation, and labs often don't share exact counts, so treat the following as orders of magnitude rather than a spec sheet: compact on-device models are often around a billion parameters; strong open-weight models are typically tens to hundreds of billions; frontier-scale models are estimated in the hundreds of billions to around a trillion. The useful takeaway is the jump: going from a small model to a frontier one is roughly a thousand-fold increase in the number of learned weights working together on every prediction.

📝

Later training stages — instruction-tuning, preference training (RLHF), and reasoning training — still predict the next token. They change which continuations are likely (a chat reply instead of a raw completion; a refusal instead of a harmful continuation). The mechanism stays the same; the data and objectives change. We'll come back to this in Reasoning Models and Safety.

💡

A useful mental model: an LLM is an extremely sophisticated autocomplete, trained on a huge fraction of human writing — not a fact database with a lookup step.

Check your understanding
1. What is the fundamental task an LLM is trained to perform?
2. In the reliability example, the model gets "capital of France" right but confidently invents a specific name and date for a made-up company's third employee. Why the difference?
All lessons in Stage 2: How AI works