SentencePiece

Requiring text to be split into words first makes tokenization depend on another set of boundary rules. SentencePiece can learn pieces from a text stream that explicitly represents whitespace, reducing that dependence on predefined words.

14 sections · 15 questions · 3 coding challenges

1 / 14

Why Should Vocabulary Learning Require a Word Split First?

BOTIE

Many subword systems begin by asking another tool to split text into words. That creates a dependency before vocabulary learning even starts, and the split may be difficult in a writing system that does not place spaces between words.

Kudo and Richardson introduced SentencePiece in 2018 as a framework that could train subword models directly from raw sentences. Treating whitespace as an explicit symbol helped keep segmentation and detokenisation within a shared representation, instead of assuming a language-specific word splitter had already done the right thing.

The space marker lets a learned piece carry information about a preceding separator. A vocabulary method, such as BPE or a unigram model, can then work over the represented sentence. Normalisation still needs attention: if an earlier step changes the input, decoding can recover the normalised form without reproducing every original byte. SentencePiece is a framework with choices, not one universal merge rule.

Sources for this history