A Case Study on Context-Aware Neural Machine Translation with Multi-Task Learning

Ramakrishna Appicharla, Baban Gain, Santanu Pal, Asif Ekbal, Pushpak BhattacharyyaarXiv 2024

TL;DR

This paper investigates whether Multi-Task Learning (MTL) can force document-level translation models to truly utilize surrounding context rather than just treating it as a source of "robustness-inducing noise." While the proposed MTL approach improves translation performance in low-resource settings and makes models more sensitive to context choice, the authors find that models still struggle to reconstruct source sentences from context, raising questions about the inherent "context-awareness" of current document-level datasets.

What Problem Does This Paper Address?

In Neural Machine Translation (NMT), document-level models (DocNMT) aim to produce more consistent translations by looking at surrounding sentences (context) rather than translating in isolation. However, recent research has suggested a surprising "noise generator" hypothesis: multi-encoder DocNMT models might not actually be encoding context meaningfully. Instead, the context encoder might just be generating noise that makes the main translation model more robust, similar to data augmentation.

The authors of this paper set out to challenge this. They wanted to see if they could force a model to explicitly model the relationship between context and the current sentence. If the model is required to perform a task that requires context, will it finally learn to use that information to improve translation?

Methods

The researchers employed a Cascade Multi-Task Learning architecture. Unlike standard multi-encoder models that simply fuse context and source representations, this architecture sets up a dependency chain:

  1. Context Encoder: Encodes the provided context (e.g., the previous two sentences).
  2. Intermediate Decoder (Auxiliary Task): Attempts to reconstruct the current source sentence based solely on the context encoder's output.
  3. Final Decoder (Main Task): Generates the target translation by attending to the output of the intermediate decoder.
Figure 1: The overview of our MTL architecture. The in- put to the model is a triplet. The triplet consist of (Context, Source, Target). The Intermediate Decoder is trained to re- construct the Source given Context, and the Final Decoder is trained to translate the Source. Here, Source: Current source sentence, Context: Context for the current source sentence, and Target: Translation of current source sentence. None of the layers are shared.

By training the model to optimize both translation and reconstruction objectives simultaneously, the authors hypothesized the model would be forced to encode the context more effectively. They compared this against several baselines:

  • Vanilla-Sent: A standard sentence-level model.
  • Concat-Context: A model where context and source are simply concatenated as a single input.
  • Inside-Context: A multi-encoder approach where the decoder attends to separate context and source encoders (see Figure 2 in the paper).

Datasets

The experiments were conducted on German-to-English translation using three distinct corpora:

  • WMT News-commentary v14: Representing a low-resource, domain-specific setting (~329k sentences).
  • IWSLT ‘17 TED: Another low-resource setting consisting of transcribed talks (~206k sentences).
  • Europarl-v7: A high-resource setting based on European Parliament proceedings (~1.66M sentences).

The authors tested three context configurations: the previous two source sentences (P@2-SRC), the previous two target sentences (P@2-TGT), and a "sandwich" of the previous and next source sentences (P-N-SRC).

Key Insights and Ideas

  • Sensitivity is the Key Difference: The most striking finding is that MTL models are highly sensitive to the choice of context. When tested with random sentences as context, the MTL model's performance plummeted (e.g., dropping from ~20 BLEU to ~1 BLEU). In contrast, standard multi-encoder models (Inside-Context) were "context-agnostic"—they performed almost as well with random noise as they did with real context. This confirms that the MTL objective successfully forces the model to rely on the context.
  • The Reconstruction Paradox: Despite the performance gains in translation, the models were actually terrible at the auxiliary task. The BLEU scores for reconstructing the source from context were extremely low (around 1.3 to 4.9).
  • Questioning the Data: The failure of the reconstruction task led the authors to a provocative conclusion: the available document-level parallel corpora might not actually be very "context-aware." If a human (or a sophisticated model) cannot reasonably predict a sentence from its neighbors, the contextual link in the dataset might be too weak to provide significant translation benefits beyond simple noise-based robustness.

Key Results

  • Low-Resource Gains: In the News and TED datasets, the MTL approach consistently outperformed both the vanilla sentence-level baseline and the concatenation-based models. For example, on the News corpus, the MTL (P-N-SRC) model achieved 20.1 s-BLEU, a +1.8 improvement over the vanilla baseline.
  • High-Resource Plateau: In the high-resource Europarl setting, the simple concatenation method (Concat-Context) actually performed best. This suggests that with enough data, simpler architectures can learn to extract what little contextual information is available without the need for complex multi-task objectives.
  • Pronoun Accuracy: The MTL models generally achieved higher Accuracy of Pronoun Translation (APT) scores, indicating that the context was indeed helping with discourse-level phenomena like anaphora resolution.

Limitations and Future Work

The authors acknowledge two primary limitations:

  1. Ineffective Auxiliary Task: While the reconstruction task forced context sensitivity, the task itself was too difficult, resulting in poor reconstruction quality.
  2. Static Weighting: The study used a fixed 0.5/0.5 weight for the two tasks in the loss function.

For future work, the authors suggest exploring different auxiliary tasks that might be more achievable or relevant, such as Gap Sentence Generation (GSG). They also plan to investigate dynamic loss weighting to prioritize the main translation task more effectively during different stages of training.

Summary updated

BibTeX
@misc{appicharla2024case,
  author = {Ramakrishna Appicharla and Baban Gain and Santanu Pal and Asif Ekbal and Pushpak Bhattacharyya},
  title = {{A Case Study on Context-Aware Neural Machine Translation with Multi-Task Learning}},
  year = {2024},
  eprint = {2407.03076},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2407.03076},
}
Figure