Tinker Tokens & embeddings

by Samy (Kondasamy Jayaraman)

0 tokens · 0 words · 0 charactersThe paragraph is not cut yet.

Chapter 2 of 7

How the vocabulary is learned

The sentence came out as more tokens than words: some words were cut into pieces. Nobody chose those pieces by hand; the tokenizer learned them from Larkspur’s documents.

This chapter: Where does a tokenizer’s vocabulary come from, and why does it cut where it does?

About this chapter

You will learn

  • A byte-level tokenizer starts from single bytes, so it can read any text
  • How a merge glues a common pair of tokens into one new token
  • Why the order of merges comes from the training text, not from the text you send

Words you’ll meet

Byte
The smallest unit computers store text in. An English letter is one byte; many other characters take two to four.
Merge
A rule the tokenizer learned: wherever these two tokens sit side by side, glue them into one new token.
Byte pair encoding (BPE)
Sennrich and colleagues (2016) brought byte pair encoding to neural translation: rare and unknown words are encoded as sequences of word pieces.

Step 1 of 5

A byte-level tokenizer starts from 256 tokens, one per , so it reads anything.

Cut it into bytes.