Nearest Neighbor Machine Translation

Urvashi Khandelwal, Angela Fan, Dan Jurafsky, Luke Zettlemoyer, Mike Lewis
10/1/2020
cs.CL

Official code: urvashik/knnlm (332 stars, MIT, last commit 2021-06-07).

Abstract

We introduce $k$-nearest-neighbor machine translation ($k$NN-MT), which predicts tokens with a nearest neighbor classifier over a large datastore of cached examples, using representations from a neural translation model for similarity search. This approach requires no additional training and scales to give the decoder direct access to billions of examples at test time, resulting in a highly expressive model that consistently improves performance across many settings. Simply adding nearest neighbor search improves a state-of-the-art German-English translation model by 1.5 BLEU. $k$NN-MT allows a single model to be adapted to diverse domains by using a domain-specific datastore, improving results by an average of 9.2 BLEU over zero-shot transfer, and achieving new state-of-the-art results -- without training on these domains. A massively multilingual model can also be specialized for particular language pairs, with improvements of 3 BLEU for translating from English into German and Chinese. Qualitatively, $k$NN-MT is easily interpretable; it combines source and target context to retrieve highly relevant examples.

View on arXivView PDF

Code Implementations(1)

urvashik/knnlmOfficial100%
MIT
33247C++, LuaFeb 11, 20205 years agoMIT

Cite this paper

@article{khandelwal2020nearest,
  title  = {Nearest Neighbor Machine Translation},
  author = {Urvashi Khandelwal and Angela Fan and Dan Jurafsky and Luke Zettlemoyer and Mike Lewis},
  year   = {2020},
  eprint = {2010.00710},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/2010.00710}
}

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/2010.00710.svg)](https://codeofpaper.com/paper/2010.00710)

Discussion