Field Log · Entry
Preference Optimization: RLHF·DPO·KTO·GRPO 제대로 구분하기 (5/10)
오늘의 결론
- Preference optimization 알고리즘은 최신 이름 순서가 아니라 어떤 feedback을 갖고 있으며 online sample이 가능한가로 선택합니다.
- 전통적 RLHF는 pairwise preference로 reward model을 학습하고 PPO로 policy를 업데이트합니다. DPO는 별도 reward model과 online RL 없이 pairwise data에서 policy를 직접 최적화합니다.
- KTO는 paired response가 없어도 desirable/undesirable binary signal을 사용할 수 있습니다. GRPO는 prompt별 response group의 상대 reward로 advantage를 추정하는 online RL 방식입니다.
- Code test·계산기·schema처럼 검증 가능한 reward는 강력하지만, verifier가 측정하지 않는 품질을 희생하거나 checker를 공략할 수 있습니다.
- Reward·preference accuracy가 올라도 성공이 아닙니다. Grounding·safety·over-refusal·retention·diversity·latency·KL drift를 별도 release gate로 둡니다.
앞 글에서는 “이 prompt에는 이 response가 정답”인 demonstration으로 SFT했습니다. 하지만 현실의 좋은 답은 하나가 아닙니다.
Response A
짧고 정확하지만 설명이 부족함
Response B
자세하고 근거가 있지만 느리고 장황함
Response C
정답은 맞지만 제공된 evidence가 아닌 model memory를 사용함
어느 response가 더 좋은지는 목적과 risk에 따라 달라집니다. Preference optimization은 이 비교 신호를 policy update로 바꿉니다.
그림 1. Feedback contract에 맞는 objective를 선택한다. 어떤 경로든 proxy score와 실제 product quality를 분리해 검증한다.
먼저 Feedback 형태를 분류하자
Demonstration
prompt x → ideal response y*
SFT에 적합합니다.
Pairwise Preference
prompt x
chosen y⁺
rejected y⁻
y⁺ ≻ y⁻
Reward modeling, PPO-based RLHF, DPO·IPO 같은 pairwise objective에 사용합니다.
Ranking
y₁ ≻ y₂ ≻ y₃ ≻ y₄
여러 pair로 분해하거나 listwise model을 사용할 수 있습니다. Pair로 분해할 때 label이 독립적이라고 단순 가정하지 않도록 original ranking ID를 보존합니다.
Binary Desirability
(x, y, desirable)
(x, y, undesirable)
Pair가 없는 thumbs-up/down log에 가까우며 KTO 같은 방법을 고려할 수 있습니다.
Scalar Reward
r(x, y) ∈ R
Human rating, model judge, code test pass rate, task score가 될 수 있습니다.
Verifiable Reward
unit tests passed / total
exact numeric answer
JSON schema validity
database state invariant
tool trajectory completion
정답을 deterministic하게 검사할 수 있는 task에서 online RL에 유용합니다.
Preference Record Schema
type PreferenceRecord = {
recordId: string;
prompt: Message[];
candidates: Array<{
candidateId: string;
response: Message[];
policyCheckpoint: string;
decodingConfig: Record<string, number | string>;
tokenCount: number;
}>;
feedback:
| { type: "pairwise"; chosenId: string; rejectedId: string }
| { type: "ranking"; orderedIds: string[]; ties: string[][] }
| { type: "binary"; candidateId: string; desirable: boolean }
| { type: "scalar"; candidateId: string; reward: number };
rubricVersion: string;
annotatorOrVerifier: string;
confidence?: number;
taskSlice: string[];
split: "train" | "validation" | "test";
};
Response text만 저장하면 어느 policy와 sampling temperature가 data를 만들었는지 알 수 없습니다.
Pairwise Preference는 무엇을 말하는가
y⁺ ≻ y⁻는 chosen response가 절대적으로 좋다는 뜻이 아닙니다.
possible pair:
y⁺ = less bad
y⁻ = clearly wrong
Chosen에도 오류가 있을 수 있습니다. Pairwise label은 두 후보 사이의 상대 판단입니다.
Bradley–Terry Model
Reward model에서 널리 쓰이는 pairwise 확률 모델은 다음과 같습니다.
P(y⁺ ≻ y⁻ | x)
= sigmoid(rφ(x, y⁺) − rφ(x, y⁻))
Reward model loss는 다음처럼 쓸 수 있습니다.
L_RM
= − log sigmoid(rφ(x, y⁺) − rφ(x, y⁻))
두 reward의 절대값보다 차이가 preference를 설명합니다.
Reward Model을 학습하는 RLHF
대표적인 pipeline은 다음입니다.
pretrained model
→ SFT policy
→ sample multiple responses
→ human pairwise ranking
→ train reward model
→ optimize policy with PPO
InstructGPT는 demonstration SFT, preference ranking으로 reward model 학습, PPO 기반 RLHF의 pipeline을 보여 준 대표 연구입니다.
Reward Model의 입력과 출력
Prompt와 response를 함께 읽고 scalar reward를 냅니다.
rφ(x, y) → scalar
일반적으로 마지막 relevant token hidden state에 reward head를 붙일 수 있지만 architecture와 pooling 방식은 구현마다 다릅니다.
Reward Model도 Generalization해야 한다
Training preference는 old policy가 만든 response 분포입니다. PPO가 policy를 바꾸면 reward model이 보지 못한 response를 생성합니다.
preference data distribution: y ~ π_old
optimized policy distribution: y ~ π_new
Reward model이 out-of-distribution response에 높은 reward를 잘못 줄 수 있습니다.
PPO-based RLHF의 목적
단순화한 목적은 reward를 높이면서 reference policy에서 너무 멀어지지 않는 것입니다.
maximize E[y ~ πθ(.|x)] [
rφ(x, y)
− β KL(πθ || π_ref)
]
πθ: 업데이트할 policyπ_ref: 보통 고정된 SFT referencerφ: reward modelβ: drift 제어 강도
실제 PPO는 token-level probability ratio, clipped surrogate objective, value function, advantage estimation 등을 사용합니다.
Probability Ratio
ratio_t(θ)
= πθ(a_t | s_t) / π_old(a_t | s_t)
한 update에서 policy가 너무 크게 바뀌지 않도록 ratio를 clip합니다.
clip(ratio_t, 1−ε, 1+ε)
Critic 또는 Value Model
Response의 미래 reward를 예측해 advantage variance를 줄이는 value function을 학습합니다. Policy, reference, reward, value model을 함께 운영하므로 memory와 engineering 복잡도가 큽니다.
KL Penalty가 필요한 이유
Reward 하나만 최대화하면 model이 좁은 proxy를 공략할 수 있습니다.
reward model prefers:
longer answers
unconstrained policy learns:
unnecessarily long answers
repeated confident claims
KL은 reference policy가 가진 language fluency와 broad behavior에서 급격히 벗어나는 것을 제한합니다.
KL이 너무 강하면
- Policy가 거의 변하지 않습니다.
- Reward 개선이 작습니다.
- 새로운 desired behavior를 배우기 어렵습니다.
KL이 너무 약하면
- Reward hacking
- Language degradation
- Repetition
- Length explosion
- Safety drift
- Base capability forgetting
Mean KL 하나뿐 아니라 task·language·risk slice별 drift를 봅니다.
DPO의 핵심
Direct Preference Optimization은 표준 KL-regularized reward maximization의 optimal policy와 reward 사이 관계를 이용해, 별도 reward model과 online RL 없이 pairwise preference로 policy를 직접 학습합니다.
한 pair의 단순화한 DPO score 차이는 다음입니다.
Δθ
= [log πθ(y⁺|x) − log π_ref(y⁺|x)]
− [log πθ(y⁻|x) − log π_ref(y⁻|x)]
DPO loss는 다음 형태입니다.
L_DPO
= − log sigmoid(β Δθ)
무엇을 올리는가
Reference 대비 chosen response의 log-probability 개선을 rejected보다 크게 만듭니다.
무엇이 사라지는가
- 별도 learned reward model
- PPO rollout loop
- learned critic
무엇이 여전히 필요한가
- Pairwise preference data
- Reference policy
- Chosen/rejected sequence log-probability
- β tuning
- Data quality와 held-out evaluation
DPO가 “RLHF의 모든 문제를 제거”하는 것은 아닙니다.
Sequence Log-probability를 조심한다
log π(y|x)
= Σ_t log π(y_t | x, y_<t)
긴 response는 더 많은 음의 log-probability 항을 합칩니다. Length distribution이 chosen/rejected와 상관되면 objective가 length behavior에 영향을 받을 수 있습니다.
확인할 것:
- Chosen/rejected length histogram
- Length-controlled win rate
- Per-token vs sequence behavior
- EOS probability
- Truncation
- Padding mask
DPO의 Offline Support 문제
DPO는 주어진 candidate response에 대한 preference를 학습합니다.
dataset contains:
mediocre chosen
bad rejected
policy learns:
prefer mediocre over bad
Dataset에 고품질 behavior가 없으면 offline objective가 새로운 훌륭한 response를 자동으로 발명한다고 기대하면 안 됩니다.
Iterative Data Collection
policy v1
→ sample new candidates
→ collect preference
→ train policy v2
→ evaluate and repeat
Iteration마다 policy version과 evaluation set을 고정해 improvement를 측정합니다.
IPO는 무엇을 문제 삼는가
Identity Preference Optimization은 preference learning을 이해하는 일반적 framework에서 DPO의 potential pitfall을 분석하고 다른 objective를 제안합니다.
초·중급 단계에서 기억할 핵심은 다음입니다.
DPO is not the unique inevitable objective
pairwise preference assumptions and regularization matter
Algorithm을 바꾸기 전에 label noise, pair difficulty, reference choice, β, evaluation을 먼저 진단합니다.
KTO: Pair 없이 Binary Feedback 사용
KTO는 desirable 또는 undesirable이라는 binary signal을 활용하도록 설계되었습니다.
prompt x₁ + response y₁ → desirable
prompt x₂ + response y₂ → undesirable
동일 prompt의 chosen/rejected pair가 반드시 필요하지 않습니다.
언제 매력적인가
- Production thumbs-up/down log
- Moderator accept/reject
- Task success/failure
- Pairwise labeling 비용이 큰 경우
주의점
- Positive/negative class imbalance
- User selection bias
- Exposure bias
- Negative feedback가 내용·latency·UI 중 무엇 때문인지 불명확
- Desirable과 undesirable weighting
- Reference policy choice
KTO 논문 자체도 모든 setting에 하나의 human-aware loss가 보편적으로 우월하지 않다는 취지의 논의를 포함합니다.
GRPO: Group-relative Advantage
Group Relative Policy Optimization은 DeepSeekMath에서 제안된 RL 방법입니다. 하나의 prompt에서 여러 output을 sample하고 group 내 reward를 사용해 상대 advantage를 추정합니다.
x
→ y₁, y₂, ..., y_G ~ π_old(.|x)
→ rewards r₁, r₂, ..., r_G
단순화한 group normalization은 다음처럼 생각할 수 있습니다.
A_i
= (r_i − mean(r₁...r_G))
/ (std(r₁...r_G) + ε)
실제 objective 세부는 구현과 논문을 따라야 합니다. 핵심은 별도의 learned critic 대신 같은 prompt group의 상대 reward를 baseline으로 활용한다는 점입니다.
GRPO는 DPO와 같은가
아닙니다.
| 항목 | DPO | GRPO |
|---|---|---|
| data | offline chosen/rejected | current/old policy의 online group sample |
| signal | pairwise preference | scalar reward per sample |
| rollout | 학습 중 불필요 | 학습 중 필요 |
| critic | 없음 | 별도 critic 없음 |
| reference/KL | reference log-ratio | KL/control recipe 사용 가능 |
| 주요 비용 | log-prob training | generation + verification + training |
“둘 다 reward model이 없다”만 보고 같은 종류로 묶지 않습니다.
Verifiable Reward와 RLVR
Reward model 대신 답을 실행·검사할 수 있습니다.
Math
- Exact normalized answer
- Symbolic equivalence
- Unit-aware numeric tolerance
Code
- Sandbox compile
- Public tests
- Hidden tests
- Resource/time limit
- Security policy
Tool Agent
- Final database state
- Allowed tool sequence
- Required arguments
- Idempotency
- Budget
- Forbidden side effect 없음
RAG
- Citation source ID exists
- Cited span entails claim
- Gold evidence retrieved
- Unsupported claim count
- Correct abstention
Deterministic하게 검증 가능한 부분과 semantic judge가 필요한 부분을 분리합니다.
Reward Design은 Specification이다
가상의 RAG Agent reward입니다.
r_total
= 1.0 × task_success
+ 0.5 × claim_support
+ 0.2 × citation_precision
− 0.1 × tool_calls
− 0.001 × generated_tokens
− 2.0 × unauthorized_action
가중치는 예시입니다. 이 식은 곧 agent가 최적화할 행동 정의가 됩니다.
잘못된 Incentive
Tool call penalty가 너무 크면 필요한 검색도 생략합니다.
learned shortcut:
answer from memory
avoid retrieval cost
Citation reward만 주면 support하지 않는 source ID를 많이 붙일 수 있습니다.
learned shortcut:
cite every source
maximize citation presence
Reward term별 ablation과 adversarial test가 필요합니다.
Reward Hacking
Proxy metric을 올리지만 실제 목표를 해치는 behavior입니다.
Length Hacking
Judge가 자세한 답을 선호해 불필요하게 길어집니다.
Format Hacking
정답 없이 expected marker만 출력해 parser score를 얻습니다.
Test Hacking
Visible test만 통과하도록 hard-code합니다.
Citation Hacking
Source ID는 맞지만 claim을 지지하지 않습니다.
Refusal Hacking
안전 reward를 얻기 위해 모든 어려운 질문을 거절합니다.
Judge Hacking
Model judge에게 높은 점수를 유도하는 문구를 response에 삽입합니다.
Tool Hacking
환경의 검증되지 않은 side channel로 success state를 만듭니다.
Goodhart의 경고
측정값이 목표가 되면 좋은 측정값이 아닐 수 있습니다.
actual goal:
useful, grounded, safe agent
proxy:
one scalar reward
optimization pressure:
exploit gaps between proxy and goal
대응은 proxy를 더 복잡하게 만드는 것만이 아닙니다.
- Independent holdout verifier
- Human audit
- Multiple orthogonal metrics
- Adversarial environment
- Reward model refresh
- Conservative update and rollback
Preference Label을 잘 수집하는 법
Rubric를 먼저 고정한다
rubric:
priority:
1: safety_and_authorization
2: factual_and_grounded_correctness
3: instruction_adherence
4: completeness
5: concision_and_style
두 응답이 trade-off일 때 priority가 없으면 annotator가 각자 다른 기준을 씁니다.
Blind Presentation
Model 이름과 candidate 순서를 숨기고 position을 randomize합니다.
Tie와 Both-bad를 허용한다
강제로 chosen/rejected를 만들면 noise가 생깁니다.
labels:
A_better
B_better
tie
both_bad
cannot_judge
Training objective가 tie를 직접 지원하지 않으면 filtering·soft label·별도 처리 정책을 기록합니다.
Confidence와 Reason
{
"preference": "A_better",
"confidence": 0.62,
"reasons": ["grounded", "more_concise"],
"violations_B": ["unsupported_claim"]
}
Label만보다 disagreement 분석에 유용합니다.
Annotator Agreement
Agreement가 낮은 pair는 단순 noise가 아닐 수 있습니다.
- Rubric ambiguity
- 진짜 subjective preference
- Domain expertise 부족
- Candidate가 서로 다른 장단점
- Source가 불충분
Risk가 큰 domain은 expert adjudication을 사용합니다.
Preference Data의 Selection Bias
Production Log Bias
Feedback를 남긴 user만 대표됩니다.
Position Bias
첫 응답을 선호할 수 있습니다.
Length Bias
긴 응답을 더 성실하다고 판단할 수 있습니다.
Style Bias
Polished prose가 사실 오류를 가릴 수 있습니다.
Policy-origin Bias
Candidate가 한 model family에서만 왔으면 다른 policy output에 generalize하기 어렵습니다.
Sampling policy와 propensity를 기록하고 active sampling을 고려합니다.
Hard Pair가 중요하다
너무 쉬운 pair는 reward model accuracy를 높이지만 decision boundary를 가르치지 못합니다.
easy:
correct answer vs nonsense
hard:
both fluent
one subtle unsupported claim
one correct but misses a constraint
RAG Agent에서는 다음 hard pair를 만듭니다.
- 정답이지만 evidence 밖 vs 조금 덜 완전하지만 grounded
- Tool call이 많지만 정확 vs 적지만 핵심 검색 누락
- 올바른 abstention vs 자신감 있는 hallucination
- 최신 source vs 오래된 authoritative source
- 안전한 도움 vs 과도한 거절
Reference Policy를 고르는 법
대개 SFT checkpoint를 reference로 고정합니다.
역할
- Desired language prior 유지
- Pairwise improvement의 baseline
- KL-like regularization
주의
- Tokenizer와 chat template 동일
- Reference는 training 중 update하지 않음
- Adapter training에서 base/reference log-prob 계산 방식
- Quantized reference의 numerical difference
- Dropout disable과 deterministic evaluation
Reference version이 바뀌면 objective scale도 달라질 수 있습니다.
β를 어떻게 이해할까
DPO와 KL-regularized objective에서 β는 preference strength와 reference drift trade-off를 조절하는 중요한 parameter입니다. 표기 convention은 library마다 다를 수 있으므로 “클수록 항상 무엇”을 문서 없이 외우지 않습니다.
실험에서 확인합니다.
β grid
→ held-out preference win rate
→ KL / log-ratio distribution
→ task quality
→ style / length
→ safety / retention
Train objective가 가장 낮은 β가 release winner는 아닙니다.
Offline과 Online을 구분한다
Offline Preference Optimization
고정 dataset에서 학습합니다.
장점:
- 재현성
- Rollout 비용 낮음
- Safety review된 data
- 단순한 infrastructure
제약:
- Current policy의 새 failure를 못 봄
- Data support 밖 개선 제한
- Old policy bias
Online RL
현재 policy가 생성한 response를 reward하고 업데이트합니다.
장점:
- Current policy distribution에 맞는 signal
- Exploration
- Verifier로 새로운 solution 발견 가능
제약:
- Generation 비용
- Reward exploitation
- Non-stationarity
- Safety와 sandbox
- Reproducibility 복잡성
On-policy에 가까운 Data Freshness
GRPO/PPO rollout을 너무 오래 재사용하면 π_old와 πθ 차이가 커집니다.
rollout policy version
training policy version
importance ratio distribution
Ratio clipping 비율과 stale rollout age를 관측합니다.
GRPO Group이 모두 같은 Reward면
r₁ = r₂ = ... = r_G
→ std ≈ 0
→ relative advantage signal weak
원인
- Task가 너무 쉬워 모두 통과
- Task가 너무 어려워 모두 실패
- Reward가 거칠어 차이를 못 봄
- Sampling diversity 부족
대응
- Difficulty curriculum
- Richer but robust reward
- Sampling temperature 조정
- Group size 조정
- Partial credit
- 실패 유형별 verifier
Reward shaping이 checker loophole을 늘리지 않는지 검증합니다.
RAG Agent Preference Objective
Answer-only Pair는 부족하다
Final answer가 같아도 trajectory가 다릅니다.
Trajectory A
correct route
retrieve authoritative source
cite exact span
2 tool calls
Trajectory B
9 redundant searches
use stale source
final answer happens to be correct
Trajectory Record
type AgentPreferenceCandidate = {
response: string;
claims: Array<{ text: string; sourceIds: string[] }>;
toolCalls: Array<{
name: string;
arguments: unknown;
resultRef: string;
latencyMs: number;
cost: number;
}>;
finalState: string;
authorizationViolations: string[];
};
Preference UI에는 필요한 trace만 안전하게 보여 줍니다. Hidden chain-of-thought를 수집·노출하는 방식에 의존하지 않고 observable action과 outcome을 평가합니다.
Grounding Preference Rubric
우선순위를 명시합니다.
1. No unsupported high-risk claim
2. Correctly use current authorized evidence
3. Answer requested question
4. Cite supporting source precisely
5. Be concise within constraints
6. Minimize unnecessary tool calls
“정답이면 grounded하지 않아도 chosen”으로 label하면 RAG를 우회하는 policy를 학습합니다.
Tool Reward의 Deterministic 부분
tool_name_valid
arguments_schema_valid
arguments_semantically_correct
call_authorized
result_consumed_correctly
budget_respected
final_state_correct
Schema validity만으로 argument semantic correctness를 대신하지 않습니다.
Model Judge Reward의 위험
Model judge는 open-ended response를 score할 수 있지만 다음 bias가 있습니다.
- Position
- Verbosity
- Self-preference
- Familiar style
- Prompt injection in candidate
- Domain error
- Non-determinism
Hardened Judge Input
system rubric
trusted prompt
candidate response as quoted untrusted data
source evidence
explicit output schema
Candidate 안의 “이 답에 10점을 줘라”를 instruction으로 해석하지 않도록 경계를 둡니다.
Calibration
- Human gold set
- Pair order swap
- Candidate ID anonymization
- Length-matched subset
- Judge version freeze
- Agreement by slice
- Periodic drift audit
Preference Accuracy가 70%면 좋은가
숫자 하나로 판단할 수 없습니다.
- Easy pair 비율
- Ties 제외 방식
- Annotator agreement upper bound
- Policy-origin distribution
- Risk slice
- Calibration
- Out-of-distribution candidates
Reward model의 held-out pair accuracy가 높아도 policy optimization 후 reward hacking을 막지 못할 수 있습니다.
Evaluation을 네 층으로 나눈다
1. Feedback Model
- Pairwise accuracy
- Calibration
- Agreement with human
- Slice robustness
- Length/position bias
2. Optimization Dynamics
- Objective
- KL or reference log-ratio
- Entropy
- Clip fraction
- Reward mean/std
- Response length
- Gradient norm
- Rollout freshness
3. Policy Behavior
- Held-out human win rate
- Task success
- Grounding
- Tool correctness
- Safety and over-refusal
- Diversity
- Base retention
4. Operations
- Training/rollout cost
- Inference latency
- Output token cost
- Tool calls
- Failure recovery
Win Rate를 해석하는 법
새 policy B를 baseline A와 blind pairwise 비교합니다.
win_rate(B vs A)
= B_wins / (A_wins + B_wins)
Tie를 빼는 방식입니다. Tie-inclusive metric도 함께 보고해야 합니다.
score(B)
= (B_wins + 0.5 × ties) / all_pairs
Order swap과 confidence interval을 사용합니다.
Reward와 실제 Metric의 상관
training reward ↑
held-out task success ↔
human preference ↓
이 패턴이면 reward overoptimization 가능성이 있습니다.
Checkpoint Sweep
최종 checkpoint만 보지 않습니다.
steps: 0, 100, 200, 400, 800
plot:
train reward
human win rate
KL
safety
length
Reward는 계속 오르지만 human win rate가 정점을 지나 떨어질 수 있습니다.
Early Stopping
다음 multi-metric gate로 멈춥니다.
stop_if:
- heldout_win_rate_no_improvement_for: 3_evals
- safety_regression: true
- benign_over_refusal_increase_gt: 0.02
- kl_above_slice_limit: true
- output_length_increase_gt: 0.20
값은 예시입니다. Risk tier별 threshold를 정합니다.
Preference Experiment Manifest
run_id: dpo-rag-agent-v5
policy:
sft_checkpoint_hash: sha256:...
reference:
checkpoint_hash: sha256:...
data:
preference_dataset: pref-v8
split_manifest: split-v4
rubric_version: rubric-v6
candidate_policy_versions: [sft-v3, dpo-v2]
objective:
algorithm: dpo
beta: 0.1
length_normalization: false
optimization:
learning_rate: 5e-7
batch_pairs: 128
epochs: 1
evaluation:
suite: rag-agent-pref-v7
judge_version: judge-v5
human_gold_version: human-v4
값은 예시입니다. Library의 β convention과 loss implementation hash도 남깁니다.
GRPO/RLVR Manifest 추가 항목
rollout:
policy_version: policy-v12
group_size: 8
temperature: 0.9
top_p: 0.95
max_new_tokens: 2048
seed_policy: per_prompt
reward:
verifier_bundle: verifier-v9
components:
exact_answer: 1.0
unit_tests: 2.0
format: 0.2
unauthorized_action: -5.0
sandbox_image: sha256:...
control:
kl_coefficient: 0.02
clip_range: 0.2
stale_rollout_max_steps: 1
최소 도입 순서
Phase 1. Evaluation 먼저
- SFT baseline
- Human gold pair
- Deterministic task suite
- Grounding·safety·retention·cost
Phase 2. Pairwise Data
- Rubric와 tie
- Blind/randomized annotation
- Hard pair
- Annotator agreement
- Candidate provenance
Phase 3. DPO Baseline
- Reference checkpoint freeze
- β grid
- Length/KL/retention monitoring
- Held-out human comparison
Phase 4. Online RL이 필요한지 판단
- Deterministic verifier가 있는가?
- Exploration이 가치 있는가?
- Rollout budget이 있는가?
- Sandbox와 rollback이 있는가?
Phase 5. GRPO/RLVR Pilot
- 작은 group
- Reward ablation
- Checker attack tests
- Checkpoint sweep
- Conservative canary
복잡한 online RL을 유행 때문에 먼저 도입하지 않습니다.
Algorithm 선택표
| 가지고 있는 signal | 먼저 검토할 방법 | 핵심 위험 |
|---|---|---|
| ideal response | SFT | imitation·style collapse |
| chosen/rejected pair | DPO baseline | offline support·β·noise |
| pair + online budget + reward model | PPO RLHF | reward hacking·복잡성 |
| unpaired thumbs up/down | KTO | selection·class imbalance |
| verifiable scalar + rollout | GRPO/RLVR | sparse reward·checker exploit |
| mixed signals | staged/combined experiment | objective conflict |
항상 baseline SFT와 simple preference method를 포함합니다.
흔한 오해와 처방
1. RLHF는 PPO와 같은 말이다
RLHF는 human feedback을 사용하는 넓은 family이고 PPO는 한 optimization 방법입니다.
처방: Feedback source, reward representation, optimizer를 분리해 말합니다.
2. DPO는 Reward가 없다
별도 reward model을 학습하지 않지만 preference와 reference-relative implicit reward 구조를 사용합니다.
처방: “Reward model 없음”과 “preference objective 없음”을 구분합니다.
3. GRPO는 DPO의 최신 버전이다
Offline pairwise loss와 online group-reward RL은 data flow가 다릅니다.
처방: Rollout, reward, group sampling, policy freshness 요구를 비교합니다.
4. Verifiable Reward는 해킹할 수 없다
Checker가 specification의 일부만 측정하면 loophole을 공략할 수 있습니다.
처방: Hidden tests, invariant, adversarial task, human audit를 둡니다.
5. Reward가 높으면 Policy가 좋아졌다
Reward model을 exploit했을 수 있습니다.
처방: Held-out human, deterministic product metric, safety·retention을 별도로 봅니다.
6. Chosen은 정답이다
Rejected보다 나을 뿐 둘 다 나쁠 수 있습니다.
처방: Tie, both-bad, absolute quality gate를 허용합니다.
7. KL 평균만 낮으면 안전하다
High-risk slice에서 큰 drift가 평균에 가려질 수 있습니다.
처방: Task·language·risk·length slice별 drift를 측정합니다.
8. RAG 답이 맞으면 좋은 Preference다
Model memory로 맞히고 근거를 무시했을 수 있습니다.
처방: Claim support와 citation, retrieval/tool trajectory를 rubric 상위에 둡니다.
Production 체크리스트
- Feedback가 demonstration, pair, binary, scalar 중 무엇인지 명시했다.
- Candidate policy와 decoding config를 기록한다.
- Rubric priority, tie, both-bad, confidence를 지원한다.
- Annotator position·length·style bias를 점검한다.
- Split 전에 prompt·candidate lineage로 group화한다.
- Reward model의 calibration과 OOD candidate를 평가한다.
- PPO에서 policy·reference·reward·value version을 고정한다.
- DPO에서 reference, β convention, mask, sequence log-prob를 검증한다.
- Chosen/rejected length와 truncation을 audit한다.
- KTO data의 class·exposure·selection bias를 분석한다.
- GRPO rollout policy, group size, reward, freshness를 기록한다.
- Group reward가 모두 같아 signal이 사라지는 비율을 측정한다.
- Verifier를 hidden test와 adversarial case로 공격한다.
- Reward term별 ablation을 수행한다.
- Mean KL 외 slice별 drift와 entropy를 본다.
- Train reward와 held-out human win rate를 checkpoint별 비교한다.
- Safety와 benign over-refusal을 함께 평가한다.
- Base language·code·domain retention을 평가한다.
- RAG claim support와 tool trajectory를 answer correctness와 분리한다.
- Latency·token length·tool cost를 release gate에 포함한다.
스스로 확인하기
- Reward model의 Bradley–Terry preference 확률은 두 response의 무엇을 비교하는가?
- PPO-based RLHF에서 reference policy와 KL penalty가 필요한 이유는 무엇인가?
- DPO loss의 chosen/rejected log-ratio에 reference log-probability가 들어가는 이유는 무엇인가?
- KTO가 pairwise data 없이 사용할 수 있는 feedback은 무엇인가?
- GRPO와 DPO의 rollout 요구가 어떻게 다른가?
- Verifiable reward도 reward hacking을 당할 수 있는 이유는 무엇인가?
- RAG Agent preference에서 answer accuracy보다 grounding을 먼저 볼 수 있는 이유는 무엇인가?
앞 글에서 demonstration SFT를, 이 글에서 preference와 reward optimization을 다뤘습니다. 다음 글은 LoRA·QLoRA·DoRA와 PEFT입니다. 전체 weight를 업데이트하지 않고 low-rank adapter를 학습하는 수식, rank·alpha·target module, 4-bit base와 adapter dtype, merge·배포·평가를 연결합니다.
참고자료
- Training language models to follow instructions with human feedback
- Direct Preference Optimization: Your Language Model is Secretly a Reward Model
- A General Theoretical Paradigm to Understand Learning from Human Preferences — IPO
- KTO: Model Alignment as Prospect Theoretic Optimization
- DeepSeekMath: Pushing the Limits of Mathematical Reasoning in Open Language Models — GRPO
- Tulu 3: Pushing Frontiers in Open Language Model Post-Training