A base model fresh out of pre-training knows a surprising amount. Yet if you write “write quicksort in Python”, it may continue with whatever text is likely to follow — say, five more similar questions. A base model is a machine that continues documents, not an assistant that answers questions. All the training that closes this gap is called post-training, and at its centre sits reinforcement learning that uses human (or AI) judgement as the reward: RLHF (reinforcement learning from human feedback).
This lesson is the map for the whole track. We look at what post-training does, why the canonical recipe has the shape it does, and how that recipe has changed over eight years. The individual algorithms are derived and implemented one by one in the lessons that follow.
What post-training does: elicitation
Lambert reads post-training as elicitation. A base model already contains a great deal of intelligence and capability, and post-training amplifies and draws out the valuable behaviours among them. This view explains why models that start from the same base model can end up at very different levels depending on the post-training recipe.
The contrasting claim is the superficial alignment hypothesis (LIMA, Zhou et al. 2023): all capability comes from pre-training, post-training only teaches the format and style of conversation, and so about 1,000 well-chosen examples are enough. Lambert considers this hypothesis wrong. Change the data and the effect of post-training can become much larger, and especially in areas where RL runs for a long time, such as reasoning and agents, the difference post-training makes is anything but “superficial”.
The two views actually merge into one sentence. Post-training cannot add much new knowledge, but it greatly changes which behaviours the model performs and how often. Checking one’s work on a maths problem, trying a different approach when stuck, calling a tool to verify — these behaviours exist in the base model too, just rarely. RL raises their probability each time such a rare behaviour gets rewarded.
The canonical recipe: SFT → reward model → KL-regularised RL
The three stages that InstructGPT cemented in 2022 are still the skeleton of every recipe.
1. SFT (instruction tuning). Minimise the NLL of the response tokens on human-written (prompt, response) pairs (SFT lesson).
This model is the starting point for the later stages and becomes the reference policy .
2. Reward model. For a prompt, collect two responses: the one a person chose, , and the one they did not, . Train a model that outputs a scalar score with the Bradley–Terry loss (reward model lesson).
3. KL-regularised RL. Score the policy’s own responses with the reward model, and add a KL penalty so it does not drift too far from the reference policy.
This is optimised with PPO (KL-regularised RL lesson).
Half of understanding RLHF is knowing what each of the two terms in the third equation guards against. With only the first term, the policy finds strange outputs that the reward model mistakenly scores highly (repetition, flattery, excessive length, meaningless token strings). is a proxy objective trained only on responses near , and it cannot be trusted outside that distribution. The KL term is the constraint “optimise only inside the neighbourhood the reward model knows”. This tension becomes the subject of the over-optimisation lesson.
The map: stages and recipes
The figure below puts the stages that appear in today’s post-training on a single page. Switch between recipes and see which stages light up.
사전학습이 끝난 base model은 놀라울 만큼 많은 것을 안다. 그런데 “파이썬으로 퀵소트를 짜 줘”라고 쓰면, 그 뒤에 이어질 법한 텍스트, 예컨대 비슷한 질문 다섯 개를 더 늘어놓을 수도 있다. base model은 문서를 이어 쓰는 기계이지 질문에 답하는 조수가 아니다. 이 간극을 메우는 모든 학습을 사후학습(post-training) 이라고 부르고, 그 중심에 사람(또는 AI)의 판단을 보상으로 쓰는 강화학습, RLHF(reinforcement learning from human feedback) 가 있다.
이 레슨은 트랙 전체의 지도다. 사후학습이 무엇을 하는지, 정형 레시피가 왜 그런 모양인지, 그리고 그 레시피가 8년 동안 어떻게 변했는지를 본다. 세부 알고리즘은 이어지는 레슨에서 하나씩 유도하고 구현한다.
사후학습은 무엇을 하는가: elicitation
Lambert는 사후학습을 끌어내기(elicitation) 로 해석한다. base model 안에는 이미 많은 지능과 능력이 들어 있고, 사후학습은 그중 가치 있는 행동을 증폭해 꺼내는 일이라는 것이다. 같은 base model에서 출발해도 사후학습 레시피에 따라 결과 모델의 수준이 크게 달라지는 것을 이 관점으로 설명한다.
이와 대비되는 주장이 superficial alignment hypothesis(LIMA, Zhou et al. 2023)다. 능력은 전부 사전학습에서 오고, 사후학습은 대화의 형식과 스타일만 가르치므로 잘 고른 예시 1,000개 정도면 충분하다는 가설이다. Lambert는 이 가설이 틀렸다고 본다. 데이터를 바꾸면 사후학습의 효과는 훨씬 커질 수 있고, 특히 추론과 agent처럼 RL이 오래 돌아가는 영역에서는 사후학습이 만드는 차이가 결코 “표면적”이지 않다는 것이다.
두 관점은 사실 한 문장으로 합쳐진다. 사후학습은 새 지식을 많이 넣지 못하지만, 어떤 행동을 얼마나 자주 하게 할지는 크게 바꾼다. 수학 문제에서 검산하는 행동, 막히면 다른 접근을 시도하는 행동, 도구를 호출해 확인하는 행동은 base model에도 드물게 있다. RL은 그 드문 행동이 보상을 받을 때마다 확률을 올린다.
정형 레시피: SFT → 보상모델 → KL 정규화 RL
2022년 InstructGPT가 굳힌 세 단계는 지금도 모든 레시피의 뼈대다.
1. SFT (instruction tuning). 사람이 쓴 (prompt, 응답) 쌍으로 응답 토큰의 NLL을 최소화한다(SFT 레슨).
이 모델이 이후 단계의 출발점이자 기준 정책 가 된다.
2. 보상모델(reward model). 한 prompt에 대한 두 응답 중 사람이 고른 쪽 와 고르지 않은 쪽 을 모은다. 스칼라 점수 를 내는 모델을 Bradley–Terry 손실로 학습한다(보상모델 레슨).
3. KL 정규화 RL. 정책이 생성한 응답에 보상모델 점수를 주고, 기준 정책에서 너무 멀어지지 않게 KL 패널티를 건다.
이것을 PPO로 최적화한다(KL 정규화 RL 레슨).
세 번째 식의 두 항이 각각 무엇을 막는지가 RLHF 이해의 절반이다. 첫 항만 있으면 정책은 보상모델이 실수로 높게 쳐 주는 이상한 출력(반복, 아첨, 지나친 길이, 의미 없는 토큰열)을 찾아낸다. 는 근처의 응답으로만 학습된 대리(proxy) 목표이고, 그 분포를 벗어나면 믿을 수 없다. KL 항은 “보상모델이 아는 동네 안에서만 최적화하라”는 제약이다. 이 긴장은 과최적화 레슨의 주제가 된다.
지도: 단계와 레시피
아래 그림은 오늘날 사후학습에 등장하는 단계들을 한 장에 놓은 것이다. 레시피를 바꿔 가며 어떤 단계가 켜지는지 보자.
Check a few things.
- InstructGPT has only six stages, in a straight line.
- In Tülu 3 the reward model turns off and DPO and RLVR turn on. Preference learning is done without a reward model, and RL is used only for tasks where “is it correct?” can be judged by a program.
- In R1-style reasoning, SFT and RL each appear twice. Data is regenerated by rejection sampling from the model improved by RL, used for SFT, and then RL runs again. The recipe becomes a loop rather than a linear pipeline.
- In Agentic, mid-training and distillation carry more weight, and the unit of RL is no longer a single response but an episode with dozens of tool calls going back and forth.
A short history
| Year | Work | What changed |
|---|---|---|
| 2017 | Christiano et al. | On Atari and MuJoCo, learned a reward model from pairwise comparisons of trajectory segments and did RL against it. Showed that human labels on only a fraction of environment interactions suffice. |
| 2019 | Ziegler et al. | The same setup on GPT-2, for stylistic continuation and summarisation. The format of putting a KL penalty to the pretrained model into the reward settles here. |
| 2020 | Stiennon et al. | On TL;DR summarisation, RM + PPO was preferred over much larger supervised models. Clearly showed over-optimisation: pushing the RM score ever higher eventually lowers human ratings. |
| 2022 | InstructGPT (Ouyang et al.) | Extended to general instruction following. SFT → RM → PPO. Outputs of the 1.3B InstructGPT were preferred by people over those of the 175B GPT-3. ChatGPT at the end of that year. |
| 2022 | Anthropic HH, Constitutional AI (Bai et al.) | The tension between helpful and harmless; iterated online RLHF. CAI produces preference labels from a list of principles and AI feedback (RLAIF). |
| 2023 | Llama 2 (Touvron et al.) | Large-scale RLHF on an open model. Separate helpfulness and safety reward models, PPO stacked on top of rejection sampling fine-tuning, repeated over several rounds. |
| 2023 | DPO (Rafailov et al.) | Learns the policy directly from preference pairs, with no reward model and no RL loop. Its simplicity makes it the standard for open-model post-training (Zephyr, Tülu 2, etc.). |
| 2024 | Tülu 3, o1 | RLVR: on tasks whose answers can be verified, a verifier replaces the reward model as the reward. The same year OpenAI o1 shows long chains of thought learned with inference-time compute and RL. |
| 2025 | DeepSeek-R1 | Showed publicly that large-scale RL (GRPO) with rule-based rewards alone draws out behaviours such as long CoT, self-checking and retrying. Spread to small models by distillation. |
| 2025–26 | Agentic RL | RL in environments such as multi-turn interaction, tool use and code-execution sandboxes. Environments, verifiers and training–inference infrastructure become as important as the algorithm. |
In one line: the source of reward has moved from human preferences → AI preferences → verifiable answers → interaction with environments, and while the algorithms have become simpler (PPO → DPO → GRPO-style), the recipes have become longer and more iterative.
In InstructGPT-style RLHF, what is the first problem to appear if you remove the KL term β·KL(π_θ‖π_ref)?
The reward model is a proxy objective trained only on comparisons of responses from near . Without KL, the policy seeks out and optimises the errors of outside that distribution. This is the over-optimisation that Stiennon et al. (2020) and Gao et al. (2023) showed quantitatively. PPO’s clipping only limits the size of a single update; it does not limit the accumulated distance travelled.
Today’s recipes: multi-stage and data-centric
The patterns that keep recurring in modern recipes are these.
- Many stages, many rounds. SFT → preference learning → RL happens not once; each stage’s resulting model generates the data for the next round. Llama 2’s RLHF V1–V5 and R1’s RL → rejection sampling → SFT → RL are examples.
- On-policy data. Whether preference pairs or RL samples, responses generated by the model being trained (or its latest checkpoint) work better — an observation made again and again.
- Synthetic data and distillation. A large share of SFT and preference data is produced by stronger models (distillation lesson). Human labels are expensive and slow, and a strong model’s judgement is good enough in many areas.
- Growth of verifiable rewards. Rewards that a program can grade — maths, code, format constraints, unit tests, tool-execution results — have become the main signal for RL (RLVR lesson).
- Evaluation drives the recipe. Each stage’s hyperparameters and data mixture are set by evaluation results, and so development evaluations are kept separate from held-out evaluations to avoid overfitting to the evals.
Map of this track
| # | Lesson | Question it answers | Builds on |
|---|---|---|---|
| 1 | Overview (this lesson) | What is post-training, and why does the recipe look like this? | SFT |
| 2 | Reward models | How do we turn preferences into a scalar reward? ORM, PRM, LLM-as-judge | 1 |
| 3 | KL-regularised RL and PPO | What is the optimum of , and how is KL estimated and applied? | 2, PPO |
| 4 | Best-of-N and rejection sampling | The simplest way to improve a policy with a reward and no RL, and its KL cost | 2, 3 |
| 5 | DPO and its variants | What do we gain and lose by using the closed-form solution of 3 to drop the RM and RL? | 3 |
| 6 | RLVR and GRPO | Verifiable rewards and critic-free policy gradients | 3, Policy gradient |
| 7 | Over-optimisation | Why does optimising a proxy reward eventually break things? | 2, 3, 4 |
| 8 | Agent RL | Multi-turn interaction, tool use, credit assignment over long horizons | 6 |
| 9 | Training–inference mismatch | Importance sampling when the sampler and the trainer give different probabilities | 3, 6 |
| 10 | Distillation and synthetic data | Learning from a strong model’s outputs, on-policy distillation, CAI | 1, 5 |
Lessons 2–5 are one story. We build a reward model (2), derive the exact solution for optimising it under KL regularisation (3), and then see methods that approximate that solution by sampling (4) or fit it directly from preference data (5). The closed-form solution derived in 3 is the reference point for both 4 and 5.
Summary
- Post-training elicits the capabilities of a base model. It changes how often behaviours occur more than it adds new knowledge, and its effect depends heavily on the data.
- The canonical recipe is SFT → reward model (Bradley–Terry) → KL-regularised RL (PPO). The KL keeps the optimisation of the proxy reward (the RM) within the range where it can be trusted.
- The source of reward has moved from human preferences → AI preferences → verifiable answers → environments.
- Modern recipes are multi-stage and multi-round, and on-policy data, synthetic data and evaluation design matter as much as (often more than) the choice of algorithm.
몇 가지를 확인해 보자.
- InstructGPT에는 단계가 여섯 개뿐이고 일직선이다.
- Tülu 3에서는 보상모델이 꺼지고 DPO와 RLVR이 켜진다. 선호 학습은 보상모델 없이 하고, RL은 “맞았는가”를 프로그램으로 판정할 수 있는 과제에만 쓴다.
- R1식 추론에서는 SFT와 RL이 두 번씩 나온다. RL로 좋아진 모델에서 rejection sampling으로 데이터를 다시 만들어 SFT하고, 다시 RL을 한다. 레시피가 선형 파이프라인이 아니라 루프가 된다.
- Agentic에서는 mid-training과 증류의 비중이 커지고, RL의 단위가 응답 하나가 아니라 도구 호출이 수십 번 오가는 에피소드가 된다.
짧은 역사
| 연도 | 작업 | 무엇이 바뀌었나 |
|---|---|---|
| 2017 | Christiano et al. | Atari와 MuJoCo에서, 궤적 조각의 쌍 비교로 보상모델을 학습하고 그것으로 RL. 환경 상호작용의 일부에만 사람 라벨을 붙여도 된다는 것을 보였다. |
| 2019 | Ziegler et al. | 같은 구조를 GPT-2에. 스타일 이어쓰기와 요약. 사전학습 모델로의 KL 패널티를 보상에 넣는 형식이 여기서 정착한다. |
| 2020 | Stiennon et al. | TL;DR 요약에서 RM + PPO가 훨씬 큰 지도학습 모델보다 선호되었다. RM 점수를 계속 올리면 사람 평가가 오히려 떨어지는 과최적화를 명확히 보였다. |
| 2022 | InstructGPT (Ouyang et al.) | 일반 지시 따르기로 확장. SFT → RM → PPO. 1.3B InstructGPT의 출력이 175B GPT-3보다 사람에게 선호되었다. 그해 말 ChatGPT. |
| 2022 | Anthropic HH, Constitutional AI (Bai et al.) | 도움(helpful)과 무해(harmless)의 긴장, 반복적 online RLHF. CAI는 원칙 목록과 AI 피드백으로 선호 라벨을 만든다(RLAIF). |
| 2023 | Llama 2 (Touvron et al.) | 공개 모델의 대규모 RLHF. 도움·안전 보상모델을 따로 두고, rejection sampling fine-tuning 위에 PPO를 얹어 여러 라운드 반복. |
| 2023 | DPO (Rafailov et al.) | 보상모델과 RL 루프 없이 선호 쌍에서 바로 정책을 학습. 단순함 때문에 공개 모델 사후학습의 표준이 된다(Zephyr, Tülu 2 등). |
| 2024 | Tülu 3, o1 | RLVR: 정답 검증이 가능한 과제에서 보상모델 대신 검증기를 보상으로. 같은 해 OpenAI o1이 추론 시간 계산과 RL로 학습한 긴 사고 과정을 보여 준다. |
| 2025 | DeepSeek-R1 | 규칙 기반 보상만으로 한 대규모 RL(GRPO)이 긴 CoT, 검산, 재시도 같은 행동을 끌어낸다는 것을 공개적으로 보였다. 증류로 작은 모델에도 전파. |
| 2025–26 | Agentic RL | 멀티턴, 도구 사용, 코드 실행 샌드박스 같은 환경에서의 RL. 환경·검증기·학습–추론 인프라가 알고리즘만큼 중요해진다. |
흐름을 한 줄로 요약하면, 보상의 원천이 사람 선호 → AI 선호 → 검증 가능한 정답 → 환경과의 상호작용으로 옮겨 왔고, 알고리즘은 PPO → DPO → GRPO류로 단순해지는 동시에 레시피는 더 길고 반복적이 되었다.
InstructGPT식 RLHF에서 KL 항 β·KL(π_θ‖π_ref)을 빼면 가장 먼저 생길 문제는?
보상모델 는 근처에서 나온 응답 비교로만 학습된 대리 목표다. KL이 없으면 정책은 그 분포 바깥에서 의 오류를 찾아 최적화한다. Stiennon et al.(2020)과 Gao et al.(2023)이 정량적으로 보인 과최적화가 이것이다. PPO의 clipping은 한 번의 업데이트 크기를 제한할 뿐, 누적된 이동 거리를 제한하지는 않는다.
오늘의 레시피: 다단계, 데이터 중심
현대 레시피에서 반복해서 나타나는 패턴은 다음과 같다.
- 여러 단계, 여러 라운드. SFT → 선호 학습 → RL이 한 번이 아니라, 각 단계의 결과 모델로 다음 라운드의 데이터를 만든다. Llama 2의 RLHF V1–V5, R1의 RL → rejection sampling → SFT → RL이 그 예다.
- On-policy 데이터. 선호 쌍이든 RL 샘플이든, 지금 학습하는 모델(또는 그 직전 체크포인트)이 만든 응답일수록 효과가 좋다는 관찰이 반복된다.
- 합성 데이터와 증류. SFT·선호 데이터의 상당량을 더 강한 모델이 만든다(증류 레슨). 사람 라벨은 비싸고 느리며, 강한 모델의 판단은 많은 영역에서 충분히 좋다.
- 검증 가능한 보상의 확대. 수학, 코드, 형식 제약, 단위 테스트, 도구 실행 결과처럼 프로그램으로 채점할 수 있는 보상이 RL의 주된 신호가 되었다(RLVR 레슨).
- 평가가 레시피를 끈다. 각 단계의 하이퍼파라미터와 데이터 혼합은 평가 결과로 정해지고, 그래서 평가에 과적합하지 않도록 개발용 평가와 미공개 평가를 나눈다.
이 트랙의 지도
| # | 레슨 | 답하는 질문 | 기대는 레슨 |
|---|---|---|---|
| 1 | 개관 (이 레슨) | 사후학습은 무엇이고 레시피는 왜 이런 모양인가 | SFT |
| 2 | 보상모델 | 선호를 어떻게 스칼라 보상으로 바꾸나. ORM, PRM, LLM-as-judge | 1 |
| 3 | KL 정규화 RL과 PPO | 의 최적해는 무엇이고, KL은 어떻게 추정·적용하나 | 2, PPO |
| 4 | Best-of-N과 rejection sampling | RL 없이 보상으로 정책을 개선하는 가장 단순한 방법과 그 KL 비용 | 2, 3 |
| 5 | DPO와 변형들 | 3의 닫힌 해를 이용해 RM과 RL을 없애면 무엇을 얻고 잃나 | 3 |
| 6 | RLVR과 GRPO | 검증 가능한 보상과 critic 없는 policy gradient | 3, 정책 경사 |
| 7 | 과최적화 | 대리 보상을 최적화하면 왜 결국 망가지나 | 2, 3, 4 |
| 8 | Agent RL | 멀티턴, 도구 사용, 긴 horizon의 credit assignment | 6 |
| 9 | 학습–추론 불일치 | 샘플러와 학습기가 다른 확률을 낼 때의 importance sampling | 3, 6 |
| 10 | 증류와 합성 데이터 | 강한 모델의 출력으로 배우기, on-policy distillation, CAI | 1, 5 |
2–5는 하나의 이야기다. 보상모델을 만들고(2), 그것을 KL 정규화 아래서 최적화하는 정확한 해를 구한 뒤(3), 그 해를 샘플링으로 근사하거나(4) 선호 데이터에서 바로 맞추는(5) 방법을 본다. 3에서 유도하는 닫힌 해 가 4와 5 모두의 기준점이다.
정리
- 사후학습은 base model의 능력을 끌어내는(elicit) 과정이다. 새 지식보다 행동의 빈도를 바꾸며, 그 효과는 데이터에 따라 크게 달라진다.
- 정형 레시피는 SFT → 보상모델(Bradley–Terry) → KL 정규화 RL(PPO)이다. KL은 대리 보상인 RM을 믿을 수 있는 범위 안에서만 최적화하게 하는 장치다.
- 보상의 원천은 사람 선호 → AI 선호 → 검증 가능한 정답 → 환경으로 옮겨 왔다.
- 현대 레시피는 여러 단계·여러 라운드이고, on-policy 데이터·합성 데이터·평가 설계가 알고리즘 선택만큼(종종 그 이상) 중요하다.
더 읽을거리Further reading
- Lambert, Reinforcement Learning from Human Feedback (rlhfbook.com, 2025; arXiv 2504.12501) — 이 트랙의 기준 교재. 1–3장(소개, 역사, 학습 개관)이 이 레슨의 범위다.The reference textbook for this track. Chapters 1–3 (introduction, history, training overview) are the scope of this lesson.
- Christiano et al., Deep Reinforcement Learning from Human Preferences (NeurIPS 2017) — 쌍 비교로 보상모델을 학습하고 그것으로 RL을 하는 구조의 원형.The prototype of the setup: learn a reward model from pairwise comparisons, then do RL against it.
- Ziegler et al., Fine-Tuning Language Models from Human Preferences (2019) — 같은 구조를 GPT-2에 적용. 사전학습 모델로의 KL 패널티가 여기서 들어온다.The same setup applied to GPT-2. The KL penalty to the pretrained model enters here.
- Stiennon et al., Learning to Summarize from Human Feedback (NeurIPS 2020) — 요약에서 RM + PPO가 지도학습을 이긴다는 것, 그리고 RM 과최적화를 처음 뚜렷하게 보였다.Showed that RM + PPO beats supervised learning on summarisation, and gave the first clear picture of RM over-optimisation.
- Ouyang et al., Training Language Models to Follow Instructions with Human Feedback (NeurIPS 2022) — InstructGPT. SFT → RM → PPO 세 단계의 정형.InstructGPT. The canonical three stages SFT → RM → PPO.
- Bai et al., Constitutional AI: Harmlessness from AI Feedback (2022) — 사람 대신 원칙(constitution)과 AI 피드백으로 선호 데이터를 만든다(RLAIF).Builds preference data from a set of principles (a constitution) and AI feedback instead of humans (RLAIF).
- Lambert et al., Tülu 3: Pushing Frontiers in Open Language Model Post-Training (2024) — 완전히 공개된 다단계 레시피(SFT → DPO → RLVR). RLVR이라는 이름이 여기서 나왔다.A fully open multi-stage recipe (SFT → DPO → RLVR). The name RLVR comes from here.
- DeepSeek-AI, DeepSeek-R1: Incentivizing Reasoning Capability in LLMs via RL (2025) — 검증 가능한 보상으로 한 대규모 RL이 긴 추론을 끌어낸다는 것을 공개적으로 보였다.Showed publicly that large-scale RL with verifiable rewards draws out long reasoning.