The basics

How a language model reads

What a language model does with your text: from statistics, via tokens, to why a question in Dutch costs more than the same question in English.

What tokens cost →

Statistics

Language is statistics

Behind language lies a complete set of statistics. Every word in a given context carries a statistic with it. In essence, that is the whole idea behind language models.

My favourite colour is …

blue
42%
green
21%
red
17%
purple
9%
car
0.1%
In this context “blue” is far more likely to complete the sentence than “car”. Illustrative probabilities, not measured. Example after AI engineer Chip Huyen.

Tokens

From text to tokens

But there are more regularities to discover in language. Characters carry a statistic too: in most Western languages “e” is the most used character, unlike “x” or “q”.

How often letters occur in Dutch

e
18.91%
n
10.03%
a
7.49%
t
6.79%
i
6.5%
…
x
0.036%
q
0.009%
Share of all letters in Dutch text. Source: Genootschap Onze Taal.

Some patterns of characters also occur more often, such as “ing”. A word like “wandering” can be split into two parts: wander + ing. Both parts carry a certain meaning. Dividing language into tokens means a text contains fewer tokens than characters, which in turn makes the model more efficient.

One pattern, many words

  • s + ing
  • w + ing
  • walk + ing
  • wander + ing
Simplified: every model splits words its own way, and the real boundaries differ per tokenizer.

Vocabulary

A vocabulary like an alphabet

The complete set of tokens is a model’s vocabulary, and it works like an alphabet: you use a limited number of letters to form an endless number of words. In the same way a model can build many different words from a relatively small set of tokens.

Another advantage of tokens is that the model can recognise unknown words. Often these are words from everyday speech, like hangry, or jokes like chillax.

Unknown words, known pieces

  • hang + ry
  • chill + ax

The process of splitting the original text into these tokens is called tokenization.

Rule of thumb

100 tokens is about 75 words

As a rule of thumb, a token is about three quarters of the length of a word. That means 100 tokens roughly correspond to 75 words.

One square is one token. The 75 amber squares stand for the words they roughly make. A rule of thumb for English.

Most models are optimised for English; for Dutch the ratio is less favourable. Using Dutch therefore costs more tokens, and so more money.

Same meaning, two languages

English
14
Dutch
19
Measured with Claude: the Dutch sentence needed about 36% more tokens.
Measured in the cost infographic, chapter 05 →

Next

Now you know what a token is. The next question is what it costs: input and output, caching, and the tokens you don’t see.

What tokens cost →