← AI Terminology

Rejection Sampling (Alignment)

Rejection sampling in alignment generates multiple candidates and keeps only those that pass a reward threshold or rank filter, often to build higher-quality SFT/preference sets.

Also a classic statistics method; in LLMs it usually means filter-by-reward sampling.
Why It Matters in AI
Before or beside RL, labs sample many outputs and keep winners — simple, parallel, effective. It improves datasets and can approximate heavier RL at inference (best-of-N).
Key Points
Aspect Description
Use Curate SFT data; inference best-of-N
Cost Linear in N samples
Loop Sample N → score → keep top / above threshold
Risk Reward hacking if scorer flawed
Related Best-of-N, RLAIF, RAFT-style methods
Stats sense Sample until proposal accepted under criterion
Simple Analogy
Photographing twenty takes and publishing only the shots that pass the art director’s bar.
Common Usage Examples
  • Generate 16 answers; keep highest RM score for SFT
  • Best-of-N at serving time
  • Filter code by unit tests
  • Watch diversity collapse if filter too strict
Summary
In short: Rejection sampling keeps only high-scoring generations — a simple filter used to clean training data and boost inference quality.