Concepts / Tokens and Vocabulary in Language Models

Tokens and Vocabulary in Language Models

The GPT-3 dataset totals 499 billion tokens, but the model was trained on 300 billion tokens, and the source gives no reason for the difference.

  • Programming

Why One Dataset Size Is Not Enough

When people say a model was trained on a dataset, they usually mean a single number. For GPT-3, that number is not as simple as it first looks. The dataset the training data was drawn from is reported at one size, and the amount the model actually consumed during training is reported at a smaller size. Understanding the gap between those two numbers is the first step toward reading any large-model dataset description accurately.

In this article you will follow the GPT-3 figures from the full pool to the training run, place them beside the much larger CommonCrawl corpus, and then look at the additional data sources that later models added. Throughout, keep one question in mind: is a given figure a count of tokens, a size in gigabytes, or a share of a sample?

Tracing the GPT-3 Token Pool

The GPT-3 training data is described in a table that lists its component subsets together with a count of tokens for each one. If you add up the token counts in that column, the total is 499 billion tokens. This is the size of the dataset as a whole. It is the pool that the training data was drawn from.

The model itself was trained on 300 billion tokens, which is less than the full 499 billion. The source does not give a reason for this. The authors of the GPT-3 paper did not explain why training stopped short of the full pool, so the accurate statement is that the size of the dataset and the size of the training run are two different figures. Neither number is wrong; they answer different questions.

GPT-3 dataset total499 billion tokensTokens used fortraining300 billion tokenstraining consumed
How can a dataset contain 499 billion tokens while the model trains on only 300 billion, and which part of the pool is actually used? The full pool is the total, and the training run consumed a smaller count.
Worked example

Following the GPT-3 figures in order

Track the GPT-3 numbers from the full pool to the amount used in training, the way you would track money moving from a total balance into a spending account.

  1. 1
    Start with the pool

    Adding up the token column of the GPT-3 data table gives 499 billion tokens. This is the size of the whole dataset.

  2. 2
    Identify the training count

    The model was trained on 300 billion tokens. This is the amount consumed during the training run.

  3. 3
    Compare the two

    300 billion is less than 499 billion, so training used fewer tokens than the pool contains. The source gives no reason for the difference.

  4. 4
    Keep the labels straight

    Report the dataset as 499 billion tokens and the training run as 300 billion tokens. Quoting only one of them misrepresents the other.

Result

The GPT-3 dataset is 499 billion tokens, and the model was trained on 300 billion of them. The two figures describe different things.

Reading the Proportions and Token Columns

The GPT-3 data table has two numeric columns, and they measure different things. The token column gives the size of each subset, so it tells you how big each part of the pool is. The proportions column gives each subset's share of the sampled data. Those shares add up to 100 percent of the sample, with small adjustments made for rounding errors.

In short, the proportions tell you how the sample is split across subsets, while the token column tells you how big the pool is. When you read a dataset description, check which column a number came from before you interpret it.

Setting CommonCrawl Beside GPT-3

To judge whether 499 billion tokens is a large amount, it helps to compare it with another dataset. The source uses the CommonCrawl dataset for this purpose. CommonCrawl alone consists of 410 billion tokens and requires about 570 GB of storage.

The two measures in that sentence answer different questions. Tokens measure how much text there is in units the model reads, while gigabytes measure how much disk space the data occupies. Because the source gives CommonCrawl in both units, you can compare it with the GPT-3 figures on tokens. The source does not give a storage size for the GPT-3 dataset, so no storage comparison with GPT-3 can be made from the source.

GPT-3 dataset total499 billion tokensCommonCrawl storageabout 570 GBCommonCrawl alone410 billion tokensGPT-3 training run300 billion tokenslarger by 89 billionlarger by 110 billionmeasured in storage
Which is larger on the token measure? CommonCrawl's 410 billion tokens sit below the GPT-3 dataset total of 499 billion and above the 300 billion tokens used for training. CommonCrawl's storage size is given separately in gigabytes.

On the token measure, the GPT-3 dataset total is the largest of the three figures, CommonCrawl is in the middle, and the GPT-3 training count is the smallest. The comparison also shows that a single public corpus can be very large on its own terms even though it is not the whole of a particular model's data.

Additional Sources in Later Models

The source notes that later iterations of models like GPT-3 have widened their training scope. Meta's LLaMA is named as an example. Rather than relying only on a web-derived corpus, these later models include additional data sources. Two are named in the source. Arxiv research papers add 92 GB to the dataset, and StackExchange code-related questions and answers add 78 GB.

Web-derived corpusCommonCrawl is one exampleArxiv research papers92 GBLater models suchas LLaMAwider training scopeStackExchange Q&As78 GB, code-relatedextended byaddsadds
Which data sources sit inside the training scope, and how do the added sources relate to the original web-based corpus? The web-derived corpus is the starting base, and later models add specialized sources alongside it.

What the source does establish is the direction of change. Newer models drew on specialized sources such as scientific papers and programming question-and-answer material, in addition to the kind of data that the earlier GPT-3 corpus was built from.

Mistakes When Reading Dataset Sizes

  • Common mistake

    Treating the 499 billion figure as the amount the model trained on

    What it looks like

    Saying GPT-3 was trained on 499 billion tokens.

    Why it fails

    The 499 billion figure is the size of the dataset as a whole. The training run used 300 billion tokens.

    Do this instead

    Report the pool as 499 billion tokens and the training count as 300 billion tokens.

  • Common mistake

    Reading the proportions column as token counts

    What it looks like

    Concluding that a subset with a 20 percent share contains 20 billion tokens.

    Why it fails

    Proportions describe shares of the sample. The token column gives the size of each subset.

    Do this instead

    Use the token column for sizes and the proportions column for shares.

  • Common mistake

    Comparing gigabytes with tokens as if they were the same unit

    What it looks like

    Deciding that 92 GB of Arxiv papers is a specific number of tokens.

    Why it fails

    The source gives the additional sources in gigabytes and does not convert them to tokens.

    Do this instead

    Keep the storage figures in GB and do not infer a token count from them.

  • Common mistake

    Assuming the source explains why training stopped at 300 billion tokens

Practice With the Figures

EASY

Using only the figures in this article, state whether CommonCrawl's token count is larger than the number of tokens the GPT-3 model was trained on. Then explain which column in the GPT-3 table each of your figures came from.

Hints
  • Find the token count for CommonCrawl and the training count for GPT-3.
  • Compare the two numbers directly, and remember that both are measured in tokens.

What do you think happens?

Is CommonCrawl larger than the GPT-3 training run, measured in tokens?

  • Yes, CommonCrawl has more tokens than the training run

  • No, the training run has more tokens than CommonCrawl

Reveal answer
Answer:

Yes. CommonCrawl alone is 410 billion tokens, and the GPT-3 training run used 300 billion tokens.

Both figures are counts of tokens, so they can be compared directly. The storage size of CommonCrawl, about 570 GB, is a different measure and does not change this comparison.

Key Takeaways

  • The GPT-3 dataset totals 499 billion tokens, but the model was trained on 300 billion tokens. The source gives no reason for the difference, and the dataset size and training size are separate figures.
  • In the GPT-3 table, the token column gives the size of each subset and the proportions column gives each subset's share of the sample, which sums to 100 percent.
  • CommonCrawl alone is 410 billion tokens and about 570 GB of storage. On the token measure it sits below the GPT-3 dataset total and above the GPT-3 training count.
  • Later models such as Meta's LLaMA widened their training scope with Arxiv research papers at 92 GB and StackExchange code-related Q&As at 78 GB. These are given in gigabytes, not tokens.

Related concepts

More concepts starting with T