UniLID turns UnigramLM tokenizers into a language identifier
TL;DR
- UniLID reuses the UnigramLM tokenization algorithm to predict a string's language by asking under which language's unigram distribution the string is most likely.
- The method reaches roughly 70% accuracy with as few as five labeled samples per language in low-resource settings.
- It supports incremental addition of new languages without retraining and integrates into existing language model tokenization pipelines.
There is a small, tidy idea in a new paper from Clara Meister, Ahmetcan Yavuz, Pietro Lesci and Tiago Pimentel, posted to arXiv in February 2026 and revised in June: language identification, the humble step at the front of most multilingual NLP pipelines, can be done by the same tokenizer you were going to train anyway. Their method, UniLID, reuses the UnigramLM tokenization algorithm and, to predict a string's language label, simply asks under which language's unigram distribution that string is most likely.
Why bother, when fastText, GlotLID and CLD3 already handle the easy cases? Because the easy cases are the high-resource ones. The authors' framing is that existing systems remain brittle in low-resource and closely related language settings, which is precisely where corpus curation and cross-lingual evaluation of large language models actually get hard. The reported headline number is that UniLID reaches roughly 70% accuracy with as few as five labeled samples per language, and the paper claims large gains on fine-grained dialect identification.
The structural bit that matters for anyone building pipelines is that UniLID supports incremental addition of new languages without retraining, and slots into a tokenizer step you already run. You are not adding a separate classifier to the stack, you are asking one component to do a second job. That kind of small-but-real efficiency tends to get adopted quietly rather than announced loudly, especially by teams that spend real money on data curation for multilingual training runs.
The honest caveat is that these numbers are the authors' own empirical evaluations against those three baselines, and the abstract does not give you the specific benchmarks, the language coverage counts, or how the ~70% figure was averaged, so take the specifics as reported, not settled. What the reporting also does not spell out is how UniLID compares once you move past the five-sample regime into the range where fastText and GlotLID are already well trained, or how it handles code-switched and very short strings.
If the result holds up under outside scrutiny, the people who gain most are the ones who care about the long tail: dialect researchers, low-resource language communities, and the data teams inside frontier labs whose curation pipelines currently treat closely related languages as one indistinguishable blob.
Shared on Bluesky by 2 AI experts
-
Effective language identification based on a tokenizer UnigramLM tokenizer already gives probabilities, testing those to identify a language is fast and effective. Whiceh leads me to wonder, can we identify language duri…
View on Bluesky →
Originally reported by arxiv.org
Read the original article →Original headline: What Language is This? Ask Your Tokenizer