What the model is, how it is built, and how it begins to act
2026-09-15
If you type into a system like ChatGPT, what exists on the other side, how was it created, and what happens to your text?
The website tells the same story with the mathematics: The Short Story.
How a model is built Text is prepared, cut into tokens, fed to a neural network, and training sets the network’s numbers.
What happens when we use it Your text becomes the model’s context; it produces one token at a time; its numbers stay fixed.
How software makes an agentic system Tools, stored state, and a loop around the same fixed model.
The code says how to compute. Training discovered the parameter values. Inference uses them without changing them. The application adds instructions, conversation management, tools, and other software around the trained model.
Karpathy, Intro to Large Language Models (2023) · Karpathy, llama2.c · lesson: How Pretraining Works
Text is gathered from permitted sources, extracted from raw pages, filtered by language and quality, deduplicated, then tokenized. What goes in shapes what can be learned.
FineWeb is one open, documented example. Closed corpora are often not disclosed.
Penedo et al., The FineWeb Datasets (2024) · lesson: From Text to Numbers
The tokenizer cuts text into entries of a fixed vocabulary; each entry has an index. The split and the numbers above are illustrative.
5109 is not larger, later, or more than 88. It only says which entry.
Radford et al., Language Models are Unsupervised Multitask Learners (2019) · lesson: From Text to Numbers
Row 3912 of the embedding table is a list of learned numbers, not a definition. Training changed them because that improved prediction.
Later layers make the vector depend on its context: ␣bank starts the same in “river bank” and “central bank” and ends different.
Bengio et al., A Neural Probabilistic Language Model (2003) · lesson: Tokens, Embeddings, and the Context Window
One piece: multiply the inputs by learned weights, add a bias, apply a fixed nonlinear function. Written out: h = σ(Wx + b). Large networks stack millions of such pieces, and training sets the weights.
Lesson: Neurons, Layers, and Learning
Recurrent networks pass a running state one position at a time: distant positions connect only through every step between them, and training cannot compute positions in parallel.
Bengio et al. (2003) · Vaswani et al., Attention Is All You Need (2017), §1 · lesson: Why Transformers
Compare the destination with each permitted source to get a score. Softmax turns the scores into weights that sum to one. Combine the sources’ vectors with those weights to update the destination. The weights explain no more than that.
Vaswani et al. (2017), §3.2 · Bahdanau, Cho, and Bengio, Neural Machine Translation by Jointly Learning to Align and Translate (2015) · lesson: How Self-Attention Moves Information
Attention Is All You Need (2017) built the architecture around attention and per-position computation. During training on a known sequence, positions compute in parallel; generation is still one token at a time. Causal: a position never sees later tokens.
Vaswani et al., Attention Is All You Need (2017) · lesson: Why Transformers
The loss scores how little probability went to the token that actually came next. Backpropagation computes gradients. The optimizer changes the parameters. Repeated at enormous scale, this produces the base model.
Karpathy, Deep Dive into LLMs like ChatGPT (2025) · Radford et al. (2019), §2 · lesson: How Pretraining Works
It captures the statistical structure of text: grammar, meaning, recurring facts, conventions of argument.
It can reproduce text it saw, but it stores no verified, searchable record of the corpus.
Given an instruction, it may answer it, continue it, or produce more instructions like it.
Radford et al. (2019) · Brown et al. (2020) · Carlini et al., Extracting Training Data from Large Language Models (2021) · lesson: How Pretraining Works §6–§7
Data: a very large curated corpus
Objective: predict the next token
Changes: the trainable parameters θ
Data: prompt → desired response
Objective: the same next-token loss, on the response
Changes: the same θ
Data: comparisons, or checkable outcomes
Objective: further shape behavior with the signal
Changes: the same θ again
Same loss, gradients, and optimizer. Different data and objectives. Demonstrations, preference comparisons, and checkable rewards are three different routes; providers combine and vary them.
Ouyang et al., Training language models to follow instructions with human feedback (2022) · Rafailov et al., Direct Preference Optimization (2023) · lesson: Post-training
Pretraining rewards plausible continuation; nothing in it checks truth.
Post-training makes answering the default, so a well-formed answer can outrun what the parameters contain.
Recipes can teach abstention. Retrieval and tools supply inspectable evidence, which still has to be evaluated.
Lewis et al., Retrieval-Augmented Generation (2020) · lesson: How Pretraining Works §7, Using Models Well
One token per pass, appended, then again. Earlier keys and values are cached. Nothing in θ changes.
Shazeer, Fast Transformer Decoding (2019) · lesson: Softmax, Sampling, and Temperature
Reinforcement learning against automatically checked outcomes, such as a math answer or a passing test, can reward useful intermediate reasoning before the final answer.
DeepSeek-R1 is one published recipe: R1-Zero applied reinforcement learning directly to the pretrained base model, with no supervised fine-tuning first; the released R1 added supervised stages.
One route used by some reasoning-oriented models. Not a stage every model passes through.
DeepSeek-AI, DeepSeek-R1 (2025) · lesson: Post-training §7
Parameters stay fixed. Extra intermediate tokens give the same model more sequential computation before an answer. Providers expose it as effort or thinking levels; what is shown of the reasoning depends on the product. More reasoning is not a guarantee.
Anthropic, Thinking · Google, Gemini thinking · OpenAI, Reasoning models (docs, accessed 2026-09-15)
Training changes parameters. A request fills the context for one step. Software keeps state outside and can supply it again. Only the first is the model changing.
Anthropic, Context windows (docs, accessed 2026-09-15) · lesson: From Assistant to Agent §7
“What is the weather in Bogotá today?” The parameters cannot contain it.
weather(location="Bogotá")Anthropic, Tool use with Claude (docs, accessed 2026-09-15) · lesson: From Assistant to Agent §2
Workflow: the steps are written in advance. Agent: the model chooses the steps and tools, within limits. Either way, the same fixed model is called again and again.
Anthropic, Building effective agents (2024) · lesson: From Assistant to Agent §4–§5
Project instructions and skills are context loaded for the task, not retraining. Permissions live in the software. A passing test establishes only what that test checked.
Anthropic, Claude Code documentation (accessed 2026-09-15) · lesson: From Assistant to Agent §8–§11
A learned next-token predictor: code plus parameters, set by pretraining and post-training. Once trained, the parameters are fixed; what is request-specific arrives through context. Software adds tools, state, and a loop.
Backup slide, not in the prepared route
Everything around the model changes what the model is given or what is done with its output. None of it changes the model.
Lesson: Post-training §9 (model versus assistant)