← All posts

Model development

Post 15 of 26

Post-training data: curated prompts, synthetic examples, rejection sampling and distillation

Posts in this series · 26

The previous post treated fine-tuning data as given. In practice, assembling it is most of the work, and most of it is no longer written by hand. Prompts are collected and synthesized; responses are generated by strong models, filtered by other models or by programs, and selected from many candidates. Each step is a filter, and like the filters in the corpus post, each favours something. This post follows the pipeline and asks, at every stage, what it selects for.

Prompts: what the model is asked

The prompt pool decides which skills get practice. Tülu 3’s recipe starts from the skills to be improved, then collects prompts for each (Tülu 3, §3.1):

The prompt pool is also where contamination enters. Real chat logs contain benchmark questions that users pasted in; Tülu 3 found several popular public datasets overlapping with test sets (App. B.2).

Responses: who writes the answer

For each prompt, someone or something writes the response:

Distillation is remarkably effective at transferring capabilities. DeepSeek-R1’s report compares two ways of making a 32B model reason: large-scale reinforcement learning on the base model for over 10,000 steps, against fine-tuning the same base on about 800,000 examples generated by the much larger DeepSeek-R1. The distilled model scored 72.6 on AIME 2024 against 47.0 for the RL-trained one (DeepSeek-R1, App. F.1, Table 16). The authors conclude that distilling a stronger model into a smaller one is economical and effective, while advancing beyond what existing models can do may still require stronger base models and large-scale RL. Distillation copies the teacher’s mistakes and habits along with its skills, and the student rarely surpasses it.

Rejection sampling: choosing among the model’s own answers

Rejection sampling (also called best-of-K sampling) generates KK responses per prompt and keeps the best one, judged by a reward model or a verifier, then fine-tunes on the kept responses. Llama 3 sampled KK between 10 and 30 outputs per prompt from its latest model and kept the one its reward model scored highest, repeating the process over six rounds of post-training (Llama 3, §4.1.6, §4.2.2). Sharing the prompt’s key-value cache across the KK samples doubled the throughput of this step, a direct use of the KV-cache arithmetic.

With a verifier, for example a program that checks a math answer, a prompt yields a usable example only if at least one of KK samples passes. If each sample passes independently with probability pp,

P(prompt kept)=1−(1−p)K.P(\text{prompt kept}) = 1 - (1 - p)^K .
Pass rate ppK=1K = 1K=4K = 4K=16K = 16
0.50.500.941.00
0.250.250.680.99
0.020.020.080.28

Larger KK recovers more prompts, but prompts the model rarely solves stay rare.

Try it: what survives? Your prompt pool has 1,000 easy prompts (the model solves each sample half the time) and 1,000 hard ones (2% of the time). With K=16K = 16 and a perfect verifier, what fraction of the kept examples are hard?

Answer. Easy: 1,000×(1−0.516)≈1,0001{,}000 \times (1 - 0.5^{16}) \approx 1{,}000 kept. Hard: 1,000×(1−0.9816)≈2761{,}000 \times (1 - 0.98^{16}) \approx 276. Hard prompts were half the pool but are 22% of the kept data, after 32,000 generations. Rejection sampling teaches the model most about what it can already do. Remedies include larger KK for hard prompts, a stronger teacher for them (distillation), or keeping hard prompts for reinforcement learning, where partial progress can still produce a learning signal.

Keeping synthetic data honest

Generated data has failure modes of its own:

Tülu 3’s decontamination is a concrete, reproducible procedure (§3.2). It compares training prompts with evaluation prompts (responses are often regenerated, so they are not compared) using 8-word overlaps: a test item counts as matched by a training example if more than half of its tokens fall inside 8-grams shared with that example. Training sets matching more than 2% of an evaluation’s items were removed or filtered. The team tried embedding-based matching too, but found it hard to tell real paraphrases from mere similarity of topic, the same limitation the corpus post described. The rule catches near-copies: a word problem with only its numbers changed shares 53% of its tokens in 8-grams with the original and is flagged, while a reworded version shares none and is not.

Everyday picture: a kitchen that tastes every dish before it leaves. It keeps quality up, but only for the dishes the cook can already make; a dish that comes out right one time in fifty rarely reaches a customer, so the menu drifts towards what is easy.

What to remember

Sources

Further reading