How AI is Trained
From random numbers to a useful assistant
Where does knowledge come from?
Teaching factory
Weights are not a fact table
Pretraining encodes statistical structure in parameters. Models can generalize from it, but cannot reliably retrieve every learned claim like a database row.
Post-training steers behavior
SFT and preference methods can improve instruction following and shape refusals, tone, and tool behavior; the exact recipe differs by system.
Objectives are proxies
Lower next-token or preference loss is not proof of truth, safety, or task success. Each deployment still needs representative evaluations.
Phase 1 / 7
Collect Training Data
Training corpora can combine web text, books, papers, code, licensed collections, and purpose-built examples. Teams filter and deduplicate data, but quality, representation, consent, privacy, and licensing remain substantive design choices—not cleanup details.
Raw text arrives on the loading dock. No learning yet.
Start marker for the teaching sequence.
Advance phases to draw the illustrative stage sequence.
Not one continuous loss curve: each stage may optimize a different objective.
Do not compare unlike objectives
Pretraining cross-entropy, an SFT loss, a preference objective, a reinforcement learning reward, and a task-success eval answer different questions. A lower number in one stage does not prove that it contributed more than another stage. Compare checkpoints on held-out capabilities, safety, and product tasks instead.
Key Insight
Check your understanding
1/5What objective is commonly used to pretrain a causal language model?
Sources, scope & review statusVerified Jul 29, 2026
Claims this lesson makes
- Stable conceptModern assistants commonly combine large-scale pretraining with one or more post-training stages.
Scope: The exact recipe, datasets, and optimization stages differ by model developer.
- Stable conceptSupervised instruction tuning, RLHF, AI-feedback methods, and direct preference optimization are distinct post-training approaches rather than interchangeable names for one objective.
- Stable conceptReasoning-focused training and extra inference-time computation are separate levers: training can incentivize reasoning behavior, while serving can allocate more computation to a particular answer.
Scope: The staged chart does not compare real loss values across objectives; its values are an illustrative progress signal only.
Primary reading
- Training language models to follow instructions with human feedbackOpenAI · paper
- Constitutional AI: Harmlessness from AI FeedbackAnthropic · paper
- Direct Preference Optimization: Your Language Model is Secretly a Reward ModelStanford University · paper
- DeepSeek-R1: Incentivizing Reasoning Capability in LLMs via Reinforcement LearningDeepSeek AI · paper
Next content review: 2027-07-29. Source links establish the lesson's claims; interactive numbers remain labeled simulations unless explicitly identified as measured data.