In this article
Blend weights choose underlying samples; document proportions and effective loss-token exposure require separate measurement.
Blending selects an underlying sample
Megatron Core’s BlendedDataset maps each output position to a dataset and a sample position within it. In the documented sized-blend case, weights guide the proportions of samples drawn from contributing datasets. They are not direct instructions to count original web documents.
The implementation also distinguishes a supplied total size from the case without that size. In the latter contract, weights describe sample counts. Read the installed API before interpreting one configuration file as though every numeric weight always meant the same normalized probability.
GPT samples can cross document boundaries
GPTDataset builds document, sample and shuffle indices. A training sample is assembled from token ranges in the indexed documents and can draw across document boundaries. A long document can contribute to several samples, while short documents can share a sample.
Consequently, equal sampling weight does not imply equal counts of distinct documents seen. Retain document-level provenance if the experiment needs source coverage or repetition analysis. The blend’s sample index answers where to read, not which source documents are statistically independent.
Sequence length changes token exposure
When contributing samples have the same usable length, sample proportions can approximate token proportions under corresponding assumptions. Variable usable lengths, padding or truncation can break that relationship. State the denominator before reporting a source mixture as a token budget.
Track selected samples, consumed tokens and unique source documents separately. These measurements help distinguish deliberate oversampling from a tokenizer or packing change. A configuration weight by itself is insufficient evidence that the realized training stream matched a desired source-token distribution.
Loss masking creates another denominator
The current GPTDataset implementation masks padded labels and supports other configured loss behavior. Tokens present in an input are therefore not necessarily tokens contributing to the objective. Source exposure and objective contribution can diverge even within the same batch.
If the report concerns learning signal, count effective loss-bearing positions under the actual mask. Do not substitute file size, source-document count or unmasked sequence length for that quantity without explaining the approximation and its limits.
Cache identity belongs to the experiment
The blended implementation derives cache identity from contributing dataset descriptions, split, weights and size. Preserve that description with the tokenizer and sample-construction revision. Reusing familiar dataset names does not establish unchanged underlying token files.
A proposed audit can inspect a bounded stream of dataset identifiers and mapped source ranges before a training run. This article explains the contracts; it does not report a measured mixture or claim that a particular blend improves model quality.
Primary references
Megatron Core dataset construction.
BlendedDataset implementation.
Related explanations: Batch and sequence axes; Independent dataset splits.
Earn rental income from GPUs
Have idle GPUs or looking to fund AI infrastructure? Retrivium finds a rental platform, sets up the server and helps you assess income and costs with a pilot.