Skip to main content
QUICK REVIEW

[论文解读] In-context Examples Selection for Machine Translation

Sweta Agrawal, Chunting Zhou|arXiv (Cornell University)|Dec 5, 2022
Topic ModelingComputer Science被引用 17
一句话总结

本文提出了一种新颖的少样本机器翻译少样本示例选择与重排序策略,利用大规模生成模型进行。通过BM25检索与测试源句n-gram相似的示例,并基于最大n-gram覆盖度进行重排序,该方法在随机或k-NN-MT基线之上提升了翻译质量,尤其在分布外设置下表现更优,同时保持了较低的内存与计算开销。

ABSTRACT

Large-scale generative models show an impressive ability to perform a wide range of Natural Language Processing (NLP) tasks using in-context learning, where a few examples are used to describe a task to the model. For Machine Translation (MT), these examples are typically randomly sampled from the development dataset with a similar distribution as the evaluation set. However, it is unclear how the choice of these in-context examples and their ordering impacts the output translation quality. In this work, we aim to understand the properties of good in-context examples for MT in both in-domain and out-of-domain settings. We show that the translation quality and the domain of the in-context examples matter and that 1-shot noisy unrelated example can have a catastrophic impact on output quality. While concatenating multiple random examples reduces the effect of noise, a single good prompt optimized to maximize translation quality on the development dataset can elicit learned information from the pre-trained language model. Adding similar examples based on an n-gram overlap with the test source significantly and consistently improves the translation quality of the outputs, outperforming a strong kNN-MT baseline in 2 out of 4 out-of-domain datasets.

研究动机与目标

  • 研究在少样本机器翻译中,上下文示例的选择、排序及其领域对翻译质量的影响。
  • 解决现有研究中对上下文示例属性(尤其是分布外设置下)缺乏系统性分析的问题。
  • 通过选择高覆盖度、语义等价的示例,而非随机或噪声示例,来提升翻译质量。
  • 开发一种基于检索与重排序的内存与计算高效替代方案,以替代基于密集向量的k-NN-MT方法。
  • 探索提示模板与示例特定上下文是否能协同提升翻译质量与风格模仿能力。

提出的方法

  • 利用测试源句与训练示例之间的n-gram重叠,从BM25索引的数据存储中检索上下文示例。
  • 对检索到的示例进行重排序,以最大化最终提示中源端n-gram的覆盖度。
  • 通过简单拼接方式,将单个优化的任务级提示(如“翻译为德语:”)与示例特定的上下文示例结合。
  • 使用贪婪解码策略,结合大规模预训练语言模型(PLM)生成基于最终提示的翻译结果。
  • 采用双重用途的提示设计:一个用于任务说明(如语言方向),另一个用于示例特定的引导。
  • 在WMT’19与FLORES-101数据集上,通过BLEU分数评估性能,并与随机、k-NN-MT及基线少样本学习方法进行比较。

实验结果

研究问题

  • RQ1在少样本MT中,示例选择(尤其是噪声或无关示例)对翻译质量有何影响?
  • RQ2哪些示例属性(如n-gram相似度、领域、语义等价性)能带来更高质量的翻译?
  • RQ3单个优化的任务级提示是否能优于多个随机示例?
  • RQ4与随机或k-NN-MT基线相比,检索示例的n-gram覆盖度如何影响翻译质量?
  • RQ5PLM在多大程度上能模仿上下文示例的风格,从而实现基于模板的翻译合成?

主要发现

  • 单个1-shot的噪声或无关上下文示例可能对翻译质量造成灾难性影响,表明对示例质量具有高度敏感性。
  • 单个优化的任务级提示可从PLM中有效激发足够的任务知识,在某些设置下优于多个随机示例。
  • 对检索示例进行最大源端n-gram覆盖度的重排序,可在分布内与分布外数据集上一致提升BLEU分数。
  • 尽管未使用密集的token级数据存储,该方法在4个分布外数据集中的2个(医学与IT)上仍优于强基线k-NN-MT。
  • PLM能够成功模仿上下文示例的风格,实现保留格式与语调的基于模板的翻译合成。
  • 使用较小的领域内数据存储并检索多个示例,可达到与使用更大存储但较少示例相当的BLEU性能,凸显覆盖度而非规模的重要性。

阅读本论文

在 Nubint 阅读器中打开原文,边读边就任意段落提问。

在 Nubint 中阅读本论文

本解读由 AI 根据论文原文生成,引用前请核对原文。