Large language models have demonstrated the capability to perform well on many NLP tasks when the input is prompted with a few examples (in-context learning) including machine translation, which is the focus of this work. The quality of translation depends on various features of the selected examples, such as their quality and relevance. However, previous work has predominantly focused on individual features for example selection. We propose a general framework for combining different features influencing example selection. We learn a regression function that selects examples based on multiple features in order to maximize the translation quality. On multiple language pairs and language models, we show that our example selection method significantly outperforms random selection as well as strong single-factor baselines reported in the literature. Using our example selection method, we see an improvement of over 2.5 COMET points on average with respect to a strong BM25 retrieval-based baseline.
翻译:大语言模型已展现出在输入包含少量示例时(上下文学习)能有效完成多项自然语言处理任务的能力,其中包括本工作聚焦的机器翻译。翻译质量取决于所选示例的多种特征,例如其质量和相关性。然而,现有研究主要关注示例选择的单一特征。我们提出一个通用框架,用于融合影响示例选择的不同特征。通过学习一个回归函数,该函数基于多特征选择示例以最大化翻译质量。在多种语言对和语言模型上的实验表明,我们的示例选择方法显著优于随机选择及文献中报道的强单因子基线方法。相较于基于BM25检索的强基线方法,我们的示例选择方法平均提升超过2.5个COMET评分点。