The unreasonable effectiveness of few-shot learning for machine translation

Xavier Garcia, Yamini Bansal, Colin Cherry, George F. Foster, Maxim Krikun, Fangxiaoyu Feng, Melvin Johnson, Orhan Firat

Abstract

Traditional machine translation (MT) systems rely heavily on massive parallel corpora, which are often scarce, noisy, or biased. This paper explores an alternative paradigm: using a moderately sized (8-billion parameter) decoder-only model trained exclusively on monolingual data. By employing a mixture of self-supervised objectives and Minimum Bayes Risk (MBR) decoding, the researchers demonstrate that this model can match or outperform state-of-the-art supervised systems and significantly larger models like PaLM (540B). Furthermore, the few-shot prompting approach provides unprecedented control over translation style, dialect, and formality, addressing long-standing challenges in the field.

Introduction

State-of-the-art machine translation has historically been synonymous with supervised learning on millions of parallel sentence pairs. While effective for high-resource language pairs, this approach suffers from three primary limitations: the scarcity of parallel data for most world languages, the inherent biases and noise in mined data (often referred to as "translationese"), and the architectural complexity of unsupervised methods that rely on back-translation.

Recent advances in Large Language Models (LLMs) like GPT-4 and PaLM have shown that translation can emerge as a few-shot capability. However, these models are computationally expensive and often fail to beat specialized supervised baselines. This research investigates whether an 8B parameter model—roughly 1/70th the size of PaLM—can achieve competitive translation quality using only monolingual data and a handful of examples at inference time.

Methodology

Model Architecture and Training

The researchers utilized a Transformer decoder-only architecture with 8 billion parameters. Unlike traditional MT models, this model was trained using only monolingual corpora for English, German, Chinese, and Icelandic. The training objective followed a variant of the UL2 (Unifying Language Learning Paradigms) framework, which combines:

  • Span Corruption: Predicting missing segments of text.
  • Prefix Language Modeling: Predicting the continuation of a given text segment.
  • Causal Language Modeling: Standard next-token prediction.

Crucially, the model never encountered a parallel sentence pair during its pre-training phase, learning only the internal structures and semantics of individual languages.

Inference and Decoding

At inference time, the model is provided with a prompt containing five high-quality translation examples (few-shot prompting) followed by the source sentence.

To optimize output quality, the study moved beyond standard beam search in favor of Minimum Bayes Risk (MBR) decoding. MBR involves sampling 64 candidate translations and selecting the one with the highest average similarity to all other candidates, using the BLEURT metric. This approach prioritizes semantic consistency and has proven more robust than word-matching metrics like BLEU for LLM-based translation.

Experimental Results

Benchmarking Performance

The model was evaluated on the WMT’21 news translation tasks across high, medium, and low-resource scenarios:

  • English-Chinese: The 8B few-shot model outperformed the top-ranked supervised submission from the WMT’21 competition.
  • English-German: The model achieved parity with specialized supervised systems and surpassed commercial baselines like Google Translate in the English-to-German direction.
  • English-Icelandic: Despite Icelandic having 100x less monolingual training data than Chinese, the model remained highly competitive, surpassing Google Translate in BLEURT scores.

Controllability and Dialect Adaptation

One of the most significant findings was the model's sensitivity to the style of few-shot examples. Using the FRMT benchmark for regional Mandarin varieties, the researchers found that providing examples in a specific dialect (e.g., Taiwanese Mandarin) allowed the model to adapt its output accordingly. Lexical accuracy jumped from 13.8% to 86.2% simply by matching the prompt's dialect to the target. Similar success was observed in the IWSLT’22 task for formality control in German, where the model correctly toggled between formal ("Sie") and informal ("du") registers based on the prompt.

Discussion and Limitations

The "unreasonable effectiveness" of this 8B model suggests that for translation, the quality of the training objective and the decoding strategy are more critical than raw parameter count. The model's ability to outperform the 540B PaLM model indicates that smaller, well-tuned models can be more efficient for specific tasks.

However, several challenges remain:

  1. Scaling Floor: Performance drops significantly when the model size is reduced to 1B parameters, suggesting a minimum threshold for few-shot translation emergence.
  2. Multilingual Capacity: There is a potential "curse of multilinguality" where adding too many languages to a single 8B model may eventually degrade per-language performance.
  3. Computational Cost: MBR decoding is resource-intensive, requiring dozens of samples per translation. Future research must focus on making this high-quality decoding more efficient.

Conclusion

This work demonstrates that monolingual pre-training, when combined with few-shot prompting and MBR decoding, is a powerful alternative to supervised machine translation. By eliminating the need for parallel data and providing a mechanism for fine-grained stylistic control, this approach paves the way for more flexible and inclusive translation technologies.

Summary updated

BibTeX
@inproceedings{garcia2023unreasonable,
  author = {Xavier Garcia and Yamini Bansal and Colin Cherry and George F. Foster and Maxim Krikun and Fangxiaoyu Feng and Melvin Johnson and Orhan Firat},
  title = {{The unreasonable effectiveness of few-shot learning for machine translation}},
  booktitle = {International Conference on Machine Learning},
  year = {2023},
  url = {https://openreview.net/forum?id=zvCSNsoyKW},
}
Figure