Chapter 11
Synthetic Data and Mixture Design
On this page
Synthetic data is useful when generation, verification, and sampling create training signal that the available corpus cannot provide. Its value is determined by verified novelty and distributional effect, not by generation volume.
Synthetic generation pipeline¶
Verified candidates enter deduplication and mixture construction. Rejections provide diagnostic evidence about the generator and verifier; neither acceptance rate nor generation volume establishes training value.
Synthetic data is a programmable acquisition process, not a free source of truth:
seed -> generate -> verify -> score -> deduplicate -> balance -> audit -> train
Every arrow needs a versioned contract. Synthetic data is most valuable when it creates verified signal that is expensive or rare in natural data: new exercises with executable tests, counterexamples, controlled difficulty, tool-use traces, multilingual variants, or targeted failures from serving.
Define the target before prompting¶
A generation specification should state:
- target capability and failure mode;
- input and output schema;
- allowed knowledge sources and temporal cutoff;
- difficulty, language, domain, and format coverage;
- correctness oracle or adjudication process;
- novelty relation against training and evaluation data;
- privacy, safety, and rights constraints;
- generator, verifier, and student independence requirements;
- maximum generation and verification cost per accepted example.
Without this contract, prompt iteration optimizes what looks plausible to the team rather than what produces a useful gradient.
Coverage begins with seeds¶
Seed selection controls the reachable distribution. If prompts are sampled only from existing easy examples, high-temperature decoding produces stylistic variety around an easy core, not new capability.
Construct a coverage matrix across dimensions such as:
- domain and subdomain;
- skill and reasoning operator;
- difficulty and required trajectory length;
- input shape and edge case;
- language, locale, and notation;
- tool or API;
- expected failure mode;
- verifier type and confidence.
Use under-covered cells to drive generation. Keep seed IDs and generator-family IDs so later splitting and deduplication do not place siblings across train and evaluation.
Generation can use decomposition:
- propose a task specification;
- validate that the specification is well-posed;
- generate one or more solutions;
- derive tests or invariants independently;
- execute or adjudicate;
- generate critiques and repairs only when repair lineage is retained.
The task generator and answer generator need not be the same model. Separation can reduce self-confirmation, although shared pretraining still creates correlated errors.
Pipeline yield and cost¶
Let stage s retain fraction y_s of its input. Starting from N_0 candidates:
Each stage retention rate is conditional on reaching that stage.
Multiplying these conditional rates follows the probability chain rule and does not require independent gates. Reusing a stage yield from a different upstream mixture can still make the forecast wrong. To obtain M accepted examples under stable yield, expected initial generation volume is:
Required generation volume grows rapidly when several filters have modest yield.
If task validation retains 0.8, solution verification 0.6, deduplication 0.75, and final policy review 0.9, total yield is:
0.8 * 0.6 * 0.75 * 0.9 = 0.324.
One million accepted examples require about 3.09 million initial candidates. A budget that prices only accepted generations understates model calls, verifier compute, storage, and failed-sample analysis.
With per-item cost c_s applied to the number entering stage s, expected total cost is:
Cost = sum_s c_s N_0 product_{j < s} y_j.
Place cheap, high-recall gates early and expensive, high-precision verification later. An early gate with poor recall can permanently erase rare valuable cases.
Verifier error from Bayes' rule¶
A verifier's pass rate is not its precision. Let:
p = P(good)before verification;alpha = P(accept | good)be true-accept rate;beta = P(accept | bad)be false-accept rate.
Then:
Bayes' rule converts verifier error and generator quality into accepted-data risk.
If 60 percent of candidates are good, alpha=0.95, and beta=0.10, then:
P(bad | accept) = 0.10*0.40 / (0.95*0.60 + 0.10*0.40) ~= 0.0656.
About 6.6 percent of accepted examples are still bad. At billion-example scale that is not a rounding error. Improve the generator prior p, reduce verifier false acceptance beta, add independent checks, or lower the weight of uncertain examples.
Running two verifiers does not multiply error rates unless their failures are conditionally independent. Two models trained on the same data and prompted with the same rubric may confidently accept the same false solution. Measure joint errors on a human- or execution-adjudicated set.
Verification by data type¶
| Data type | Stronger verification | Residual risk |
|---|---|---|
| Code | Compile, type-check, sandbox, hidden tests, property tests, complexity bounds | Weak tests, nondeterminism, unsafe behavior, test leakage |
| Mathematics | Symbolic equivalence, independent solver, randomized substitution, proof checker | Domain restrictions, solver bugs, invalid proof steps |
| Retrieval-grounded QA | Source allowlist, claim-evidence alignment, citation entailment | Source error, stale evidence, unsupported synthesis |
| Tool use | Execute in sandbox, validate state transition and side effects | Simulator differs from production, hidden permissions |
| Open-ended reasoning | Rubric decomposition, multiple critics, human adjudication | Correlated preferences, persuasive but false reasoning |
| Safety behavior | Adversarial prompts, policy rule checks, expert review | Coverage gaps, evaluator over-refusal bias |
Teacher confidence is not independent verification. A teacher can be confidently wrong, can recognize its own preferred style, and can leak benchmarks into both task and answer.
Rejection changes the distribution¶
Accepted data follows:
P(x | accept) proportional to P(accept | x) P_generated(x).
If a verifier is better at short algebra than geometry proofs, filtering shifts the accepted mixture toward short algebra even when the generator proposed balanced tasks. Track yield by every coverage cell and inspect rejected examples.
Verifier gaming is the synthetic analogue of reward hacking. A generator can learn to emit solutions that exploit weak tests, include scorer-friendly phrases, or avoid hard cases. Keep hidden tests, rotate verifier families, audit unusually high-yield generators, and evaluate accepted examples with checks that were not used during generation.
Diversity and novelty¶
Measure more than surface lexical diversity:
- unique task specifications and solution strategies;
- semantic and structural cluster sizes;
- coverage-cell entropy;
- rare skill and failure-mode recall;
- distance to seed and teacher examples;
- execution trace or proof-shape diversity;
- student gradient or loss diversity in small pilots.
Deduplicate after generation, but keep controlled variants when they isolate a meaningful factor. Ten paraphrases of one arithmetic problem are not ten reasoning skills. Conversely, two solutions with the same answer but different valid algorithms may be valuable.
Synthetic lineage and leakage¶
Each record should include:
- seed and source IDs;
- generator checkpoint, prompt template, decoding parameters, and random seed;
- retrieved context and tool versions;
- candidate family and repair chain;
- every verifier result and confidence;
- human adjudication;
- duplicate cluster and evaluation-overlap results;
- final sample weight and release membership.
If the teacher or retrieval index may have seen a benchmark, synthetic paraphrases can carry contamination without literal copying. Scan task semantics, generator lineage, and retrieved evidence against the evaluation registry.
Recursion and human-data anchors¶
Repeatedly training generators on generated descendants can narrow tails and amplify model errors. Preserve human-authored or otherwise independently grounded data, label generation depth, and cap recursive descendants in each mixture. Monitor lexical, semantic, factual, and difficulty diversity across generations.
Synthetic data should receive lower weight when:
- verification is weak or correlated with the generator;
- it mostly repeats teacher style or facts;
- coverage differs from product traffic;
- recursive generation depth is high;
- a small set of templates creates high effective repetition;
- human data provides contradictory or more diverse signal;
- pilot training shows gains on verifier-shaped metrics but regressions on fresh independent tests.
It may deserve equal or higher weight when correctness is mechanically verified, novelty is established, the target capability is underrepresented, and controlled pilots show improvement without distributional regressions.
Distribution balancing¶
Balancing controls the distribution of gradient updates after eligibility, deduplication, and scoring. Raw source size is not a neutral default: large scraped domains then dominate by collection convenience. Uniform domains are not neutral either: tiny sources repeat and can overfit.
Domain mixture¶
Let domain d contain n_d eligible tokens. A common temperature mixture is:
Temperature sampling interpolates between proportional and uniform domain sampling.
tau=1samples in proportion to available tokens;tau=0samples domains uniformly;- intermediate values upsample smaller domains smoothly.
For raw domain shares 90%, 9%, and 1%, tau=0.5 uses square roots:
sqrt(90) : sqrt(9) : sqrt(1) = 9.49 : 3 : 1,
which normalizes to approximately 70.3%, 22.2%, and 7.4%. The rarest domain is upsampled by about 7.4 times relative to its raw share, so unique-example reuse and memorization risk must be measured.
Sampling by documents rather than tokens changes the objective when lengths differ. State whether q_d governs documents, examples, tokens, or packed sequences.
Importance weights and target distributions¶
If product traffic has target distribution p_d but training samples domains from q_d, an unbiased estimate of product-distribution loss can use the following weights, provided q_d>0 wherever p_d>0 and within-domain sampling matches the target conditional distribution:
Importance weighting corrects a sampling distribution toward a declared target distribution.
For a sampled loss ell(x):
E_{d~q}[w_d ell_d] = sum_d p_d E[ell_d].
Large weights create high-variance gradients. In practice, cap or smooth weights and accept controlled bias. Report the effective sample size:
Effective sample size reveals concentration hidden by the nominal example count.
If 1,000 examples have weight one, ESS=1,000. If a few examples carry most weight, ESS can be far smaller than the row count. This weight-based diagnostic does not account for dependence among duplicates or related examples; audit that separately. Token count alone hides both forms of concentration.
Constrained capability objective¶
Product frequency should not be the sole objective when rare failures are costly. One formulation is:
Choose mixture q to reduce target-weighted domain loss subject to data and risk constraints.
subject to:
Metric_c(q) >= target_c for every critical slice c,
Regression_j(q) <= budget_j,
q_d >= q_min,d,
and compute, data-reuse, safety, and rights constraints.
This expresses a common decision: optimize average product utility while requiring minimum safety, language, or reliability performance. Constraint thresholds come from product risk, not from whichever dataset happens to be largest.
Adaptive mixture selection¶
Static heuristics are a baseline. A principled control loop:
- define domains and held-out losses that are stable enough to guide decisions;
- train small proxy models on candidate mixtures;
- estimate which domains are underfit relative to a reference or target;
- update mixture weights subject to floors and reuse caps;
- confirm on fresh runs and larger scale;
- stop adapting before the same holdouts become over-optimized.
Methods such as group distributionally robust reweighting can emphasize domains with excess loss, but proxy-to-large-model transfer is an empirical assumption. Domains must be meaningful: if one "web" bucket mixes every style and language, its aggregate loss gives weak guidance.
Multiple balancing axes¶
One domain label is rarely enough. Balance or audit:
- source and license class;
- language, script, locale, and dialect;
- topic and task;
- difficulty and context length;
- human versus synthetic origin and generation depth;
- quality-score bands;
- code language and repository family;
- safety risk and rare critical failure;
- time and freshness.
The full Cartesian product is sparse. Use hierarchical quotas, constrained sampling, or iterative proportional fitting rather than requiring every combination. Monitor which constraints conflict.
Repetition and curriculum¶
Track expected exposure:
Expected reuse exposes memorization risk hidden by aggregate token counts.
Two domains with equal sampled tokens can have very different reuse. Set caps for exact examples, duplicate clusters, sources, and synthetic families. Shuffle at the group level so repeated siblings do not appear back-to-back.
Curriculum changes mixture over training step t, so write q_d(t). Introduce long contexts or difficult verified reasoning when the model can use them, but preserve replay of earlier domains to avoid forgetting. A curriculum needs transition gates and regression monitoring, not only a schedule.
Worked balancing decision¶
Suppose product traffic is 95 percent general assistance, 4 percent code, and 1 percent security-sensitive support. Raw eligible data is 98 percent general, 1.9 percent code, and 0.1 percent security.
A reasonable pilot might:
- keep the majority of mass near general traffic;
- upsample code while monitoring repository repetition;
- allocate a larger-than-traffic security floor because failure cost is high;
- use independent safety evaluations as constraints;
- compare fixed-token pilots at several floors;
- record both nominal proportions and effective weights.
Calling this mixture "representative" would be inaccurate. It is deliberately risk-adjusted, and the rationale should be part of the release manifest.
Language-aware curation and a fixed-budget ablation¶
A quality threshold learned on English web text can reject useful text in another writing system. Token fertility, punctuation, document length, and repeated boilerplate have language-dependent distributions. Language identification should therefore route to an appropriate quality policy, with an explicit mixed-language path, rather than serve only as a final reporting label. FineWeb2 studies language-adapted filtering and deduplication, and combines duplication counts with quality when rebalancing the resulting corpus. Its lesson is to evaluate the curation pipeline through trained models across languages, not just retained bytes.
Consider an original experiment with a 10-billion-token budget. Recipe A spends 8 billion tokens on English and 2 billion on other languages. Recipe B uses 6 and 4 billion. Train both with the same architecture, optimizer, total tokens, and evaluation checkpoints. Report English regression as well as gains by language; an average weighted by the new training mixture would move the goalposts. If B's tokenizer produces twice as many tokens per document for a target language, doubling tokens may not double semantic coverage. Track documents, bytes, unique content, and tokens separately.
To isolate filtering from mixture changes, first hold per-language sampling proportions fixed while varying the filter. Then hold the chosen filter fixed while varying the mixture. Preserve an untouched evaluation set and check contamination before either experiment. A synthetic-data generator must use the training pool, not read held-out questions and paraphrase them into the corpus. The acceptance rule is useful generalization per training budget, not agreement with the quality classifier that produced the data.
The cumulative record now includes the generator/verifier trace and effective sampling weight. The platform must bind these decisions to the tokenizer-specific pack:C and publish release:1 only after its complete partition set is present.