Concepts / Scaling Language Models

Scaling Language Models

Language models are one family among these, yet they became the center of the scaling effort that led to the ChatGPT moment.

  • Programming

Why Labels Become a Bottleneck

Most machine learning systems are trained on examples that someone has marked with the correct answer. A photo labeled as a cat, or a review labeled as positive, gives the learner something specific to aim for. Preparing those labels takes effort, and that effort limits how much training data can be collected. Language models follow a different path: they learn from ordinary text sequences, and no one has to attach a label to each one.

What do you think happens?

Because a language model learns without human-written answer keys, is self-supervision just another name for unsupervised learning?

  • Yes, both learn without any answer keys

  • No, self-supervision is a different approach that still has labels, which come from the text itself

Reveal answer
Answer:

No. Self-supervision is a different approach from unsupervised learning. Self-supervised learning uses labels that come from the text, while unsupervised learning, as described in the source, does not need labels at all.

The shared feature is that no human writes the answers, which is why the two are easy to confuse. The key difference is that self-supervised training still has a training signal, because the labels are inferred from the input data. The next sections show how that works.

Machine learning covers many kinds of models. Some detect objects in images, some forecast the weather, some predict stock prices, and some recommend products. Language models are one family among these, yet they became the center of the scaling effort that led to the ChatGPT moment. The reason is a property of how they can be trained: they can learn from self-supervision, while many other model types need supervision. This article explains what that property means and why it matters.

The Cost of Supervised Learning

In supervised learning, you show a model examples of the behavior you want and attach a label to each one. Once trained, the model can be applied to new data. A fraud detection model, for instance, learns from transactions that are each tagged as fraud or not fraud, and then predicts the tag for transactions it has never seen. The success of many AI systems in the 2010s rested on this approach.

The weakness is cost. Obtaining labels is expensive and slow, and this is the data labeling bottleneck that limits how large a supervised dataset can grow. The bottleneck gets worse as tasks become harder. Labeling everyday objects is something most people can do without training, but labeling whether a medical scan shows signs of cancer demands expert time and is far more costly.

Definition

The data labeling bottleneck is the limit on how large a supervised dataset can grow, caused by the expense and slowness of obtaining labels for each example.

Splitting One Sentence into Training Samples

Self-supervision removes the need for an external answer key. Instead, the model infers the labels from the input data itself. Language modeling is a clean case of this. Every input sequence contains two things at once: the tokens the model should predict, and the surrounding tokens that serve as context for predicting them. Because the text supplies both, a large body of ordinary writing can be turned into training material without anyone annotating it.

Take a new sentence to see the mechanism: Cats chase mice. The sentence is first wrapped in a beginning marker and an end marker. It has four ordinary tokens, and each position in the sequence becomes one training sample. The learner sees the context to the left of a position and must predict the token that comes next. Watch how the context grows one token at a time.

SampleContext the model seesNext-token target
1<BOS>Cats
2<BOS> Catschase
3<BOS> Cats chasemice
4<BOS> Cats chase micethe period
5<BOS> Cats chase mice .<EOS>

Five training samples from one sentence, with no human-written labels. Each target is simply the token that actually follows in the text.

Worked example

Counting the samples from one sentence

How many training samples does the sentence Cats chase mice produce, and where does each target come from?

  1. 1
    Wrap the sequence

    The sentence gets a beginning marker and an end marker, giving the sequence <BOS> Cats chase mice . <EOS>.

  2. 2
    Count the positions that need a prediction

    Each ordinary token position and the end position produce one sample. Here there are four ordinary tokens, so the sample count is five.

  3. 3
    Read each target from the text

    The target at each step is the token that actually follows the context in the sentence. No person wrote these answers.

Result

Five samples, each with a context and a next-token target, produced from one sentence with no labeling step.

Notice what happened. A single sentence produced five separate training samples, and no one wrote a label for any of them. A longer passage of text yields many more samples in the same way, which is why this approach can scale to very large collections of writing.

Reading the BOS and EOS Markers

The markers at the edges of each sequence are special tokens. The beginning marker, written <BOS>, shows where a sequence starts. The end marker, written <EOS>, shows where it stops. Each marker is typically handled by the model as one token, not as a set of characters. These markers matter because a language model usually works with many sequences, and it needs a clear way to tell where one ends and the next begins.

In the sentence example, <BOS> sits at the left edge and gives the model a starting point for the first prediction. <EOS> sits at the right edge. The source notes that the end marker teaches the model when to stop. In the final sample, the context is the full sentence and the target is <EOS>, so the model is trained to predict the end of the sequence as well as the words within it.

Comparing the Three Learning Approaches

The distinction is not whether a model is trained on raw data, since both approaches can use it. The distinction is whether the learning setup relies on labels, and where those labels come from. Use the presence or absence of labels as the key test.

ApproachSource of labelsHuman answer key neededWorks on raw text
Supervised learningPeople attach a label to each exampleYesOnly if the text is labeled
Unsupervised learning (as described in the source)No labels neededNoYes
Self-supervised learningInferred from the input text itselfNo external answer keyYes

The key test is whether labels exist and where they come from. Self-supervision has labels, but the text supplies them.

  • Common mistake

    Filing self-supervision under unsupervised learning because both avoid human-made answer keys

    What it looks like

    Assuming a language model trained on Cats chase mice has no training signal at all.

    Why it fails

    Self-supervised learning still has a training signal. Its labels come from the text, and each next token is the target.

    Do this instead

    Ask whether labels exist and where they come from. Self-supervision infers them from the input; unsupervised learning, as described here, needs no labels.

  • Common mistake

    Thinking self-supervision needs humans to label the data

    What it looks like

    Believing every language model sample must be annotated before training.

    Why it fails

    The source states that each input sequence supplies both the tokens to predict and the context used to predict them.

    Do this instead

    Recognize that no step in the chain asks a person to mark what each sequence means.

How Self-Supervised Training Runs

Self-supervised training follows a chain. Text sequences are gathered from sources such as books, blog posts, articles, and Reddit comments. Each gathered sequence is wrapped in <BOS> and <EOS> and split into positions. At each position, the text itself supplies the target, the token that really comes next. The model makes its prediction from the context, and its parameters, which are variables updated during training, change as training runs. No step asks a person to mark what each sequence means.

  1. 1
    Gather text sequences such as books, blog posts, articles, and Reddit comments.
  2. 2
    Wrap each sequence with the <BOS> beginning marker and the <EOS> end marker.
  3. 3
    Read the labels from the text: each target is the token that actually follows the context.
  4. 4
    Ask the model to predict the next token from the context to the left of each position.
  5. 5
    Update the model's parameters during training so later predictions improve.

Parameters as the Measure of Model Size

Before asking how large a language model is, we need a way to measure size. A model's size is typically measured by its number of parameters. The source defines a parameter as a variable within an ML model that is updated through the training process. Each time training runs, these variables change, and the final values are what the trained model uses.

Definition

A parameter is a variable within a machine learning model that is updated through the training process. The number of parameters is the usual measure of a model's size.

Parameters matter because they set how much a model can absorb. In general, a model with more parameters has a greater capacity to learn the behaviors we want. The source adds a necessary qualification: this is not always true. Parameter count is a useful guide, not a guarantee, so it should be read as a tendency rather than a rule.

How the Meaning of Large Keeps Shifting

The source gives a concrete history that shows how quickly the idea of a large model has shifted. Each milestone records a model and its parameter count at the time it appeared.

Point in timeParameter figureHow the figure was regarded
2018117 millionConsidered large
After GPT-2 arrived1.5 billion (GPT-2)The 117 million figure was downgraded to small
At the time of writing100 billionConsidered large, though this could one day be considered small too

Milestones from the source. The word large describes a moving reference point, not a fixed size.

This is why the source observes that what is large today might be considered tiny tomorrow. The label is relative to the models available at the time.

Capacity and the Need for Data

The source raises a question that is usually taken for granted: why do larger models need more data? Its answer starts with capacity. Larger models have more capacity to learn, and that extra capacity only pays off when there is enough training data to fill it. A model with a large capacity but little to learn from is like a student with a big memory and only a few pages to read.

The consequence follows directly from capacity. The more a model can learn, the more material it needs to learn from in order to reach its best performance. Model size and dataset size therefore need to move together.

Predicting Samples from a New Sentence

EASY

Apply the same wrapping and splitting to the sentence Dogs bark loudly. How many training samples does it produce, and what is the target of the final sample?

Hints
  • Wrap the sentence in <BOS> and <EOS> first.
  • Count one sample per ordinary token position, then add the sample whose target is the end marker.
  • The final sample's context is the full sentence, and its target is <EOS>.
Output
Expected answer: four samples. The contexts are <BOS>, <BOS> Dogs, <BOS> Dogs bark, and <BOS> Dogs bark loudly, with targets Dogs, bark, loudly, and <EOS>.

Key Takeaways

  • Self-supervision avoids the data labeling bottleneck by inferring labels from the input text itself, so no external answer key is needed.
  • One sentence yields several training samples: each position provides a context and a next-token target taken from the text, with <BOS> at the start and <EOS> marking where the sequence stops.
  • The key test between approaches is whether labels exist and where they come from: supervised learning uses human labels, unsupervised learning as described here needs none, and self-supervised learning infers labels from the text.
  • Model size is typically measured by parameters, which are updated during training; more parameters generally means more capacity, though not always.
  • Larger models need more training data to use their capacity, and training a large model on a small dataset wastes compute.

Related concepts

More concepts starting with S