Abstract
Large Language Models (LLMs) have shown promise in translation, yet they often struggle with document-level context. Standard approaches treat surrounding context and the current source sentence with equal priority, leading to suboptimal attention allocation. We introduce DeMPT (Decoding-enhanced Multi-phase Prompt Tuning), a framework that decomposes the translation process into three distinct phases: inter-sentence encoding, intra-sentence encoding, and decoding. By utilizing specialized prompts and a novel decoding strategy, DeMPT ensures that LLMs prioritize relevant semantic information while maintaining document-level consistency.
Introduction: The Context-Awareness Problem
In context-aware Neural Machine Translation (NMT), the objective is to translate a sentence while accounting for the surrounding document to ensure lexical and grammatical consistency (e.g., maintaining pronoun gender or technical terminology).
The prevailing strategy for adapting decoder-only LLMs to this task is simple concatenation, where previous context and the current sentence are fed into the prompt together. However, this approach forces the model to distribute attention weights equally across all tokens. In practice, the "intra-sentence" context—the specific sentence being translated—contains the most critical semantic information and should be prioritized. Naive concatenation often results in "long-distance" issues, where the model loses focus on the core sentence amidst the surrounding document noise.
Methodology
DeMPT addresses these limitations through two primary innovations: Multi-phase Prompt Tuning and an Enhanced Decoding Strategy.
Multi-phase Prompt Tuning
Rather than a single pass, DeMPT divides the process into three sequential phases, each utilizing its own set of trainable continuous prompts and type embeddings:
- Phase 1 (Inter-sentence): Encodes the surrounding document context ($C$).
- Phase 2 (Intra-sentence): Encodes the current source sentence ($S$), conditioned on the representations from Phase 1.
- Phase 3 (Decoding): Generates the target translation ($T$).
This separation allows the model to learn a hierarchy of information, distinguishing its role as either a context encoder or a translator at different stages of the pipeline.
Enhanced Decoding Strategy
To further ground the model in the current sentence, DeMPT employs a specialized decoding head. During generation, the next-token probability is calculated by fusing three distributions: the standard LLM output, a distribution conditioned on a fusion of inter- and intra-sentence representations, and a distribution conditioned solely on the intra-sentence representation. This heuristic "boost" ensures the model remains faithful to the source sentence while remaining informed by the broader context.
Experimental Evaluation
DeMPT was evaluated across five translation directions (Chinese, French, German, Spanish, and Russian to English) using several benchmarks:
- News-Commentary-v18: For general NMT evaluation.
- BlonDe: To measure discourse-level challenges like pronoun resolution.
- Voita et al. (2019): A contrastive test set for linguistic phenomena like ellipsis.
Key Results
- Superior Performance: DeMPT consistently outperformed standard prompt tuning and concatenation baselines in BLEU, COMET, and BlonDe metrics. In Chinese-to-English tasks, it achieved a BlonDe score of 52.68, significantly higher than the 49.53 baseline.
- Human Validation: In Direct Assessment evaluations, DeMPT outperformed the concatenation baseline by 7.14 points, confirming the practical utility of the approach.
- Efficiency and Robustness: Despite the multi-phase architecture, DeMPT maintains inference speeds comparable to simple concatenation (only ~0.02s delay) while using significantly fewer trainable parameters (3.11% vs. 13.87%). Furthermore, it proved more robust to "noisy" or irrelevant context than standard methods.
Conclusion
DeMPT demonstrates that explicitly separating document context from sentence-level information allows LLMs to become more effective translators. By structuring the encoding process and enhancing the decoding stage, the model achieves better discourse consistency without sacrificing efficiency. Future work will explore scaling these benefits to larger models (70B+) and integrating target-side context for even greater document-level coherence.
Summary updated