[Paper Review] Neural Machine Translation Models Can Learn to be Few-shot Learners
This paper proposes fine-tuning neural machine translation (NMT) models to perform in-context learning (ICL) for few-shot domain adaptation, using a specialized objective that enables them to adapt to new domains using only a few example translations. The method achieves state-of-the-art performance in translation quality and immediate adaptation rate—outperforming both traditional fine-tuning and a 40B-parameter LLM (Falcon-40B)—while enabling efficient batch inference with lightweight adapters.
The emergent ability of Large Language Models to use a small number of examples to learn to perform in novel domains and tasks, also called in-context learning (ICL). In this work, we show that a much smaller model can be trained to perform ICL by fine-tuning towards a specialized training objective, exemplified on the task of domain adaptation for neural machine translation. With this capacity for ICL, the model can take advantage of relevant few-shot examples to adapt its output towards the domain. We compare the quality of this domain adaptation to traditional supervised techniques and ICL with a 40B-parameter Large Language Model. Our approach allows efficient batch inference on a mix of domains and outperforms state-of-the-art baselines in terms of both translation quality and immediate adaptation rate, i.e. the ability to reproduce a specific term after being shown a single example.
Motivation & Objective
- To investigate whether standard NMT models can be trained to perform in-context learning (ICL) for domain adaptation, despite lacking this capability out-of-the-box.
- To develop a training scheme that enhances NMT models' ability to leverage few-shot examples during inference for domain-specific adaptation.
- To compare the performance of ICL-enabled NMT models against traditional fine-tuning and large language models (LLMs) like Falcon-40B on few-shot translation tasks.
- To evaluate the effectiveness of combining ICL with lightweight adapter fine-tuning for multi-domain adaptation with minimal computational cost.
Proposed method
- Fine-tune a standard NMT model on a specialized objective that trains it to attend to and utilize few-shot example translations during inference, rather than just learning a single domain.
- Use nearest neighbor retrieval to identify relevant in-context examples from a source domain's training data to include in the prompt during inference.
- Integrate lightweight adapter layers into the NMT model to enable efficient domain-specific adaptation without full fine-tuning.
- Combine the ICL-capable NMT model with domain-specific fine-tuning (Stage 3) to improve performance on unseen domains.
- Use a prompt template with k-shot examples (e.g., English: [source] German: [target]) to guide the model during inference, similar to LLM prompting.
- Train the model to generate accurate translations conditioned on context examples, optimizing for both BLEU score and word substitution accuracy (WSA) on consistent terminology.
Experimental results
Research questions
- RQ1Can a standard NMT model be trained to perform in-context learning (ICL) for domain adaptation, even without architectural changes?
- RQ2How does the performance of an ICL-optimized NMT model compare to traditional domain fine-tuning and a 40B-parameter LLM (Falcon-40B) in few-shot translation tasks?
- RQ3What is the impact of combining ICL training with lightweight adapter fine-tuning on multi-domain adaptation performance?
- RQ4How well do ICL-enabled NMT models maintain translation consistency (e.g., terminology alignment) compared to fine-tuned models on word-substitution segments?
Key findings
- The ICL-optimized NMT model outperforms the baseline NMT model and traditional fine-tuning in terms of BLEU score, achieving a 2.5 BLEU point improvement over the runner-up in 1-shot settings on the ACED dataset.
- On the MDNS dataset, the Stage 3 model (ICL + adapter fine-tuning) achieved a 3.8 BLEU point improvement over the runner-up in 0-shot settings, with a 101% relative improvement on the Koran subset.
- The Stage 3 model achieved a word substitution accuracy (WSA) of 74.6% on word-substitution segments, significantly outperforming the fine-tuned model (57.14%) and the non-adapted model (1.7%).
- The model reduced the rate of empty translations to 0.0% across all k-shot settings, indicating robustness in few-shot inference.
- Falcon-40B LLM showed strong ICL performance on ACED and MDNS datasets when k was high, but its inference speed was slow (2.6 tokens/second), and it underperformed the optimized NMT model in absolute BLEU scores.
- The ICL behavior in NMT models was degenerate without task-specific fine-tuning, indicating that explicit training is necessary to unlock reliable few-shot adaptation.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.