You are building a 7B model for 25 languages including Hindi, Arabic, and Swahili. Design a fair tokenizer and name what it costs.
Same topic, related formats. Practice these next.
Same topic, related formats. Practice these next.
You are building a 7B model for 25 languages including Hindi, Arabic, and Swahili. Design a fair tokenizer and name what it costs.
200K-256K byte-level BPE, sampling temperature 0.3-0.5, NFC, per-language fertility+STRR+downstream eval. Fairness costs ~30 percent of model parameters and softmax latency grows linearly.
Imagine designing a phonebook for 25 different countries to share. If you give 1,000 entries to English alone, every other language has to spell things out letter by letter. If you give a fair share to each language, the phonebook becomes huge (which costs paper and time to flip through), but everyone gets quick lookups. A fair multilingual tokenizer is the second design. You spend more parameters on the bigger vocabulary, and the model takes slightly longer at every step because it has more options to choose from at the end. In return, speakers of Hindi, Swahili, Vietnamese, and other under-served languages get the same quality of service English speakers get. The cost of fairness is real (~30 percent of model parameters); the benefit is real too. Production teams decide whether to pay it based on who their users are.
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.
Open with the framing that a fair multilingual tokenizer is a parameter and latency budget decision disguised as a tokenization decision. Walk five design axes: vocab 200K-256K, sampling temperature 0.3-0.5, byte-level BPE, NFC normalization, per-language fertility+STRR+downstream eval. Explicitly surface the cost: 256K vocab on a 7B at d_model=4096 adds ~2.1B params (30 percent of model) and softmax latency grows linearly. Close with the production examples (Llama 3 128K, Qwen 3.5 152K, Gemma 2 256K) and the Token Tax research that motivates per-language evaluation.
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.
Optimizing for English fertility and reporting only the mean, hiding that low-resource languages fragment at 3-5x English rates and pay the 'token tax' in cost, context, and downstream quality.
The night-before-the-interview bullets. Scan these on the way to the call.
Primary sources. Skim if you want the original framing.