Neurocache: Efficient Vector Retrieval for Long-range Language Modeling
Not on the map. Why?
Abstract (arXiv)
This paper introduces Neurocache, an approach to extend the effective context size of large language models (LLMs) using an external vector cache to store its past states. Like recent vector retrieval approaches, Neurocache uses an efficient k-nearest-neighbor (kNN) algorithm to retrieve relevant past states and incorporate them into the attention process. Neurocache improves upon previous methods by (1) storing compressed states, which reduces cache size; (2) performing a single retrieval operation per token which increases inference speed; and (3) extending the retrieval window to neighboring states, which improves both language modeling and downstream task accuracy. Our experiments show the effectiveness of Neurocache both for models trained from scratch and for pre-trained models such as Llama2-7B and Mistral-7B when enhanced with the cache mechanism. We also compare Neurocache with text retrieval methods and show improvements in single-document question-answering and few-shot learning tasks. We made the source code available under: https://github.com/alisafaya/neurocache
Key facts. Cited by 1 paper in the map (data through 14 Oct 2026). Builds on 25 of its 39 references that are in the map. First posted on arXiv 2 Jul 2024.
Builds on
25 of 39 references.
References · 25
- 2017Attention Is All You Needcited by 60,361
- 2014Adam: A Method for Stochastic Optimizationcited by 37,240
- 2020Language Models are Few-Shot Learnerscited by 32,419
- 2023LLaMA: Open and Efficient Foundation Language Modelscited by 14,132
- 2019BART: Denoising Sequence-to-Sequence Pre-training for Natural Language Generation, Translation, and Comprehensioncited by 5,893
- 2020Dense Passage Retrieval for Open-Domain Question Answeringcited by 3,824
- 2018HotpotQA: A Dataset for Diverse, Explainable Multi-hop Question Answeringcited by 3,754
- 2023Lost in the Middle: How Language Models Use Long Contextscited by 3,455
- 2020The Pile: An 800GB Dataset of Diverse Text for Language Modelingcited by 2,411
- 2020REALM: Retrieval-Augmented Language Model Pre-Trainingcited by 2,141
- 2019Transformer-XL: Attentive Language Models Beyond a Fixed-Length Contextcited by 1,850
- 2019Generating Long Sequences with Sparse Transformerscited by 1,546
13 more
- 2023LongBench: A Bilingual, Multitask Benchmark for Long Context Understandingcited by 1,417
- 2021Improving language models by retrieving from trillions of tokenscited by 1,293
- 2021Unsupervised Dense Information Retrieval with Contrastive Learningcited by 1,216
- 2021Train Short, Test Long: Attention with Linear Biases Enables Input Length Extrapolationcited by 1,103
- 2018Adafactor: Adaptive Learning Rates with Sublinear Memory Costcited by 905
- 2023Extending Context Window of Large Language Models via Positional Interpolationcited by 740
- 2019Compressive Transformers for Long-Range Sequence Modellingcited by 726
- 2023In-Context Retrieval-Augmented Language Modelscited by 702
- 2017The NarrativeQA Reading Comprehension Challengecited by 597
- 2019SAMSum Corpus: A Human-annotated Dialogue Dataset for Abstractive Summarizationcited by 535
- 2021A Dataset of Information-Seeking Questions and Answers Anchored in Research Paperscited by 486
- 2023Unlimiformer: Long-Range Transformers with Unlimited Length Inputcited by 128
- 2023Advancing Transformer Architecture in Long-Context Large Language Models: A Comprehensive Surveycited by 72
Built on by
Citing papers per year: 2025: 1.
1 paper.