Bookmarks

Pretraining

pre-training

The first and most expensive stage of training a language model: it starts from scratch on a huge text corpus so that the model learns to predict the next token.

Also: pre-training, base model training, pretraining

checked 18 Nov

All terms

At the start of pretraining, the model’s weights are random. The model reads a huge corpus of text and guesses the next token trillions of times, and the error nudges the weights. This is how it picks up language, facts and reasoning patterns. The result is a base model, which is then fine-tuned.

How it works

  • Data — web text, books and code; it is cleaned, deduplicated and split into tokens.
  • Task — given the start of a sequence, predict the next token; no human-labelled answers are needed.
  • Scale — hundreds or thousands of accelerators: even the small 3-billion-parameter SmolLM3 was trained on 384 H100 GPUs, so few teams can afford pretraining.
  • Outcome — a base model: it continues text, but does not answer questions like an assistant.

Scaling laws

Quality depends on three quantities: the number of parameters, the amount of data and the compute. The Chinchilla paper (2022) showed that for a fixed compute budget, model size and the number of training tokens should be scaled up in equal proportion. The 70-billion-parameter Chinchilla, trained on 1.4 trillion tokens, outperformed the 280-billion-parameter Gopher on the same budget. This gives a rough rule of thumb: about 20 tokens per parameter. In practice, open models are often trained on noticeably more tokens to get a compact model that is cheap at inference: SmolLM3 read 11.2 trillion tokens, more than 3,500 per parameter.

What comes next

After pretraining, the model goes through SFT, preference training (RLHF, DPO) and, if needed, fine-tuning for a specific task. Most knowledge is instilled in the first stage, while the later stages teach the form of the answer and the behaviour.

Sources

the term is written from these pages

Verified 18 Nov

Not to be confused with

what it is mixed up with and how it differs

  • fine-tuning

    Fine-tuning continues training an existing model on a small dataset rather than building it from scratch.

  • base model and instruct model

    Pretraining produces a base model; SFT makes it an instruct model, and preference training then refines its answers.

In depth in the references

where the topic is covered in detail

Appears in the references