Simple and Scalable Nearest Neighbor Machine Translation

Yu-Hsiu Dai, Zhirui Zhang, Qiuzhi Liu, Qu Cui, Wei-Hong Li +2 more
2/1/2023

No official code found. Best implementation: dirkiedai/sk-mt (15 stars, last commit 2023-11-22).

Abstract

$k$NN-MT is a straightforward yet powerful approach for fast domain adaptation, which directly plugs pre-trained neural machine translation (NMT) models with domain-specific token-level $k$-nearest-neighbor ($k$NN) retrieval to achieve domain adaptation without retraining. Despite being conceptually attractive, $k$NN-MT is burdened with massive storage requirements and high computational complexity since it conducts nearest neighbor searches over the entire reference corpus. In this paper, we propose a simple and scalable nearest neighbor machine translation framework to drastically promote the decoding and storage efficiency of $k$NN-based models while maintaining the translation performance. To this end, we dynamically construct an extremely small datastore for each input via sentence-level retrieval to avoid searching the entire datastore in vanilla $k$NN-MT, based on which we further introduce a distance-aware adapter to adaptively incorporate the $k$NN retrieval results into the pre-trained NMT models. Experiments on machine translation in two general settings, static domain adaptation and online learning, demonstrate that our proposed approach not only achieves almost 90% speed as the NMT model without performance degradation, but also significantly reduces the storage requirements of $k$NN-MT.

View on arXivView PDF

Code Implementations(1)

dirkiedai/sk-mtCommunity100%

This is the official code for our paper "Simple and Scalable Nearest Neighbor Machine Translation" (ICLR 2023).

153Perl, ShellFeb 9, 20232 years ago
k-nearest-neighborsmachine-translation

Similar Papers

Cite this paper

@article{dai2023simple,
  title  = {Simple and Scalable Nearest Neighbor Machine Translation},
  author = {Yu-Hsiu Dai and Zhirui Zhang and Qiuzhi Liu and Qu Cui and Wei-Hong Li and Yichao Du and Tong Xu},
  year   = {2023},
  eprint = {2302.12188},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/pdf/2302.12188},
  journal = {ICLR 2023 2023}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2302.12188.svg)](https://codeofpaper.com/paper/2302.12188)

Discussion