Lune

ACL Findings2023

In-context Examples Selection for Machine Translation

Sweta Agrawal, Chunting Zhou, Mike Lewis, Luke Zettlemoyer, Marjan Ghazvininejad

Abstract

Large-scale generative models show an impressive ability to perform a wide range of Natural Language Processing (NLP) tasks using in-context learning, where a few examples are used to describe a task to the model. For Machine Translation (MT), these examples are typically randomly sampled from the development dataset with a similar distribution as the evaluation set. However, it is unclear how the choice of these in-context examples and their ordering impacts the output translation quality. In this work, we aim to understand the properties of good in-context examples for MT in both in-domain and out-of-domain settings. We show that the translation quality and the domain of the in-context examples matter and that 1-shot noisy unrelated example can have a catastrophic impact on output quality. While concatenating multiple random examples reduces the effect of noise, a single good prompt optimized to maximize translation quality on the development dataset can elicit learned information from the pre-trained language model. Adding similar examples based on an n-gram overlap with the test source significantly and consistently improves the translation quality of the outputs, outperforming a strong kNN-MT baseline in 2 out of 4 out-of-domain datasets.

Ask Lune

Ask anything. The answer quotes the paper.

Lune reads all of it and the papers around it, then shows you the passages behind every answer.

Questions to start from

Lune answers from

the full paper · 48 top-tier papers that cite it · related work

Get the answer

Free to start. No credit card required.

Cited by top-tier papers48

  1. Prompting Large Language Model for Machine Translation: A Case StudyBiao Zhang, Barry Haddow, Alexandra BirchICML 2023 · 402 citations
  2. What Makes Good Examples for Visual In-Context Learning?Yuanhan Zhang, Kaiyang Zhou, Ziwei LiuNeurIPS 2023 · 219 citations
  3. Compositional Exemplars for In-context LearningJiacheng Ye, Zhiyong Wu, Jiangtao Feng, Tao Yu et al.ICML 2023 · 188 citations
  4. Lift Yourself Up: Retrieval-augmented Text Generation with Self-MemoryXin Cheng, Di Luo, Xiuying Chen, Lemao Liu et al.NeurIPS 2023 · 177 citations
  5. The Unreasonable Effectiveness of Few-shot Learning for Machine TranslationXavier Garcia, Yamini Bansal, Colin Cherry, George F. Foster et al.ICML 2023 · 133 citations

Builds on14

  1. Language Models are Few-Shot LearnersTom B. Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah et al.NeurIPS 2020 · 64,255 citations
  2. Fantastically Ordered Prompts and Where to Find Them: Overcoming Few-Shot Prompt Order SensitivityYao Lu, Max Bartolo, Alastair Moore, Sebastian Riedel et al.ACL 2022 · 1,494 citations
  3. Few-Shot Parameter-Efficient Fine-Tuning is Better and Cheaper than In-Context LearningHaokun Liu, Derek Tam, Mohammed Muqeeth, Jay Mohta et al.NeurIPS 2022 · 1,483 citations
  4. Prompting Large Language Model for Machine Translation: A Case StudyBiao Zhang, Barry Haddow, Alexandra BirchICML 2023 · 402 citations
  5. Nearest Neighbor Machine TranslationUrvashi Khandelwal, Angela Fan, Dan Jurafsky, Luke Zettlemoyer et al.ICLR 2021 · 323 citations

Related papers

  1. Augmenting Large Language Model Translators via Translation MemoriesYongyu Mu, Abudurexiti Reheman, Zhiquan Cao, Yuchun Fan et al.ACL Findings 2023 · 11 citations
  2. Large Language Models Might Not Care What You Are Saying: Prompt Format Beats DescriptionsChenming Tang, Zhixiang Wang, Hao Sun, Yunfang WuEMNLP Findings 2025 · 2 citations
  3. An Empirical Study of In-context Learning in LLMs for Machine TranslationPranjal A. Chitale, Jay P. Gala, Raj DabreACL Findings 2024 · 10 citations
  4. Dissecting In-Context Learning of Translations in GPT-3Vikas Raunak, Arul Menezes, Hany Hassan AwadallaEMNLP Findings 2023 · 2 citations
  5. CTQScorer: Combining Multiple Features for In-context Example Selection for Machine TranslationAswanth M., Ratish Puduppully, Raj Dabre, Anoop KunchukuttanEMNLP Findings 2023 · 4 citations
Dusk over the sea between two cliffs drawn in fine vertical lines