Nearest Neighbor Machine Translation ($k$NN-MT) has achieved great success on domain adaptation tasks by integrating pre-trained Neural Machine Translation (NMT) models with domain-specific token-level retrieval. However, the reasons underlying its success have not been thoroughly investigated. In this paper, we provide a comprehensive analysis of $k$NN-MT through theoretical and empirical studies. Initially, we offer a theoretical interpretation of the working mechanism of $k$NN-MT as an efficient technique to implicitly execute gradient descent on the output projection layer of NMT, indicating that it is a specific case of model fine-tuning. Subsequently, we conduct multi-domain experiments and word-level analysis to examine the differences in performance between $k$NN-MT and entire-model fine-tuning. Our findings suggest that: (1) Incorporating $k$NN-MT with adapters yields comparable translation performance to fine-tuning on in-domain test sets, while achieving better performance on out-of-domain test sets; (2) Fine-tuning significantly outperforms $k$NN-MT on the recall of low-frequency domain-specific words, but this gap could be bridged by optimizing the context representations with additional adapter layers.
翻译:最近邻机器翻译($k$NN-MT)通过将预训练的神经机器翻译(NMT)模型与领域特定的词级检索相结合,在领域适应任务中取得了巨大成功。然而,其成功背后的原因尚未得到深入探究。本文通过理论和实证研究,对$k$NN-MT进行了全面分析。首先,我们提供了一种理论解释,将$k$NN-MT的工作机制视为一种高效技术,隐式地在NMT的输出投影层上执行梯度下降,表明它是模型微调的一个特例。随后,我们进行了多领域实验和词级分析,以检验$k$NN-MT与全模型微调之间的性能差异。我们的研究发现:(1)将$k$NN-MT与适配器结合使用,在领域内测试集上可获得与微调相当的翻译性能,同时在领域外测试集上表现更优;(2)在低频领域特定词汇的召回率上,微调显著优于$k$NN-MT,但通过额外的适配器层优化上下文表示,这一差距可以被弥补。