← The Synthetic Self

[ Plain-English AI guide ]

How do large language models learn?

They are trained to predict the next piece of text, then repeatedly adjusted to make better predictions. That simple objective, applied at vast scale, is the starting point—not the whole story—of modern generative AI.

Mayone Maha Rajan · The Synthetic Self

Short answer

A large language model (LLM) learns by seeing an immense number of text examples and trying to predict what comes next. When its prediction differs from the text that actually followed, a mathematical training process adjusts its internal parameters so a better prediction becomes slightly more likely next time. Repeat that process across enormous quantities of text, and the model becomes good at producing continuations that resemble useful human language.

This is often called next-token prediction. It does not mean an LLM is merely guessing one isolated word at a time in the ordinary sense. Each new token becomes part of the context for the next one, allowing the model to build sentences, code, explanations, and longer arguments piece by piece.

1. Text is broken into tokens

A model does not receive a sentence as a human reader does. Its input is split into tokens: units that may be words, parts of words, punctuation, or other small pieces of text. A prompt is therefore a sequence of token IDs. The model’s immediate task is to estimate which token is most likely to come next, given the tokens already present.

“The capital of France is” makes some continuations more likely than others. During training, the system can compare its probability distribution with the token that really followed in the training example. The comparison produces an error signal called loss.

2. The model improves through error correction

The loss is not a teacher’s explanation of why an answer was wrong. It is a number that measures how far the prediction was from the training example. An optimization method then changes the model’s adjustable values—its parameters—by very small amounts intended to reduce that loss.

Gradient descent is the basic idea behind those changes: calculate the local direction that would lower the error, then take a small step in that direction. Backpropagation is the efficient bookkeeping that computes how a final error should affect many parameters inside a neural network. The process is repeated over and over on batches of examples.

No one writes a separate rule for grammar, translation, persuasive prose, or every fact the model may later discuss. Many useful regularities are learned because representing them helps the system make better predictions. That is a mechanism, not a proof that the system understands language in the human sense.

3. Transformers help the model use context

Most modern LLMs use a family of neural-network designs called Transformers. Their central operation, attention, lets the model weigh relationships among tokens in the context when making the next prediction. It is one reason a model can connect a pronoun with an earlier noun, preserve a pattern in code, or respond to a detail that appeared earlier in a prompt.

Attention is not a tiny person inside the model deciding what matters. It is a learned numerical mechanism for weighting information. The original Transformer paper introduced an architecture based on attention mechanisms rather than recurrent or convolutional layers; later language models adapted and scaled related designs for text generation. [1]

4. Pretraining makes a language model; post-training makes an assistant

The long first stage is usually called pretraining. It gives a model broad predictive ability by exposing it to text at scale. A raw pretrained model is not automatically a useful conversational assistant; it may continue text in an unhelpful direction or fail to follow a request as a user expects.

Builders commonly add post-training: further training on demonstrations of desired responses and on preferences about which responses are better. Reinforcement learning from human feedback (RLHF) is one well-known approach. The details differ by model and provider, but the important distinction remains: pretraining develops broad language-model capability; post-training tries to shape how that capability is used in conversation. [3]

5. Why prediction can look like reasoning

To predict human writing well, a model has to capture many regularities found in human writing: syntax, common associations, the structure of arguments, styles of explanation, and patterns in code. That is why next-token prediction can produce behavior that looks startlingly competent. It can also solve some unfamiliar tasks from examples placed in its prompt, a behavior explored in large-scale language-model research. [2]

But an impressive answer is not, by itself, evidence that the model has grounded knowledge, independent judgment, or human-like understanding. Those are separate questions. A useful explanation should keep the training mechanism distinct from larger philosophical conclusions about minds.

6. Why fluent AI is not automatically factual

The basic training objective rewards a continuation that fits the context and training patterns. It is not, on its own, a live fact-checking system with direct access to the world. A model can therefore produce a coherent answer that is inaccurate, unsupported, or invented. Some products reduce that risk with retrieval, tools, source links, evaluations, and post-training, but those safeguards do not make verification unnecessary.

This is not an incidental concern. TruthfulQA, a research benchmark, was designed to test whether language models reproduce common human falsehoods and found that imitating web text is not the same objective as being truthful. [4] For consequential questions, check the underlying source rather than treating confident prose as evidence.

Where the book’s interpretation begins

The Synthetic Self calls a language model a “mirror of the human record.” That phrase is an interpretive lens, not a technical term. The established mechanism is simpler: models are optimized to capture predictive patterns in their training material, then often shaped further by human demonstrations and preferences. The book’s argument is that this mechanism has a human consequence: the systems can reproduce not only the useful patterns in our record, but also its omissions, contradictions, and distortions.

Keeping that boundary visible is part of the point. We should neither mystify the machinery nor pretend that a description of the machinery settles every question about intelligence, responsibility, or value.

Frequently asked questions

What is next-token prediction?

It is the task of estimating the most likely next token from the preceding context. In generation, the model repeatedly selects or samples a next token and adds it to the context, producing an answer one piece at a time.

What is gradient descent in simple terms?

It is an iterative error-reduction strategy. After measuring how wrong a prediction was, training computes a small change to the model’s parameters that should reduce similar error. It repeats that process many times rather than solving the entire problem in one step.

Do LLMs simply memorize the internet?

No. A model’s usual response process is not a search through a complete stored library of sentences. It learns distributed statistical patterns in its parameters, although models can retain some training examples and memorization is a real research and privacy concern. “Compression” is therefore a useful but incomplete analogy—not a literal description of a model as a zip file of the web.

[ Sources ]

  1. 1
    Attention Is All You Need · Vaswani et al. (2017)

    Introduced the Transformer architecture used throughout modern language modeling.

  2. 2
    Language Models are Few-Shot Learners · Brown et al. (2020)

    A primary account of large-scale autoregressive language-model training and evaluation.

  3. 3
    Training Language Models to Follow Instructions with Human Feedback · Ouyang et al. (2022)

    Documents supervised fine-tuning and preference-based post-training for instruction following.

  4. 4
    TruthfulQA: Measuring How Models Mimic Human Falsehoods · Lin, Hilton, and Evans (2021)

    A benchmark examining factual truthfulness and imitative falsehoods in language-model answers.