The Unigram Language Model

A word can have several valid divisions into smaller pieces. A unigram tokenizer assigns probabilities to those pieces so it can compare complete segmentations while learning which vocabulary entries to keep.

14 sections · 15 questions · 3 coding challenges

1 / 14

Must a Word Have Only One Useful Segmentation?

BOTIE

A vocabulary can spell the same word through several sequences of pieces. A fixed merge order commits to one route, but another route may use pieces that generalise better when the wording or domain changes.

Kudo's 2018 work on subword regularisation used a unigram language model over pieces to support multiple segmentation candidates. Sampling different segmentations during training offered a way to make a translation model less dependent on one rigid division of the text.

Each piece has a probability, and a complete route receives a score from its constituent pieces. We can compare routes through the same text or sample among them. Vocabulary fitting can remove pieces whose loss is least harmful under the objective. The independence assumption belongs to this segmentation model; it does not claim that the words of a real sentence are independent.

Sources for this history