HybridCache: Enhancing Prefix Caching for Linear–Softmax Language Models
Xin Wang, Hao Yu, Yi Zhang, jianwei zhang, Huiqiang Jiang, Bo Zheng, Mi Zhang, Dayiheng Liu
NeurIPS page · Open on the map
Category: Efficient LLM Inference & Training › KV Cache Optimization · Type: system or tooling · Keywords: prefix caching, recurrent state, dual-scale quantization, hybrid linear-softmax LLMs, efficient LLM serving
Areas: Memory › Model Memory Optimization › KV Cache Optimization; Long Context › Long-context mechanisms › KV cache eviction; Model Architectures & Sequence Modeling › Language Model Architectures › Linearized Transformers
Summary
HybridCache is a system that enhances prefix caching for hybrid linear-softmax LLMs by aligning recurrent state caching with KV caching and using dual-scale quantization to improve cache utilization and throughput.
Explained to a 5-year-old
Large computer programs called language models need a lot of memory to remember what they have said before. To save memory, they keep a copy of what they have already thought. But some newer models also keep extra memory that is too big to copy all the time. This makes the copying less helpful. The new system helps by only copying the small memories and reusing the big ones, and it makes the big memories smaller by splitting them into parts, which makes the computer work faster and use less memory.
Explained to a 5-year-old, longer
Imagine a big robot brain that talks and writes things. When it talks, it needs to remember everything it has said before so it can continue a story. To help it remember, the brain saves a copy of what it has already thought, like a bookmark. Some newer robot brains also keep another kind of memory that is much bigger, like a huge notebook. This big notebook cannot be saved for every single word because it would take too much space. So the brain only saves parts of it, like every few pages, which creates a mismatch with the smaller bookmarks. This mismatch means the robot often has to redo some work, making it slower and using more energy. The new system looks at how the big notebook is used and decides which parts are needed often and which are not. It keeps the small, frequently needed memories as bookmarks and reuses the big memories when possible. It also splits the big memories into smaller pieces and stores them in a smarter way, like organizing them by rows and columns. By doing this, the robot brain can remember more efficiently, reducing the amount of memory it needs. As a result, the robot can answer questions faster, use less memory, and still stay accurate.
For a technical reader
HybridCache addresses the inefficiency of prefix caching in hybrid linear-softmax LLMs where linear attention modules maintain large recurrent states that cannot be stored per token. It introduces a recurrent-aware state reuse mechanism that stores short-range head states while reusing long-range cached states, aligning them with token-level KV caches. Additionally, a dual-scale quantization method compresses these states by applying independent scaling along rows and columns to handle structured outliers. Evaluations on realistic serving workloads show significant improvements in cache utilization, reduced recomputation, and higher throughput without harming model accuracy. The system provides a practical solution for production LLM serving pipelines that need to balance memory usage and inference speed.
Problem
Extending prefix caching to hybrid linear-softmax language models is challenging because linear attention modules have large recurrent states that cannot be stored at every token due to memory constraints, leading to a mismatch between token-level key-value caching and coarse-grained state caching, which reduces cache hit rates and increases recomputation.
Method
The approach introduces a recurrent-aware state reuse mechanism that stores short-range head states while reusing long-range cached states, and applies a dual-scale quantization that scales independently along rows and columns to compress states with structured outliers.
Results
The approach significantly improves effective prefix cache utilization, reduces recomputation overhead, and achieves substantial throughput gains while maintaining model accuracy.
Contributions
It provides a recurrent-aware state reuse mechanism and a dual-scale quantization method that together align recurrent state caching with token-level KV caching, enabling efficient prefix caching for hybrid linear-softmax LLMs.
Limitations and assumptions
The approach relies on periodic saving of recurrent states due to memory constraints, and the quantization may be limited by structured outliers in the state distribution.
Practical relevance
It enables more efficient LLM serving on hybrid architectures, reducing compute costs and improving throughput for production systems.
This page was written by language models from the title and abstract of each paper, and the answers were checked by two other models. It can be wrong: check the paper itself. Suggest a correction