As Easy as 1, 2, 3: Behavioural Testing of NMT Systems for Numerical Translation

Jun Wang, Chang Xu, Francisco Guzmán, Ahmed El-Kishky, Benjamin I. P. Rubinstein, Trevor Cohn

Introduction

Neural Machine Translation (NMT) has seen significant advances, yet it remains prone to "hallucinations"—errors where the model generates content not present in the source. While many evaluation metrics like BLEU focus on overall fluency, they often overlook numerical accuracy. A single digit error in a financial or medical context can be catastrophic, yet it barely impacts a BLEU score. This research introduces a systematic behavioral testing framework to evaluate how commercial and research NMT systems handle numerical translation across various formats and languages.

Methodology: Behavioral Testing for Numbers

The authors adapted the CheckList framework to create a targeted "stress test" for numerical translation. This black-box approach evaluates systems based on four core capabilities:

  1. Integers: Basic sequences of digits (e.g., 914).
  2. Decimals: Numbers with fractional components (e.g., 3.28).
  3. Numerals: Numbers expressed as words (e.g., "fifty-two").
  4. Separators: Localization of punctuation (e.g., swapping dots and commas between English and German).

To generate test cases, the researchers used template-based generation, pulling real-world sentences from the TICO-19 (medical) and WikiMatrix (Wikipedia) corpora. They then "fuzzed" these templates by injecting thousands of numerical variations. The study evaluated two commercial APIs (anonymized as A and B) and a state-of-the-art research model (R) across high-resource (English-German, English-Chinese) and low-resource (English-Tamil, English-Nepali) language pairs.

Quantitative Results

The primary metric for evaluation was the Pass Rate (PR), representing the percentage of cases where the numerical component was translated perfectly.

Pass Rates (PR) across different language pairs and systems for the four numerical capabilities.

As shown in the results table, performance varies wildly. While systems generally handled integers well in high-resource settings, performance plummeted for Numerals (written words), which had an average PR of only 70.8%. Low-resource languages faced the most severe issues; for instance, the research model (R) achieved a 0.0% PR for separators in Nepali-to-English translation, showing a complete inability to handle localization in that pair.

Qualitative Error Analysis

Beyond simple failure rates, the types of errors observed were particularly concerning. Models frequently failed to localize separators, leading to massive changes in numerical value (e.g., treating a thousands separator as a decimal point).

Examples of numerical translation errors, including digit hallucinations and localization failures.

As illustrated in the error analysis, "digit hallucinations" occurred where models randomly added or omitted digits. In one case, "670" was translated into Nepali as "70700". These errors are often linked to Byte Pair Encoding (BPE), which can fragment long numbers into arbitrary sub-units (e.g., "123456" becoming "12" + "34" + "56"), causing the model to lose track of the number's global value.

Conclusion

Numerical translation is far from a solved problem in NMT. The study highlights that even top-tier systems struggle with written numerals and localization. Future improvements may require treating numbers as distinct entities during the translation process, utilizing data augmentation, or refining sub-word segmentation strategies to better preserve numerical integrity.

Summary updated

BibTeX
@inproceedings{wang2021as,
  author = {Jun Wang and Chang Xu and Francisco Guzmán and Ahmed El-Kishky and Benjamin I. P. Rubinstein and Trevor Cohn},
  title = {{As Easy as 1, 2, 3: Behavioural Testing of NMT Systems for Numerical Translation}},
  booktitle = {Annual Meeting of the Association for Computational Linguistics},
  year = {2021},
  doi = {10.18653/v1/2021.findings-acl.415},
}
Figure