# KVBuffer: IO-aware Serving for Linear Attention

*Longwei Zou, Lin Zhong*

[NeurIPS page](https://neurips.cc/virtual/2026/poster/154931) · [OpenReview](https://openreview.net/forum?id=9sEutXZ2qj) · [alphaXiv](https://www.alphaxiv.org/abs/2605.19049) · [Open on the map](../papers.html#p154931)

Category: [Efficient LLM Inference & Training](../pcat/14.md) › [Sparse Long-Context Attention](../pgroup/226.md) · Type: system or tooling · Keywords: linear attention, serving optimization, IO-aware buffering, speculative decoding, latency reduction

Areas: [Memory](../areas/memory.md) › Model Memory Optimization › KV Cache Optimization; [Long Context](../areas/longcontext.md) › Long-context mechanisms › Efficient long-context attention; [Model Architectures & Sequence Modeling](../areas/architectures.md) › Language Model Architectures › Sparse Attention

## Summary
KVBuffer introduces an IO-aware serving mechanism that buffers recent keys and values to enable chunkwise and speculative decoding optimizations, reducing memory access and decoding latency for linear attention models.

## Explained to a 5-year-old
We have a big computer program that reads a lot of words. To answer questions, it needs to remember what it has seen before. Right now, it updates its memory a tiny bit each time it reads a new word, which makes it slow and uses a lot of memory. The new idea is to keep a small notebook of recent words and use that notebook to answer questions without constantly updating the big memory. This helps the program work faster and serve more people at once.

## Explained to a 5-year-old, longer
A computer program can read many words and answer questions about them. To do this, it needs to remember everything it has seen. The current way it does this is by updating a big memory each time it reads a new word. Updating a lot of memory every step takes a lot of time and uses a lot of power. The new idea is to keep a small notebook of only the most recent words. This notebook is called a buffer, and it holds keys and values from the recent words. When the program needs to answer a question, it can use the notebook instead of the whole memory. This makes the answering process faster because it doesn't have to look at everything. For long sequences of words, the program can process them in chunks, using the notebook for each chunk. In speculative decoding, the program can try several possible answers at once without storing extra temporary memories. For short sequences, the program can answer directly from the notebook without creating a big memory state. Overall, this new method lets the program serve more users at the same time and answer questions quicker.

## For a technical reader
KVBuffer is an IO-aware serving mechanism designed to improve the efficiency of linear attention models during inference. It buffers recent keys and values so that attention outputs can be computed in chunks, reducing memory accesses and latency. For speculative decoding, KVBuffer verifies draft tokens in parallel and avoids storing temporary states, allowing more concurrent requests. The implementation integrates with the existing serving framework (SGLang) and targets models like Qwen3-Next. Evaluations show up to 45 % lower decoding latency and a 5× increase in the number of serving requests for speculative decoding.

## Problem
Serving linear attention models currently requires recurrently updating a large attention state each decoding step, leading to high memory access and inefficiency. This creates a bottleneck for long-context inference in production systems.

## Method
The approach buffers recent keys and values, enabling chunkwise computation of attention outputs, parallel verification of draft tokens in speculative decoding, and direct computation for short contexts without creating the full attention state. It integrates with the serving framework to defer state updates and apply them in batch, reducing memory accesses.

## Results
The approach reduces linear attention decoding latency by up to 45.17% and allows up to 5× more serving requests for speculative decoding with four draft tokens.

## Contributions
It introduces an IO-aware serving mechanism that buffers keys and values to enable chunkwise and speculative decoding optimizations, and demonstrates significant latency and throughput improvements for linear attention models.

## Practical relevance
It enables serving systems to handle more concurrent requests and lower latency for long-context language models, improving scalability in production.

## Research questions this paper is counted under

- [How can we reduce the quadratic attention cost and memory usage of large language models for long contexts while preserving performance?](../q/4.md)

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](../feedback/?on=p/154931)
