Chunk-based Nearest Neighbor Machine Translation

Pedro Henrique Martins, Zita Marinho, André F. T. Martins
5/24/2022
cs.CL

Official code: deep-spin/chunk-based_knn-mt (6 stars, Python, MIT, last commit 2022-11-08).

Abstract

Semi-parametric models, which augment generation with retrieval, have led to impressive results in language modeling and machine translation, due to their ability to retrieve fine-grained information from a datastore of examples. One of the most prominent approaches, $k$NN-MT, exhibits strong domain adaptation capabilities by retrieving tokens from domain-specific datastores \citep{khandelwal2020nearest}.

Show full abstract

However, $k$NN-MT requires an expensive retrieval operation for every single generated token, leading to a very low decoding speed (around 8 times slower than a parametric model). In this paper, we introduce a \textit{chunk-based} $k$NN-MT model which retrieves chunks of tokens from the datastore, instead of a single token. We propose several strategies for incorporating the retrieved chunks into the generation process, and for selecting the steps at which the model needs to search for neighbors in the datastore. Experiments on machine translation in two settings, static and ``on-the-fly'' domain adaptation, show that the chunk-based $k$NN-MT model leads to significant speed-ups (up to 4 times) with only a small drop in translation quality.

View on arXivView PDF

Code Implementations(1)

MIT
61Python, CudaOct 11, 20224 years agoMIT

Similar Papers

Cite this paper

@article{martins2022chunkbased,
  title  = {Chunk-based Nearest Neighbor Machine Translation},
  author = {Pedro Henrique Martins and Zita Marinho and André F. T. Martins},
  year   = {2022},
  eprint = {2205.12230},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/2205.12230}
}

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

Discussion