RedLectern topic

Pretraining

Broad initial training · objectives · data and compute allocation · scaling evidence.

For: Advanced learners · researchers.

After this page you can: Explain a pretraining plan and its resource constraints.

Page reviewed

Part of: Artificial Intelligence › AI training and adaptation

About Pretraining

Pretraining is broad initial training on a corpus before a model is adapted to a particular task. For language models, the objective specifies the prediction signal: autoregressive training predicts text in sequence, while masked-language training predicts selected content from its context. These choices shape what the model is optimized to learn; they do not by themselves establish how well it will perform on a later task.

A useful plan connects the objective, data mix, model size, token budget, and compute budget. Empirical scaling studies relate training resources to measured loss and examine how to divide a fixed compute budget. Their recommendations depend on the study: earlier work favored a different allocation from a later compute-optimal analysis. Use that evidence to make a testable plan, then evaluate it against the tasks and constraints that matter. For the wider training sequence, see AI training and adaptation, Fine-tuning, and Preference and reward training.

Start here

Learn the foundations

1.Choose what pretraining predictsChoose the prediction target before choosing a corpus or budget.

Choose the prediction target before choosing a corpus or budget. Autoregressive training predicts text in sequence; masked-language training predicts selected content from its context. These are distinct objectives, and experimental comparisons report different outcomes across architectures, objectives, and whether later task adaptation is included.

When planning from scratch, state the objective, the unit being predicted, and what evidence would count as useful transfer. Broad pretraining and later task adaptation are separate decisions: research across several domains and classification tasks found gains from a second, in-domain pretraining phase. Use a small example to check that the training signal matches the behavior you want to study.

Try it

For the sentence “A fox crossed the road,” describe the prediction target for an autoregressive objective and for a masked-language objective. What context does each use?

An autoregressive objective predicts the next token from preceding text. A masked-language objective could hide “fox” and predict it from the surrounding context, including words on both sides.

2.Plan the data and compute budgetA data plan should specify more than the corpus's total size: it should say which sources and domains contribute training tokens.

A data plan should specify more than the corpus's total size: it should say which sources and domains contribute training tokens. The Pile paper describes one example corpus built from 22 diverse subsets and explicitly notes concerns for prospective users, making it a useful case study rather than a universal recipe.

For continued pretraining, state what new domain or task data is being added and what outcome will be evaluated. One study across biomedical and computer-science publications, news, and reviews found gains from a second in-domain phase on eight classification tasks. Treat such findings as evidence for a particular setting. Record the available compute budget, candidate model sizes and token counts, data mix, and evaluation plan so the allocation can be revised against measured results.

Try it

Write a compact pretraining plan for a fixed compute budget. Name the objective, the data mixture, the candidate model size and token count, and the evaluation you would use to revise the allocation.

A useful plan names the prediction objective, gives source proportions for the training data, records candidate model sizes and token counts within the fixed compute budget, and specifies validation and downstream evaluations to compare the choices.

3.Read scaling evidenceA scaling law is an empirical relationship between training resources and measured model performance.

A scaling law is an empirical relationship between training resources and measured model performance. Scaling studies can help estimate how a measured loss changes as model size, dataset size, or training compute changes, and can inform how to allocate a fixed compute budget.

The allocation recommendation is evidence from a study, not a universal constant. One early study argued for relatively large models trained on less data; a later compute-optimal analysis recommended increasing training tokens alongside model size. When using either result, ask what was measured, what budget was fixed, and which training setup the conclusion describes.

Scaling law

An empirical relationship between resources and measured model performance.

Try it

Contrast the allocation advice in the early scaling study and the later compute-optimal analysis. What planning question should a researcher ask before applying either result?

The early study favored larger models trained on relatively less data, while the later analysis recommended scaling training tokens with model size under its compute-optimal setup. Ask whether the study's budget and training setup match the plan being designed.

Latest

No recent updates are available.

See the sources list

Books

Glossary

1 terms on this page.

Browse the AI glossary

Questions and comments