Lune

ICML2023顶会

Why do Nearest Neighbor Language Models Work?

Frank F. Xu, Uri Alon, Graham Neubig

摘要

Language models (LMs) compute the probability of a text by sequentially computing a representation of an already-seen context and using this representation to predict the next word. Currently, most LMs calculate these representations through a neural network consuming the immediate previous context. However recently, retrieval-augmented LMs have shown to improve over standard neural LMs, by accessing information retrieved from a large datastore, in addition to their standard, parametric, next-word prediction. In this paper, we set out to understand why retrieval-augmented language models, and specifically why k-nearest neighbor language models (kNN-LMs) perform better than standard parametric LMs, even when the k-nearest neighbor component retrieves examples from the same training set that the LM was originally trained on. To this end, we perform a careful analysis of the various dimensions over which kNN-LM diverges from standard LMs, and investigate these dimensions one by one. Empirically, we identify three main reasons why kNN-LM performs better than standard LMs: using a different input representation for predicting the next tokens, approximate kNN search, and the importance of softmax temperature for the kNN distribution. Further, we incorporate these insights into the model architecture or the training procedure of the standard parametric LM, improving its results without the need for an explicit retrieval component. The code is available at https://github.com/frankxu2004/knnlm-why .

问 Lune

几分钟读透这篇 Paper,不用再花一下午。

Lune 能读完全文,也能读引用它的顶会 Paper,讲清它的结论、证据和局限,每一点都注明出自哪篇 Paper。不用硬啃,也不靠猜。

已有 10 篇顶会 Paper 引用了它。别等审稿人问起,先弄清它们发现了什么。

可以从这些问题问起

Lune 可以查阅

全文 · 引用它的顶会 Paper · 相关的 Paper

获取答案

免费开始,无需绑卡

脉络

  • CAGRA: Highly Parallel Graph Construction and Approximate Nearest Neighbor Search for GPUs 引用了 Generalization through Memorization: Nearest Neighbor Language Models
  • kNN-LM Does Not Improve Open-ended Text Generation 引用了 Improving Language Models by Retrieving from Trillions of Tokens
  • kNN-LM Does Not Improve Open-ended Text Generation 引用了 Generalization through Memorization: Nearest Neighbor Language Models
  • kNN-LM Does Not Improve Open-ended Text Generation 引用了 Nearest Neighbor Machine Translation
  • kNN-LM Does Not Improve Open-ended Text Generation 引用了 The Curious Case of Neural Text Degeneration
  • Improving Language Models by Retrieving from Trillions of Tokens 引用了 Generalization through Memorization: Nearest Neighbor Language Models
  • Improving Language Models by Retrieving from Trillions of Tokens 引用了 Language Models are Few-Shot Learners
  • Memory Decoder: A Pretrained, Plug-and-Play Memory for Large Language Models 引用了 Generalization through Memorization: Nearest Neighbor Language Models
  • Language Models are Few-Shot Learners 引用了 The Curious Case of Neural Text Degeneration
  • Nearest Neighbor Machine Translation 引用了 Generalization through Memorization: Nearest Neighbor Language Models
  • RAGO: Systematic Performance Optimization for Retrieval-Augmented Generation Serving 引用了 Improving Language Models by Retrieving from Trillions of Tokens
  • RAGO: Systematic Performance Optimization for Retrieval-Augmented Generation Serving 引用了 Generalization through Memorization: Nearest Neighbor Language Models
  • RAGO: Systematic Performance Optimization for Retrieval-Augmented Generation Serving 引用了 Language Models are Few-Shot Learners
  • RAGO: Systematic Performance Optimization for Retrieval-Augmented Generation Serving 引用了 Nearest Neighbor Machine Translation
  • FT2Ra: A Fine-Tuning-Inspired Approach to Retrieval-Augmented Code Completion 引用了 Improving Language Models by Retrieving from Trillions of Tokens
  • FT2Ra: A Fine-Tuning-Inspired Approach to Retrieval-Augmented Code Completion 引用了 Generalization through Memorization: Nearest Neighbor Language Models
它引用的引用它的从左到右按年份排列,引用越多,位置越高。

引用它的顶会 Paper10

  1. CAGRA: Highly Parallel Graph Construction and Approximate Nearest Neighbor Search for GPUsHiroyuki Ootomo, Akira Naruse, Corey Nolet, Ray Wang 等ICDE 2024 · 59 次引用
  2. RAGO: Systematic Performance Optimization for Retrieval-Augmented Generation ServingWenqi Jiang, Suvinay Subramanian, Cat Graves, Gustavo Alonso 等ISCA 2025 · 16 次引用
  3. Memory Decoder: A Pretrained, Plug-and-Play Memory for Large Language ModelsJiaqi Cao, Jiarui Wang, Rubin Wei, Qipeng Guo 等NeurIPS 2025 · 14 次引用
  4. FT2Ra: A Fine-Tuning-Inspired Approach to Retrieval-Augmented Code CompletionQi Guo, Xiaohong Li, Xiaofei Xie, Shangqing Liu 等ISSTA 2024 · 14 次引用
  5. kNN-LM Does Not Improve Open-ended Text GenerationShufan Wang, Yixiao Song, Andrew Drozdov, Aparna Garimella 等EMNLP 2023 · 3 次引用

它引用的 Paper11

  1. Language Models are Few-Shot LearnersTom B. Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah 等NeurIPS 2020 · 64,255 次引用
  2. The Curious Case of Neural Text DegenerationAri Holtzman, Jan Buys, Li Du, Maxwell Forbes 等ICLR 2020 · 4,112 次引用
  3. Improving Language Models by Retrieving from Trillions of TokensSebastian Borgeaud, Arthur Mensch, Jordan Hoffmann, Trevor Cai 等ICML 2022 · 1,629 次引用
  4. Generalization through Memorization: Nearest Neighbor Language ModelsUrvashi Khandelwal, Omer Levy, Dan Jurafsky, Luke Zettlemoyer 等ICLR 2020 · 1,038 次引用
  5. Nearest Neighbor Machine TranslationUrvashi Khandelwal, Angela Fan, Dan Jurafsky, Luke Zettlemoyer 等ICLR 2021 · 323 次引用

相关 Paper

  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 等EMNLP Findings 2022 · 10 次引用
  2. Adaptation Approaches for Nearest Neighbor Language ModelsRishabh Bhardwaj, George Polovets, Monica SunkaraACL Findings 2023 · 7 次引用
  3. Nearest Neighbor Zero-Shot InferenceWeijia Shi, Julian Michael, Suchin Gururangan, Luke ZettlemoyerEMNLP 2022 · 26 次引用
  4. Efficient Nearest Neighbor Language ModelsJunxian He, Graham Neubig, Taylor Berg-KirkpatrickEMNLP 2021
  5. Neuro-Symbolic Language Modeling with Automaton-augmented RetrievalUri Alon, Frank F. Xu, Junxian He, Sudipta Sengupta 等ICML 2022 · 79 次引用
黄昏的海面,两侧是细线勾勒的悬崖