AttnCache: Accelerating Self-Attention Inference for LLM Prefill via Attention Cache
Not on the map. Why?
Abstract (arXiv)
Large Language Models (LLMs) are widely used in generative applications such as chatting, code generation, and reasoning. However, many realworld workloads such as classification, question answering, recommendation, and text embedding rely solely on the prefill stage of inference, where the model encodes input sequences without performing autoregressive decoding. In these prefill only scenarios, the self-attention computation becomes the primary performance bottleneck due to its quadratic complexity with respect to sequence length. In this paper, we observe that semantically different sentences often produce similar attention maps across layers and heads. Building on this insight, we propose AttnCache, a framework that accelerates the prefill stage of LLM inference by retrieving and reusing similar attention maps. Based on an attention map memorization database, AttnCache employs efficient caching and similarity search techniques to identify and reuse pre-cached attention maps during inference, thereby reducing the computational overhead of self-attention. Experimental results show that AttnCache achieves an average of 1.2x end-to-end and 2x attention speedup on CPU, and 1.6x end-to-end and 3x attention speedup on GPU, with negligible accuracy degradation.
Key facts. Cited by 2 papers in the map (data through 7 Oct 2026). Builds on 57 of its 74 references that are in the map. First posted on arXiv 29 Oct 2025.
Builds on
57 of 74 references.
References · 57
- 2017Attention Is All You Needcited by 59,932
- 2019RoBERTa: A Robustly Optimized BERT Pretraining Approachcited by 13,266
- 2023Llama 2: Open Foundation and Fine-Tuned Chat Modelscited by 12,865
- 2020Measuring Massive Multitask Language Understandingcited by 7,768
- 2018GLUE: A Multi-Task Benchmark and Analysis Platform for Natural Language Understandingcited by 4,854
- 2020Longformer: The Long-Document Transformercited by 3,362
- 2023QLoRA: Efficient Finetuning of Quantized LLMscited by 3,355
- 2015Fast R-CNNcited by 2,930
- 2017Billion-scale similarity search with GPUscited by 2,477
- 2020DeBERTa: Decoding-enhanced BERT with Disentangled Attentioncited by 2,157
- 2023Efficient Streaming Language Models with Attention Sinkscited by 2,115
- 2018CommonsenseQA: A Question Answering Challenge Targeting Commonsense Knowledgecited by 1,793
38 more
- 2016Efficient and robust approximate nearest neighbor search using Hierarchical Navigable Small World graphscited by 853
- 2023H2O: Heavy-Hitter Oracle for Efficient Generative Inference of Large Language Modelscited by 805
- 2022MTEB: Massive Text Embedding Benchmarkcited by 623
- 2025Humanity's Last Examcited by 467
- 2023Model Tells You What to Discard: Adaptive KV Cache Compression for LLMscited by 466
- 2024NV-Embed: Improved Techniques for Training LLMs as Generalist Embedding Modelscited by 466
- 2021Sentence-T5: Scalable Sentence Encoders from Pre-trained Text-to-Text Modelscited by 462
- 2024LLM2Vec: Large Language Models Are Secretly Powerful Text Encoderscited by 396
- 2023A Survey on Large Language Models for Recommendationcited by 378
- 2024MInference 1.0: Accelerating Pre-filling for Long-Context LLMs via Dynamic Sparse Attentioncited by 375
- 2024ShortGPT: Layers in Large Language Models are More Redundant Than You Expectcited by 369
- 2023Large Language Models are Effective Text Rankers with Pairwise Ranking Promptingcited by 302
- 2023Improving Text Embeddings with Large Language Modelscited by 295
- 2018SentEval: An Evaluation Toolkit for Universal Sentence Representationscited by 294
- 2023Prompt Cache: Modular Attention Reuse for Low-Latency Inferencecited by 255
- 2020SpAtten: Efficient Sparse Attention Architecture with Cascade Token and Head Pruningcited by 228
- 2024Generative Representational Instruction Tuningcited by 227
- 2024Retrieval Head Mechanistically Explains Long-Context Factualitycited by 219
- 2023AnnoLLM: Making Large Language Models to Be Better Crowdsourced Annotatorscited by 171
- 2024Transformers are Multi-State RNNscited by 120
- 2024RazorAttention: Efficient KV Cache Compression Through Retrieval Headscited by 99
- 2020A3: Accelerating Attention Mechanisms in Neural Networks with Approximationcited by 97
- 2024SLEB: Streamlining LLMs through Redundancy Verification and Elimination of Transformer Blockscited by 96
- 2023Scaling Sentence Embeddings with Large Language Modelscited by 83
- 2024What Matters in Transformers? Not All Attention is Neededcited by 83
- 2024ChunkAttention: Efficient Self-Attention with Prefix-Aware KV Cache and Two-Phase Partitioncited by 81
- 2024Gecko: Versatile Text Embeddings Distilled from Large Language Modelscited by 81
- 2023LLMaAA: Making Large Language Models as Active Annotatorscited by 78
- 2024Making Text Embedders Few-Shot Learnerscited by 78
- 2023Enhancing Recommender Systems with Large Language Model Reasoning Graphscited by 52
- 2024Your Mixture-of-Experts LLM Is Secretly an Embedding Model For Freecited by 37
- 2019Sharing Attention Weights for Fast Transformercited by 34
- 2021Leveraging redundancy in attention with Reuse Transformerscited by 33
- 2024PromptReps: Prompting Large Language Models to Generate Dense and Sparse Representations for Zero-Shot Document Retrievalcited by 30
- 2024Simple Techniques for Enhancing Sentence Embeddings in Generative Language Modelscited by 26
- 2024FinerCut: Finer-grained Interpretable Layer Pruning for Large Language Modelscited by 26
- 2025PrefillOnly: An Inference Engine for Prefill-only Workloads in Large Language Model Applicationscited by 21
- 2024Depression Detection on Social Media with Large Language Modelscited by 20
50 most cited of 57 All 57 (JSON)
Built on by
Citing papers per year: 2026: 2.
2 papers.