MT2: Towards a Multi-Task Machine Translation Model with Translation-Specific In-Context Learning

Chunyou Li, Mingtong Liu, Hongxiao Zhang, Yufeng Chen, Jinan Xu, Ming ZhouEMNLP 2023

Abstract

Modern machine translation (MT) has evolved beyond simple sentence-level mapping to encompass complex tasks such as document-level translation, translation memory (TM) integration, and terminology-constrained translation. Traditionally, these tasks have been addressed using fragmented, specialized models, which limits knowledge transfer and increases system complexity. This paper introduces MT2, a unified Multi-Task Machine Translation model that leverages a novel translation-specific In-Context Learning (ICL) paradigm. By treating various translation tasks as context-learning problems, MT2 integrates contextual information to improve performance across the board. Extensive experiments demonstrate that MT2 not only outperforms specialized supervised models but also exhibits a superior ability to utilize provided context compared to massive models like ChatGPT.

Introduction

As the field of Machine Translation matures, the demand for systems that can handle more than isolated sentences has grown. Professional translation workflows often require adherence to specific glossaries (terminology constraints) or the reuse of previously translated segments (translation memory). Furthermore, maintaining consistency across an entire document is crucial for high-quality output.

Historically, solving these diverse requirements meant building separate architectures or adding complex external modules to standard NMT systems. While Large Language Models (LLMs) offer a potential unified solution through In-Context Learning, they often fail to strictly follow the specific translation hints provided in a prompt. MT2 addresses this by fine-tuning a 7B-parameter model specifically to become an expert at utilizing translation-specific context.

Methodology: The MT2 Framework

MT2 is built upon the BLOOM-7B architecture and employs a two-stage training strategy designed to instill both general translation proficiency and specialized context-utilization skills.

1. Two-Stage Training

  • Stage 1: General Translation Ability. The model is first pre-trained on a massive corpus of approximately 100 million parallel sentence pairs to establish a robust baseline for English-Chinese translation.
  • Stage 2: ICL Enhancement. In this stage, the model is trained on "context-enhanced" data. The input is structured to include prompts containing similar translation pairs, terminology definitions, or preceding document context, teaching the model how to map these hints to the final output.

2. Data Construction Pipeline

To create the necessary training data for multi-task learning, the researchers developed a sophisticated retrieval and alignment pipeline. This process ensures the model sees a wide variety of contextual scenarios during training.

The MT2 data construction pipeline, illustrating the retrieval of translation memories, phrase alignment for terminology, and the processing of monolingual/bilingual document corpora into a unified context dataset.

As shown in the pipeline above, the system uses BM25 retrieval to find similar sentences for TM tasks and phrase alignment dictionaries to generate synthetic terminology constraints. This allows the model to learn from realistic examples of how human translators use reference materials.

3. Context-Dependent Training Strategies

To ensure the model doesn't ignore the provided context, two key strategies were implemented:

  • Masking Strategy: The authors masked tokens in the target sentence that were explicitly provided in the context prompts. This forces the model to attend to the prompt to correctly predict the target token, rather than relying solely on its internal language modeling weights.
  • Noise Robustness: By intentionally including incorrect or "noisy" translations in some training prompts, the model learns to discern when a hint is helpful and when it should rely on its own knowledge, improving its reliability in real-world scenarios where retrieval might be imperfect.

Experimental Results

MT2 was evaluated across several challenging benchmarks, including the UM-Corpus for domain adaptation and IWSLT2015 for document-level translation.

Translation Memory and Terminology

In TM tasks, MT2 showed significant BLEU score improvements, with average gains of 2.18 points (En-Zh) and 2.69 points (Zh-En) when context was provided. In specialized domains like Aviation, terminology accuracy rose from 81.44% to 92.27%.

Comparison with ChatGPT

Perhaps the most striking result is MT2's performance relative to ChatGPT. Despite being significantly smaller (7B vs. 175B+ parameters), MT2 proved more adept at following specific translation instructions.

A qualitative comparison between ChatGPT and MT2. MT2 consistently adheres to the provided terminology translations (e.g., 'HIMSS' and 'culling strategy'), whereas ChatGPT often ignores the prompt's specific constraints.

As illustrated in the comparison, MT2 successfully incorporates the provided Chinese translation for technical terms like "HIMSS," while ChatGPT tends to default to its general knowledge, often leaving the term in English or using a different synonym than the one requested.

Conclusion

MT2 demonstrates that a unified approach to machine translation is not only possible but highly effective. By framing diverse translation requirements as In-Context Learning tasks and employing specialized training strategies like target masking, the researchers created a model that is both versatile and highly accurate. MT2's ability to outperform much larger models in context utilization suggests that specialized ICL training is a powerful path forward for the next generation of machine translation systems.

Summary updated

BibTeX
@inproceedings{li2023mt,
  author = {Chunyou Li and Mingtong Liu and Hongxiao Zhang and Yufeng Chen and Jinan Xu and Ming Zhou},
  title = {{MT2: Towards a Multi-Task Machine Translation Model with Translation-Specific In-Context Learning}},
  booktitle = {Conference on Empirical Methods in Natural Language Processing},
  year = {2023},
  url = {https://openreview.net/forum?id=TtQfZwf5s5},
}
Figure