Efficient Nearest Neighbor Language Models
Not on the map. Why?
Cited by 31 in Retrieval-augmented generation, but placed by its own abstract, which didn’t fit.
Abstract (arXiv)
Non-parametric neural language models (NLMs) learn predictive distributions of text utilizing an external datastore, which allows them to learn through explicitly memorizing the training datapoints. While effective, these models often require retrieval from a large datastore at test time, significantly increasing the inference overhead and thus limiting the deployment of non-parametric NLMs in practical applications. In this paper, we take the recently proposed k-nearest neighbors language model (Khandelwal et al., 2020) as an example, exploring methods to improve its efficiency along various dimensions. Experiments on the standard WikiText-103 benchmark and domain-adaptation datasets show that our methods are able to achieve up to a 6x speed-up in inference speed while retaining comparable performance. The empirical analysis we present may provide guidelines for future research seeking to develop or deploy more efficient non-parametric NLMs.
Key facts. Cited by 93 papers in the map (data through 7 Oct 2026). Builds on 23 of its 35 references that are in the map. First posted on arXiv 9 Sep 2021.
Builds on
23 of 35 references.
References · 23
- 2017Attention Is All You Needcited by 59,932
- 2018BERT: Pre-training of Deep Bidirectional Transformers for Language Understandingcited by 40,204
- 2014Adam: A Method for Stochastic Optimizationcited by 36,960
- 2020Language Models are Few-Shot Learnerscited by 32,199
- 2014Neural Machine Translation by Jointly Learning to Align and Translatecited by 4,530
- 2016Pointer Sentinel Mixture Modelscited by 2,992
- 2019XLNet: Generalized Autoregressive Pretraining for Language Understandingcited by 2,801
- 2017Billion-scale similarity search with GPUscited by 2,477
- 2018Deep contextualized word representationscited by 2,285
- 2019Generalization through Memorization: Nearest Neighbor Language Modelscited by 788
- 2015A Neural Attention Model for Abstractive Sentence Summarizationcited by 394
- 2017Six Challenges for Neural Machine Translationcited by 334
11 more
- 2018Adaptive Input Representations for Neural Language Modelingcited by 226
- 2020Nearest Neighbor Machine Translationcited by 209
- 2019Facebook FAIR's WMT19 News Translation Task Submissioncited by 179
- 2020Unsupervised Domain Clusters in Pretrained Language Modelscited by 160
- 2018Character-Level Language Modeling with Deeper Self-Attentioncited by 138
- 2017Generating Sentences by Editing Prototypescited by 88
- 2021Adaptive Semiparametric Language Modelscited by 83
- 2021NeurIPS 2020 EfficientQA Competition: Systems, Analyses and Lessons Learnedcited by 52
- 2020Learning Sparse Prototypes for Text Generationcited by 15
- 2018Quicker ADC : Unlocking the hidden potential of Product Quantization with SIMDcited by 14
- 2017Learning when to skim and when to readcited by 1
Built on by
Citing papers per year: 2021: 2; 2022: 19; 2023: 26; 2024: 23; 2025: 16; 2026: 7.
93 papers.
Sort:
By area:
- 2022When Not to Trust Language Models: Investigating Effectiveness of Parametric and Non-Parametric Memoriescited by 1,103
- 2023In-Context Retrieval-Augmented Language Modelscited by 694
- 2024A Survey on RAG Meeting LLMs: Towards Retrieval-Augmented Large Language Modelscited by 450
- 2024Retrieval-Augmented Generation for AI-Generated Content: A Surveycited by 352
- 2023RECOMP: Improving Retrieval-Augmented LMs with Compression and Selective Augmentationcited by 253
- 2022Training Language Models with Memory Augmentationcited by 112
- 2021The Efficiency Misnomercited by 98
- 2023Test-Time Training on Nearest Neighbors for Large Language Modelscited by 82
- 2022Language Generation Models Can Cause Harm: So What Can We Do About It? An Actionable Surveycited by 80
- 2022Efficient Methods for Natural Language Processing: A Surveycited by 78
- 2023SILO Language Models: Isolating Legal Risk In a Nonparametric Datastorecited by 71
- 2022Neuro-Symbolic Language Modeling with Automaton-augmented Retrievalcited by 60
38 more
- 2024Repoformer: Selective Retrieval for Repository-Level Code Completioncited by 55
- 2024Instruction-tuned Language Models are Better Knowledge Learnerscited by 54
- 2022Nonparametric Masked Language Modelingcited by 39
- 2022Decoupling Knowledge from Memorization: Retrieval-augmented Prompt Learningcited by 36
- 2023How Do Large Language Models Capture the Ever-changing World Knowledge? A Review of Recent Advancescited by 33
- 2024RAG-DDR: Optimizing Retrieval-Augmented Generation Using Differentiable Data Rewardscited by 33
- 2023Privacy Implications of Retrieval-Based Language Modelscited by 31
- 2021How BPE Affects Memorization in Transformerscited by 29
- 2023Why do Nearest Neighbor Language Models Work?cited by 29
- 2025Adaptive Tool Use in Large Language Models with Meta-Cognition Triggercited by 29
- 2025Metacognitive Reuse: Turning Recurring LLM Reasoning Into Concise Behaviorscited by 28
- 2022kNN-Prompt: Nearest Neighbor Zero-Shot Inferencecited by 27
- 2024Metacognitive Retrieval-Augmented Large Language Modelscited by 26
- 2024Nearest Neighbor Speculative Decoding for LLM Generation and Attributioncited by 26
- 2023Copy Is All You Needcited by 25
- 2024RAG and RAU: A Survey on Retrieval-Augmented Language Model in Natural Language Processingcited by 25
- 2022Efficient Cluster-Based k-Nearest-Neighbor Machine Translationcited by 24
- 2022Chunk-based Nearest Neighbor Machine Translationcited by 21
- 2024Non-Exchangeable Conformal Language Generation with Nearest Neighborscited by 21
- 2024Accelerating Retrieval-Augmented Language Model Serving with Speculationcited by 20
- 2025MLP Memory: A Retriever-Pretrained Memory for Large Language Modelscited by 19
- 2022You can't pick your neighbors, or can you? When and how to rely on retrieval in the kNN-LMcited by 18
- 2025Memory Decoder: A Pretrained, Plug-and-Play Memory for Large Language Modelscited by 16
- 2023Retrosynthesis Prediction with Local Template Retrievalcited by 15
- 2024On the Vulnerability of Applying Retrieval-Augmented Generation within Knowledge-Intensive Application Domainscited by 14
- 2022Relation Extraction as Open-book Examination: Retrieval-enhanced Prompt Tuningcited by 13
- 2023kNN-Adapter: Efficient Domain Adaptation for Black-Box Language Modelscited by 13
- 2024Retrieval Meets Reasoning: Even High-school Textbook Knowledge Benefits Multimodal Reasoningcited by 13
- 2022Reasoning Through Memorization: Nearest Neighbor Knowledge Graph Embeddingscited by 12
- 2022Non-Parametric Domain Adaptation for End-to-End Speech Translationcited by 12
- 2023Simple and Scalable Nearest Neighbor Machine Translationcited by 12
- 2023Learn to Memorize: Scalable Continual Learning in Semiparametric Models with Mixture-of-Neighbors Induction Memorycited by 12
- 2024Retrieval-Enhanced Machine Learning: Synthesis and Opportunitiescited by 11
- 2023KNN-LM Does Not Improve Open-ended Text Generationcited by 10
- 2024FT2Ra: A Fine-Tuning-Inspired Approach to Retrieval-Augmented Code Completioncited by 9
- 2025Self-Routing RAG: Binding Selective Retrieval with Knowledge Verbalizationcited by 9
- 2025Judge as A Judge: Improving the Evaluation of Retrieval-Augmented Generation through the Judge-Consistency of Large Language Modelscited by 8
- 2022Efficient Machine Translation Domain Adaptationcited by 7
50 most cited of 93 All 93 (JSON)
- 2026Does Episodic Memory Help Close the Lexical Frequency Gap in Sensitivity to Syntactic Contrasts? A Test Using Retrieval-Augmented Language Models24 Aug 2026
- 2026Oilbird: Training-Free Speculative Decoding with Keys the Verifier Already Computes4 Aug 2026
- 2026AB-RAG: Adaptive Budgeted Retrieval-Augmented Generation for Reliable Question Answering27 Jun 2026
- 2026Encode Errors: Representational Retrieval of In-Context Demonstrations for Multilingual Grammatical Error Correction13 Jun 2026
- 2026A Reproducibility Study of Metacognitive Retrieval-Augmented Generation21 Apr 2026
- 2026MetaMem: Evolving Meta-Memory for Knowledge Utilization through Self-Reflective Symbolic Optimization27 Jan 2026
- 2026Enhancing Large Language Models for Time-Series Forecasting via Vector-Injected In-Context Learning12 Jan 2026
- 2025Retrieval-augmented Prompt Learning for Pre-trained Foundation Models23 Dec 2025
- 2025End-to-End Transformer Acceleration Through Processing-in-Memory Architectures21 Nov 2025
- 2025AtlasKV: Augmenting LLMs with Billion-Scale Knowledge Graphs in 20GB VRAM20 Oct 2025
- 2025Angular Dispersion Accelerates k-Nearest Neighbors Machine Translation20 Sep 2025
- 2025Metacognitive Reuse: Turning Recurring LLM Reasoning Into Concise Behaviors16 Sep 2025
38 more
- 2025Memory Decoder: A Pretrained, Plug-and-Play Memory for Large Language Models13 Aug 2025
- 2025Impact-driven Context Filtering For Cross-file Code Completion8 Aug 2025
- 2025MLP Memory: A Retriever-Pretrained Memory for Large Language Models3 Aug 2025
- 2025On the Predictive Power of Representation Dispersion in Language Models30 Jun 2025
- 2025ConfRAG: Confidence-Guided Retrieval-Augmenting Generation8 Jun 2025
- 2025Self-Routing RAG: Binding Selective Retrieval with Knowledge Verbalization1 Apr 2025
- 2025UltraRAG: A Modular and Automated Toolkit for Adaptive Retrieval-Augmented Generation31 Mar 2025
- 2025From Retrieval to Generation: Comparing Different Approaches27 Feb 2025
- 2025Judge as A Judge: Improving the Evaluation of Retrieval-Augmented Generation through the Judge-Consistency of Large Language Models26 Feb 2025
- 2025Adaptive Tool Use in Large Language Models with Meta-Cognition Trigger18 Feb 2025
- 2025SteLLA: A Structured Grading System Using LLMs with RAG15 Jan 2025
- 2024RAG-DDR: Optimizing Retrieval-Augmented Generation Using Differentiable Data Rewards17 Oct 2024
- 2024GleanVec: Accelerating vector search with minimalist nonlinear dimensionality reduction14 Oct 2024
- 2024Generation with Dynamic Vocabulary11 Oct 2024
- 2024Misinformation with Legal Consequences (MisLC): A New Task Towards Harnessing Societal Harm of Misinformation4 Oct 2024
- 2024Reference Trustable Decoding: A Training-Free Augmentation Paradigm for Large Language Models30 Sep 2024
- 2024Incorporating Precedents for Legal Judgement Prediction on European Court of Human Rights Cases27 Sep 2024
- 2024On the Vulnerability of Applying Retrieval-Augmented Generation within Knowledge-Intensive Application Domains12 Sep 2024
- 2024Retrieval-Enhanced Machine Learning: Synthesis and Opportunities17 Jul 2024
- 2024Efficient Nearest Neighbor based Uncertainty Estimation for Natural Language Processing Tasks2 Jul 2024
- 2024Efficient k-Nearest-Neighbor Machine Translation with Dynamic Retrieval10 Jun 2024
- 2024Retrieval Meets Reasoning: Even High-school Textbook Knowledge Benefits Multimodal Reasoning31 May 2024
- 2024Nearest Neighbor Speculative Decoding for LLM Generation and Attribution29 May 2024
- 2024A Survey on RAG Meeting LLMs: Towards Retrieval-Augmented Large Language Models10 May 2024
- 2024RAG and RAU: A Survey on Retrieval-Augmented Language Model in Natural Language Processing30 Apr 2024
- 2024Retrieving Examples from Memory for Retrieval Augmented Neural Machine Translation: A Systematic Comparison3 Apr 2024
- 2024FT2Ra: A Fine-Tuning-Inspired Approach to Retrieval-Augmented Code Completion2 Apr 2024
- 2024Repoformer: Selective Retrieval for Repository-Level Code Completion15 Mar 2024
- 2024Retrieval-Augmented Generation for AI-Generated Content: A Survey29 Feb 2024
- 2024Instruction-tuned Language Models are Better Knowledge Learners20 Feb 2024
- 2024Metacognitive Retrieval-Augmented Large Language Models18 Feb 2024
- 2024Non-Exchangeable Conformal Language Generation with Nearest Neighbors1 Feb 2024
- 2024NNOSE: Nearest Neighbor Occupational Skill Extraction30 Jan 2024
- 2024Accelerating Retrieval-Augmented Language Model Serving with Speculation25 Jan 2024
- 2023LeanVec: Searching vectors faster by making them fit26 Dec 2023
- 2023PEFA: Parameter-Free Adapters for Large-scale Embedding-based Retrieval Models5 Dec 2023
- 2023Towards Example-Based NMT with Multi-Levenshtein Transformers13 Oct 2023
- 2023How Do Large Language Models Capture the Ever-changing World Knowledge? A Review of Recent Advances11 Oct 2023
50 newest of 93 All 93 (JSON)
- 2022When Not to Trust Language Models: Investigating Effectiveness of Parametric and Non-Parametric Memoriescited by 1,103
- 2023In-Context Retrieval-Augmented Language Modelscited by 694
- 2024A Survey on RAG Meeting LLMs: Towards Retrieval-Augmented Large Language Modelscited by 450
- 2024Retrieval-Augmented Generation for AI-Generated Content: A Surveycited by 352
- 2023RECOMP: Improving Retrieval-Augmented LMs with Compression and Selective Augmentationcited by 253
- 2024Repoformer: Selective Retrieval for Repository-Level Code Completioncited by 55
- 2022Decoupling Knowledge from Memorization: Retrieval-augmented Prompt Learningcited by 36
- 2024RAG-DDR: Optimizing Retrieval-Augmented Generation Using Differentiable Data Rewardscited by 33
- 2023Why do Nearest Neighbor Language Models Work?cited by 29
- 2022kNN-Prompt: Nearest Neighbor Zero-Shot Inferencecited by 27
- 2024Metacognitive Retrieval-Augmented Large Language Modelscited by 26
- 2024RAG and RAU: A Survey on Retrieval-Augmented Language Model in Natural Language Processingcited by 25
12 most cited of 30 All 30 (JSON)
- 2026Does Episodic Memory Help Close the Lexical Frequency Gap in Sensitivity to Syntactic Contrasts? A Test Using Retrieval-Augmented Language Models24 Aug 2026
- 2026AB-RAG: Adaptive Budgeted Retrieval-Augmented Generation for Reliable Question Answering27 Jun 2026
- 2026A Reproducibility Study of Metacognitive Retrieval-Augmented Generation21 Apr 2026
- 2025Retrieval-augmented Prompt Learning for Pre-trained Foundation Models23 Dec 2025
- 2025AtlasKV: Augmenting LLMs with Billion-Scale Knowledge Graphs in 20GB VRAM20 Oct 2025
- 2025Impact-driven Context Filtering For Cross-file Code Completion8 Aug 2025
- 2025MLP Memory: A Retriever-Pretrained Memory for Large Language Models3 Aug 2025
- 2025ConfRAG: Confidence-Guided Retrieval-Augmenting Generation8 Jun 2025
- 2025Self-Routing RAG: Binding Selective Retrieval with Knowledge Verbalization1 Apr 2025
- 2025UltraRAG: A Modular and Automated Toolkit for Adaptive Retrieval-Augmented Generation31 Mar 2025
- 2025From Retrieval to Generation: Comparing Different Approaches27 Feb 2025
- 2025Judge as A Judge: Improving the Evaluation of Retrieval-Augmented Generation through the Judge-Consistency of Large Language Models26 Feb 2025
12 newest of 30 All 30 (JSON)
- 2025Metacognitive Reuse: Turning Recurring LLM Reasoning Into Concise Behaviorscited by 28
- 2024Retrieval Meets Reasoning: Even High-school Textbook Knowledge Benefits Multimodal Reasoningcited by 13
- 2022Reasoning Through Memorization: Nearest Neighbor Knowledge Graph Embeddingscited by 12
- 2022Analogical Math Word Problems Solving with Enhanced Problem-Solution Associationcited by 4
- 2025Metacognitive Reuse: Turning Recurring LLM Reasoning Into Concise Behaviors16 Sep 2025
- 2024Retrieval Meets Reasoning: Even High-school Textbook Knowledge Benefits Multimodal Reasoning31 May 2024
- 2022Analogical Math Word Problems Solving with Enhanced Problem-Solution Association1 Dec 2022
- 2022Reasoning Through Memorization: Nearest Neighbor Knowledge Graph Embeddings14 Jan 2022
- 2022Training Language Models with Memory Augmentationcited by 112
- 2021The Efficiency Misnomercited by 98
- 2023Test-Time Training on Nearest Neighbors for Large Language Modelscited by 82
- 2022Language Generation Models Can Cause Harm: So What Can We Do About It? An Actionable Surveycited by 80
- 2022Efficient Methods for Natural Language Processing: A Surveycited by 78
- 2023SILO Language Models: Isolating Legal Risk In a Nonparametric Datastorecited by 71
- 2022Neuro-Symbolic Language Modeling with Automaton-augmented Retrievalcited by 60
- 2024Instruction-tuned Language Models are Better Knowledge Learnerscited by 54
- 2022Nonparametric Masked Language Modelingcited by 39
- 2023How Do Large Language Models Capture the Ever-changing World Knowledge? A Review of Recent Advancescited by 33
- 2023Privacy Implications of Retrieval-Based Language Modelscited by 31
- 2021How BPE Affects Memorization in Transformerscited by 29
12 most cited of 55 All 55 (JSON)
- 2026Encode Errors: Representational Retrieval of In-Context Demonstrations for Multilingual Grammatical Error Correction13 Jun 2026
- 2026MetaMem: Evolving Meta-Memory for Knowledge Utilization through Self-Reflective Symbolic Optimization27 Jan 2026
- 2026Enhancing Large Language Models for Time-Series Forecasting via Vector-Injected In-Context Learning12 Jan 2026
- 2025Angular Dispersion Accelerates k-Nearest Neighbors Machine Translation20 Sep 2025
- 2025Memory Decoder: A Pretrained, Plug-and-Play Memory for Large Language Models13 Aug 2025
- 2025On the Predictive Power of Representation Dispersion in Language Models30 Jun 2025
- 2025SteLLA: A Structured Grading System Using LLMs with RAG15 Jan 2025
- 2024GleanVec: Accelerating vector search with minimalist nonlinear dimensionality reduction14 Oct 2024
- 2024Generation with Dynamic Vocabulary11 Oct 2024
- 2024Misinformation with Legal Consequences (MisLC): A New Task Towards Harnessing Societal Harm of Misinformation4 Oct 2024
- 2024Reference Trustable Decoding: A Training-Free Augmentation Paradigm for Large Language Models30 Sep 2024
- 2024Incorporating Precedents for Legal Judgement Prediction on European Court of Human Rights Cases27 Sep 2024
12 newest of 55 All 55 (JSON)