Tokenization and Its Effect on Model Evaluation
Bits per token is not directly comparable across language models that use different tokenization methods, because each token can represent a different amount of text.
Two Models With the Same Bits per Token
Suppose two language models both report a cross entropy of 6 bits. It is tempting to conclude that they are equally good at the same job. That conclusion depends on an assumption that often fails: that each model's token means the same amount of text. A model that treats each word as a token and a model that treats each character as a token can both report 6 bits per token, yet those 6 bits cover very different amounts of text.
This article follows one idea through the whole discussion. Bits per token is a per-token figure, so it only means something when you know how much text a token holds. The two metrics introduced to fix this problem are bits-per-character (BPC) and bits-per-byte (BPB). Together they connect cross entropy to a practical question: how much can a model compress text?
What One Token Actually Covers
A tokenization method cuts a stretch of text into spans. Each span becomes one token, and the spans can be long or short depending on the method. The same stretch of text can therefore be cut into a small number of long tokens or a large number of short tokens. When a model reports a fixed number of bits for each token, the bits are being spread over whatever span that token happens to cover.
To see this concretely, take a 12-character text, abcdefghijkl. Tokenizer A cuts it into six tokens of 2 characters each: ab, cd, ef, gh, ij, and kl. Tokenizer B cuts the same text into three tokens of 4 characters each: abcd, efgh, and ijkl. Both tokenizers describe exactly the same text. Only the spans differ.
Notice what changed. Tokenizer A uses six tokens and Tokenizer B uses three, yet the text is identical. Each token in A covers half as many characters as each token in B. If every token costs 6 bits, then A spends more total bits on the same text, and the bits it spends are spread over a smaller span per token.
Comparing Bits per Character Across Two Tokenizers
Now apply the same measurement to both tokenizers. Assume each token costs 6 bits, as in the opening example. A raw bits-per-token comparison says the two models are identical. Converting to bits per character shows the difference.
BPC for the Same 12-Character Text
Both tokenizers spend 6 bits per token on the text abcdefghijkl. Tokenizer A averages 2 characters per token and Tokenizer B averages 4 characters per token. Find the bits per character for each.
- 1Step 1: Find the bits per token for each tokenizer
Both tokenizers spend 6 bits on each token, so the bits-per-token value is 6 for A and for B.
- 2Step 2: Find the average characters per token
Tokenizer A has an average of 2 characters per token. Tokenizer B has an average of 4 characters per token.
- 3Step 3: Divide bits per token by characters per token for A
For A, the calculation is $\frac{6}{2} = 3$ bits per character.
- 4Step 4: Divide bits per token by characters per token for B
For B, the calculation is $\frac{6}{4} = 1.5$ bits per character.
- 5Step 5: Compare the results
Under the raw per-token figure both models look equal at 6. Under BPC, Tokenizer B spends half as many bits per character as Tokenizer A on the same text.
Tokenizer A has a BPC of 3 and Tokenizer B has a BPC of 1.5. The per-token numbers hid a difference that BPC makes visible.
What do you think happens?
If the same 6 bits per token now cover 4 characters instead of 2, what happens to bits per character?
Reveal answer
It halves to 1.5
Bits per character is bits per token divided by characters per token. Going from 2 characters per token to 4 changes 6 divided by 2 (which is 3) into 6 divided by 4 (which is 1.5).
Rescaling Bits per Token to Bits per Character
Bits-per-character rescales the per-token figure into a per-character figure. The procedure is simple. Take the number of bits the model spends on each token and divide it by the average number of characters that a token contains. Because every model can be described in terms of characters, BPC gives a common basis for comparing models that split text in different ways.
In the source's own example, a model spends 6 bits per token and each token averages 2 characters, so the BPC is $\frac{6}{2} = 3$ bits per character. The pipeline below shows the same steps as a flow: two inputs feed one division, and the division produces the BPC.
When comparing two models that report bits per token, first find the average characters per token for each tokenizer. Convert both values to BPC before drawing any conclusion about which model is more efficient.
Where BPC Still Falls Short
BPC removes the dependence on token size, but it still has a weakness, and the source points to its cause: the number of bits used to store a character depends on the character encoding scheme. Under ASCII, each character is encoded using 7 bits. Under UTF-8, a character can take anywhere from 8 to 32 bits.
Bits-per-byte fixes this by anchoring the measure to the byte, the unit of the original training data rather than the character. BPB is the number of bits a language model needs to represent one byte of that data. Because the reference unit is the stored byte, the measure accounts for the encoding scheme, which is why the source calls BPB a more standardized metric than BPC.
| Property | BPC | BPB |
|---|---|---|
| Reference unit | Character | Byte of the original training data |
| Depends on character encoding | Yes, so it can vary | Accounted for, because the unit is the stored byte |
| Standardization | Gives a per-character basis, but is less standardized | The more standardized metric, according to the source |
| Derived from | Bits per token divided by average characters per token | BPC scaled by how much of a byte each character occupies |
BPC and BPB compared by reference unit and standardization
Converting BPC to BPB
To move from BPC to BPB, the bits-per-character value is scaled by how much of a byte each character occupies. The source's example uses ASCII, where each character is 7 bits. Seven bits is $\frac{7}{8}$ of a byte, because a byte has 8 bits.
BPB From a BPC of 3 Under ASCII
A model has a BPC of 3 on ASCII text. Convert this to bits per byte, rounded to two decimal places.
- 1Step 1: Identify the byte fraction
Under ASCII each character is 7 bits, which is $\frac{7}{8}$ of a byte.
- 2Step 2: Divide the BPC by the byte fraction
The calculation is $\frac{3}{\frac{7}{8}}$. Dividing by a fraction is the same as multiplying by its reciprocal, so this equals $3 \times \frac{8}{7} = \frac{24}{7}$.
- 3Step 3: Round to two decimal places
The value $\frac{24}{7}$ is approximately 3.4286, which rounds to 3.43.
The BPB is 3.43.
Reading BPB as Compression
The reason these metrics matter is their link to cross entropy. The source states that cross entropy tells us how efficient a language model will be at compressing text. Cross entropy is measured in bits, and BPB expresses that same cost against the bytes of the original text. A lower BPB therefore means fewer bits are spent on each original byte, so the model can represent the text more compactly.
The baseline is the original data itself. Each original byte has 8 bits. A model with a BPB of 3.43 represents that byte using only 3.43 bits. Because 3.43 is less than half of 8, the model can compress the original training text to less than half its original size.
Lower BPB means fewer bits per original byte. The comparison baseline is the 8 bits that every original byte occupies, so a BPB value well below 8 indicates a more compact representation of the text.
Converting a New Measurement
A model reports 4 bits per token on ASCII text. Its tokens average 2 characters each. Compute the BPC first, then convert that BPC to BPB, rounding to two decimal places.
Hints
- Start by dividing bits per token by average characters per token to get BPC.
- Under ASCII each character is 7 bits, so the byte fraction is 7/8. Divide your BPC by 7/8, which is the same as multiplying by 8/7.
- The BPC should come out to 2. The BPB is 2 multiplied by 8/7, which is 16/7, or about 2.29.
Common Mistakes When Comparing Models
Common mistake Comparing raw bits per token across tokenizers
What it looks likeModel A and Model B both report 6 bits per token, but A averages 2 characters per token and B averages 4.
Why it failsEach token covers a different amount of text, so equal per-token values do not mean equal efficiency.
Do this insteadConvert each model to BPC by dividing bits per token by average characters per token, then compare the BPC values.
Common mistake Dividing by the total characters instead of the average characters per token
Why it failsBPC is defined with respect to the average number of characters that a single token contains, not the length of the whole text.
Do this insteadUse the average characters per token for the tokenizer being measured.
Common mistake Treating BPC as the standardized metric across different encodings
What it looks likeTwo models with the same BPC are assumed to be equally efficient even though they use different encodings.
Why it failsThe number of bits per character depends on the encoding scheme, so BPC can vary for the same underlying measure.
Do this insteadConvert to BPB, which is anchored to the byte of the original training data and is the more standardized metric.
Common mistake Multiplying by 7/8 when converting BPC to BPB under ASCII
What it looks likeConverting a BPC of 3 by computing 3 times 7/8, which gives 2.625.
Why it failsThe conversion divides BPC by 7/8, because each character takes 7/8 of a byte and BPB counts bits per whole byte.
Do this insteadDivide the BPC by 7/8 (equivalently, multiply by 8/7). A BPC of 3 gives a BPB of 3.43.
Key Takeaways
- Bits per token cannot be compared directly across tokenizers, because each token can cover a different amount of text.
- Bits per character (BPC) is bits per token divided by the average characters per token, giving a shared per-character basis for comparison.
- BPC still depends on the character encoding, so bits per byte (BPB), the bits a model needs per byte of original training data, is the more standardized metric.
- A lower BPB means fewer bits per original byte, which corresponds to a more compact representation and a text that can be compressed to a smaller size.