Track V RL for LLMs & Agents

LLM·Agent를 위한 RLRL for LLMs & Agents

보상모델, RLHF, DPO, GRPO·RLVR, 멀티턴 agent RL, 학습-추론 불일치.Reward models, RLHF, DPO, GRPO and RLVR, multi-turn agent RL, training–inference mismatch.

10개 레슨10 lessons약 7.3시간~7.3 h 진행Progress 0 / 10
  1. RLHF와 사후학습 개관Overview of RLHF and post-training

    사후학습이 base model에서 무엇을 끌어내는지, SFT → 보상모델 → KL 정규화 RL의 정형 레시피가 왜 그런 모양인지, 그리고 2017년 이후 레시피가 어떻게 다단계·데이터 중심으로 바뀌었는지 설명할 수 있다.Explain what post-training draws out of a base model, why the canonical recipe of SFT → reward model → KL-regularised RL has the shape it does, and how the recipe has turned multi-stage and data-centric since 2017.

    rlhf · post-training · instructgpt · history · rlvr · recipe
    35 분min
  2. 보상모델Reward models

    쌍 비교 선호에서 Bradley–Terry 모델을 유도하고 보상모델을 학습할 수 있다. 보상의 어떤 부분이 데이터로 정해지고 어떤 부분이 정해지지 않는지, ORM·PRM·가치함수·LLM-as-judge가 각각 무엇을 예측하는지 구분할 수 있다.Derive the Bradley–Terry model from pairwise preferences and train a reward model. Tell apart which parts of a reward the data determines and which it does not, and what ORMs, PRMs, value functions and LLM-as-judge each predict.

    reward model · bradley-terry · plackett-luce · prm · orm · llm-as-judge · rewardbench
    40 분min
  3. KL 정규화 RL과 PPO for LMsKL-regularised RL and PPO for LMs

    KL 정규화 목적함수의 닫힌 해 π* ∝ π_ref·exp(r/β)를 유도하고 β의 의미를 설명할 수 있다. KL을 보상에 넣을 때와 손실에 넣을 때의 차이, k1·k2·k3 추정량의 편향·분산, 그리고 LLM용 PPO의 구성 요소와 진단 지표를 안다.Derive the closed-form solution π* ∝ π_ref·exp(r/β) of the KL-regularised objective and explain what β means. Know the difference between putting the KL in the reward and putting it in the loss, the bias and variance of the k1, k2 and k3 estimators, and the components and diagnostics of PPO for LLMs.

    rlhf · kl divergence · ppo · kl estimator · gae · value function
    45 분min
  4. Best-of-N과 rejection samplingBest-of-N and rejection sampling

    Best-of-N의 보상 분포와 기대 이득, 그리고 KL(π_BoN‖π_ref) = log N − (N−1)/N을 유도하고 그것이 언제 상한인지 설명할 수 있다. 같은 아이디어를 학습으로 옮긴 rejection sampling fine-tuning, expert iteration, STaR가 레시피 안에서 어떻게 쓰이는지 안다.Derive the reward distribution and expected gain of best-of-N, and KL(π_BoN‖π_ref) = log N − (N−1)/N, and explain when it is an upper bound. See how rejection sampling fine-tuning, expert iteration and STaR — the same idea moved into training — are used inside recipes.

    best-of-n · rejection sampling · kl divergence · expert iteration · star · inference-time scaling
    35 분min
  5. Direct alignment: DPO와 그 변형들Direct alignment: DPO and its variants

    KL 정규화 RL의 닫힌 해에서 DPO 손실을 유도하고, 그 gradient가 무엇을 하는지, implicit reward와 β가 무엇인지 설명할 수 있다. chosen·rejected 확률이 함께 떨어지는 현상, 길이 편향, off-policy 데이터 같은 실패 모드와 IPO·KTO·SimPO·ORPO·online DPO의 차이를 안다.Derive the DPO loss from the closed-form solution of KL-regularised RL, and explain what its gradient does and what the implicit reward and β are. Know its failure modes — chosen and rejected probabilities falling together, length bias, off-policy data — and how IPO, KTO, SimPO, ORPO and online DPO differ.

    dpo · direct alignment · preference optimization · ipo · kto · simpo · orpo · likelihood displacement
    45 분min
  6. RLVR과 추론 — GRPO, RLOO, Dr. GRPO, DAPO, GSPORLVR and reasoning — GRPO, RLOO, Dr. GRPO, DAPO, GSPO

    채점 프로그램이 보상을 주는 RLVR에서 critic 없이 그룹 평균을 baseline으로 쓰는 GRPO를 유도하고, 길이 정규화·std 정규화·대칭 clip이 만드는 편향과 그 수정(Dr. GRPO, DAPO, GSPO), 신호 없는 그룹 문제를 직접 계산해 본다.In RLVR, where a grading program provides the reward, derive GRPO — which uses the group mean as a baseline instead of a critic — and compute for yourself the biases created by length normalisation, std normalisation and symmetric clipping, their fixes (Dr. GRPO, DAPO, GSPO), and the problem of signal-free groups.

    RLVR · GRPO · RLOO · DAPO · GSPO · reasoning · advantage
    45 분min
  7. 과최적화와 reward hackingOver-optimisation and reward hacking

    학습된 보상은 진짜 목표의 대리(proxy)일 뿐이다. proxy를 세게 최적화할수록 진짜 보상이 올랐다 떨어지는 이유를 Goodhart의 법칙과 Gao et al.의 √KL 스케일링 법칙으로 설명하고, 실제 reward hacking 사례와 완화책(KL, 앙상블, 보상 변형, 길이 통제, held-out 평가)의 효과와 한계를 직접 실험한다.A learned reward is only a proxy for the true goal. Explain, with Goodhart's law and Gao et al.'s √KL scaling laws, why the true reward rises and then falls the harder you optimise the proxy, and experiment with real reward-hacking cases and the effects and limits of mitigations (KL, ensembles, reward transformation, length control, held-out evaluation).

    reward hacking · overoptimization · Goodhart · KL · ensemble · best-of-n
    40 분min
  8. Agent RL — 멀티턴, tool use, credit assignment, 환경Agent RL — multi-turn, tool use, credit assignment, environments

    한 번 답하고 끝나는 bandit에서 모델 토큰과 환경 관측이 번갈아 나오는 멀티턴 trajectory로 넘어간다. 왜 tool 출력 토큰을 loss에서 빼야 하는지 유도하고, 긴 horizon의 credit assignment, 환경과 검증기 설계, 비동기 rollout과 staleness의 trade-off를 그림과 코드로 확인한다.From a bandit that answers once and stops, to multi-turn trajectories where model tokens and environment observations alternate. We derive why tool-output tokens must be left out of the loss, then look at credit assignment over long horizons, environment and verifier design, and the trade-off between asynchronous rollout and staleness, with figures and code.

    agent · multi-turn · tool use · loss mask · credit assignment · async rollout
    40 분min
  9. 학습–추론 불일치와 importance samplingTraining–inference mismatch and importance sampling

    "on-policy" LLM RL의 샘플이 실제로는 다른 정책에서 나오는 세 가지 이유(여러 epoch, 비동기 staleness, 추론·학습 엔진의 수치 차이)를 정리하고, importance sampling의 분산과 ESS, truncated·self-normalized IS, 토큰 단위와 시퀀스 단위 보정의 trade-off를 유도한다. TIS, IcePop, CISPO, GSPO가 이 그림의 어디에 있는지와 진단 지표를 다룬다.Three reasons why the samples of "on-policy" LLM RL actually come from a different policy (multiple epochs, asynchronous staleness, numerical differences between inference and training engines). We derive the variance of importance sampling and the ESS, truncated and self-normalised IS, and the trade-off between token-level and sequence-level correction, then place TIS, IcePop, CISPO and GSPO on that picture and cover diagnostic metrics.

    importance sampling · off-policy · TIS · training-inference mismatch · ESS · vLLM
    45 분min
  10. 증류와 합성 데이터 — on-policy distillation, Constitutional AIDistillation and synthetic data — on-policy distillation, Constitutional AI

    큰 모델의 지식을 작은 모델로 옮기는 방법을 soft target 증류에서 시퀀스 수준 증류, 합성 데이터 파이프라인, Constitutional AI(RLAIF), on-policy distillation까지 하나의 축(어떤 분포에서 샘플하고 어떤 KL을 줄이는가)으로 정리한다. forward와 reverse KL의 차이를 직접 학습시켜 보고, on-policy distillation이 왜 dense한 신호와 on-policy 학습의 장점을 함께 갖는지 유도한다. 이어서 GKD의 일반화 JSD, 도메인 교사로 라우팅하는 다중 교사 증류(MOPD), 참고 풀이를 본 자기 자신을 교사로 쓰는 OPSD, 그리고 top-k sparse KL과 비동기 교사 파이프라인의 편향과 비용을 다룬다.Ways of moving a large model's knowledge into a small one — soft-target distillation, sequence-level distillation, synthetic-data pipelines, Constitutional AI (RLAIF) and on-policy distillation — organised along a single axis: which distribution do we sample from, and which KL do we reduce? We train with forward and reverse KL ourselves to see the difference, and derive why on-policy distillation gets both a dense signal and the benefits of on-policy learning. Then GKD's generalised JSD, multi-teacher distillation that routes each prompt to its domain teacher (MOPD), self-distillation from a solution-conditioned copy of the model (OPSD), and the bias and cost of top-k sparse KL with asynchronous teachers.

    distillation · synthetic data · on-policy distillation · reverse KL · RLAIF · constitutional AI · GKD · JSD · MOPD · self-distillation · top-k KL
    70 분min