Elamur Research

The Curious Case of Hallucinations in Neural Machine Translation

Paper · 2021 · Vikas Raunak, Arul Menezes and Marcin Junczys-Dowmunt

Summary

A translation can read smoothly while telling the reader something entirely different from the source. That is a particularly serious failure of machine translation because the quality a reader can judge from the output alone, its fluency, may survive the loss of meaning. This paper asks how such failures arise. The authors distinguish hallucinations triggered by a small edit to the source from natural hallucinations, which occur when the source is left as it is. Among the natural failures, they distinguish fluent output that has become detached from the input and inadequate output that keeps returning to the same words or phrases.

To investigate sensitivity to edits, the authors estimate how much a translation system gains from having seen a particular sentence pair in training. They train Transformer systems on different subsets of IWSLT-2014 De-En and compare how well the systems translate each original sentence depending on whether its pair was included. They adapt a memorization estimator developed for classification, using translation scores such as chrF and BLEU to give credit for partial matches. Then they insert a frequent word at the start of each selected source sentence. With chrF used to rank the training examples, the 100 highest-ranked examples yield 51 distinct sources that trigger hallucinations and 431 triggering insertions in total. An equally sized random comparison set yields 1 distinct source and 1 triggering insertion. The authors relate this vulnerability to the long-tail account of learning, in which knowing a rare example can be valuable even when the learned behavior transfers poorly to a variation of that example.

To investigate natural hallucinations, the authors add deliberately mismatched sentence pairs to otherwise unchanged parallel training data. How the wrong pairs are arranged matters. When many different sources point to a small set of repeated target sentences, the system sometimes emits an entire training target for a source it has never seen. When the same sources are repeatedly paired with different unrelated targets, the resulting translations tend to loop over phrases. These failures are conspicuous on the targeted diagnostic sentences, even though aggregate BLEU on the ordinary test set changes comparatively little.

Faulty outputs can also become new training material. The paper studies backtranslation, which creates synthetic source sentences from monolingual target text, and sequence-level knowledge distillation, which trains a new system on whole translations supplied by an existing one. In the generated data, repeated wrong targets are especially prominent when the generating system was trained on noise that reused targets across different sources. The authors release the code and datasets for reproducing their experiments and propose targeted data augmentation, filtering and robust training as possible responses. The experiments establish how particular failures can be produced and carried into synthetic data. The proposed remedies and the effects of training a subsequent system on those outputs remain questions for further study.

Deep dive: The Curious Case of Hallucinations in Neural Machine Translation

Why neural machine translation can lose touch with its source, and how memorization and noisy training pairs contribute to hallucinations. · about 35 minutes to read

The problem and its context

When smooth output is severely inadequate

A translation has to communicate the source meaning in another language. The paper treats adequacy, the extent to which the translation conveys that meaning, as distinct from how naturally the target sentence reads. A system that drops part of a sentence or mistranslates a name has made an adequacy error. A system that produces a coherent sentence about an unrelated event has lost the connection that makes the output a translation. The authors place hallucination at this severe end of the range of errors. They situate the problem in a field where neural methods had surpassed earlier statistical approaches in settings with moderate or abundant resources, while errors such as incomplete coverage and mistranslated names persisted.

The paper illustrates the distinction with a German source about detecting something through more rigorous checks. The output turns it into a speech about blood, history and the privilege of fighting. The target language is intelligible and the output has its own line of thought. The subject and purpose of the source are gone. The paper calls this a detached hallucination. A second example begins with a statement about pizza production. The output moves to the United States and repeatedly reuses pieces of phrasing about positions and periods of time. This output has lost the source meaning and also has a repetitive structure. The authors call that an oscillatory hallucination. An n-gram is a run of adjacent tokens, so repeatedly returning to the same short stretch of words leaves a pattern that can be counted.

Both are natural hallucinations in the paper's terminology. Here, natural describes how the input is presented. It means the sentence was translated as it stood, without an experimental edit at inference time. A natural hallucination can therefore come from a system trained with deliberately corrupted data. The definition also allows an output to be awkward or repetitious as long as its inadequacy is severe. The paper sets aside short outputs and source copying as separate problems for this investigation. That boundary allows the authors to ask why a full, unrelated sentence appears or why a translation falls into a loop, without treating every loss of content as the same event.

What earlier experiments had established

Lee and colleagues had examined an experimentally induced failure. They made a small change to the source and looked for a translation that diverged sharply from the output the system gave for the original sentence. This design provided a way to test sensitivity to a controlled input change. Their detection algorithm also gave other researchers a procedure they could apply repeatedly. Lee and colleagues suggested instability in the decoder, the part of the system that generates the target sequence, as a possible explanation. The attempts to address the problem on that basis were inconclusive in the account given by this paper. Related work had actively explored training methods that make translation systems less sensitive to small changes in their inputs. Robust Neural Machine Translation with Doubly Adversarial Inputs

Earlier work also described translations that became detached from their sources during ordinary use. Wang and Sennrich used human judgments to identify these errors and reported greater susceptibility when inputs came from outside the training domain. A domain is the kind of material, or distribution of material, a system encounters. Text from a different domain can differ in ways that a one-word edit to a familiar sentence does not capture. The paper also cites work on domain robustness in this connection. Recognizing detachment by reading the source and translation is a direct way to assess adequacy, but manually reviewing large collections slows experiments that compare multiple conditions. This practical problem motivates a separate, approximate detector for generated corpora. Domain Robustness in Neural Machine Translation

The two lines of work ask different questions. In the perturbation experiment, the original output supplies a baseline for the same source, and the failure is a dramatic change after an edit. In the natural case, the crucial comparison is between the output and what the unedited source means. There is no preceding successful translation of that sentence to use as a point of reference. The paper preserves the distinction throughout its experiments. It uses one procedure to find sudden changes in behavior and another combination of human judgments and automated checks to examine spontaneous detachment and repetition.

Why memorization is a candidate explanation

The idea behind the perturbation study comes from Feldman's account of learning from a long-tailed distribution. Such a distribution contains common kinds of examples as well as a large collection of rare kinds. A training set may contain a representative of a rare group with little comparable material nearby. Feldman's argument is that retaining the information in that example can improve predictions on its group and therefore help generalization overall. In the classification setting, the question is whether seeing an individual labeled example has an unusually large effect on the prediction for that example. Feldman and Zhang developed an estimator to measure this dependence. Discovering the Long Tail via Influence Estimation

Translation changes the measurement problem. A classifier can be credited for predicting the correct label. A translation is an entire sequence, and a system may preserve much of the reference wording without reproducing it exactly. At the same time, a high score on an original training sentence may conceal a dependence on its exact form. The authors' hypothesis is that examples with greater measured dependence on inclusion in the training set are particularly susceptible to small source edits. That is a prediction about how to find fragile examples, and it can be tested even though the internal process that causes a particular output remains difficult to inspect.

For unedited sources, the authors start from a different possibility. A parallel corpus is a collection of sentence pairs meant to express corresponding content in the source and target languages. If a pair is wrong, its presence gives the training procedure an example of a correspondence it should not learn. The same amount of wrong data can impose different demands depending on how often an individual source or target recurs. A target that is reused across diverse sources gives a different training signal from a source that is assigned a succession of unrelated translations. The authors use this distinction to ask whether the arrangement of bad pairs can help explain the form of a hallucination. They note that noisy parallel data are plausible where corpus builders automatically mine bilingual sentence pairs from web material. Filtering and Mining Parallel Data in a Joint Multilingual Space

The method, step by step

Estimate reliance on individual training pairs

The starting point is a source sentence and its paired reference translation. The authors want to know how much the ability to reproduce that reference depends on access to this pair during training. They repeatedly draw training subsets from the same corpus and train a separate translation system on each subset. For the pair under consideration, they divide these trained systems into a group that saw the pair and a group that did not. Both groups translate the original source, and each output receives a score against the same reference. The difference between the groups' average scores is the pair's memorization value.

This approach uses the same collection of trained systems to estimate values for many examples. Each subset supplies inclusion observations for the pairs inside it and exclusion observations for the pairs outside it. The relevant comparison always concerns a particular example. A system might be strong overall yet contribute a low score for a particular sentence excluded from its training subset. Conversely, a sentence that is easy to translate from patterns shared with other examples may receive high scores in both groups, leaving a small memorization value. A high value represents a large advantage from inclusion as measured by the chosen score.

Estimating memorization and testing sensitivity to source edits

The steps in order.

Estimating memorization and testing sensitivity to source editsStep 1: Draw random subsets of the parallel training corpus1. Draw random subsets of the parallel training corpusStep 2: Train a translator on each subset2. Train a translator on each subsetStep 3: Translate original sentences and score against their references3. Translate original sentences and score against their referencesStep 4: Compare scores with and without each training pair4. Compare scores with and without each training pairStep 5: Select highly memorized and randomly chosen examples5. Select highly memorized and randomly chosen examplesStep 6: Insert frequent tokens into eligible source sentences6. Insert frequent tokens into eligible source sentencesStep 7: Count sharp changes in the resulting translations7. Count sharp changes in the resulting translations

The estimator is written below with the example being scored shown explicitly in the metric. The expectations are approximated by the averages over sampled runs in the relevant groups.

mem(A, S, i) = Eₕ∼A(S)[M(h, i)] − Eₕ∼A(S∖{i})[M(h, i)]

Here mem is the memorization value, A is the learning procedure, S is the training dataset and i identifies the sentence pair of interest. h is a trained translation system. M(h, i) is the score for translating the source of pair i with h and comparing the output against that pair's target. E denotes an average over training outcomes, and its subscript indicates which training condition the outcomes come from. The tilde denotes a draw from that condition. S∖{i} denotes the dataset with pair i removed. In the implementation, the authors estimate the first and second expectations with the runs whose sampled subsets include and exclude i, respectively. The minus sign makes the value larger when inclusion gives a greater scoring advantage.

The extension from classification is in M. With chrF, the score reflects overlap among sequences of characters in the output and reference. With BLEU, the comparison uses shared sequences of words. The paper also uses exact sentence accuracy, where the complete output string must match the reference to count as a success. These measurements imply different notions of remembering. Word or character overlap can register substantial reproduction of the target even when the output contains a small variation. Exact matching collapses every imperfect reproduction into the same outcome. The authors also mention softer evaluation metrics as possible adaptations, while arguing that direct overlap offers a clearer indication of reproduction for this purpose. chrF · BLEU · METEOR

Turn a source edit into a testable event

After estimating memorization, the authors use a version of Lee and colleagues' perturbation detector. They first translate an original source and check whether the output has enough overlap with the known reference to be eligible. They then try inserting a token at the very beginning of the source. Each insertion is evaluated separately. The procedure compares the new translation with the original output. It flags an event when that comparison finds very little overlap. The two tests in order are as follows.

adjusted-BLEU(y₀, y) > 0.09

adjusted-BLEU is the overlap score used by the perturbation detector, y₀ is the system output for the original source and y is the reference translation. The greater-than sign specifies a strict quality gate. The value 0.09 is the threshold on the initial output's adjusted-BLEU in this detector. This gate gives the subsequent change a meaningful starting point. A system that already fails to produce a sufficiently related output is not counted by this procedure as having fallen from an eligible original translation.

adjusted-BLEU(ỹ, y₀) < 0.01

Here ỹ is the translation after inserting one token and y₀ remains the translation without the insertion. adjusted-BLEU is the same scoring function, now applied to the two outputs. The less-than sign specifies that a flag requires a score strictly below 0.01. The reference y has already served its purpose at the first gate. The second test asks how much the output changed, which is a different comparison from how well the edited source was translated.

The authors make the insertion at the level of words, before the text is split into smaller units for the translator. They restrict it to the first position because the earlier study found that position particularly reliable for eliciting the behavior. They draw the candidate insertions from common words to keep the intervention plausible as a change to the input. Specifically, they randomly select 30 tokens from the 100 most frequent tokens in a dictionary calculated on the training corpus. The intervention can therefore be applied in the same way to the highly memorized and randomly chosen examples. The procedure tests the effect of adding one token at a particular position, instead of a general ability to cope with arbitrary edits. Tokenization & segmentation

A source can cross the output-change threshold for several candidate tokens. The authors therefore record both the number of distinct source sentences that cross it at least once and the total number of flagged source-and-insertion events. The first count indicates how widely fragility is distributed within the selected set. The second captures how frequently the detector fires over all the trials. A large total can arise when many sources are vulnerable, when individual sources respond badly to several insertions, or when both occur. The distinction is essential when reading the reported counts.

Construct wrong pairs with different repetition patterns

The natural-hallucination experiment intervenes in training. The authors start with a small collection they call the invalid reference set, or IRS. It contains 21 pairs of unrelated source and target sentences. They also draw sentences from the larger WMT 2014 De-En training corpus. From these materials they construct equally sized noise sets that differ in whether sources and targets recur. The source comes first in the names. Unique means the relevant side uses a different sentence for each noisy entry. Repeat means the construction reuses the same sentences.

  • In Unique–Unique, or UU, the authors take 21K distinct sources from WMT and assign each a different unrelated WMT target. The mismatch is dispersed across many different sentences on both sides.
  • In Repeat–Repeat, or RR, they use the 21 unrelated IRS pairs and repeat each pair 1,000 times. A given noisy source keeps getting the same wrong target.
  • In Repeat–Unique, or RU, they use the same 21 sources as in RR, reusing each 1,000 times. Each occurrence receives a different unrelated WMT target, so the training material assigns many incompatible outputs to the same input.
  • In Unique–Repeat, or UR, they repeat each of 21 IRS targets 1,000 times. Different unrelated WMT sources receive those repeated targets, so diverse inputs are made to share a small stock of outputs.

Each noise condition is added to the IWSLT 2014 parallel corpus, and a clean training run supplies a baseline. The paper describes 21K noisy pairs as approximately 12% of the combined training material when added to the 160K original pairs. Holding the size of the addition fixed lets the comparison examine the organization of the erroneous pairings. The settings still use different sentence inventories and different numbers of distinct sentences, which are part of how the authors create the contrasting signals.

The motivation is to vary what the system is asked to learn from the wrong examples. RR is consistent at the level of a particular association. RU presents the same encoded input with many unrelated desired continuations, which the authors suggest could destabilize the decoder. UR supplies a recurring target in many source contexts. The authors suggest that this spreads the effects of the wrong training signal through the encoder, the component that represents the source for the decoder. UU spreads the signal across diverse, mismatched pairs without favoring a repeated target. These are proposed accounts of training behavior. The empirical test examines whether the resulting outputs have different observable properties.

The IRS also serves as an evaluation set. Its exact invalid pairs are in RR training. Its sources occur in RU training, but with other targets, and its targets occur in UR training, but with other sources. UU has no overlap with it. The authors make a valid reference set, or VRS, by keeping the same IRS sources and giving them correct translations. This paired design separates two questions. The IRS asks whether the output resembles a particular invalid reference or takes on other visible failure patterns. The VRS asks how much legitimate translation remains for those very inputs. The ordinary IWSLT test set supplies a separate view of translation quality on examples outside the training data.

Look for hallucinations in generated corpora

The final experiment examines the text that a trained translator supplies to later data-generation processes. In backtranslation, the available monolingual sentences are on the side that will ultimately be the target of a translation system. A translator working in the reverse direction generates a synthetic source for each sentence. A badly detached reverse translation consequently becomes a mismatched source in a new pair. In sequence-level knowledge distillation, an existing translator supplies a complete target sequence for each original source. Its output serves as the target that a subsequent system would be trained to imitate. This experiment measures the translated data produced by these procedures. Sequence-Level Knowledge Distillation

To screen large collections, the authors first translate all the sources and score how similar each output is to its own source across languages. The scorer is LASER, which represents sentences from different languages in a form that permits comparison. This gives the method a way to prioritize potentially detached outputs even when it has no correct target translation. Low estimated cross-language similarity alone is an initial screen. The estimator also requires evidence from the structure of an individual translation or from the recurrence of the same translation across different inputs. Massively Multilingual Sentence Embeddings

The individual-output check compares the most repeated n-gram in the translation with the most repeated n-gram in the source. An output passes the check if its highest repetition count exceeds the source's by at least the specified threshold. This allows for the possibility that a legitimate translation repeats a phrase because the source repeats one. The corpus-level check looks for the same target string paired with multiple distinct sources. It is motivated by the UR result: if a system has learned to emit a stock target in different contexts, the same output may occur several times when a large set is translated. This check uses the generated collection itself. It requires no lookup to see whether the output is an exact copy of a training sentence.

ANH = (Sε ∩ F₁) ∪ (Sε ∩ F₂)

ANH is the set of approximate natural hallucinations returned by the estimator. Sε is the set of source-output examples in the bottom ε percent by cross-language similarity. F₁ is the set that meets the excess n-gram repetition rule and F₂ is the set whose translations recur across distinct sources. The intersection sign ∩ requires an example to satisfy both conditions in its parentheses. The union sign ∪ collects examples that qualify through either route, counting membership only once. In the paper's algorithm, S denotes the collection of sources, T denotes the decoded translations, X denotes the cross-language scoring system and M is the translator. The parameter n sets the length of the repeated token sequence, and t sets the minimum excess repetition required by F₁.

The experiments use ε at 1%, n at 4 and t at 2. Thus the within-sentence screen compares repetitions of groups of 4 tokens, and the translation's most repeated group must occur at least 2 more times than the source's most repeated group. The corpus screen asks a different question, about exact whole-output recurrence across sources. Either result is then checked against the low-similarity slice. An output with both properties still contributes one case to the final estimate, while a low-similarity output with neither property contributes none. The estimator is designed to make large comparisons tractable using specific signatures of detachment and repetition.

Experiments and results

The translation systems and the memorization comparison

For the perturbation study, the authors draw subsets of about 101K sentence pairs from the 160K-pair IWSLT-2014 De-En corpus. They train 10 systems with fairseq. The text is tokenized and lower-cased, then segmented with byte-pair encoding, or BPE, which allows words to be represented by smaller units. The source and target use a shared vocabulary of 10K units. Each Transformer has six layers, embedding size 512, feed-forward dimension 1024 and 4 attention heads, for 42M parameters. The source encoder and target decoder share embeddings. Batches contain 4K tokens and training uses dropout of 0.3. The authors choose the checkpoint with the highest validation BLEU after reconstructing ordinary text from tokens, using a decoding beam of 5. A beam keeps multiple candidate sequences in contention during decoding. fairseq · Subword tokenization

The authors discard examples that were absent from fewer than two of the sampled training subsets. This leaves an exclusion group with more than a lone trained system for every example considered. They take the 100 eligible examples with the highest measured memorization and sample an equally sized group from the remaining eligible examples. The comparison concerns training-set sources in both groups. Its outcome is whether the perturbation detector flags a sharp change, and its grouping variable is the separately estimated memorization value. The random group is a comparison against typical eligible examples from outside the selected top group, whose scores can still include some dependence on their training pairs.

Distinct sources triggering perturbation hallucinations on IWSLT-2014 De-En training examples ranked with chrF

The highly memorized set contains many more sources whose translations change sharply after an insertion.

Distinct sources triggering perturbation hallucinations on IWSLT-2014 De-En training examples ranked with chrFMost memorized examples: 51Most memorized examples51Random examples (this paper): 1Random examples (this paper)1
The numbers
System or settingUnique HP count
Most memorized examples51
Random examples (this paper)1

With the chrF ranking, the total count across insertions is 431 for the highly memorized set and 1 for the random set. So the difference is visible both in how many source sentences fail and in how frequently the insertions elicit a failure. Changing the memorization score changes which sentences enter the highly ranked group. With BLEU as the ranking metric, the highly memorized group records 42 distinct triggering sources and 180 triggering insertions, while the random group records 2 and 2. With exact output-to-reference matching as the ranking metric, the corresponding counts are 8 and 30 for the highly memorized group and 4 and 5 for the random group. The perturbation detector continues to use adjusted-BLEU in all of these comparisons. Only the score used to estimate memorization changes.

Translation quality with mismatched training pairs

The natural-hallucination study trains 5 systems on the IWSLT 2014 corpus for the noise comparison, consisting of the no-noise baseline and the four specified patterns. The paper reports outcomes in both directions, German to English and English to German. It uses the earlier translation architecture and training conditions, with BPE learned on the augmented corpus for the noisy settings. The evaluation includes BLEU against the ordinary test references, BLEU against the deliberately invalid IRS targets and BLEU against the VRS targets for the same diagnostic sources. In addition, the authors manually identify natural and oscillatory hallucinations on the IRS. They check whether hallucinated text exactly matches a training reference and measure how varied the adjacent token pairs are in the translations.

Ordinary test BLEU gives little indication of what has happened to the diagnostic sentences. In German to English, the uncorrupted training baseline scores 33.65 on the IWSLT test set. UU gives 33.75, UR gives 33.26, RU gives 34.03 and RR gives 33.89. In English to German, the baseline scores 28.33 on the test set. The corresponding values are 28.61 for UU, 27.93 for UR, 28.67 for RU and 28.54 for RR. UR has the lowest test BLEU in each direction, but the central changes in behavior become easier to see when the test input is connected to the construction of the noise.

German-to-English BLEU against valid references for the IWSLT noise-study diagnostic sources

Correct-reference scores fall with every noise pattern and are lowest when the diagnostic sources recur in corrupted training pairs.

German-to-English BLEU against valid references for the IWSLT noise-study diagnostic sourcesNo added noise (this paper): 20.59No added noise (this paper)20.59Unique–Unique: 12.90Unique–Unique12.90Unique–Repeat: 12.82Unique–Repeat12.82Repeat–Unique: 0.55Repeat–Unique0.55Repeat–Repeat: 0.39Repeat–Repeat0.39
The numbers
System or settingBLEU
No added noise (this paper)20.59
Unique–Unique12.90
Unique–Repeat12.82
Repeat–Unique0.55
Repeat–Repeat0.39

The corresponding English-to-German VRS scores are 14.62 for the baseline, 13.26 for UU, 12.15 for UR, 0.56 for RU and 0.50 for RR. In both directions, the settings with the repeated diagnostic sources, RU and RR, are particularly poor against the correct references. How they fail becomes clear when the scoring target is changed. RR reaches 100.00 IRS BLEU in both directions. That score reflects reproduction of the deliberately wrong targets repeated in its training data. The near-zero score against valid references for the same sources shows the practical meaning of this successful reproduction.

The other patterns give different results on the invalid references. In German to English, the baseline has 0.54 IRS BLEU, compared with 0.48 for UU, 12.20 for UR and 0.42 for RU. In English to German, the baseline gives 2.06, while UU gives 0.25, UR gives 0.42 and RU gives 0.35. The lower overlap with the particular invalid reference can coexist with severe output failures. RU, for instance, was never repeatedly shown the same invalid association that the IRS uses for scoring. Its poor outputs are better characterized by oscillation than by agreement with a particular wrong sentence.

Detachment, copying and repetition on the diagnostic sources

In German to English, the manually identified IRS natural-hallucination percentages reported for UU and UR are 33.33% and 42.85%, respectively. In English to German, those percentages are 14.28% and 9.52%. The clean baseline reports 0.0% in both directions. The table leaves some cells unreported where the authors regard the associated metric as uninformative. The oscillation measure is the direct result to look at for RU. It shows oscillatory hallucinations in 76.19% of its IRS translations in German to English and 47.61% in English to German. UU has 0.0% for this metric in both directions, while UR has 4.76% in German to English and 0.0% in English to German.

Exact training-target matches are important in UR. Its IRS Repeats result is 38.09% for German to English and 9.52% for English to German, while the reported results for UU and RU are 0.0% in both directions. The match check searches for a training reference, which can be a different sentence from the invalid reference assigned to that source in the IRS. UR's behavior can therefore be visible in the match check even when IRS BLEU is low. The training pairs have supplied reusable targets, and an entire target may surface for one of the unseen diagnostic sources.

The bigram statistic complements human identification of oscillation. A bigram is a sequence of adjacent tokens of length two. The paper calculates the number of distinct bigrams in the IRS translations relative to the possible number at the same lengths. Lower values indicate greater reuse of the same pairs. In German to English, the value is 0.19 for RU, compared with 0.925 for the baseline, 0.80 for UU, 0.84 for UR and 0.96 for RR. In English to German, the value is 0.49 for RU, compared with 0.95 for both the baseline and UR, 0.91 for UU and 0.99 for RR. RR can consistently produce the wrong sentence while still having a high diversity of adjacent words within its outputs. The statistic is sensitive to repetitive form and complements measures concerned with source meaning.

What enters the synthetic training data

For the distillation experiment, the authors generate new targets for the source sentences of the original, unaugmented IWSLT 2014 De-En training set. They decode with a beam of 5 and apply the corpus estimator to the human parallel data and to the outputs of the clean and noisy translation systems. The original corpus establishes how often the automated signatures are already present. Distillation with the clean system establishes a comparison for synthetic targets made without intentionally added noise. The remaining settings show how the pattern of noise in the generator's training data changes what that generator supplies.

Estimated natural hallucinations in IWSLT 2014 De-En parallel and distilled training data

The original parallel corpus has the fewest flagged examples, while distillation with repeated-target noise produces the most.

Estimated natural hallucinations in IWSLT 2014 De-En parallel and distilled training dataOriginal parallel data (this paper): 41Original parallel data (this paper)41Distilled without added noise: 120Distilled without added noise120Distilled with Unique–Unique noise: 119Distilled with Unique–Unique noise119Distilled with Unique–Repeat noise: 688Distilled with Unique–Repeat noise688Distilled with Repeat–Unique noise: 124Distilled with Repeat–Unique noise124Distilled with Repeat–Repeat noise: 136Distilled with Repeat–Repeat noise136
The numbers
System or settingANH count
Original parallel data (this paper)41
Distilled without added noise120
Distilled with Unique–Unique noise119
Distilled with Unique–Repeat noise688
Distilled with Repeat–Unique noise124
Distilled with Repeat–Repeat noise136

The original parallel data have 1900 examples flagged by the whole-output recurrence rule before similarity filtering. The clean distilled data have 2310, and the UR distilled data have 3090. When the low-similarity rule is applied as well, the corresponding counts are 41, 120 and 688. For UR the entire reported final count is accounted for by that recurrence branch. All noisy distilled corpora exceed the original parallel data on the final estimate. The clean distilled data also exceed the original, and the UU result is slightly below the clean distilled comparison. These conditions distinguish an increase relative to the human parallel corpus from an increase that can be attributed to a particular added noise pattern relative to clean distillation.

For backtranslation the authors take 1 million English sentences from WMT 17 De-En and use the reverse-direction systems to generate German by sampling. The backtranslation table compares the four noisy generators. UU yields 5009 approximate natural hallucinations, UR yields 7280, RU yields 3 and RR yields 12. The whole-output recurrence rule on its own flags 7592 translations for UU and 176,184 for UR, compared with 67 for RU and 65 for RR. Intersecting those recurrence candidates with the low-similarity slice leaves 5009 for UU and 7280 for UR. The large recurrence count for UR shows how broadly a stock output can be reused. The much smaller filtered count measures the narrower combination of recurrence and low source agreement.

The repetition screen contributes relatively few detections to the final counts. In the distillation comparison, it flags 30 translations from UR and 17 pairs in the original parallel corpus before similarity filtering, but the intersection with the low-similarity slice is 0 in both cases. In the backtranslation comparison, the corresponding intersection counts for the oscillation screen are 0 for UU, 0 for UR, 1 for RU and 1 for RR. The strongest amplification result therefore concerns repeated whole outputs that also score poorly for cross-language similarity. The estimator and the manual diagnosis of oscillation capture different aspects of the phenomenon.

What the ablations show

How stable is the memorization result?

The comparison of chrF, BLEU and exact matching varies the way memorization is measured while keeping the general perturbation test in place. All three versions put more distinct failures in the highly memorized group than in the random comparison group. The separation is most pronounced with chrF and least pronounced with exact matching. This fits the intuition behind the estimator's adaptation. If a translator that has seen a pair gives much of its wording back, a character-overlap score can register that advantage even when the string is imperfect. With exact matching, the same pair may receive no measurable credit from either group of runs. The results show that the degree of separation depends on how sensitively the ranking captures reproduction of the reference.

The authors also ask whether the association extends beyond the contrast between selected extremes. They use BLEU to estimate memorization and progressively tighten the minimum value for entry into the pool from which examples are selected. The thresholds range from 0 to 0.9 in increments of 0.1. Both distinct-source counts and counts over all insertions rise as selection is restricted to examples with higher scores. The experiment therefore gives a graded version of the association. The original comparison could have isolated an unusual top group by construction. The threshold analysis shows that increasingly restrictive selection by the same measure also enriches the pool for examples that fail under the detector.

Another check changes how many training runs must exclude a pair for it to be eligible. When a pair is omitted from very few subsets, its exclusion estimate depends heavily on the outcomes of those runs. Requiring more exclusions gives the estimate more observations on that side, while also changing which pairs can be compared. The difference between the highly memorized and random sets persists under stricter eligibility rules. When the sets are restricted to examples omitted at least 4 times, the random group has zero distinct cases flagged by the perturbation detector. These comparisons concern the stability of the association under changes to the estimation procedure. They do not experimentally alter a sentence's inherent rarity.

The paper also compares example sentences from high and low parts of the memorization ranking. Among the high-scoring examples are a mathematical statement with symbolic notation, an exchange built around repeated commands and refusals, and a string of repeated eating sounds. Such examples suggest several ways an item can stand apart from nearby training material. The qualitative comparison also includes lower-scoring examples phrased as more ordinary statements. These illustrations help explain the motivation for a long-tail reading, while leaving open which specific properties, if measured over the corpus, best predict a large inclusion effect.

What the attention measurements add

Cross-attention links the decoder's activity at target positions to positions in the encoded source. The authors look at the final decoder layer and compare statistics averaged over the memorized and random sets. Attention entropy summarizes how concentrated the distribution is. The memorized set has average attention entropy of 1.85, compared with 2.70 for the random set. The reported diagonal attention entropies are 1.48 and 2.21, respectively. Average attention to the final source token is 0.35 in the memorized group and 0.25 in the random group. These measurements describe distributions that are more concentrated on average for the highly memorized examples.

The paper relates these distributions to deficient attention patterns described in earlier analyses of hallucinations. It also shows a qualitative example from the noise experiment, comparing cross-attention when the clean system and the UR system translate the same diagnostic source. The source concerns an undesirable situation the speaker wants to avoid in future. The clean output preserves that intent. The UR output introduces a football player's reaction to a victory, and its attention map displays a pattern the authors associate with hallucination. The source sentence was absent from UR training, although the added data contain material from the same domain with invalid targets. The comparison illustrates an unusual way of using source information in a concrete case. Concentrated attention by itself remains compatible with more than one account of what brought about the failure.

Which part of the noise pattern matters?

Comparing RR with RU holds the repeated source inventory fixed in the construction and changes what happens on the target side. RR consistently assigns each source the same wrong target, and the translator reproduces these wrong pairings. RU supplies varied, unrelated targets for the same input, and repetition within the generated output becomes prominent. The frequency comparison for the top 5 output bigrams on the English-to-German IRS illustrates this contrast. The bigram evidence agrees with the manual judgments and the diversity statistic. Repetition of a bad pair and presentation of conflicting targets for the same source lead to different translation behavior even though both settings repeatedly expose the system to the diagnostic sources.

Comparing UU with UR highlights a different change. Both constructions use varied sources. UR concentrates the mismatched associations on a small number of targets, whereas UU distributes them among unique targets. Both can produce detached output on the IRS even when the diagnostic source was absent from the added training data. A distinctive feature of UR is that it sometimes emits a whole training target verbatim for such a source. The distinction between exact target reproduction and other forms of inadequacy is observable in the training-reference match check, even when the manually identified natural-hallucination percentages alone would not distinguish how the systems fail.

These comparisons also clarify the role of the evaluation sets. The ordinary test asks whether the system still translates generally useful material about as well by BLEU. The two reference sets for the diagnostic sources ask how it behaves around the deliberately constructed errors. In particular, the RR and RU comparison would look much less consequential in aggregate test BLEU. Looking at correct and incorrect references for the same source, and at repetition within the output, makes it possible to distinguish retention of a specific wrong association from a failure to produce a stable, adequate sentence.

Which signals drive the amplification estimate?

The synthetic-data tables report the component checks in addition to their union. This makes it possible to see which check contributes the reported increase. Whole-output recurrence accounts for most of the detections in the strongest backtranslation and distillation conditions. In those cases the output is both reused across distinct inputs and sufficiently low in source similarity to pass the filter. The within-sentence check tells a different story. Some generated collections contain more translations with repeated token groups, yet only a small number of those translations also fall in the bottom similarity slice. The relative scarcity of oscillation detections in the final estimate therefore reflects the intersection used by the detector as well as the behavior of the system being screened.

That distinction matters when connecting the amplification study to the earlier diagnostic test. RU produced many manually identified oscillatory hallucinations on a small set of sources deliberately related to its training noise. The later measurement applies a common automatic rule to generated corpora and requires oscillation to coincide with particularly low similarity. The severe repetition visible in the targeted RU test and the small automatic count for that pattern in generated data concern different source collections and different definitions of a detected case. The paper treats the weak detection of oscillation at scale as a limitation of the estimator.

Limitations

Limits stated by the authors

Most of the experimentation uses IWSLT 2014 because the repeated training and diagnostic procedures are computationally intensive. The memorization method requires training a collection of systems on different subsets, and the other experiments add similarly structured training conditions. The authors argue that a larger corpus can still have a long tail and that web-scale collections can contain mismatched references. They also note that both kinds of hallucination have been reported in larger systems. These considerations motivate taking the explanations seriously beyond the experimental corpus. The paper itself establishes the reported associations and intervention results at the scale and in the language directions it studies.

The authors explicitly leave the internal training dynamics for further work. The proposed accounts invoke how inconsistent errors act through the source encoder or target decoder. The observed outputs are consistent with the idea that the structure of the bad pairs matters, but the study does not follow the training updates through those components or experimentally intervene on the layers to isolate the proposed mechanisms. The attention comparisons show differences in how source positions receive weight. They cannot on their own establish which training dynamics produced those differences or whether changing attention alone would prevent the hallucination.

The long-tail interpretation also remains incomplete in a specific way. The authors observe qualitative differences between examples with high and low estimated memorization. They leave quantitative characterization of those differences for future research, along with a quantitative test of the link between out-of-domain inputs and heavily memorized material. An example's high score establishes a dependence on whether the corresponding pair appeared in training, within this subset experiment and scoring procedure. Establishing that this pair represents a rare subpopulation, and that memorizing it helped on other members of that subpopulation, would require additional evidence.

The authors acknowledge that their corpus estimator finds few oscillatory cases because the repetition candidates seldom overlap with the bottom 1% by cross-language similarity. Its whole-output recurrence rule likewise rests on an assumption about the evaluation collection. A copied target must recur in the generated data to trigger the duplicate-output check, and that is more plausible when the source set is large enough to elicit the target multiple times. The evaluation of amplification ends with the synthetic corpus. The paper leaves measurement of downstream systems trained on distilled material to future work.

The discussion identifies several possible remedies. For the sensitivity to edits, the authors suggest inspecting highly memorized examples and building augmentation around their characteristics, so that rare constructions receive broader support. They also discuss learning procedures designed to reduce memorization of noisy examples and training objectives that reduce the influence of unreliable data. For natural hallucinations, they suggest filtering invalid alignments, potentially with attention to the particular repetition structures in their experiments. These suggestions follow from the diagnoses. The paper has no corresponding intervention results establishing the effectiveness of those remedies in the studied translation systems. Improved Natural Language Generation via Loss Truncation · Dual Conditional Cross-Entropy Filtering of Noisy Parallel Corpora

Limits apparent from the design

The perturbation detector uses an initial quality gate and then measures output divergence. A detected event is operationally a case where an initially eligible translation changes sharply according to adjusted-BLEU. It is possible for a small input edit to affect meaning, and a very different surface form does not by itself establish that every change is equally inadequate. A system can also make a serious adequacy error while retaining enough wording to escape the divergence threshold. The experiment supports a specific claim about susceptibility under frequent-token insertion at the beginning of a sentence. Other edits, positions and notions of sentence similarity would require separate evaluation.

Ranking the training pairs by an estimated score also selects on a quantity influenced by the choice of reference comparison and by the particular subset runs. The stability checks address some of that dependence by using alternative scoring rules and stricter exclusion criteria. The random comparison is drawn from outside the top group, so its members are not necessarily examples with no memorization. The study shows that the score can identify a more vulnerable collection in this experiment. It does not assign all perturbation failures to memorization or show that reducing an individual pair's memorization value would eliminate its sensitivity.

The natural-hallucination study has a clear intervention, but the targeted evaluation is designed around it. RR and RU repeatedly see the diagnostic sources, UR sees the diagnostic targets in other contexts, and UU sees neither. This is what makes the consequences of each form of overlap visible. It also means that percentages on that small set are diagnostic frequencies rather than estimates of how often an ordinary user would encounter each pathology. The study establishes that constructed types of bitext noise can cause the observed failures. To diagnose an individual failure in deployment from its form alone would require evidence about how often other causes produce similar outputs.

The paper's estimated amplification counts require similar care. An unrelated output that appears only once and contains no conspicuous repetition may evade both structural screens. A correct recurring translation can enter the duplicate-output candidates when several distinct sources legitimately convey the same content. The low-similarity filter is intended to narrow these possibilities, but it is still an estimated similarity measure. The backtranslation comparison also has no clean-generator row and uses sampled generation, whereas the distillation comparison includes original and clean-generated data and uses beam search. It is possible to compare noise settings within each procedure from these experiments. A comparison of the procedures themselves would need to account for the different data, decoding methods and baselines.

What came after

Hallucination as a translation problem

Several later studies that cite the paper pursue questions that its experiments bring into focus. Looking for a Needle in a Haystack takes hallucination in neural machine translation as the object of a comprehensive study. Its declared scope brings the phenomenon out of any single elicitation setup and puts the overall problem of studying hallucinations at the center. The connection is direct at the level of the research question. A failure may be clearly recognizable once a source and output are inspected, while identifying and characterizing instances across a collection remains a separate task. Looking for a Needle in a Haystack

Hallucinations in Large Multilingual Translation Models takes the question into a setting explicitly concerned with large multilingual systems. The earlier paper's diagnostic evidence comes principally from German and English. The later study's scope puts multilingual translation itself in view, where language directions and the setting in which generations are produced become central to the question being studied. The citation connects this broader setting to an earlier effort to give severe translation failures distinct operational definitions. Hallucinations in Large Multilingual Translation Models

The later work on source-contrastive and language-contrastive decoding addresses hallucination together with off-target translation. Its announced intervention is at decoding, the point when a system chooses its output. This gives the connection to the earlier paper a practical focus. The earlier experiments change training pairs or edit the supplied source to investigate how failures arise. The later work asks whether contrasting source or language signals during output selection can mitigate failures. It takes source dependence as something to strengthen at the point of generation. Source- and Language-Contrastive Decoding

Evaluation across tasks and languages

xCOMET approaches machine translation evaluation through fine-grained error detection. Its focus connects to the contrast between ordinary test BLEU and the severe errors visible in the diagnostic set. An aggregate score summarizes performance over many examples. Detecting errors at a finer level addresses a different question, about which translations contain problems and how those problems can be exposed to the reader of an evaluation. The later work's stated emphasis on transparent evaluation puts that finer-grained question at the center. xCOMET

Comparing Hallucination Detection Metrics for Multilingual Generation makes the choice of detector an explicit subject of comparison. That issue is already visible in the earlier paper's results. Human identification, low source similarity and repetition checks each respond to different properties, and combining them changes the set of flagged cases. The later work addresses the metric comparison in multilingual generation, a setting where the choice of how to recognize a hallucination is itself part of the research question. Comparing Hallucination Detection Metrics for Multilingual Generation

The survey of hallucination in natural language generation places translation within a wider area of research. The earlier paper's distinction between a failure exposed by changing an input and a failure on an unchanged input gives a concrete example of why scope and definitions matter when bringing studies together. Its use of manual labels on targeted data and automatic estimates on large collections likewise illustrates why measurements from different settings require context. The survey's contribution as described by its scope is to examine hallucination across natural language generation, taking in a field broader than translation. Survey of Hallucination in Natural Language Generation

Data quality as a question beyond translation

On the Origin of Hallucinations in Conversational Models asks how responsibility for hallucination should be understood in terms of datasets and the systems that learn from them. That question closely follows the logic of intervening on parallel data and observing how output changes, while moving to conversation as the task. Translation gives a source sentence against which an output can be judged. The conversational study's stated question carries the investigation of data and learning into a different setting, where the relevant grounds for a faithful response belong to the dialogue task. On the Origin of Hallucinations in Conversational Models

FaithDial addresses faithfulness in information-seeking dialogue through a benchmark. Its connection is through evaluation. The translation paper constructed diagnostic examples whose correct and incorrect references could reveal different aspects of behavior on the same source. A benchmark devoted to faithful dialogue makes the corresponding concern an explicit target of measurement in information-seeking exchanges. Together, these later directions retain the distinction between asking where a failure originates, asking how to detect it and asking how to intervene. The translation experiments supply concrete evidence that those questions can have different answers even for the same set of outputs. FaithDial

 Institutions

 Fields, topics and concepts

 Shelves 4The field of science this work belongs to (OpenAlex fields).Computer Science · 19,503 worksArtificial Intelligence · 18,805 worksArts and Humanities · 17,959 worksLanguage and Linguistics · 17,789 works

 Topics 1Research subjects and languages the work is about.Machine translation · 1,109 works

Cite

Cite as Vikas Raunak, Arul Menezes and Marcin Junczys-Dowmunt. 2021. The Curious Case of Hallucinations in Neural Machine Translation. Proceedings of the 2021 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies.

The paper itself, not this page. BibTeX from the library's record of the work. DOI 10.18653/v1/2021.naacl-main.92

@inproceedings{raunak2021curious,
  title = {{The Curious Case of Hallucinations in Neural Machine Translation}},
  author = {Vikas Raunak, Arul Menezes and Marcin Junczys-Dowmunt},
  booktitle = {Proceedings of the 2021 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies},
  year = {2021},
  doi = {10.18653/v1/2021.naacl-main.92},
  url = {https://doi.org/10.18653/v1/2021.naacl-main.92}
}

References

20 references, 12 of them with a card of ours. Each entry links to our card when we hold the work, else to OpenAlex and Google Scholar searches for it.

  1. Mikel Artetxe and Holger Schwenk. 2019. Massively Multilingual Sentence Embeddings for Zero-Shot Cross-Lingual Transfer and Beyond. Transactions of the Association for Computational Linguistics, 7:597–610.
  2. Satanjeev Banerjee and Alon Lavie. 2005. METEOR: An automatic metric for MT evaluation with improved correlation with human judgments. In Proceedings of the ACL Workshop on Intrinsic and Extrinsic Evaluation Measures for Machine Translation and/or Summarization, pages 65–72, Ann Arbor, Michigan. Ass…
  3. Alexandre Berard, Ioan Calapodescu, and Claude Roux. 2019. Naver labs Europe’s systems for the WMT19 machine translation robustness task. In Proceedings of the Fourth Conference on Machine Translation (Volume 2: Shared Task Papers, Day 1), pages 526–532, Florence, Italy. Association for Computationa… OpenAlex ↗ · Scholar ↗
  4. Yong Cheng, Lu Jiang, and Wolfgang Macherey. 2019. Robust neural machine translation with doubly adversarial inputs. In Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics, pages 4324–4333, Florence, Italy. Association for Computational Linguistics.
  5. Sergey Edunov, Myle Ott, Michael Auli, and David Grangier. 2018. Understanding back-translation at scale. In Proceedings of the 2018 Conference on Empirical Methods in Natural Language Processing, pages 489–500, Brussels, Belgium. Association for Computational Linguistics. OpenAlex ↗ · Scholar ↗
  6. Vitaly Feldman. 2020. Does learning require memorization? a short tale about a long tail. In Proceedings of the 52nd Annual ACM SIGACT Symposium on Theory of Computing, STOC 2020, page 954–959, New York, NY, USA. Association for Computing Machinery. OpenAlex ↗ · Scholar ↗
  7. Vitaly Feldman and Chiyuan Zhang. 2020. What neural networks memorize and why: Discovering the long tail via influence estimation. Advances in Neural Information Processing Systems, 33.
  8. Marcin Junczys-Dowmunt. 2018. Dual conditional cross-entropy filtering of noisy parallel corpora. In Proceedings of the Third Conference on Machine Translation: Shared Task Papers, pages 888–895, Belgium, Brussels. Association for Computational Linguistics.
  9. Daniel Kang and Tatsunori Hashimoto. 2020. Improved natural language generation via loss truncation. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, pages 718–731, Online. Association for Computational Linguistics.
  10. Yoon Kim and Alexander M. Rush. 2016. Sequence-level knowledge distillation. In Proceedings of the 2016 Conference on Empirical Methods in Natural Language Processing, pages 1317–1327, Austin, Texas. Association for Computational Linguistics.
  11. Philipp Koehn and Rebecca Knowles. 2017. Six challenges for neural machine translation. In Proceedings of the First Workshop on Neural Machine Translation, pages 28–39, Vancouver. Association for Computational Linguistics. OpenAlex ↗ · Scholar ↗
  12. Katherine Lee, Orhan Firat, Ashish Agarwal, Clara Fannjiang, and David Sussillo. 2018. Hallucinations in neural machine translation. In NIPS 2018 Interpretability and Robustness for Audio, Speech and Language Workshop. OpenAlex ↗ · Scholar ↗
  13. Tian Li, Ahmad Beirami, Maziar Sanjabi, and Virginia Smith. 2021. Tilted empirical risk minimization. In International Conference on Learning Representations. OpenAlex ↗ · Scholar ↗
  14. Marianna Martindale, Marine Carpuat, Kevin Duh, and Paul McNamee. 2019. Identifying fluently inadequate output in neural and statistical machine translation. In Proceedings of Machine Translation Summit XVII Volume 1: Research Track, pages 233–243, Dublin, Ireland. European Association for Machine T… OpenAlex ↗ · Scholar ↗
  15. Mathias Müller, Annette Rios, and Rico Sennrich. 2020. Domain robustness in neural machine translation. In Proceedings of the 14th Conference of the Association for Machine Translation in the Americas (Volume 1: Research Track), pages 151–164, Virtual. Association for Machine Translation in the Amer…
  16. Myle Ott, Sergey Edunov, Alexei Baevski, Angela Fan, Sam Gross, Nathan Ng, David Grangier, and Michael Auli. 2019. fairseq: A fast, extensible toolkit for sequence modeling. In Proceedings of the 2019 Conference of the North American Chapter of the Association for Computational Linguistics (Demonstr…
  17. Kishore Papineni, Salim Roukos, Todd Ward, and Wei-Jing Zhu. 2002. Bleu: a method for automatic evaluation of machine translation. In Proceedings of the 40th Annual Meeting of the Association for Computational Linguistics, pages 311–318, Philadelphia, Pennsylvania, USA. Association for Computational…
  18. Maja Popović. 2015. chrF: character n-gram F-score for automatic MT evaluation. In Proceedings of the Tenth Workshop on Statistical Machine Translation, pages 392–395, Lisbon, Portugal. Association for Computational Linguistics.
  19. Vikas Raunak, Siddharth Dalmia, Vivek Gupta, and Florian Metze. 2020. On long-tailed phenomena in neural machine translation. In Findings of the Association for Computational Linguistics: EMNLP 2020, pages 3088–3095, Online. Association for Computational Linguistics. OpenAlex ↗ · Scholar ↗
  20. Holger Schwenk. 2018. Filtering and mining parallel data in a joint multilingual space. In Proceedings of the 56th Annual Meeting of the Association for Computational Linguistics (Volume 2: Short Papers), pages 228–234, Melbourne, Australia. Association for Computational Linguistics.

↑ back to top

This page in Markdown https://md.research.elamur.ai/free/en/papers/raunak-2021-curious-case-hallucinations-neural-machine/