In-Context Example Selection via Similarity Search Improves Low-Resource Machine Translation

Armel Zebaze, Benoît Sagot, Rachel Bawden
8/1/2024
cs.CL

Official code: ArmelRandy/ICL-MT (9 stars, Apache-2.0, last commit 2025-02-04).

Abstract

The ability of generative large language models (LLMs) to perform in-context learning has given rise to a large body of research into how best to prompt models for various natural language processing tasks. In this paper, we focus on machine translation (MT), a task that has been shown to benefit from in-context translation examples. However no systematic studies have been published on how best to select examples, and mixed results have been reported on the usefulness of similarity-based selection over random selection. We provide a study covering multiple LLMs and multiple in-context example retrieval strategies, comparing multilingual sentence embeddings. We cover several language directions, representing different levels of language resourcedness (English into French, German, Swahili and Wolof). Contrarily to previously published results, we find that sentence embedding similarity can improve MT, especially for low-resource language directions, and discuss the balance between selection pool diversity and quality. We also highlight potential problems with the evaluation of LLM-based MT and suggest a more appropriate evaluation protocol, adapting the COMET metric to the evaluation of LLMs. Code and outputs are freely available at https://github.com/ArmelRandy/ICL-MT.

View on arXivView PDF

Code Implementations(1)

ArmelRandy/ICL-MTOfficial100%
Apache-2.0

[NAACL 2025 Findings] Example Selection via Similarity Search improves Low-resource Machine Translation

91Python, Jupyter NotebookJul 30, 20241 years agoApache-2.0

Cite this paper

@article{zebaze2024incontext,
  title  = {In-Context Example Selection via Similarity Search Improves Low-Resource Machine Translation},
  author = {Armel Zebaze and Benoît Sagot and Rachel Bawden},
  year   = {2024},
  eprint = {2408.00397},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2408.00397v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2408.00397.svg)](https://codeofpaper.com/paper/2408.00397)

Discussion