Concepts / Pre-training Large Language Models

Pre-training Large Language Models

Changing weights is necessary for training but not sufficient to call an operation training. Ask what the change is for. Training changes weights to improve performance. Quantization changes weights by reducing their precision, and it is not a training phase.

  • Programming

When Someone Says They Trained a Model

Suppose someone tells you they have just trained a language model and asks what that means. Before you can answer, you need a shared idea of what training is, and you need to decide whether every operation that touches a model's weights belongs in that category. This article builds that idea. It separates the general word training from the more specific words pre-training, fine-tuning, and post-training, and it asks where other operations, such as quantization, fit.

What do you think happens?

Quantization changes the stored values of a model's weights. Does that make it a kind of training?

  • Yes, because it changes the weights

  • No, it changes weights but is not considered training

Reveal answer
Answer:

No, it changes weights but is not considered training

Changing weights is necessary for training, but not every weight change is training. Quantization reduces the precision of weights and changes their values, yet it is treated as a separate operation rather than a training phase.

Following the Weights Through Each Phase

The clearest way to see the relationship between the phases is to ask where each one starts. Pre-training starts from randomly initialized weights. Fine-tuning starts from a model that has already been pre-trained. Post-training comes after fine-tuning and starts from the fine-tuned model. The phases therefore form a chain, and each stage begins from the result of the stage before it.

Randomlyinitialized weightsstarting point ofpre-trainingPre-trainingtext completion for LLMsPre-trained modelstarting point offine-tuningFine-tuningspecific task, smallerdatasetFine-tuned modelstarting point ofpost-trainingPost-trainingfurther improvesperformancestarts fromproducesstarts fromproducesstarts from
Where does each phase start (random weights, a pre-trained model, or an already fine-tuned model), and how do the phases follow one another?

Read the diagram from left to right. Each phase depends on the phase before it. Pre-training does the first, foundational work. Fine-tuning adjusts an already pre-trained model toward one task. Post-training then improves the model further after fine-tuning. Because each stage begins from a model that already carries the results of earlier work, you cannot understand a later phase without knowing what came before it.

Why Changing Weights Defines Training

Definition

Training is the process of changing model weights to improve performance. Not every weight change counts as training.

The definition has two halves, and both matter. The first half says that training changes weights. Changing weights is necessary for training. The second half says that a weight change is not automatically training. The purpose of the change is what makes it training: the change is made to improve performance. This is the reason the source uses quantization as a counterexample. Quantization alters the stored weight values, but it is treated as a separate operation rather than a phase of training.

Quantization is the process of reducing the precision of model weights. It is worth studying next to training because it touches the same objects, the weights, and it can change their values. The difference is what happens to the model. When quantization occurs, the stored value becomes less precise, and the model is not being trained to get better at a task. The contrast is what makes the distinction useful.

Stored weight valuebefore either operationTrained weight valuechanged to improveperformanceQuantized weightvalueless precise, not trainingtrainingquantization
Which values change during training and which change during quantization, and does the model learn anything new in the second case?
Key point

Changing weights is necessary for training but not sufficient to call an operation training. Ask what the change is for. Training changes weights to improve performance. Quantization changes weights by reducing their precision, and it is not a training phase.

Pre-training: Starting From Random Weights

Pre-training starts from randomly initialized weights. For large language models, the source says pre-training often involves training the model for text completion. The model is trained to continue text. This general capability is the foundation that later phases build on. Since pre-training begins from random weights, every later phase starts from a model that already has the results of this work.

The word training in everyday speech often serves as a shorthand that covers the more specific phases. The source notes that the term training can often be used in place of pre-training, fine-tuning, and post-training. When you hear that someone trained a model, the phrase alone does not tell you which phase they mean. Asking where the process started, whether from random weights, a pre-trained model, or a fine-tuned model, is the quickest way to find out.

Where the Resources Go

Of all the training steps, pre-training is often the most resource-intensive by a long way. The source gives a concrete figure: for the InstructGPT model, pre-training takes up to 98 percent of the overall compute and data resources. The remaining phases together use a small share of what the project spends.

Pre-trainingup to 98 percent of computeand data (InstructGPT)Fine-tuningsmaller dataset, specifictaskPost-trainingfurther improvement afterfine-tuning
How do the data volume, compute, and cost of pre-training compare with those of fine-tuning and post-training?

The same resource demands raise the stakes. Pre-training takes a long time, and a small mistake during it can cause a significant financial loss and set the project back considerably. The source observes that because of this, pre-training has become a skill that only a few people practice, and those with expertise in pre-training large models are heavily sought after.

Mistakes Beginners Make With Training Vocabulary

  • Common mistake

    Treating every weight change as training

    What it looks like

    Reading that quantization changed the weights and concluding that the model was trained.

    Why it fails

    Changing weights is necessary for training but not every weight change is training. Quantization reduces precision and changes values without being a training phase.

    Do this instead

    Ask what the change is for. Training changes weights to improve performance.

  • Common mistake

    Using training as a single undifferentiated word

    What it looks like

    Hearing that a model was trained and assuming it started from random weights.

    Why it fails

    The term training is often used as shorthand. Pre-training starts from random weights, fine-tuning starts from a pre-trained model, and post-training starts from a fine-tuned model.

    Do this instead

    Identify the starting point before deciding which phase is meant.

  • Common mistake

    Assuming fine-tuning can replace pre-training

    What it looks like

    Thinking a small specialized dataset is enough to build a general language model from nothing.

    Why it fails

    Fine-tuning trains a pre-trained model on a specific task using a smaller dataset. It depends on the pre-training phase, which is where the foundational work happens.

    Do this instead

    Remember that each later phase begins from the results of the earlier one.

Classifying Operations on a Model

Worked example

Deciding whether an operation is training

A team takes a model that has already been pre-trained on general text. They train it further on a small dataset of medical questions to specialize it. Later, they reduce the precision of its stored weights so it runs on cheaper hardware. Which of these operations are training, and which phase or category does each belong to?

  1. 1
    Identify the starting point of the first operation

    The model was already pre-trained, so the starting point is a pre-trained model.

  2. 2
    Match the first operation to a phase

    Training a pre-trained model on a specific task with a smaller dataset is fine-tuning.

  3. 3
    Examine the second operation

    Reducing the precision of stored weights changes their values, but it is not considered training.

  4. 4
    State the classification

    The first operation is fine-tuning, which is training. The second operation is quantization, which is not training.

Result

Fine-tuning counts as training. Quantization changes weight values but is not a training phase.

EASY

A colleague says they trained a model from randomly initialized weights on a large body of text so that it learns to continue text. Which phase are they describing, and what is the defining feature that makes it training?

Hints
  • Look at the starting point the colleague describes.
  • The phase that starts from randomly initialized weights is pre-training.
  • Consider whether the weights are changed to improve performance.

Key Takeaways on Training Phases

  1. 1
    Training is the process of changing model weights to improve performance, and changing weights is necessary but not sufficient for training.
  2. 2
    Pre-training starts from randomly initialized weights and, for large language models, often trains the model for text completion.
  3. 3
    Fine-tuning trains a pre-trained model on a specific task with a smaller dataset, and post-training further improves the model after fine-tuning.
  4. 4
    Pre-training is often the most resource-intensive phase, with up to 98 percent of compute and data for InstructGPT.
  5. 5
    Quantization reduces the precision of weights and changes their values, but it is not considered training.

At a glance

  • Training is the process of changing model weights to improve performance, but not every weight change counts as training.
  • Pre-training starts from randomly initialized weights and is often used for text completion in large language models.
  • Fine-tuning and post-training both begin from earlier results, with fine-tuning on a specific task and post-training improving the model afterward.
  • Pre-training is the most resource-intensive phase, using up to 98 percent of compute and data for InstructGPT.
  • Quantization changes weight values by reducing precision, but it is not considered a training phase.

Related concepts

More concepts starting with P