Source-linked AI summary
Analyzing Uncertainty in Neural Machine Translation
Myle Ott, Michael Auli, David Grangier, Marc'Aurelio Ranzato
TL;DR
NMT still lacks a clear account of how uncertainty affects model distributions and search, given multiple valid translations and noisy training data. The paper introduces tools and metrics to analyze calibration, distributions, search, and data uncertainty. It finds that search works well, but models diffuse probability mass excessively and data noise contributes to wide-beam degradation.
Problem
NMT has unresolved issues involving large-beam degradation, rare-word underestimation, diversity, model calibration, and the representation of multiple valid translations.
Method
The paper combines machine-learning and statistical tools with multiple human translations to assess model fitting, calibration, uncertainty, search, and noisy-data effects.
Results
Search works remarkably well, but NMT models are generally calibrated at token and sentence levels while spreading probability mass too broadly across sequences.
Takeaways & Limitations
Excessive probability spread harms model samples, while extrinsic uncertainty linked to copy mode contributes to declining accuracy with larger beams.
Takeaways & Limitations
The paper does not determine the causes of excessive probability spread and notes that large-beam degradation is only at least partially attributable to extrinsic uncertainty.
Abstract
from arXiv · showhide
Machine translation is a popular test bed for research in neural sequence-to-sequence models but despite much recent research, there is still a lack of understanding of these models. Practitioners report performance degradation with large beams, the under-estimation of rare words and a lack of diversity in the final translations. Our study relates some of these issues to the inherent uncertainty of the task, due to the existence of multiple valid translations for a single source sentence, and to the extrinsic uncertainty caused by noisy training data. We propose tools and metrics to assess how uncertainty in the data is captured by the model distribution and how it affects search strategies that generate translations. Our results show that search works remarkably well but that models tend to spread too much probability mass over the hypothesis space. Next, we propose tools to assess model calibration and show how to easily fix some shortcomings of current models. As part of this study, we release multiple human reference translations for two popular benchmarks.
1. Introduction
The paper examines unresolved NMT questions through the lens of uncertainty in a one-to-many translation task. It combines statistical tools and evaluation data to analyze model distributions, search, calibration, and data noise.
- Multiple correct translations make machine translation a multimodal learning task with an intractably large hypothesis space.
- The study targets open questions about rare-word underestimation, large-beam degradation, model calibration, and search behavior.
- Token-level cross-entropy models are evaluated for how well they capture and calibrate the rich distribution of possible translations.
- Statistical and machine-learning tools are combined to assess model fitness despite hundreds of millions of parameters, exponential search spaces, and sparse references.
- Search finds highly likely sequences with relatively narrow beams, while models spread probability mass broadly over the hypothesis space.
- The paper releases ten human translations for 500 sentences from the WMT’14 English–French and English–German test sets.
2. Related Work
Prior work improved NMT accuracy and studied uncertainty, evaluation, search, and known translation challenges. This paper differs by jointly analyzing how uncertainty affects model fitting and search.
- Uncertainty-aware evaluation metrics aim not to penalize valid translations that differ from the single provided reference.
- Earlier NMT research largely prioritized accuracy without directly modeling the translation task’s intrinsic uncertainty.
- Latent-variable models explicitly model multiple data-distribution modes, while diverse decoding methods seek varied outputs without changing the model.
- Koehn and Knowles identified large-beam accuracy deterioration and rare-word underestimation as NMT challenges addressed here.
- Other analyses compared neural and phrase-based systems, tested linguistic properties, or argued for better modeling rather than better search.
3. Data Uncertainty
The paper distinguishes intrinsic uncertainty from uncertainty introduced by noisy data collection. Both arise because benchmark datasets can contain multiple plausible or spurious target sequences.
- The study asks which uncertainty sources occur in benchmark datasets and separates task-inherent variation from collection artifacts.
- 3.1. Intrinsic Uncertainty: Intrinsic uncertainty includes several semantically equivalent translations of one source sentence, expressed through literal variation, voice, optional function words, or paraphrase.
- 3.1. Intrinsic Uncertainty: Target-language under-specification creates multiple plausible translations when gender, tense, or number cannot be inferred from the source alone.
- 3.2. Extrinsic Uncertainty: Web-crawled data supplements human-translated corpora but can introduce partial translations, unsupported information, or targets written in the source language.
- 3.2. Extrinsic Uncertainty: Source copying is defined by at least 50% unigram overlap, excluding punctuation and numbers, and can significantly affect model output even in small quantities.
4. Experimental Setup
Experiments use pretrained convolutional sequence-to-sequence models, beam search, conditional sampling, several WMT datasets, and tokenized BLEU alongside human evaluation.
- 4.1. Sequence to Sequence Model: The model encodes the source into hidden states and decodes target words from previous words, encoder states, and a conditional word distribution.
- 4.1. Sequence to Sequence Model: Training minimizes token-level cross-entropy with Nesterov momentum.
- 4.1. Sequence to Sequence Model: At test time, beam search approximates the most likely translation, normally using beam width k = 5 and length-normalized log-likelihood.
- 4.2. Datasets and Evaluation: Datasets include WMT’14 English–German, WMT’17 English–German, and WMT’14 English–French corpora with filtered and clean variants for some experiments.
- 4.2. Datasets and Evaluation: Table 1 compares automatic and human evaluation on a 500-sentence subset of WMT’14 English–French and English–German test sets.
- 4.2. Datasets and Evaluation: Evaluation uses tokenized corpus- and sentence-level BLEU after removing BPE splitting, with smoothed sentence-level n-gram counts.
5. Uncertainty and Search
The analysis compares sampling and beam search under model uncertainty, then examines how noisy copy examples cause wide-beam degradation and how filtering or constraints mitigate it.
- Experimental setup: The experiments evaluate model training quality, output uncertainty, beam search versus sampling, and extrinsic copy noise.The study uses model evaluation, human assessment, 10k samples, beams of k = 5 and k = 200, and synthetic-noise experiments.
- Model output uncertainty: 10k samples cover 24.9% of sequence-level probability mass, while beam search covers 14.6% with k = 5 and 22.4% with k = 200.These results indicate that the model distributes probability mass broadly across the hypothesis space.
- Search comparison: For similar likelihood, beam hypotheses achieve higher BLEU than sampled hypotheses, although increasing sampled likelihood can eventually reduce BLEU.BLEU and model probability are therefore imperfectly correlated.
- Token probabilities: Beam search assigns high token probabilities to its hypotheses, whereas references and samples receive lower probabilities; only 20% of beam tokens fall below 0.7.The model also assigns much lower scores to references than to beam hypotheses.
- Copy noise mechanism: Copy outputs occur in 2.6% of beam-1 outputs and rise to 3.5% at beam 20, despite copies comprising 1.1%–2.0% of training pairs.The analysis identifies overrepresentation of copies in beam-search outputs.
- Copy noise mechanism: With 1% synthetic copy noise, beam k = 20 loses 3.3 BLEU; with 10% noise, every non-greedy strategy more than halves its accuracy.Copy modes become reachable after a low-probability initial token and then quickly dominate through near-deterministic transitions.
- Mitigation: Filtering noisy training pairs and constraining inference to exclude source-overlapping hypotheses greatly mitigates wide-beam degradation, while clean-data BLEU improves with beam width.The inference constraint prunes completed hypotheses overlapping the source by 50% or more.
6. Model Fitting and Uncertainty
The paper evaluates whether NMT model distributions match the data distribution at token and sequence levels. It finds good calibration in several respects, but excessive probability spread across hypotheses, with beam search favoring common alternatives and sampling producing broader coverage.
- Matching model and data distributions: The analysis compares model and data distributions using unigram statistics, set-level calibration, copy-noise controls, and multiple-reference comparisons.These are presented as necessary conditions because exact distributional comparison is intractable and only limited data samples are available.
- Token-level matching: Samples from the model roughly match reference unigram frequencies except for extremely rare words.This tests whether rare-word underestimation reflects model frequency estimates or beam-search behavior.
- Token-level matching: Sampling closely matches replacement rates across conditions, while beam search overestimates the majority class and favors common alternatives.Beam outputs fall below the prior when the majority rate is 0.5 or less and exceed it when the majority rate is larger than 0.5.
- Sequence-level matching: The model matches the data distribution remarkably well at the set level, despite the evaluated beam sets covering an average of 22.4% of model probability mass.The sets contain 200 beam hypotheses, with points binned so each represents 10% of validation or test sentences.
- Sequence-level matching: Copy-noise controls show that exact-copy probabilities are underestimated at low noise and overestimated at high noise, while exact-plus-partial copies reproduce the training noise.The result provides concrete evidence that the model distribution does not perfectly fit the data distribution.
- Sequence-level matching: 44.5 and 32.1 expected BLEU for human translations versus 28.6 and 24.2 for model samples indicate that the model spreads too much probability mass across sequences.The values correspond respectively to WMT’14 En-Fr and WMT’14 En-De.
- Comparing outputs with references: Beam hypotheses are high quality and close to references but lack diversity, whereas sampling has higher coverage but lower and more variable reference similarity.The paper links both patterns to probability mass being too spread across the hypothesis space.
7. Conclusions and Final Remarks
The paper concludes that search performs remarkably well, while NMT models are generally calibrated but diffuse probability mass too broadly. It links deteriorating large-beam accuracy to extrinsic uncertainty from copy noise and leaves the causes of excessive spread for future work.
- Conclusions: Search works remarkably well, while the model is generally well calibrated at both token and sentence levels but diffuses probability mass too much.The authors surmise that excessive spread may relate to the smooth functions represented by NMT models, but they have not investigated its causes.
- Conclusions: Extrinsic uncertainty from copy noise is linked to deteriorating accuracy with larger beams.The paper identifies this as a distinct issue from the model's general calibration and search quality.
Appendices
The supplementary material reports additional findings about large-beam degradation and introduces another condition for comparing model and data distributions using sources with many references.
- Additional findings: The supplementary material discusses experiments linking larger-beam degradation to copy noise in training data.It presents the discovery process as potentially instructive for other researchers.
- Additional findings: It also introduces a distribution-matching condition based on source sentences with hundreds of available references.This permits more direct comparison over the set of unique hypotheses.
A. How We Discovered Copy Noise
The appendix shows how visualizing model samples exposes copy artifacts and distinguishes high-likelihood valid translations from hypotheses that BLEU scores poorly because of legitimate variation.
- Visualizing sample quality: A log-probability-versus-BLEU scatter plot reveals that high BLEU implies high likelihood, but high likelihood does not necessarily imply high BLEU.Low-BLEU samples can have widely varying log-likelihood values.
- Visualizing sample quality: Outlier hypotheses form clusters that can expose systematic artifacts and alternative translation modes.The visualization makes such clustered outliers apparent.
- Valid alternatives and BLEU: A valid translation can receive low BLEU when a synonym with different gender changes subsequent inflections and reduces n-gram overlap.This illustrates intrinsic uncertainty in translation and a limitation of reference-based BLEU evaluation.
- Discovering copy noise: A source-copy cluster can achieve extremely high log-likelihood and extremely low BLEU because the model copies the source sentence almost perfectly.These examples led the authors to identify the copy issue and connect it to beam-search degradation.
- Comparing distributions: For a source sentence with 798 references and 36 unique hypotheses, the model matches the estimated data distribution rather well.The hypotheses are ordered by descending empirical probability mass in the comparison.
B. Another Necessary Condition: Matching the Full distribution for a Given Source
The paper compares model and data distributions for a particular source sentence, using repeated training-set examples to estimate the ground truth. This complements aggregate calibration tests while acknowledging that exact full-distribution comparison is generally infeasible.
- Aggregate matching tests approximate the data distribution with Monte Carlo samples from human translations.
- Exact evaluation of probability mass over every target sequence is intractable because the true data distribution is unavailable.
- Repeated training-set sentences provide an accurate ground-truth estimate for a particular source sentence, yielding another necessary matching condition.One example occurs nearly 800 times and has 36 unique translations.
- For the example examined, the model output distribution closely matches the estimated data distribution.
- Figure 12 compares binned unigram frequencies among human references, beam-search outputs, and samples across two translation datasets.
C. Does More Data Help?
The paper finds that the rare-word underestimation pattern persists across datasets but becomes much more severe in the smaller En-De dataset. The comparison supports the need for more training data to fit the data distribution better.
- The rare-word underestimation pattern appears in both WMT’14 En-Fr and WMT’17 En-De.
- 1.5% versus 0.4%: underestimation in the rarest percentile bin is nearly four times more severe for En-De than En-Fr.The En-De model uses a much smaller dataset and has BLEU 21 versus 41 for En-Fr.
- The rarest-bin median word frequency is 12 for En-De but 2552 for En-Fr, showing that the bins represent very different frequency scales.
- The authors conclude that NMT models need more data to estimate parameters and fit the data distribution better.