LESSON 8.04 · 6 STAGES · 3 CONTROLS · 3 CHECKSPRO · PREVIEW
Unigram tokenization and SentencePiece
Watch a Unigram tokenizer learn its pieces, then cut text along the likeliest path.
Needs8.03 WordPiece
Pro lesson. Stage 1 is free to watch. Pro opens all 6 stages, 3 controls and 3 checks, in this lesson and every other.
Go Pro · $8.25/moEXPLAINER · 8.04 · TOKENIZER BAY17 CHARACTERS · 3 ▁ MARKS
01
Stage 1 of 6 · Spaces become ▁
SentencePiece reads the raw text as one stream. A ▁ marks the start and each space.
Explain it simply
You see the text as a row of character cells. SentencePiece puts a space mark at the start and in place of each space. The training words above it have their marks too. Now a space is a character like any other, so decoding gives back the exact text.
The text "She drinks milk." becomes 17 characters. Each space and the start get a ▁.
textpiece probabilitylosschosen pathfallback byte
Toy: the 8.C1 training text, 26 words; pieces of at most 8 characters
MATH · STAGE 1HOVER A SYMBOL OR A SHAPE
A ▁ starts the text and replaces each space.
PRO LESSON · YOU WATCHED STAGE 1 OF 6
Unlock the full explainer
- 5 more stages and 3 live controls
- 2 mix-up cards and 3 predict-then-reveal checks
- Watch it as a narrated video, in three voices
- Every Pro lesson and capstone · 656 in total
$99 a year, or $15 a month. Cancel any time.