Focused Concatenation for Context-Aware Neural Machine Translation

Lorenzo Lupo, Marco Dinarelli, Laurent Besacier

Abstract

Context-aware neural machine translation (NMT) often employs simple concatenation of previous sentences to provide context. However, this approach can distract the model from the current sentence and struggle with long-range dependencies. We present "Focused Concatenation," a parameter-free method involving context-discounting of the training loss and segment-shifted position embeddings. Our approach significantly improves discourse-level translation quality on English-Russian and English-German tasks, outperforming complex multi-encoder architectures without increasing model complexity.

Introduction

Standard NMT systems typically translate sentences in isolation, often failing to resolve document-level ambiguities such as gendered pronouns (anaphora), consistent terminology (lexical cohesion), and omitted words (ellipsis). While concatenating previous sentences to the current input is a straightforward solution, it introduces a "distraction" problem: the model may over-allocate capacity to translating context tokens at the expense of the target sentence. Additionally, Transformers often lack an inherent "locality bias," making it difficult to distinguish between intra-sentence and inter-sentence relationships as sequences grow longer.

Methodology

The proposed "Focused Concatenation" method addresses these issues through two parameter-free modifications to the standard Transformer training pipeline:

  1. Context-Discounting (CD): During training, the loss generated by context tokens is multiplied by a discount factor ($0 \le CD < 1$). This prioritizes the translation quality of the current sentence while still allowing the model to leverage context for information.
  2. Segment-Shifted Positions: To bake a locality bias into the model, a constant "shift" is introduced to position embeddings at every sentence boundary. For instance, a shift of 10 would mean the first sentence uses positions 1–4, while the subsequent sentence starts at position 15. This increases the mathematical distance between sentences, helping the attention mechanism differentiate between local and global context.
Illustration of Context-Discounting (CD) and Segment-Shifted Positions.

Experimental Setup

The methods were evaluated on two language pairs:

  • English → Russian (En→Ru): Trained on 1.5M sentences from OpenSubtitles2018, evaluated on a contrastive test suite for deixis, lexical cohesion, and ellipsis.
  • English → German (En→De): Trained on IWSLT17 (TED talks), evaluated using the ContraPro test set for ambiguous pronoun translation.

Results and Discussion

The core insight is that reducing the requirement for the model to perfectly translate context actually improves its ability to use that context. By discounting context loss, the model's attention becomes more focused on the current sentence, effectively filtering out noise. Furthermore, shifting position embeddings provides a geometric signal of sentence boundaries, aligning the model's internal representations with human linguistic processing.

Performance of Focused Concatenation on English-to-Russian discourse phenomena.

As shown in the En→Ru results, the focused model (s4to4 + shift + CD) achieved a discourse accuracy of 73.55%, significantly outperforming the context-agnostic baseline (46.64%) and vanilla concatenation (72.02%). Notably, the model showed marked improvements in ellipsis resolution and lexical cohesion. In En→De tasks, the approach proved superior in anaphora resolution, particularly when antecedents were several sentences away. Crucially, these gains were achieved without sacrificing general translation quality, as measured by BLEU and COMET scores.

Conclusion

Focused Concatenation offers a simple yet powerful upgrade for document-level NMT. While currently tested on windows of up to four sentences, future work should explore its scalability to long-form documents and its synergy with large-scale pre-trained models. The heuristic nature of the position shifts also suggests potential for learned or dynamic shift mechanisms.

Summary updated

BibTeX
@inproceedings{lupo2022focused,
  author = {Lorenzo Lupo and Marco Dinarelli and Laurent Besacier},
  title = {{Focused Concatenation for Context-Aware Neural Machine Translation}},
  booktitle = {Wmt},
  year = {2022},
}
Figure