Tokens and Embeddings, lesson 11
Bits per byte
A loss you can compare across models with different tokenizers.
You know average negative log-likelihood ("A bigram language model") and that two tokenizers can turn one text into very different token counts ("Tokenizer quirks: numbers, spelling, languages").
Part 1. Loss per token depends on the tokenizer
Two teams train language models and test them on the same 1,000-byte passage. Team A's tokenizer uses one token per byte, so the passage is 1,000 tokens. Team B's is BPE, and its tokens cover 4 bytes on average, so the passage is 250 tokens.
Each team reports its average loss per token, the same kind of number as the bigram model's 1.631. A gets 1.2. B gets 3.6. (These results are made up, but they're the right shape.)
Your turn
Which model predicts the passage better?
Loss per token is an average over tokens, and the tokenizer decides how many tokens there are. The total loss over the passage doesn't depend on that, as long as both models read the same passage.
Part 2. From nats to bits
Keep going with Pro
You've done the first part. Pro opens the rest of this lesson, and every other one.
- From nats to bits
- Divide by the bytes
- Why training runs report it
Tokens and Embeddings overviewSpotted a mistake? Tell us.