Problem solved in full
-
Compression when sixty-eight characters become thirteen tokens 5 steps
Sixty-eight characters become thirteen tokens. Work out the compression, and then what those five characters per token are actually worth to a model.
-
The two counts are the whole measurement: characters in, tokens out.
-
Their ratio is a little over five, which is typical for English under byte-pair encoding — common words survive as single tokens and rare ones fragment.
-
The comparison that matters is against the alternative. A byte-level model reads the same text as 68 tokens, more than five times the sequence length.
-
And the attention matrix holds n² entries, so a factor of 5.23 in length is a factor of 27 in that part of the work. The rest of the network is linear in n and falls by 5.23, and which of the two dominates depends on the context length: attention only takes over past a few thousand tokens.
-
All thirteen tokens here are distinct, which tells you the text is short and varied — there is no repetition for the merges to exploit beyond what the vocabulary already encodes.
Answer
The tool prints 13 tokens for 68 characters, 5.23 characters per token. That compression is why tokenization exists at all and why it is not a detail: at a fixed context length it is the difference between five pages of text and one. It is also why the same model is cheaper in English than in languages the vocabulary was not built for — the merges were learned on a corpus, so a script under-represented there fragments toward the byte level and pays in both terms, linearly everywhere and quadratically in attention. Paste in some text in another language and watch the ratio fall.
-
Learning path
How an LLM picks the next word
References (2)
- Byte-pair encoding applied to text, which is where subword tokenisation came from: R. Sennrich, B. Haddow and A. Birch, "Neural Machine Translation of Rare Words with Subword Units." Proceedings of the 54th Annual Meeting of the ACL (Volume 1: Long Papers), 1715–1725, 2016.
- The language-independent scheme most current models actually ship: T. Kudo and J. Richardson, "SentencePiece: A simple and language independent subword tokenizer and detokenizer for Neural Text Processing." Proceedings of EMNLP 2018: System Demonstrations, 66–71, 2018.