Abstract
Decoder-only Large Language Models (LLMs) often suffer from "unfaithful translations," where the model generates hallucinations by over-relying on its own previously generated output (target prefix) rather than the source text. This paper investigates this phenomenon and introduces three novel strategies to re-center the model's focus: attention reweighting, contrastive decoding, and target-constrained tuning. Experimental results demonstrate that these methods significantly improve translation faithfulness, reducing hallucination rates by over 2.5x while maintaining or improving general translation quality.
Introduction
In traditional Neural Machine Translation (NMT), encoder-decoder architectures utilized explicit cross-attention mechanisms to ensure the model remained grounded in the source text. However, modern LLMs (e.g., Llama-2, GPT-4) typically employ a decoder-only architecture that processes both source and target sequences in a single stream.
We identify a critical flaw in this setup: as the generation progresses, the model's attention increasingly shifts toward the target prefix, leading to an "attention sink" where the source context is effectively ignored. This often results in the model abandoning the translation task to "chat" or repeat itself, a phenomenon we term unfaithful translation.
Proposed Methods
To address the loss of source grounding, we propose three distinct approaches covering both inference-time adjustments and training-time optimizations.
1. Reweight Attention (Inference-time)
This unsupervised method boosts the attention weights of relevant source tokens during decoding. By identifying a source "anchor" token—either through monotonic alignment or contribution-guided heuristics—the model applies a Gaussian window to prioritize source tokens near that anchor. This nudge ensures the model "looks" at the correct part of the original sentence for each generated word.
2. Contrastive Decoding (Inference-time)
Leveraging Maximum Mutual Information (MMI), this method compares the probability of a token given the full context (source + target prefix) against its probability given only a generic target prefix. By penalizing tokens that are highly probable even without the source text, the model is forced to select tokens that are specifically justified by the source context.
3. Target-Constrained Instruction Tuning (Training-time)
For scenarios where fine-tuning is feasible, we introduce a new training objective. The model is trained on dual inputs: the full target prefix and a partially masked version of the same prefix. A KL-divergence loss is applied to ensure prediction consistency between the two, teaching the model to rely on the source context rather than over-fitting to the target prefix.
Experimental Setup
We evaluated our methods on a newly curated Unfaithful Translation Test Set designed to highlight LLM failures in Chinese-English and German-English pairs. Additionally, standard benchmarks such as WMT22 and Flores-101 were used to verify general performance. Training involved 62.9K high-quality sentence pairs from WMT competitions.
Key Results
Our proposed methods yielded substantial improvements in both translation quality and faithfulness:
- Hallucination Reduction: Human evaluation confirmed a reduction in hallucination rates by a factor of at least 2.5x compared to vanilla zero-shot baselines.
- Translation Metrics: Reweight Attention improved performance by an average of 2.1 BLEU and 4.7 COMET scores on the unfaithful test sets.
- Consistency Across Models: Target-Constrained Tuning consistently outperformed standard LoRA instruction tuning by approximately 1.1 BLEU across various model families, including Llama-2 (7B to 70B), BLOOMZ, and ChatGLM3.
Conclusion
The transition to decoder-only LLMs has introduced new challenges for translation faithfulness. By explicitly reweighting attention or using contrastive objectives, we can mitigate the tendency of these models to ignore source context. Future work will explore the impact of these methods on other sequence-to-sequence tasks like summarization and their performance under diverse decoding strategies such as beam search.
Summary updated