The quality of output from large language models (LLMs), particularly in machine translation (MT), is closely tied to the quality of in-context examples (ICEs) provided along with the query, i.e., the text to translate. The effectiveness of these ICEs is influenced by various factors, such as the domain of the source text, the order in which the ICEs are presented, the number of these examples, and the prompt templates used. Naturally, selecting the most impactful ICEs depends on understanding how these affect the resulting translation quality, which ultimately relies on translation references or human judgment. This paper presents a novel methodology for in-context learning (ICL) that relies on a search algorithm guided by domain-specific quality estimation (QE). Leveraging the XGLM model, our methodology estimates the resulting translation quality without the need for translation references, selecting effective ICEs for MT to maximize translation quality. Our results demonstrate significant improvements over existing ICL methods and higher translation performance compared to fine-tuning a pre-trained language model (PLM), specifically mBART-50.
翻译:大语言模型(LLM)的输出质量,尤其是在机器翻译(MT)中,与查询(即待翻译文本)所附带的上下文示例(ICE)的质量密切相关。这些ICE的有效性受到多种因素的影响,例如源文本的领域、ICE的呈现顺序、示例数量以及所使用的提示模板。自然,选择最具影响力的ICE取决于理解这些因素如何影响最终的翻译质量,而这最终依赖于翻译参考或人工判断。本文提出了一种新颖的上下文学习(ICL)方法,该方法依赖于一种由领域特定质量估计(QE)引导的搜索算法。利用XGLM模型,我们的方法在无需翻译参考的情况下估计最终的翻译质量,从而为MT选择有效的ICE以最大化翻译质量。我们的结果表明,与现有的ICL方法相比,该方法取得了显著改进,并且与微调预训练语言模型(PLM)(特别是mBART-50)相比,翻译性能更高。