Lune

EMNLP2023Top-tier venue

kNN-LM Does Not Improve Open-ended Text Generation

Shufan Wang, Yixiao Song, Andrew Drozdov, Aparna Garimella, Varun Manjunatha, Mohit Iyyer

Abstract

In this paper, we study the generation quality of interpolation-based retrieval-augmented language models (LMs). These methods, best exemplified by the kNN-LM (Khandelwal et al., 2020) , interpolate the LM's predicted distribution of the next word with a distribution formed from the most relevant retrievals for a given prefix. While the kNN-LM and related methods yield impressive decreases in perplexity, we discover that they do not exhibit corresponding improvements in open-ended generation quality, as measured by both automatic evaluation metrics (e.g., MAUVE) and human evaluations. Digging deeper, we find that interpolating with a retrieval distribution actually increases perplexity compared to the baseline LM for the majority of tokens in the WikiText-103 test set, even though the overall perplexity is lower due to a smaller number of tokens for which perplexity dramatically decreases after interpolation. However, when decoding a long sequence at inference time, significant improvements on this smaller subset of tokens are washed out by slightly worse predictions on most tokens. Furthermore, we discover that the entropy of the retrieval distribution increases faster than that of the base LM as the generated sequence becomes longer, which indicates that retrieval is less reliable when using model-generated text as queries (i.e., is subject to exposure bias). We hope that our analysis spurs future work on improved decoding algorithms and interpolation strategies for retrieval-augmented language models.

Ask Lune

Know this paper in minutes, not an afternoon.

Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.

6 top-tier papers have cited it since. Know what they found before your reviewers do.

Questions to start from

Lune can draw on

the full paper · the top-tier papers that cite it · related work

Get the answer

Free to start. No credit card required.

Lineage

  • Improving Language Models by Retrieving from Trillions of Tokens cites Generalization through Memorization: Nearest Neighbor Language Models
  • Improving Language Models by Retrieving from Trillions of Tokens cites Retrieval-Augmented Generation for Knowledge-Intensive NLP Tasks
  • Retrieval is Accurate Generation cites Improving Language Models by Retrieving from Trillions of Tokens
  • Retrieval is Accurate Generation cites Generalization through Memorization: Nearest Neighbor Language Models
  • Retrieval is Accurate Generation cites Retrieval-Augmented Generation for Knowledge-Intensive NLP Tasks
  • Retrieval is Accurate Generation cites The Curious Case of Neural Text Degeneration
  • AutoSchemaKG: Autonomous Knowledge Graph Construction through Dynamic Schema Induction from Web-Scale Corpora cites Generalization through Memorization: Nearest Neighbor Language Models
  • Compressive Transformers for Long-Range Sequence Modelling cites The Curious Case of Neural Text Degeneration
  • Frustratingly Simple Retrieval Improves Challenging, Reasoning-Intensive Benchmarks cites Improving Language Models by Retrieving from Trillions of Tokens
  • Frustratingly Simple Retrieval Improves Challenging, Reasoning-Intensive Benchmarks cites Retrieval-Augmented Generation for Knowledge-Intensive NLP Tasks
  • Retrieval-Augmented Generation for Knowledge-Intensive NLP Tasks cites Generalization through Memorization: Nearest Neighbor Language Models
  • CoCoLex: Confidence-guided Copy-based Decoding for Grounded Legal Text Generation cites Improving Language Models by Retrieving from Trillions of Tokens
  • CoCoLex: Confidence-guided Copy-based Decoding for Grounded Legal Text Generation cites Generalization through Memorization: Nearest Neighbor Language Models
  • CoCoLex: Confidence-guided Copy-based Decoding for Grounded Legal Text Generation cites Retrieval-Augmented Generation for Knowledge-Intensive NLP Tasks
Builds onCited byLeft to right by year; the more cited, the higher.

Cited by top-tier papers6

  1. AutoSchemaKG: Autonomous Knowledge Graph Construction through Dynamic Schema Induction from Web-Scale CorporaJiaxin Bai, Wei Fan, Qi Hu, Qing Zong et al.ACL 2026 · 27 citations
  2. Retrieval is Accurate GenerationBowen Cao, Deng Cai, Leyang Cui, Xuxin Cheng et al.ICLR 2024 · 13 citations
  3. Frustratingly Simple Retrieval Improves Challenging, Reasoning-Intensive BenchmarksXinxi Lyu, Michael Duan, Rulin Shao, Pang Wei Koh et al.ICLR 2026 · 8 citations
  4. CoCoLex: Confidence-guided Copy-based Decoding for Grounded Legal Text GenerationT. Y. S. S. Santosh, Youssef Tarek Elkhayat, Oana Ichim, Pranav Shetty et al.ACL 2025 · 6 citations
  5. Enhancing Human Evaluation in Machine Translation with Comparative JudgementYixiao Song, Parker Riley, Daniel Deutsch, Markus FreitagACL 2025 · 2 citations

Builds on21

  1. Retrieval-Augmented Generation for Knowledge-Intensive NLP TasksPatrick Lewis, Ethan Perez, Aleksandra Piktus, Fabio Petroni et al.NeurIPS 2020 · 19,162 citations
  2. The Curious Case of Neural Text DegenerationAri Holtzman, Jan Buys, Li Du, Maxwell Forbes et al.ICLR 2020 · 4,112 citations
  3. Improving Language Models by Retrieving from Trillions of TokensSebastian Borgeaud, Arthur Mensch, Jordan Hoffmann, Trevor Cai et al.ICML 2022 · 1,629 citations
  4. Generalization through Memorization: Nearest Neighbor Language ModelsUrvashi Khandelwal, Omer Levy, Dan Jurafsky, Luke Zettlemoyer et al.ICLR 2020 · 1,038 citations
  5. Compressive Transformers for Long-Range Sequence ModellingJack W. Rae, Anna Potapenko, Siddhant M. Jayakumar, Chloe Hillier et al.ICLR 2020 · 833 citations

Related papers

  1. You can't pick your neighbors, or can you? When and How to Rely on Retrieval in the kNN-LMAndrew Drozdov, Shufan Wang, Razieh Rahimi, Andrew McCallum et al.EMNLP Findings 2022 · 10 citations
  2. Shall We Pretrain Autoregressive Language Models with Retrieval? A Comprehensive StudyBoxin Wang, Wei Ping, Peng Xu, Lawrence McAfee et al.EMNLP 2023 · 19 citations
  3. SePer: Measure Retrieval Utility Through The Lens Of Semantic Perplexity ReductionLu Dai, Yijie Xu, Jinhui Ye, Hao Liu et al.ICLR 2025
  4. Why do Nearest Neighbor Language Models Work?Frank F. Xu, Uri Alon, Graham NeubigICML 2023 · 33 citations
  5. Exposure Bias versus Self-Recovery: Are Distortions Really Incremental for Autoregressive Text Generation?Tianxing He, Jingzhao Zhang, Zhiming Zhou, James R. GlassEMNLP 2021 · 12 citations
Dusk over the sea between two cliffs drawn in fine vertical lines