Foundation Models
Yet large language models are built exactly this way at their starting point.
Learning Without an Answer Key
Imagine trying to teach a system to write fluent English without giving it a single answer key. There is no list of correct responses to copy and no teacher marking each sentence. Yet large language models are built exactly this way at their starting point. Before a model is asked to classify emails, summarize articles, or act as a personal assistant, it first goes through a broad, general learning phase on a huge amount of plain text. Only after that does it get shaped toward a particular job.
The question this article answers is what happens during that first phase, and how it sets up everything that comes after. As you read, keep track of two things at each step: what data the model is looking at, and what it is being asked to produce.
Raw Text as the Only Material
The first step is to train the model on a large corpus of text data, often described as raw text. The word raw has a specific meaning here: the text is just regular writing, with no labeling information attached. Nobody has tagged each document with a category, a sentiment, or a correct answer. The text itself is the only material the model receives.
Raw text is not always used in its original form. Filtering may be applied before training, for example by removing formatting characters or by discarding documents written in languages the training process does not handle. Filtering changes what the corpus contains, but it does not add labels. The data remains unlabeled.
Self-Supervised Labels From Text
Readers who have studied traditional machine learning will expect labels to be necessary. In conventional supervised learning, each training example comes with a target answer, and the model learns by comparing its guesses against those answers. Labeling information is typically required for traditional machine learning models and for deep neural networks trained with the conventional supervised paradigm.
Pretraining does not work that way. LLMs use self-supervised learning, a paradigm in which the model generates its own labels from the input data. The data is not hand-labeled by people, yet the training process still has a target to aim for. The labels are produced from the text itself.
The diagram below traces how one short passage yields many training pairs. Each word becomes an input, and the word that follows it becomes the target. Notice how the target at each step is already present in the text, so no person has to write it down.
Turning one sentence into training pairs
The raw text is the sentence: The cat sat down. No one has labeled it. How can the model still obtain a target to learn from?
- 1Identify the visible material
The only material is the word sequence The, cat, sat, down. There are no tags or categories attached to it.
- 2Choose an input
Take The as the input. It is the part of the text the model is shown first.
- 3Read the target from the text
The word that follows The in the sentence is cat. That word is the target. It is produced by the text, not by a human annotator.
- 4Slide forward and repeat
Next, the input becomes The cat and the target becomes sat. Then the input The cat sat leads to the target down. Each pair is generated the same way.
One unlabeled sentence yields several input and target pairs, and every target was already sitting in the text. This is the sense in which the model generates its own labels from the input data.
Pretraining is a repeated cycle. The model reads a piece of text, makes a guess about the next word, compares that guess with the word the text actually contains, and adjusts its internal weights so that the next guess is a little better. The loop below shows one cycle and how it repeats across the corpus.
Pretraining Versus Fine-Tuning Data
After pretraining, the model is not yet specialized for a particular purpose. The second stage, fine-tuning, takes the pretrained model and trains it further on a narrower dataset that is more specific to particular tasks or domains. Fine-tuning is therefore a continuation of training, not a fresh start.
The data changes at this stage. Pretraining uses a large corpus of raw, unlabeled text. Fine-tuning uses a smaller labeled dataset, in which the examples are tied to the specific task the developer wants the model to perform. The contrast is shown below, with the two stages side by side.
The Foundation Model as a Base
A pretrained LLM is called a base or foundation model. GPT-3 is a typical example. The source describes it as capable of text completion, meaning it can finish a half-written sentence that a user provides. It also has limited few-shot capabilities, which means it can learn to perform a new task from only a few examples rather than requiring extensive training data. The source notes that GPT-3 is the precursor of the original model offered in ChatGPT.
This explains why the pretrained model is called a foundation. It is useful on its own for some behaviors, such as completing text, but it is also the thing that gets refined. Its broad abilities are the raw material that fine-tuning shapes toward tasks like classification, summarization, or translation. One base can branch into many specialized models, as the hierarchy below shows.
Mistakes Beginners Make with Pretraining
Common mistake Assuming pretraining needs a labeled dataset
What it looks likeThinking that a model must be given correct answers before it can learn from a book-sized corpus.
Why it failsSelf-supervised learning lets the model generate its own labels from the input data, so pretraining does not require labeled data.
Do this insteadDescribe pretraining data as raw, unlabeled text, and describe the targets as coming from the text itself.
Common mistake Treating fine-tuning as a fresh start
What it looks likeBelieving that a model fine-tuned for summarization was trained from nothing on summarization data alone.
Why it failsFine-tuning takes the pretrained model and trains it further, so it is a continuation of training.
Do this insteadThink of the pretrained model as the starting point and fine-tuning as the next stage applied to it.
Common mistake Thinking filtering adds labels
What it looks likeBelieving that removing formatting characters or unsupported-language documents turns the corpus into labeled data.
Why it failsFiltering changes what the corpus contains, but it does not add labels. The data remains unlabeled.
Do this insteadDistinguish between cleaning the corpus and labeling it.
Common mistake Confusing a foundation model with a task-specific model, when the foundation model is the general base that other models are built from
Practice: Tracing a Training Pair
What do you think happens?
Given the raw text The model reads text, what is the target when the input is The model?
Reveal answer
reads
The text itself supplies the next word after the input, so the target is reads. No human label is needed, which is the point of self-supervised learning.
Take the raw text: Pretrained models learn from text. For each input prefix (Pretrained, Pretrained models, Pretrained models learn), write the target word the text supplies. Then state in one sentence which stage of training this data belongs to and whether its examples are labeled.
Hints
- The target for each prefix is the next word in the sentence.
- Ask whether any human added a category or answer to the sentence.
- Compare your answer with the stage described as using a large corpus of raw text.
Key Takeaways
- Pretraining trains an LLM on a large, diverse corpus of raw, unlabeled text to develop a broad understanding of language.
- Self-supervised learning lets the model generate its own labels from the input data, so the text itself supplies the targets.
- Fine-tuning continues training the pretrained model on a smaller labeled dataset tied to particular tasks or domains.
- A pretrained LLM is a base or foundation model; its broad abilities are the starting point that refinement shapes into specialized models.