liveBook · Manning

Pretraining

As explained in How Large Language Models Work

Pretraining is the initial training of a model on broad data before adapting it to particular tasks or applications.

Pretraining is a model’s first, larger round of training on broad data. It builds a general-purpose model before fine-tuning adapts that model to a particular task. section 5.0

Broad data gives the model information that a narrowly designed dataset could never anticipate. Web pages and other general documents can provide wide-ranging knowledge, while later training makes the model more useful for a specific purpose. section 5.1

The training pipeline separates general capability from task-specific behavior:

  • Curate training data before changing the model’s parameters. section 5.0
  • Pretrain on a very large collection to produce a base model or foundation model. section 5.0
  • Fine-tune on a much smaller, task-related dataset to constrain the model’s behavior. section 5.1
  • Add post-training code when outputs require further control. section 5.0

A car assistant

A car-sales dataset might cover vehicles but miss questions about sports equipment, cleaning, or accessibility. Broad pretraining can supply related information; fine-tuning can then shape the model into a more useful car salesperson. section 5.1

Figure 5.1 One may intervene to change or constrain an LLM’s behavior in four places. The two stages of model training are shown in the middle of the diagram, where the model’s parameters are altered. On the left, one could also alter the training data before model training. On the right, one could intercept the model outputs after model training and write code to handle specific situations.
figure

Use the pipeline diagram to compare the four intervention points: data curation, pretraining, fine-tuning, and output-handling code. section 5.0

How How Large Language Models Work covers it

How deep it goes
Explains the training pipeline and rationale for broad data, but stops short of coding an LLM from scratch.
Examples
Uses web pages, general documents, and a car-salesperson scenario involving sports equipment and accessibility.
What you can do after
Understand how broad pretraining and narrower fine-tuning divide general knowledge from task-specific behavior.
How it connects
Links pretraining to transformers, fine-tuning, foundation models, base models, and training-data curation.

Also explained in

Compare how 14 books explain pretraining →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of How Large Language Models Work. The section links point to the parts of the book it draws on.