Imitation learning is the right tool when there is a well-defined correct output to imitate.
Pretraining (the companion book) fits to the distribution of tokens on the open web by maximum likelihood: the model learns to predict what token is likely to come next in text written by someone, for some purpose. Supervised fine-tuning (the companion book) narrows this by further maximizing likelihood on a curated dataset of instruction-response pairs, so the model learns to imitate what a demonstrator wrote in response to a given prompt. Both stages share the same mathematical shape: minimize cross-entropy between the model’s distribution and a fixed empirical distribution of target text (the companion book). This is imitation learning — the model is trained to reproduce a distribution of demonstrations.
Imitation learning is the right tool when there is a well-defined correct output to imitate. It is a poor fit for a large fraction of the prompts a deployed assistant actually receives. Consider “explain quantum entanglement to a 10-year-old” or “write a apology email to a client for a missed deadline.” There is no single correct response — there is a wide space of acceptable responses that vary in quality along axes like helpfulness, clarity, honesty, and harmlessness, and a much smaller space of poor responses (too technical, rude, evasive, fabricated). SFT trains the model to imitate whatever example happens to be in the dataset for that prompt, which is at best a good response, not the target distribution of good responses. Two consequences follow directly from the cross-entropy objective itself. First, MLE under a single reference response penalizes any deviation from that response’s exact phrasing, even deviations that would be equally good or better — the loss has no notion of “equally acceptable alternative.” Second, when human demonstrators disagree about the best response to a prompt (which they routinely do), the empirical target distribution SFT fits becomes a mixture over annotators’ idiosyncratic styles, and likelihood maximization under a mixture tends to average across modes rather than commit to any one of them — the well-known mode-averaging behavior of MLE under a misspecified or multimodal target.
The alternative is to give up on eliciting one ideal response per prompt and instead ask a much easier question of human annotators: given two responses to the same prompt, which one is better? This is a substantially lower-effort and higher-reliability task than authoring an ideal response from scratch. Writing a excellent response requires expertise, effort, and a firm view of what “excellent” means for that prompt; comparing two already-written responses requires only recognizing which one is better, a judgment humans make quickly and with reasonably high inter-annotator agreement even when they would not agree on how to write the ideal answer themselves. This asymmetry — comparison is cheap and reliable where generation is expensive and inconsistent — is the empirical premise behind every method in this article. Instead of collecting more demonstrations, we collect preference judgments: pairs of responses to the same prompt , each labeled with which one a human (or, as discussed in the companion book, an AI evaluator) preferred. The companion book is about how to turn a dataset of such pairwise preferences into a training signal that shapes the policy — first indirectly, through a learned reward model and reinforcement learning (Sections 2–3), and then directly, without an explicit reward model or RL loop at all (the companion book example).
It is worth being precise about what “alignment” means in this narrower, technical sense used throughout the companion book: adjusting , starting from an SFT checkpoint, so that its output distribution more closely reflects human preferences along axes like helpfulness and harmlessness, as measured by a preference dataset. This is a much narrower claim than “the model shares human values” — it is a statement about optimizing a specific, imperfect, learned proxy for preference, a point that becomes mathematically important in the companion book example when the reward model’s imperfection has to be actively guarded against, not just noted in passing.
Continue with the book
Explore the full treatment, worked examples, and exercises in LLMs Derived.
Companion article for LLMs Derived, published by Choral Software. Article text and original examples © 2026 Choral Software. All rights reserved.
