Module FT15 — CoT Distillation and Rejection-Sampling FT

CoT Distillation and Rejection-Sampling FT

The two cheaper-than-RL routes to a reasoning small model. CoT distillation SFTs a student on a strong teacher's <think> traces — no RL — which is how DeepSeek-R1-Distill-Qwen-32B beat OpenAI o1-mini. Rejection-sampling FT (RFT/RAFT) generates candidates, filters by a verifiable reward, and retrains on the winners — simpler and more stable than GRPO, and per arXiv:2504.11343, surprisingly competitive with it. The three-way decision: distillation vs RFT vs GRPO.

75
minutes
8
artifacts
6
sub-sections
FT14 gave you GRPO — the most powerful, most expensive, most unstable tool in the course. FT15 answers the question that follows: can you get reasoning into a small model without paying the full RL cost? Yes, two ways. CoT distillation borrows reasoning traces from a strong teacher (R1, o1, Claude/GPT with thinking) and SFTs a smaller student on them — no reward model, no policy gradient, no KL anchor. This is the move that produced DeepSeek-R1-Distill-Qwen-32B, which beats OpenAI o1-mini on several benchmarks via SFT on ~800K curated reasoning samples — the headline that made distillation the standard, accessible recipe. Rejection-sampling fine-tuning (RFT/RAFT) is the middle path: generate candidates with the current model, filter by a verifiable reward, retrain on the winners — same rollouts/reward as GRPO but a radically different training step (SFT, not policy gradient). Per arXiv:2504.11343, RFT is surprisingly competitive with GRPO and PPO on math reasoning, making it a legitimate terminal technique, not just a warmup. The module teaches the three-way decision — distillation vs RFT vs GRPO — by teacher availability, reward verifiability, and compute/stability constraints, plus the hybrid thinking-toggle models (Qwen3) and thinking budgets for adaptive compute.
Key Claims
Load-Bearing Claims

CoT distillation is the cheapest path to a reasoning small model that works at scale: a strong reasoning teacher (DeepSeek-R1, o1, Claude/GPT with thinking) emits ... traces, the traces are curated (verified correct, deduplicated, difficulty-balanced), and a smaller student SFTs on them. No RL in the training loop — no reward model, no policy gradient, no KL anchor. The teacher did the expensive search once at data-generation time; the student imitates. This is how the open ecosystem got small reasoning models cheaply. Distillation is steering (FT00): the student's base already has latent math/code capability from pretraining; the teacher's trace routes probability mass through those pathways reliably. The limit: the student cannot exceed the teacher (imitation has a ceiling) — to push past the teacher you need RL on the student's own rollouts (RFT or GRPO).

The headline result: DeepSeek-R1-Distill-Qwen-32B beats OpenAI o1-mini on several benchmarks (incl. AIME 2024 and MATH-500), achieved via SFT on ~800K curated reasoning samples distilled from R1 — NO RL on the student. A 32B model trained with nothing more than supervised fine-tuning on a stronger model's traces outperforms a frontier compressed-reasoning product. This single fact made distillation the default, accessible recipe. The R1-Distill family (Qwen 1.5B–70B, Llama 8B/70B) demonstrated the recipe scales from consumer-GPU sizes to frontier-adjacent quality.

Rejection-sampling fine-tuning (RFT / RAFT) is the middle path: iteratively fine-tune on only POSITIVELY-REWARDED candidates. Generate N candidates per problem with the current model, filter by a verifiable reward (math checks, code passes tests, answer matches), retrain (SFT) on the winners, repeat. Same data-generation machinery as GRPO (rollouts, verifiable reward) but a radically different training step: GRPO computes a policy gradient over ALL rollouts (learns from successes AND failures); RFT DISCARDS the failures and supervises on the successes only. You keep the reward; you discard the gradient noise.

The arXiv:2504.11343 finding: a simple rejection-sampling baseline is SURPRISINGLY COMPETITIVE with GRPO and PPO on math reasoning (same base/data/compute) — close enough that RFT's simplicity and stability make it a legitimate TERMINAL choice, not merely a warmup before 'graduating' to GRPO. RFT is cheaper (no policy-gradient machinery, no critic, no KL tuning) and structurally more stable (the training step is SFT, which does not diverge the way policy gradients do; RFT's worst cases — small accepted set, wrong reward — are diagnosable data problems, whereas GRPO's worst case is a silent mode collapse that ruins the model while the reward looks fine). RFT trades expressivity (ignores failures) for stability + diagnosability. Simpler methods should not be dismissed.

The three-way decision — distillation vs RFT vs GRPO — by three axes: (1) strong teacher available? Yes → distillation (cheapest, consider first). (2) reward verifiable? Yes → RFT & GRPO available; No → FT13 preference territory, not reasoning FT. (3) compute/stability: constrained/must-not-diverge → RFT; large budget/willing to tune KL/push frontier → GRPO. In one line: distillation = cheapest (have teacher, don't need to exceed it); RFT = middle (own data, reward filter, no RL instability); GRPO = most powerful/expensive (push beyond both). A defensible stack: distill first → RFT to self-improve → GRPO only if RFT plateaus and budget remains. Each stage optional; many production reasoners stop at distillation.

Hybrid models (Qwen3) can toggle thinking on or off per request from the SAME weights — controlled by a control token / system instruction, not a separate model — avoiding the always-on latency tax of a reasoning model that always emits a long block. Thinking budgets make this continuous: a token budget for thinking (think up to N tokens, then answer) enables adaptive compute — more on hard problems, less on easy ones. A hybrid student is trained on a MIX of thinking and non-thinking traces, so it learns both modes and the ability to choose.

After This Module
01
State the two cheaper-than-RL routes to a reasoning small model — CoT distillation and rejection-sampling fine-tuning (RFT/RAFT) — and why both matter even after GRPO (FT14) is on the table.
02
Describe the DeepSeek-R1-Distill pipeline: a strong reasoning teacher emits <think>...</think> traces, curated to ~800K samples, and a smaller student SFTs on them — NO RL required — yielding R1-Distill-Qwen-32B, which beats OpenAI o1-mini on several benchmarks.
03
Distinguish RFT/RAFT from full RL: iteratively fine-tune on positively-rewarded candidates only (generate → filter by reward → retrain on winners), and explain why it is simpler and more stable than GRPO/PPO while remaining a legitimate terminal technique per arXiv:2504.11343.
04
Make the three-way decision — distillation vs RFT vs GRPO — from compute budget, stability requirements, and whether a strong teacher is available.
05
Explain the thinking-mode toggle in hybrid models (Qwen3) and thinking-budget mechanisms for adaptive compute.
06
Spot the anti-patterns: distilling from a weak teacher, RFT without reward verification, ignoring RFT's stability advantage over GRPO, and treating distillation as merely a warmup for RL.
Artifacts
01
Teaching Document
~3,200 words; 6 sub-sections — the problem (GRPO is expensive), CoT distillation (teacher generates traces, student SFTs, no RL), the R1-Distill-Qwen-32B headline result (beats o1-mini via SFT on ~800K samples), rejection-sampling FT (generate → filter by reward → retrain on winners; arXiv:2504.11343 competitive with GRPO), the three-way decision (distillation vs RFT vs GRPO by teacher/reward/budget), the thinking-mode toggle (hybrid Qwen3, thinking budgets), anti-patterns and key terms
READ
02
Diagrams
5 Mermaid diagrams (dark #14141f/#5eead4) — the CoT distillation flow (teacher generates traces → student SFTs, no RL); the RFT loop (generate → filter by reward → retrain on winners, with the GRPO comparison); the decision tree (distillation vs RFT vs GRPO by three axes); the R1-Distill headline result (32B SFT-only beats o1-mini); the thinking-mode toggle (hybrid model, thinking budgets)
READ
03
Slide Deck
12 reveal.js slides using the exact course dark template — title, the problem, CoT distillation, R1-Distill headline, RFT/RAFT, arXiv:2504.11343, the decision, thinking toggle, anti-patterns, lab, objectives; footer 'Course 3 — LLM Fine-Tuning Masterclass · FT15 · Pillar 4'
READ
04
Teaching Script
~2,000-word teaching script (~45 min at 140 wpm) with [SLIDE N] cues — verbatim transcript covering all six sub-sections; speaker-ready
READ
05
Flashcards
23 flashcards (c3::ft15::*) — the two cheaper routes, R1-Distill pipeline, RFT loop, arXiv:2504.11343, the three-way decision, thinking toggle/budgets, anti-patterns, and the analysis-level cards on steering-vs-teaching, RFT's structural stability, and terminal-technique framing
TEST
06
Exam
15-question exam, exact 3 recall / 6 application / 6 analysis Bloom split, 45 min, 70% pass — covers the two routes, R1-Distill, RAFT finding, the decision, weak-teacher diagnosis, RFT-without-verification diagnosis, RFT-vs-GRPO structural difference, and the 'distillation is terminal not warmup' analysis
TEST
07
Lab Spec
'Distill Reasoning' lab — generate CoT traces from a strong teacher (API or local R1-Distill) on 200 GSM8K problems, curate (verify answers), QLoRA-SFT a small student (Qwen2.5-1.5B / MiniCPM5-1B), merge, and measure the GSM8K lift vs the un-distilled base. Full runnable Python (TRL SFTTrainer + PEFT + bitsandbytes + OpenAI/vLLM teacher), <45 min on consumer GPU or Colab T4. Stretch goals: RFT variant, teacher-quality sweep, trace-length curation, non-thinking control, corpus scaling, GGUF export
DO
08
Module Web Page
Single-file HTML hub
HERE