Same topic, related formats. Practice these next.
Same topic, related formats. Practice these next.
Unigram LM starts with a large vocabulary and prunes the tokens whose removal least hurts corpus likelihood, the opposite direction from BPE's additive merges.
Imagine you start with a giant box holding every word and word-fragment you could ever use. Your job is to shrink the box to a fixed size, keeping only the most useful pieces. Instead of guessing, you test each piece: if I throw this one out, how much harder is it to describe my training text? You keep tossing the pieces that you barely miss, and stop when the box is the right size. That is Unigram LM. It prunes a big vocabulary down by usefulness, which is the reverse of the other popular method that starts tiny and glues frequent pieces together.
Everything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example. Click to expand.
Everything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example.
Everything important, quickly.
3 min: subtractive vs additive + EM E-step and M-step + likelihood objective + pruning by smallest drop + probabilistic output enables sampling.
Real products, models, and research that use this idea.
What an interviewer would ask next. Try answering before peeking at the approach.
Red flags and common mistakes that signal junior thinking. Click to expand.
Mixing up the directions. Unigram LM prunes a large vocabulary down by likelihood, while BPE merges up from characters by frequency.
The night-before-the-interview bullets. Scan these on the way to the call.
Primary sources. Skim if you want the original framing.