OpenLID-v3: Improving the Precision of Closely Related Language Identification -- An Experience Report

Mariia Fedorova, Nikolay Arefyev, Maja Buljan, Jindřich Helcl, Stephan Oepen, Egil Rønningstad, Yves ScherrerarXiv 2026 · DOI

TL;DR

Language identification (LID) tools often choke on closely related languages and web noise, leading to contaminated datasets during web-scale data curation. This paper introduces OpenLID-v3, an upgraded open-source classifier that addresses these issues by introducing a dedicated noise class, expanding training data for highly confused language pairs, and leveraging model ensembling. The authors demonstrate that while standard benchmarks often hide fine-grained LID errors, targeted evaluations reveal substantial precision improvements.

What Problem Does This Paper Address?

To train massive large language models (LLMs), researchers filter billions of web pages using Language Identification (LID) tools. However, current tools suffer from two major flaws: they struggle to distinguish closely related languages (like Danish vs. Norwegian, or Bosnian vs. Serbian), and they fall victim to the "trash bin" phenomenon.

Without a way to classify non-linguistic noise (like broken encodings, porn, or code snippets), models tend to dump this junk into random low-resource language buckets, severely ruining data quality. Furthermore, mainstream benchmarks like FLORES+ are too clean and parallel to expose these real-world failures, masking massive confusion between similar languages.

Methods

The authors build directly on the fastText-based OpenLID architecture, maintaining a fully open-source pipeline with permissive licenses. Key innovations in version 3 include:

  • A Dedicated Noise Class (zxx_Zxxx): Trained using specific noise subsets to capture web artifacts and prevent the trash bin effect.
  • Strategic Language Merging: Combining highly confused, mutually intelligible varieties (e.g., merging 8 Arabic dialects into a single macrolanguage, and combining Bambara and Dyula).
  • Script Expansion: Adding training data for languages written in multiple scripts—most notably, adding Latin-script Serbian, which was entirely missing in v2 and caused massive misclassifications as Bosnian or Croatian.
  • Top-1 Ensembling: Combining OpenLID-v3 with GlotLID to filter out disagreements and maximize precision.

Datasets

  • Standard Benchmarks: FLORES+ (devtest split), UDHR, and FastSpell.
  • Custom & Re-annotated Benchmarks: To truly test similar languages, the authors curated and re-annotated specific test sets where standard benchmarks fell short:
  • BCMS: Twitter user data, ParlaSent (parliamentary debates), and a manually re-annotated subset of HPLT-LID.
  • Romance Varieties: The ITDI dataset focusing on closely related regional languages (Ligurian, Venetian, and Friulian).
  • Scandinavian: SLIDE (a clean multilabel dataset) and Nordic DSL (noisy sentences from Wikipedia).

Key Insights and Ideas

  • The "Trash Bin" Effect is Real: If a model doesn't support a specific language or encounters pure web noise, it doesn't just fail gracefully; it accumulates junk into specific vulnerable classes (e.g., Ligurian was found to act as a trash bin in previous dataset releases).
  • Clean Benchmarks Mask Dirty Errors: A model can score 98% on clean parallel corpora like FLORES+ while completely failing on real-world web text where short sentences, colloquialisms, and named entities muddy the waters.
  • The Ensembling Trade-Off: Requiring strict top-1 agreement between OpenLID-v3 and GlotLID drastically lowers the False Positive Rate (FPR). However, it creates a harsh trade-off by reducing data coverage (recall) for low-resource languages where models naturally disagree on ambiguous text.

Key Results

Globally, OpenLID-v3 performs on par with top-tier models like GlotLID on standard benchmarks, but shows its true strength in fine-grained case studies.

Figure 1: Model comparison on three LID benchmarks, FPR (lower is better) vs. recall (higher is better). For the full set of metrics see Table 9. FLORES+ refers to the devtest split, and FastSpell refers to our version, which excludes Nynorsk.
  • Bosnian/Croatian/Serbian (BCMS): Adding Latin-script Serbian fixed a massive blind spot. On the Twitter user dataset, OpenLID-v3 achieved a loose accuracy of 46.34% compared to GlotLID's 40.65%.
  • Ensembling Power: Top-1 ensembling yielded the lowest False Positive Rates across almost all datasets, making it the strategy of choice for generating high-precision web datasets like HPLT 4.0.
Table 1: Performance comparison across three benchmark datasets showing false positive rate (FPR), precision (Prec.), and recall (Rec.) for Bosnian, Croatian, and Serbian in Latin script. OpenLID-v3 uses softmax threshold 0.5. Ensemble represents top-1 agreement between OpenLID-v3 and GlotLID. Best values per metric and language are in bold.

Limitations and Future Work

  • Data Mismatch: Even the "noisy" benchmarks used are heavily preprocessed, meaning true evaluation on raw, messy web crawls remains an open challenge.
  • Overfitting to Entities: Due to a lack of fully parallel datasets, models risk overfitting to specific named entities or topics common to certain language regions rather than learning the underlying syntax and morphology.
  • Need for Multilabel Data: Short web texts (e.g., titles, menus) are often perfectly valid in multiple related languages simultaneously. Future work must focus on building robust multilabel training sets and evaluations to handle this inherent ambiguity.

Summary updated

BibTeX
@misc{fedorova2026openlid,
  author = {Mariia Fedorova and Nikolay Arefyev and Maja Buljan and Jindřich Helcl and Stephan Oepen and Egil Rønningstad and Yves Scherrer},
  title = {{OpenLID-v3: Improving the Precision of Closely Related Language Identification -- An Experience Report}},
  year = {2026},
  eprint = {2602.13139},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2602.13139},
}
Figure