advanced27 min studyLesson 608 in Engineering

Mixture weights allocate training exposure rather than create new information

Distinguish corpus size from sampling probability, calculate repeated exposure under a fixed token budget, and evaluate reweighting without claiming a universally optimal mixture.

On this page

What you’ll understand

  • Normalize domain sampling weights with explicit token units.
  • Calculate expected domain exposure and repeated passes under a fixed budget.
  • Explain support, oversampling, and transfer limits in learned mixture policies.

A corpus's physical size and its training influence are different quantities. A ten-million-token domain can supply half a run's token draws if the sampler repeatedly returns to it, while a much larger domain can be seen only partially. Mixture design therefore couples coverage, repetition, learning objectives, and compute. State whether weights apply to documents, sequences, or tokens, measure what the loader actually emits, and evaluate the resulting model rather than treating the largest source or an elegant normalization formula as an automatic answer.

Define domains and the unit of sampling

A domain can mean source family, genre, language, modality, or another documented grouping. The categories should have stable membership or an explicit overlap rule. If one document belongs to both technical and English collections, simply adding their counts can double-count available text and obscure effective exposure. Pin extraction, tokenizer, deduplication, and domain assignments before measuring sizes. Uniform document sampling favors long documents in token volume unless length is accounted for; uniform sequence sampling has its own packing and truncation effects. Compare intended weights with observed emitted tokens after loader filtering.

A temperature-style size rule can interpolate between uniform domain weights and natural token proportions, but it is a policy family rather than an optimization proof. For positive domain sizes, exponent zero gives equal weights and exponent one gives size-proportional weights. Changing the exponent changes exposure to both rare content and repeated examples. If some domains are excluded for source or sensitive-data reasons, a sampling rule cannot legitimately restore them merely to satisfy a target proportion. Apply mixture optimization only within the documented admitted candidate corpus.

wi=Niτ∑jNjτ,Ni>0,0≤τ≤1w_i=\frac{N_i^{\tau}}{\sum_j N_j^{\tau}},\qquad N_i>0,\quad 0\le\tau\le1
N_i are available token counts under one tokenizer, in nonoverlapping admitted domains, and w_i are dimensionless domain probabilities. The common token unit cancels after normalization. This chosen power rule ranges from uniform domains to natural token proportions; it does not establish which mixture maximizes model utility.↔ Scroll wide equations horizontally.

Reweighting trades coverage for repeated exposure

For a fixed emitted-token budget, multiply the budget by each domain probability to obtain its expected allocation. Divide by that domain's available tokens to express an expected number of passes when repetition or replacement is allowed. This average does not guarantee that every document is sampled equally, particularly with variable lengths or clustered duplicates. A domain that is upweighted fivefold may offer valuable rare content, but the sampler has not manufactured five independent copies of its information. Audit repetition and held-out loss rather than equating exposure with diversity.

DoReMi learns domain weights using a small proxy model and then trains a larger model on the resulting mixture; its reported experiments show why weight selection can be more principled than preserving raw source proportions. The result is evidence for that method in its studied settings, not a guarantee that transferred weights are optimal for every architecture, tokenizer, budget, or target application. Compare candidate mixtures under controlled training conditions and protected evaluations. Report the definition of the domains and any proxy-to-target mismatch, since different partitions can create very different optimization problems.

Ei=BwiNi,B>0,Ni>0E_i=\frac{B w_i}{N_i},\qquad B>0,\quad N_i>0
B is a training budget in emitted tokens, w_i a token-level domain probability, and N_i the available tokens in domain i. E_i has units of average passes under the stated replacement or repetition policy. It measures expected exposure, not independent information, guaranteed document coverage, or an optimal epoch count.↔ Scroll wide equations horizontally.

Check support and the objective behind the weights

If importance weighting is used to estimate a target distribution from another sampling distribution, every target-supported region needs positive sampling support and well-defined ratios. Very large weights can increase estimator variance and concentrate learning on few examples. Resampling and weighting loss terms can share an expected objective under suitable conditions while producing different minibatch variance and optimization behavior. Distinguish those implementations in the manifest. Keep domain validation sets separate from corpus duplicates and benchmark tuning, and track per-domain outcomes so an aggregate gain does not conceal a serious coverage loss.

The probability lab models only independent domain choices. Reset, explicitly set BOTH B-domain probability p=0.1 and n=20, predict mean two B draws and variance 1.8, then Play or Step. Reset and re-set BOTH p=0.5 and n=20; predict mean ten and variance five. Edits retain t, and playback highlights the exact distribution rather than sampling training batches. The toy has no documents, variable token lengths, repetition, optimization, or DoReMi proxy model. Its p corresponds to a stipulated draw-level mixture only after that unit is defined.

A balanced token mixture can repeatedly expose the smaller domain

Two nonoverlapping domains contain ninety million and ten million available tokens. A run emits one hundred million tokens and permits repeated sampling. Compare natural token proportions with a chosen fifty-fifty token mixture.

  1. Natural proportions are 0.9 and 0.1. Their expected allocations are ninety million and ten million tokens, giving one average pass through each domain under the stated sampling assumptions.

  2. The fifty-fifty mixture allocates fifty million tokens to each. Expected passes are 50/90≈0.5556 for the large domain and 50/10=5 for the small one.

  3. Record the increased repetition and evaluate whether it helps the intended capabilities. Balanced domain exposure is not balanced unique information, and the formula alone cannot establish an optimal training choice.

The result

Upweighting the small domain changes its expected exposure fivefold without increasing its available unique text.

Explore the model

Interactive lab

Interactive lab · probability

A mixture is a probability over a defined draw unit

For EACH run Reset, set BOTH p and n, predict, then Play or Step. For n=20 independent B-domain draws, p=0.1 gives mean 2/variance 1.8; p=0.5 gives mean 10/variance 5. Edits retain t. This model has no actual corpus, token packing, repeated documents, learned weights, or training dynamics.

A mixture is a probability over a defined draw unitThese are exact binomial probabilities for independent trials with one fixed success probability. Playback tours the distribution; it does not resample outcomes. Current readings: Mean · np: 5; Variance · np(1−p): 2.5; Total probability: 1. All parameters are adjustable with the labeled controls below.03581000.070.150.220.3Successes kP(X = k)k = 0 · P = 9.77e-4
Exact probabilityHighlighted outcomeMean np
Mean · np
5
Variance · np(1−p)
2.5
Total probability
1
t = 0 s

These are exact binomial probabilities for independent trials with one fixed success probability. Playback tours the distribution; it does not resample outcomes. 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 forState the sampling unit and inspect repeated exposure before interpreting a domain probability as corpus balance.

Check your understanding

A domain contains ten million unique tokens but supplies fifty million emitted training tokens. What follows under the stated repetition policy?

Try it yourself

Domains contain forty million and sixty million tokens. With an eighty-million-token budget and token probabilities 0.25 and 0.75, calculate expected allocations and passes. Does this define document-level sampling probabilities?

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

Give me a hint

Compute B times each weight, then divide by the corresponding domain size.

Compare with the solution

Allocations are twenty million and sixty million tokens. Expected passes are 20/40=0.5 and 60/60=1. These token-level probabilities do not determine document probabilities without a document-length and loading policy; variable lengths, packing, and truncation can alter their relationship.

Take it with you

  • Corpus sizes, token probabilities, and document probabilities are distinct quantities.
  • Mixture weights allocate exposure and can strongly increase repetition in small domains.
  • Learned or heuristic weights need controlled evaluation and explicit support assumptions.

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.