Tinker Tokens & embeddings

by Samy (Kondasamy Jayaraman)

9 tokens · 8 words · 43 charactersGPT-2’s tokens, recorded ahead of time.

Chapter 4 of 7

Every tokenizer splits differently

Real tokenizers counted Larkspur’s documents differently from each other. The team now looks at why, sentence by sentence.

This chapter: Why does the same sentence become different tokens on different tokenizers?

About this chapter

You will learn

  • How leading spaces and capitals make different tokens
  • Why numbers and code cut into odd pieces
  • Why other languages often take more tokens for the same meaning

Words you’ll meet

Leading space
A space glued to the front of a word’s token: “ shelf” and “shelf” are different tokens.
Token tax
The extra tokens one language or kind of text needs, against English, for the same content.

Step 1 of 5

Each tokenizer learned its own vocabulary, so each cuts a sentence its own way. The team recorded GPT-2 and GPT-4o (o200k_base).

Predict the Hindi count.

On GPT-2, Larkspur’s order message in English is 9 tokens: “Your order of 12 shelves arrives on Friday.” How many tokens does the same message in Hindi take?