ladderlore
Request a guide
  • Type a service name, like S3 or IAM.

Concept

Training a foundation model

Pre-training, continued pre-training, fine-tuning and distillation: who does what, and what it costs.

Huge raw data
Pre-training
Foundation models
Fine-tuning
Custom model
  1. 1Raw data is collected.
  2. 2Pre-training teaches the model language and general knowledge.
  3. 3The result is a foundation model.
  4. 4Fine-tuning adapts it to a task, giving a custom model.
A model is pre-trained once, then adapted.

Step by step

  1. 1Raw data is collected.
  2. 2Pre-training teaches the model language and general knowledge.
  3. 3The result is a foundation model.
  4. 4Fine-tuning adapts it to a task, giving a custom model.

A model is pre-trained once, then adapted.

  • Pre-training

    Data
    Huge unlabeled data
    Cost
    Highest
  • Continued pre-training

    Data
    Unlabeled domain data
    Cost
    High
  • Fine-tuning

    Data
    Labeled examples
    Cost
    Medium
  • Distillation

    Data
    Outputs from a teacher model
    Cost
    Medium, cheaper to run after
The four training stages compared.

1 / 2

  • Pre-training

    Data
    Huge unlabeled data
    Cost
    Highest
  • Continued pre-training

    Data
    Unlabeled domain data
    Cost
    High
  • Fine-tuning

    Data
    Labeled examples
    Cost
    Medium

2 / 2

  • Distillation

    Data
    Outputs from a teacher model
    Cost
    Medium, cheaper to run after
The four training stages compared.

What it is

A foundation model is built in stages. Pre-training comes first. The model reads huge amounts of raw data, such as text from books and websites, and learns language and general knowledge. It needs very large compute and takes a long time, so only a few providers do it.

Most companies start from a pre-trained model and adapt it. Continued pre-training feeds it more unlabeled data from your field, so it learns your domain. Fine-tuning trains it on labeled examples, so it learns a task or style. Distillation trains a smaller student model to copy a larger teacher, to make a cheaper, faster model.

What it is

Each step uses less data and compute than the one before, except distillation, whose gain is lower cost at inference.

Remember

  • Pre-training: learn from huge raw data sets. Highest cost.
  • Continued pre-training: more unlabeled data to learn a domain.
  • Fine-tuning: labeled examples to learn a task or style.
  • Distillation: a small student learns from a large teacher.
  • Most teams adapt an existing model and do not pre-train.

On the exam

  • “Train a model from scratch on very large data” describes pre-training.
  • “Adapt a pre-trained model with a smaller labeled data set” describes fine-tuning.