advanced28 min studyLesson 619 in Engineering

Track cumulative exposure when the domain mixture changes

Define token-based mixture schedules, distinguish sampling probabilities from realized exposure, and audit repetition against available unique data.

On this page

What you’ll understand

  • Compute cumulative domain exposure across unequal curriculum phases.
  • Distinguish document-sampling weights from valid-token shares.
  • Explain why compute-optimal and curriculum findings are conditional experimental evidence.

A curriculum changes which examples the optimizer sees as training progresses. That can mean domain weights, difficulty filters, sequence lengths, or another declared selection rule. The schedule's label is less informative than its realized exposure: a short early phase and a long late phase do not contribute equal amounts merely because each has one row in a configuration. Count valid targets by source over time, keep validation separate, and treat claimed benefits as hypotheses about a particular model, corpus, budget, and evaluation.

Specify the sampling unit and progress coordinate

A probability over documents is not generally the same as a probability over valid tokens. Domains with longer documents can contribute more targets per sampled item, and packing or truncation can change that contribution. Define whether weights control documents, shards, sequences, or token mass, then measure realized valid-token shares. If the sampler draws documents with replacement, record the replacement policy and deduplication unit. An announced weight of twenty percent should not be described as twenty percent of training tokens without that accounting.

Also define when the weights change: successful optimizer update, consumed token count, accepted trajectory tokens, or another clock. Store sampler state and current phase with checkpoints so recovery does not accidentally restart the early curriculum. Adaptive changes based on development metrics should record the observed evidence and decision rule. That adaptation is part of the experiment, and repeated selection on development results does not leave those results equivalent to an untouched final test.

Ed=∑j=1JTjpd,j,∑dpd,j=1E_d=\sum_{j=1}^{J}T_jp_{d,j},\qquad \sum_d p_{d,j}=1
T_j is valid-target exposure in phase j and p_d,j its declared token share for domain d. E_d is expected exposure when shares are probabilistic, or exact exposure for an enforced matching allocation. Document-sampling probabilities cannot be substituted without accounting for their target lengths.↔ Scroll wide equations horizontally.

Cumulative exposure is weighted by phase size

Suppose the early phase contains thirty million targets and the later phase seventy million. A domain's average share is weighted by those counts, not the arithmetic mean of its two configured percentages. Compare the resulting exposures with the available unique data. Repeated exposure can be intentional, but four nominal passes over a small domain do not mean every example is seen exactly four times under replacement sampling. The actual occurrence distribution depends on the sampler and document lengths.

Hoffmann and colleagues' compute-optimal study connects model size and training-token budget through empirical experiments and fitted assumptions. DoReMi studies data-mixture optimization in a particular proxy-model method. Neither establishes one universal token-per-parameter ratio or guarantees that any easy-to-hard curriculum improves every model. Use controlled ablations at matched declared budgets, record total compute and realized tokens, and examine domain regressions. A favorable aggregate can conceal loss of coverage when the mixture repeatedly favors already strong domains.

pˉd=Ed∑jTj,ρd=EdUd\bar p_d=\frac{E_d}{\sum_jT_j},\qquad \rho_d=\frac{E_d}{U_d}
U_d>0 is available unique valid-token mass under the frozen tokenization and data definition. The dimensionless ratio ρ_d is nominal exposure relative to that mass; it is not a guarantee of equal per-document repetition or independent new information.↔ Scroll wide equations horizontally.

Check the curriculum against a fixed evaluation and baseline

Compare the planned mixture schedule with a fixed-mixture baseline under the same architecture, tokenizer, objective, optimizer policy, and declared resource budget. Log realized source counts, rejected examples, sampler exhaustion, and replacements. Changes in sequence length affect both packing and context, so they can change more than domain balance. Preserve the exact policy rather than claiming that the curriculum alone caused an improvement when several dimensions changed together.

The sampling lab quantifies realized-count variation for a deliberately simpler independent assignment process. Reset, set both p=0.2 and n=100, predict a mean proportion 0.2 and variance 0.0016, then Play or Step. Reset and set both p=0.6,n=100 for mean 0.6 and variance 0.0024. Its exact binomial bars are not sampled documents and do not implement a changing curriculum, replacement over a finite corpus, or token-length effects. They show why an intended probability and an observed finite count should be logged separately.

Integrate two curriculum phases

A fictional token-based curriculum trains on thirty million targets with web/code shares 80/20, then seventy million with shares 40/60. The frozen corpus contains eighty million unique web targets and twelve million unique code targets. Treat the planned shares as exact allocations for this arithmetic.

  1. The early phase allocates twenty-four million web and six million code targets. The later phase allocates twenty-eight million web and forty-two million code targets.

  2. Totals are fifty-two million web and forty-eight million code, so the complete run has a code share of 48%. Averaging the two code percentages equally would give 40%, which ignores unequal phase sizes.

  3. Relative to available unique target mass, web exposure is 52/80=0.65 and code exposure 48/12=4. These are nominal exposure ratios; a replacement sampler would need its own occurrence evidence before claiming each code document appeared exactly four times.

The result

The schedule implies 52/48 cumulative web/code exposure, not 60/40. Coverage and repetition must be evaluated against the actual corpus and sampler.

Explore the model

Interactive lab

Interactive lab · sampling

Separate intended share from a finite assignment count

Fresh Reset → set both p=0.2,n=100 predicts mean proportion 0.2 and variance 0.0016; Reset → set both p=0.6,n=100 predicts mean 0.6 and variance 0.0024. Play or Step highlights exact binomial outcomes, not generated data. No changing curriculum or finite-corpus replacement is modeled.

Separate intended share from a finite assignment countExact binomial masses for the mean of n independent Bernoulli trials, compared with normal mass between adjacent half-count boundaries; normal tails outside the finite support remain outside the bars. Playback highlights outcomes, not random samples. The Berry–Esseen bound applies to standardized CDFs, not individual bars or continuity-corrected errors. At p = 0 or 1, normal comparison and that bound are disabled. Normal-CDF evaluation uses a numerical approximation with absolute error below 7.5×10⁻⁸ (at most 1.5×10⁻⁷ per interval, before rounding). Current readings: Mean sample proportion: 0.5; Sample-mean variance: 0.0125; Uniform CDF error bound: ≤ 0.1062. All parameters are adjustable with the labeled controls below.Exact distribution of the mean of 20 independent Bernoulli variables with success probability 0.5; playback highlights outcome 0.00.250.50.75100.0580.1150.1730.23Sample mean · k / nProbability massNormal bin masses are an approximationk = 0 · exact probability = 9.54e-7
Exact binomial massNormal interval massHighlighted outcome / mean
Mean sample proportion
0.5
Sample-mean variance
0.0125
Uniform CDF error bound
≤ 0.1062
t = 0 s

Exact binomial masses for the mean of n independent Bernoulli trials, compared with normal mass between adjacent half-count boundaries; normal tails outside the finite support remain outside the bars. Playback highlights outcomes, not random samples. The Berry–Esseen bound applies to standardized CDFs, not individual bars or continuity-corrected errors. At p = 0 or 1, normal comparison and that bound are disabled. Normal-CDF evaluation uses a numerical approximation with absolute error below 7.5×10⁻⁸ (at most 1.5×10⁻⁷ per interval, before rounding). Parameter changes pause playback and recompute the model at the current elapsed time. Reset restores both parameters and returns time to zero. Playback starts paused. Adjust either parameter, then choose Play or Step.

Look forMixture probabilities and realized cumulative valid-token exposure are distinct records.

Check your understanding

Two curriculum phases have different token counts. How should a domain's full-run token share be calculated?

Try it yourself

A sampler chooses code documents with probability one half, but each code document contributes two hundred valid targets while each web document contributes eight hundred. Assume those fixed lengths and no truncation. What is the expected code-token share across many independent document draws?

Take a moment to make a prediction or work it out on paper. Open a hint when you need one.

Give me a hint

Compare expected code and web token contributions per draw, not just the probability of a document label.

Compare with the solution

Expected code targets per draw are 0.5×200=100 and expected web targets 0.5×800=400, so the long-run code share is 100/(100+400)=0.2. Equal document probabilities therefore correspond to twenty percent code tokens in this fixed-length model. Finite realized shares fluctuate, and actual packing or variable lengths need their own counts. A claimed fifty-percent token mixture would require a different sampling or allocation rule.

Take it with you

  • A mixture needs a sampling unit, progress clock, and realized-count ledger.
  • Cumulative exposure weights phase shares by their actual token mass.
  • Curriculum and scaling findings should be tested under their stated model, data, compute, and evaluation conditions.

Read further

Original sources and deeper explanations to follow at your own pace.

Optional progress, saved in this browser when available. Revisit any lesson at any time.

Lesson not marked complete.