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 about this paper
Your agent reads all of it.
Lune indexed this paper to the last equation, along with the top-tier papers that cite it. Ask a question and the answer quotes them.
Your agent calls
Luneget_paper_fulltext
Free to start. No credit card required.
Terminal
Install the CLIlune papers fulltext 0e5b26dd-4e32-4c18-9465-dddf69f60b84Cited by top-tier papers6
- 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
- Retrieval is Accurate GenerationBowen Cao, Deng Cai, Leyang Cui, Xuxin Cheng et al.ICLR 2024 · 13 citations
- Frustratingly Simple Retrieval Improves Challenging, Reasoning-Intensive BenchmarksXinxi Lyu, Michael Duan, Rulin Shao, Pang Wei Koh et al.ICLR 2026 · 8 citations
- 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
- Enhancing Human Evaluation in Machine Translation with Comparative JudgementYixiao Song, Parker Riley, Daniel Deutsch, Markus FreitagACL 2025 · 2 citations
Builds on20
- Retrieval-Augmented Generation for Knowledge-Intensive NLP TasksPatrick Lewis, Ethan Perez, Aleksandra Piktus, Fabio Petroni et al.NeurIPS 2020 · 19,162 citations
- The Curious Case of Neural Text DegenerationAri Holtzman, Jan Buys, Li Du, Maxwell Forbes et al.ICLR 2020 · 4,112 citations
- Improving Language Models by Retrieving from Trillions of TokensSebastian Borgeaud, Arthur Mensch, Jordan Hoffmann, Trevor Cai et al.ICML 2022 · 1,629 citations
- Generalization through Memorization: Nearest Neighbor Language ModelsUrvashi Khandelwal, Omer Levy, Dan Jurafsky, Luke Zettlemoyer et al.ICLR 2020 · 1,038 citations
- Compressive Transformers for Long-Range Sequence ModellingJack W. Rae, Anna Potapenko, Siddhant M. Jayakumar, Chloe Hillier et al.ICLR 2020 · 833 citations
Related papers
- Shall We Pretrain Autoregressive Language Models with Retrieval? A Comprehensive StudyBoxin Wang, Wei Ping, Peng Xu, Lawrence McAfee et al.EMNLP 2023 · 19 citations
- SePer: Measure Retrieval Utility Through The Lens Of Semantic Perplexity ReductionLu Dai, Yijie Xu, Jinhui Ye, Hao Liu et al.ICLR 2025
- Why do Nearest Neighbor Language Models Work?Frank F. Xu, Uri Alon, Graham NeubigICML 2023 · 33 citations
- 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
- On the Efficacy of Sampling AdaptersClara Meister, Tiago Pimentel, Luca Malagutti, Ethan Wilcox et al.ACL 2023 · 3 citations
