[论文解读] Adaptive Few-shot Prompting for Machine Translation with Pre-trained Language Models
AFSP 通过混合 LLM-嵌入检索模块为输入句子自动选择适合的翻译演示,生成多种输出并用自监督再排序器重新排序,从而提升对外交事用语的中英翻译以及 UN 语料的 MT 表现。
Recently, Large language models (LLMs) with in-context learning have demonstrated remarkable potential in handling neural machine translation. However, existing evidence shows that LLMs are prompt-sensitive and it is sub-optimal to apply the fixed prompt to any input for downstream machine translation tasks. To address this issue, we propose an adaptive few-shot prompting (AFSP) framework to automatically select suitable translation demonstrations for various source input sentences to further elicit the translation capability of an LLM for better machine translation. First, we build a translation demonstration retrieval module based on LLM's embedding to retrieve top-k semantic-similar translation demonstrations from aligned parallel translation corpus. Rather than using other embedding models for semantic demonstration retrieval, we build a hybrid demonstration retrieval module based on the embedding layer of the deployed LLM to build better input representation for retrieving more semantic-related translation demonstrations. Then, to ensure better semantic consistency between source inputs and target outputs, we force the deployed LLM itself to generate multiple output candidates in the target language with the help of translation demonstrations and rerank these candidates. Besides, to better evaluate the effectiveness of our AFSP framework on the latest language and extend the research boundary of neural machine translation, we construct a high-quality diplomatic Chinese-English parallel dataset that consists of 5,528 parallel Chinese-English sentences. Finally, extensive experiments on the proposed diplomatic Chinese-English parallel dataset and the United Nations Parallel Corpus (Chinese-English part) show the effectiveness and superiority of our proposed AFSP.
研究动机与目标
- 通过自动为每个源输入选择高质量演示示例,解决在上下文学习中的提示敏感性问题。
- 使用已部署 LLM 的嵌入构建混合演示检索模块,检索语义相关的翻译演示。
- 引入自监督再排序器以选择语义一致的翻译,缓解输出偏差。
- 在高质量的外交中英平行数据集和 UN 中英子集上创建并验证,以评估跨领域的有效性。
提出的方法
- 使用翻译演示语料库和基于已部署 LLM 的嵌入(密集、稀疏与多向量)的混合检索模块来计算混合相关性分数并检索前 k 条演示。
- 用检索到的演示填充固定的提示模板,形成 LLM 的少量示例提示。
- 让 LLM 生成多个目标语言输出,并用通过自监督和负采样训练的小语言模型(SLM)再排序。
- 使用退化的目标文本和由扰动得到的质量分数来训练自监督再排序器,创建一个大规模训练数据集。
- 在外交和 UN 中英数据集上,将 AFSP 与零-shot、少-shot、以及基于 KNN 的基线方法进行比较,使用标准 MT 指标和人工评估进行评测。

实验结果
研究问题
- RQ1自适应演示检索是否能在不同输入上提升翻译质量,相较固定提示?
- RQ2基于混合嵌入的检索是否比单模型嵌入更具语义相关性?
- RQ3自监督再排序器是否能提高语义一致性并减少 LLM 翻译中的输出偏差?
- RQ4相较基线,AFSP 在外交中英与 UN 中英数据上的表现如何?
主要发现
- AFSP 在评估的数据集与语言方向上持续优于零-shot、少-shot和 KNN 基线。
- 使用已部署 LLM 的嵌入进行演示检索(密集、稀疏、多向量)并结合自适应提示,提升翻译指标。
- 自监督再排序器能有效选择更高质量的翻译,提升自动指标与人工评估。
- AFSP 在 Diplomatic 语料和 UN Parallel Corpus(中英)上对多种指标与演示实现显著改进。
- 人工评估显示 AFSP 相较基线在流畅度、准确性和风格保留方面表现更好。
阅读本论文
在 Nubint 阅读器中打开原文,边读边就任意段落提问。
在 Nubint 中阅读本论文本解读由 AI 根据论文原文生成,引用前请核对原文。