N-Gram Nearest Neighbor Machine Translation

Rui Lv, Junliang Guo, Rui Wang, Xu Tan, Qi Liu +1 more
1/30/2023
cs.CLcs.LG

No confident code implementation found for this paper. 1 possible match can be shown below.

Abstract

Nearest neighbor machine translation augments the Autoregressive Translation~(AT) with $k$-nearest-neighbor retrieval, by comparing the similarity between the token-level context representations of the target tokens in the query and the datastore. However, the token-level representation may introduce noise when translating ambiguous words, or fail to provide accurate retrieval results when the representation generated by the model contains indistinguishable context information, e.g., Non-Autoregressive Translation~(NAT) models. In this paper, we propose a novel $n$-gram nearest neighbor retrieval method that is model agnostic and applicable to both AT and NAT models. Specifically, we concatenate the adjacent $n$-gram hidden representations as the key, while the tuple of corresponding target tokens is the value. In inference, we propose tailored decoding algorithms for AT and NAT models respectively. We demonstrate that the proposed method consistently outperforms the token-level method on both AT and NAT models as well on general as on domain adaptation translation tasks. On domain adaptation, the proposed method brings $1.03$ and $2.76$ improvements regarding the average BLEU score on AT and NAT models respectively.

View on arXivView PDF

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. 1 weaker match is hidden by default — verify before relying on them.

No code implementations found yet.

Know of an implementation? Let us know in the comments below!

Cite this paper

@article{lv2023ngram,
  title  = {N-Gram Nearest Neighbor Machine Translation},
  author = {Rui Lv and Junliang Guo and Rui Wang and Xu Tan and Qi Liu and Tao Qin},
  year   = {2023},
  eprint = {2301.12866},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2301.12866v2}
}

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

Discussion