On the Calibration of Massively Multilingual Language Models

Kabir Ahuja, Sunayana Sitaram, Sandipan Dandapat, Monojit Choudhury

Abstract

Massively Multilingual Language Models (MMLMs) like mBERT and XLM-R have revolutionized cross-lingual NLP through their zero-shot transfer capabilities. However, their reliability is often undermined by miscalibration—a discrepancy between predicted confidence and actual accuracy. This study, presented at EMNLP 2022, explores the "multilingual tax" on calibration, revealing that models become increasingly overconfident when applied to languages typologically distant from their source. We demonstrate that while standard calibration techniques provide some relief, few-shot learning in the target language is the most effective remedy for restoring model reliability.

Introduction

In safety-critical applications, a model's ability to express uncertainty is as vital as its accuracy. Calibration is the measure of this harmony: a well-calibrated model's predicted probability of 0.9 should correspond to a 90% empirical accuracy. While modern neural networks are known to be overconfident, MMLMs face a unique challenge. When transferring knowledge from a source language (typically English) to a previously unseen target language, the calibration often breaks down, leading to high-confidence errors.

Methodology and Calibration Strategies

The researchers evaluated mBERT and XLM-R using several intervention strategies to mitigate miscalibration:

  • Out-of-Box (OOB): Baseline performance without calibration interventions.
  • Temperature Scaling (TS): A post-processing technique that adjusts the "sharpness" of the probability distribution using a scalar parameter $T$.
  • Label Smoothing (LS): A regularization method applied during training to prevent the model from assigning full probability to a single class.
  • Few-Shot Learning (FSL): Fine-tuning on a small set of target-language examples (up to 2500).
  • Hybrid Approaches: Combining techniques, such as Self-TS + LS, where target-language development data is used to optimize the temperature parameter.

The primary metric for evaluation is Expected Calibration Error (ECE), which calculates the average difference between confidence and accuracy across probability bins.

The Impact of Linguistic Distance

A key finding of the study is that calibration error is not uniformly distributed across languages. Instead, it correlates strongly with factors such as pre-training data volume, syntactic similarity, and sub-word overlap. Syntactic distance from English, measured via URIEL project metrics, emerged as a primary predictor of miscalibration. Essentially, the more "alien" a language's structure is relative to the model's English-centric training, the more the model tends to be overconfident in its mistakes.

Results and Discussion

The experimental results across benchmarks like XNLI, XCOPA, MARC, and PAWS-X highlight a significant "calibration gap." On the XNLI dataset, for instance, XLM-R's ECE for English was 7.32, while for Swahili, it reached 19.07.

The effectiveness of calibration strategies is visually evident in reliability diagrams. When calibrating Swahili using only English data (zero-shot), the model remains significantly miscalibrated, as shown by the large gap between confidence and accuracy.

Reliability diagram for Swahili using English-based calibration, showing a significant gap between confidence and accuracy (ECE: 11.54).

However, the introduction of even a small amount of target-language data for calibration (Few-Shot Learning) drastically reduces the error, aligning the model's confidence more closely with its actual performance.

Reliability diagram for Swahili using target-language (Swahili) data for calibration, showing a much tighter alignment between confidence and accuracy (ECE: 5.69).

In zero-shot settings, the combination of Temperature Scaling and Label Smoothing proved most effective, reducing XLM-R's average ECE on XNLI from 13.34 to 4.89. When target data was available, the FSL + LS approach dominated, bringing mBERT’s XNLI error down to 2.55.

Conclusion

For practitioners deploying MMLMs, the study offers a clear warning: confidence scores in cross-lingual settings are often unreliable "out of the box." Implementing simple post-processing steps like temperature scaling, especially when informed by even a handful of target-language examples, is essential for building trustworthy multilingual systems. Future research will need to address these calibration issues in generative and sequence-labeling tasks, as well as explore unsupervised methods for languages where no labeled data exists.

Summary updated

BibTeX
@inproceedings{ahuja2022calibration,
  author = {Kabir Ahuja and Sunayana Sitaram and Sandipan Dandapat and Monojit Choudhury},
  title = {{On the Calibration of Massively Multilingual Language Models}},
  booktitle = {Conference on Empirical Methods in Natural Language Processing},
  year = {2022},
  doi = {10.18653/v1/2022.emnlp-main.290},
}
Figure