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模型,我们的方法能够在无需翻译参考答案的情况下预估翻译质量,从而为机器翻译任务筛选有效的ICE以最大化翻译性能。实验结果表明,相较于现有ICL方法,我们的方法取得了显著提升,其翻译性能甚至优于经过微调的预训练语言模型(PLM),特别是mBART-50模型。