The phenomena of in-context learning has typically been thought of as "learning from examples". In this work which focuses on Machine Translation, we present a perspective of in-context learning as the desired generation task maintaining coherency with its context, i.e., the prompt examples. We first investigate randomly sampled prompts across 4 domains, and find that translation performance improves when shown in-domain prompts. Next, we investigate coherency for the in-domain setting, which uses prompt examples from a moving window. We study this with respect to other factors that have previously been identified in the literature such as length, surface similarity and sentence embedding similarity. Our results across 3 models (GPTNeo2.7B, Bloom3B, XGLM2.9B), and three translation directions (\texttt{en}$\rightarrow$\{\texttt{pt, de, fr}\}) suggest that the long-term coherency of the prompts and the test sentence is a good indicator of downstream translation performance. In doing so, we demonstrate the efficacy of In-context Machine Translation for on-the-fly adaptation.
翻译:上下文学习现象通常被视为“从示例中学习”。本研究聚焦机器翻译领域,提出将上下文学习视为生成任务需要保持与其语境(即提示示例)连贯性的观点。我们首先对跨4个领域的随机采样提示进行研究,发现当呈现领域内提示时翻译性能有所提升。接着,我们进一步探究了领域设置中的连贯性——即采用滑动窗口提取提示示例。我们结合文献中已识别的其他要素(如文本长度、表面相似度及句子嵌入相似度)进行综合研究。基于三个模型(GPTNeo2.7B、Bloom3B、XGLM2.9B)及三种翻译方向(\texttt{en}$\rightarrow$\{\texttt{pt, de, fr}\})的实验结果表明,提示与测试句子的长期连贯性是下游翻译性能的有效预测指标。通过此项研究,我们验证了上下文机器翻译在即时适应场景中的有效性。