DIVERS-Bench: Evaluating Language Identification Across Domain Shifts and Code-Switching

Jessica Ojo, Zina Kamel, David Ifeoluwa AdelaniarXiv 2025 · DOI

Introduction

Language Identification (LID) serves as the critical "Step 0" for nearly all multilingual Natural Language Processing (NLP) pipelines. Before a system can perform machine translation, sentiment analysis, or content moderation, it must accurately determine the input language. While current state-of-the-art LID systems report accuracy exceeding 95% on standard benchmarks like Wikipedia or FLORES-200, these figures often represent a "clean room" performance that does not translate to the "messy" reality of global internet communication.

This paper introduces DIVERS-Bench, a comprehensive evaluation framework designed to stress-test LID models against domain shifts and code-switching (CS). The study reveals that while LID may appear "solved" on formal datasets, it remains a significant challenge when faced with noisy social media text and the linguistic fluidity of multilingual speakers.

The Challenge of Real-World LID

The primary discrepancy in LID performance stems from the nature of the training and evaluation data. Most existing benchmarks rely on professional translations or formal prose. However, real-world text—particularly on social media—is characterized by slang, orthographic variations, and code-switching. Code-switching, the practice of alternating between two or more languages within a single utterance (e.g., "I'm going to the mercado to buy some frutas"), presents a structural challenge for traditional LID models.

Most current LID systems are architected as single-label classifiers using a softmax activation function. This design forces the model to pick a single "winner," making it fundamentally incapable of identifying the multiple languages present in code-switched text.

Methodology and DIVERS-Bench

The researchers evaluated eight prominent LID models, including traditional statistical tools like Google’s CLD3 and LangDetect, as well as modern deep-learning models like GlotLID (supporting over 1,600 languages) and ConLID.

To assess these models, the authors developed DIVERS-Bench, which is divided into two primary categories:

1. DIVERS-MONO (Monolingual Evaluation)

This component tests model robustness across five distinct domains:

  • Formal: FLORES-200 (professional translations).
  • Informal/Noisy: TweetLID (Twitter/X data).
  • Structured/Simple: Bloom Stories (children’s literature).
  • Oral-to-Text: Common Voice (speech transcripts).
  • Diverse/Low-Resource: SMOL (covering 115 low-resource languages).

2. DIVERS-CS (Code-Switching Evaluation)

This unified benchmark covers 10 language pairs, including English–Hindi, Chinese–English, and Egyptian–English. To give single-label models a fair chance, the researchers allowed models to provide their "top-2" predictions. Performance was measured using two metrics:

  • Full Match (FM): The model correctly identifies both languages in the string.
  • Partial Match (PM): The model identifies at least one of the two languages.

Key Insights and Results

The evaluation yielded several critical insights into the current state of LID technology:

The Performance Gap

Models that achieved high F1 scores (approx. 94.1) on formal FLORES data saw a dramatic performance drop—often exceeding 30 points—when applied to informal TweetLID data. This suggests that high accuracy on curated datasets is a poor indicator of real-world robustness.

The Code-Switching Failure

The most striking finding was the near-total failure of models to handle code-switching. In the "Full Match" category, most models scored near zero. Even the best-performing model, OpenLID, only achieved 16% accuracy on the Basque-Spanish pair. For complex pairs like English-Hindi, models almost universally failed to identify both languages, typically defaulting to the most dominant language (often English).

Coverage vs. Accuracy

The study highlighted a trade-off between "narrow" models (supporting 20-50 languages) and "broad" models (supporting 2,000+ languages). While broad models like GlotLID are essential for global inclusivity, they face a higher risk of false positives due to the massive label space they navigate.

The Low-Resource Cliff

A significant digital divide persists. While high-resource languages consistently see F1 scores above 85, performance for low-resource languages (Joshi Class 0-2) frequently drops below 30, indicating that current LID systems are still failing a large portion of the world's linguistic diversity.

Conclusion and Future Directions

The DIVERS-Bench results suggest that the LID field requires a paradigm shift. Moving forward, researchers should transition away from "winner-take-all" architectures, as softmax-based single-label classifiers are insufficient for the multilingual nature of modern text. Multi-label or span-based architectures are needed to capture linguistic fluidity.

Furthermore, future benchmarks should move toward token-level (word-level) identification to better capture the nuances of code-switching. While Large Language Models (LLMs) offer potential, their computational cost makes them impractical for the high-speed preprocessing roles LID typically fills. Therefore, improving the efficiency and robustness of dedicated LID models remains a vital area of NLP research.

Summary updated

BibTeX
@misc{ojo2025divers,
  author = {Jessica Ojo and Zina Kamel and David Ifeoluwa Adelani},
  title = {{DIVERS-Bench: Evaluating Language Identification Across Domain Shifts and Code-Switching}},
  year = {2025},
  eprint = {2509.17768},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2509.17768},
}
Figure