Neurocache: Efficient Vector Retrieval for Long-range Language Modeling
Ali Safaya, Deniz Yuret

TL;DR
Neurocache enhances long-range language modeling by using a compressed external vector cache with efficient retrieval, significantly improving context handling and task performance in large language models.
Contribution
It introduces a novel vector cache method that reduces size, speeds up inference, and extends retrieval window for better language modeling and downstream tasks.
Findings
Improves language modeling accuracy with larger context windows
Enhances downstream task performance such as question-answering
Reduces cache size and increases inference speed
Abstract
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…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Code & Models
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsTopic Modeling · Natural Language Processing Techniques
MethodsSoftmax · Attention Is All You Need
