Cold Starts, Rejection Sampling, and Distillation › Rejection sampling with verifiers

Michael BrenndoerferNovember 29, 20265 min read
Language AI HandbookAll chapters
Part 40 of 67Reasoning Post-Training and Verifiable Rewards
Chapter 302Cold Starts, Rejection Sampling, and Distillation › Rejection sampling with verifiers
Reading section 3 of 12 · Rejection sampling with verifiers · 5 minSection 3 of 12 · 5 min

Section 3 of 12 · 5 min read

Reading settings

Definitions

Choose how many terms have tooltips.

Article links

Make inline references clickable

Notes & comments

In a verifier-filtered training pipeline, sample responses to a prompt, keep the ones that pass and fit the surviving examples. The proposal policy can be a base model or a later checkpoint. DeepSeek-R1 applied this step after cold-start supervision and reasoning-oriented RL.

The procedure is simple.

  1. For each prompt xx in a problem set, sample GG traces from the current policy pθ(τ∣x)p_\theta(\tau\mid x). Choose the budget based on generation and verification cost and the observed yield of usable examples.
  2. Apply a binary gate V(τ,x)∈{0,1}V(\tau,x)\in\{0,1\}. An exact checker can return pass or fail directly, for example by comparing the boxed answer with the reference. For a real-valued outcome score, use a binary decision rule, such as accepting scores above a threshold. Step scores need an aggregation or acceptance rule, such as requiring every scored step to pass.
  3. Keep all accepted traces and discard the rest.
  4. Fine-tune the policy (or a student) on the surviving traces with standard cross-entropy.

The math is worth writing down because it clarifies what the resulting dataset is and is not. The sampling distribution over accepted traces is

pselected(τ∣x)=pθ(τ∣x) 1[V(τ,x)=1]∑τ′pθ(τ′∣x) 1[V(τ′,x)=1].p_{\text{selected}}(\tau \mid x) = \frac{p_\theta(\tau \mid x)\,\mathbb{1}[V(\tau, x) = 1]}{\sum_{\tau'} p_\theta(\tau' \mid x)\,\mathbb{1}[V(\tau', x) = 1]}.

The denominator is the acceptance probability for that prompt and must be positive. If judgment is stochastic, replace the indicator in both places by P(V=1∣τ,x)P(V=1\mid\tau,x). A deterministic gate recovers conditioning on correctness if it accepts exactly the correct traces on the proposal support and correct traces have positive mass. A verifier error changes which targets survive and can affect the model fitted to them.

The formula has a direct visual consequence: a small false-positive rate is not harmless when the base policy is already much more likely to produce wrong traces than correct ones.

PythonIn [4]
CollapseExpand
import numpy as np

epsilon_fp = np.linspace(0.001, 0.5, 101)
epsilon_fn = 0.05
base_odds = [0.1, 1.0, 10.0]
bias_curves = [
    (odds, odds * epsilon_fp / (1.0 - epsilon_fn)) for odds in base_odds
]
VisualizationOut [5]
CollapseExpand
Accepted wrong-to-correct ratio versus false-positive rate for three base odds.
Accepted wrong-to-correct odds on a logarithmic vertical axis versus verifier false-positive rate, at proposal odds 0.1, 1, and 10. The false-negative rate is fixed at 0.05. Higher proposal odds raise retained wrong-to-correct odds at the same verifier rates.

Suppose prompts occur with mass d(x)d(x), each receives G(x)G(x) candidates, and each candidate has pass probability Z(x)Z(x) at that prompt. Under a keep-all rule, expected accepted counts are proportional to d(x)G(x)Z(x)d(x)G(x)Z(x). These also give the weights in the accepted-row population after pooling across batches. With equal budgets the factor G(x)G(x) cancels. A realized finite pool uses its actual accepted counts, which can give different weights. A per-prompt cap can also change the weights. Report how many prompts are covered as well as how many rows survive.

DeepSeek-R1 collected about 600,000 reasoning examples by filtering outputs of the reasoning-RL checkpoint. A subset used DeepSeek-V3 to judge the generated answer against the reference. About 200,000 non-reasoning examples came from the DeepSeek-V3 pipeline, which reused some of its existing supervised data. The large model used the combined set for supervised fine-tuning before another RL stage. The smaller models reused that same set. DeepSeek-R1 report, §§2.3.3–2.4

The large-model supervised stage and the smaller-model distillation stage can use the same examples. Their training purposes differ: one is an intermediate stage for the large model, while the other supplies targets to the smaller models. This reuse is distinct from sampling another independent dataset.

In on-policy RL, the current policy generates rollouts, and a verifier can supply part of their reward. The optimizer uses that reward to estimate a policy-gradient update. In verifier-filtered supervised training, a proposal model generates the examples, a verifier determines which examples enter the dataset, and a model fits those fixed targets with cross-entropy. The proposal model and the model being fit can be different.

  • Fixed-target cross-entropy does not estimate a policy-gradient reward on fresh rollouts for each fitting step. Generation, scoring, and fitting all contribute to cost.
  • Rejection sampling is bounded by the quality of the filter, because whatever gets past it becomes a target.
  • On-policy sampling can discover rare traces with positive probability that did not appear in an earlier finite batch. A trace with exactly zero proposal probability cannot appear in a draw from that policy. Access requires a proposal or exploration change that gives the trace mass, or an outside source of examples.

DeepSeek-R1 is a documented example of combining cold-start supervision, reasoning RL, verifier-filtered supervised training, and a further RL stage. The stage order reflects what its designers chose to measure and train on.

Filtering can only retain responses present in the proposal pool. Drawing more candidates may reveal a low-probability strategy. If the current sampler excludes that strategy, a different teacher or a change to the proposal distribution is needed to add it directly to the dataset.

Comments

Add to the conversation

A question, a correction, or an example from your own work.

No comments yet. Be the first to share your thoughts!

Newsletter

Stay up to date

Get new articles, book updates, and notes on AI and technology.

Unsubscribe at any time. Privacy policy