NOSA: Native and Offloadable Sparse Attention
summary
The gist
Decoding throughput improvements from larger inference batches are limited by GPU memory, which is largely consumed by the key-value (KV) cache.
In short
NOSA introduces a trainable sparse attention mechanism designed to improve decoding throughput when GPU memory is limited by large KV caches. It achieves significant speedups by adding a locality constraint during training, forcing selected tokens to be reused across decoding steps. This results in higher throughput without sacrificing performance on long-context and long-generation tasks.
Key concepts
- KV Cache Offloading
- This is the problem where the Key-Value cache (which stores previously processed information) consumes too much GPU memory, limiting how much text a model can process at once. NOSA aims to reduce this memory pressure by intelligently selecting which parts of the cache to keep and which ones to offload.
- Locality Constraint ($orall t o n, ar{ ext{t}} o t' > t$)
- This is the core training innovation. It forces the model to select tokens for different decoding steps that are close together in sequence. This constraint ensures that once a token is chosen, it is likely to be needed again soon, improving data reuse and speeding up generation.
- Query-Aware Selection
- This part of the mechanism selects tokens based on their relevance to the current query (the token being generated). It preserves model performance by not adding extra restrictions. It ensures that important information is always prioritized during the selection process.
Terminology used across episodes
This episode discusses
- NOSA: Native and Offloadable Sparse Attention · Paper Radio
- Program Synthesis with Large Language Models
- Cache Me If You Can: How Many KVs Do You Need for Effective Long-Context LMs?
- Sparse Attention across Multiple-context KV Cache
- Evaluating Large Language Models Trained on Code
- ESS: An Offload-Centric Latent-Cache Management Architecture for DeepSeek-V3.2-Exp
- Training Verifiers to Solve Math Word Problems
- The Llama 3 Herd of Models · Paper Radio
- Task-KV: Task-aware KV Cache Optimization via Semantic Differentiation of Attention Heads
- GPT-4o System Card
- PureKV: Plug-and-Play KV Cache Optimization with Spatial-Temporal Sparse Attention for Vision-Language Large Models
- DeepSeek-V2: A Strong, Economical, and Efficient Mixture-of-Experts Language Model
- Large Language Model Agent: A Survey on Methodology, Applications and Challenges
- MiniCPM4: Ultra-Efficient LLMs on End Devices
- Trainable Dynamic Mask Sparse Attention
- Megatron-LM: Training Multi-Billion Parameter Language Models Using Model Parallelism
- Long-Context Generalization with Sparse Attention
- LouisKV: Efficient KV Cache Retrieval for Long Input-Output Sequences
- FSA: An Alternative Efficient Implementation of Native Sparse Attention Kernel
- Post-Training Sparse Attention with Double Sparsity
- Hierarchical Sparse Attention Framework for Computationally Efficient Classification of Biological Cells
The paper
NOSA: Native and Offloadable Sparse Attention · Read on arXiv
NLP Group at Tsinghua University · OpenBMB (China) · BUPT (Beijing) · School of Computer Science and Technology at Beijing Institute of Technology
Decoding throughput improvements from larger inference batches are limited by GPU memory, which is largely consumed by the key-value (KV) cache. Prior training-free KV cache offloading alleviates this by keeping redundant context on the CPU and fetching only a sparse subset for attention, but it often degrades long-generation quality due to training-inference mismatch on sparse patterns. Meanwhile, trainable sparse attention is incompatible with efficient offloading, as unconstrained KV accesses may force large CPU-to-GPU transfers and erase throughput gains. To this end, we propose NOSA, a trainable sparse attention mechanism natively designed for KV cache offloading. NOSA explicitly constrains the volume of CPU-GPU KV transfers, thereby achieving low communication overhead and high decoding throughput. We further build NOSI, a KV cache offloading inference system that fully unlocks NOSA's efficiency. Empirical results on 1,3,8B LLMs demonstrate that NOSA outperforms KV cache offloading baselines on general, long-input, and long-generation tasks, while boosting decoding throughput by up to 5.04x, 1.92x, and 1.83x over FullAttn, InfLLMv2, and ShadowKV, respectively. We release our code at https://github.com/thunlp/NOSA.
Transcript
Introduction to the show: ident: AI Radio. Generated commentary on the latest Artificial Intelligence papers.
Tom: I'm Tom, and with me are Jane, Lu, senior AI researcher at Tsinghua, Meng, lead engineer at a mysterious AI startup and Lalam, the in-house Large Language Model.
Jane: Today's paper: "NOSA: Native and Offloadable Sparse Attention".
Tom: Decoding throughput improvements from larger inference batches are limited by GPU memory, which is largely consumed by the key-value (KV) cache.
Jane: First, who's behind it and why it matters.
Paper summary: Tom: So we’ve been deep into the mechanics of NOSA, and now we need to talk about what this whole thing means for the language model world regarding its title and authors.
Jane: I think focusing on the title, "NOSA: Native and Offloadable Sparse Attention," really frames how clever these authors were in solving that memory puzzle for us.
Lu: Exactly! The authors managed to bake this sparsity constraint right into their training process, which is a smart way to handle the long-term efficiency issues we’ve seen with KV caches.
Meng: From an engineering standpoint, the "Native" part suggests they built something integrated for offloading rather than just slapping on a patch later. That makes implementing it cleaner on production systems.
Lalam: For me, this work speaks to a future where we can train and run much larger models without immediately needing massive amounts of dedicated GPU memory, which opens up so many possibilities for diverse applications.
Tom: It really highlights that the authors weren't just optimizing a component; they designed an entire system meant to handle the real-world constraints of long contexts.
Jane: And their ability to maintain performance on those long tasks is what’s most compelling, showing that we don't have to sacrifice quality just for speed.
Lu: The core implication is that we can push the boundaries of context length and model size because the bottleneck shifts from simple memory limitations to something more manageable, like carefully controlled attention locality.
Meng: I see the practical impact here as making deployment much more flexible; if we can reliably offload the cache like they did, we don't have to restrict ourselves to smaller models just because of hardware constraints.
Lalam: It fundamentally improves how we interact with complex information across vast sequences, fostering a new culture where deep reasoning over massive data is much more accessible.
Tom: It’s clear that this paper lays down a solid foundation for how we approach sparse attention in future architectures, and that sets the stage for some really exciting follow-up research into scaling these techniques further.
Conclusion: Tom: So, to wrap up this discussion on NOSA: Native and Offloadable Sparse Attention, we’ve seen how the authors managed to build a smart system that directly addresses the memory challenges of long context processing by training in a way that favors efficiency.
Jane: I think focusing on the title itself really tells us a lot about their approach; "Native" suggests they didn't just add an afterthought, but built this sparsity constraint right into the core training process, which is a big deal for robustness.
Lu: Exactly! They formalized that locality requirement during training by splitting the selection process into query-aware and query-agnostic parts, showing a deep understanding of how attention needs to be managed over many decoding steps.
Meng: From an engineering standpoint, the "Offloadable" aspect is crucial because it means this isn't just a theoretical improvement; it’s designed to work with actual deployment systems where memory management is tight.
Lalam: For me, this paper suggests that we can start thinking about models that can handle massive amounts of data without immediately hitting a hard hardware wall, opening up incredible avenues for complex applications.
Tom: It really highlights that the authors didn't just fix a single problem; they designed an entire framework meant to handle the real-world constraints of scaling language models effectively.
Jane: And their ability to keep performance strong on those long tasks while boosting throughput is what makes this research so compelling for everyone in the community.
Lu: The core implication here is that we can push the boundaries of context length and model size because the bottleneck shifts from simple memory limitations to something more manageable, like carefully controlled attention locality.
Meng: I see a huge practical impact here as making deployment much more flexible; if we can reliably offload the cache like they did, we don't have to restrict ourselves to smaller models just because of hardware constraints.
Lalam: It fundamentally improves how we interact with complex information across vast sequences, fostering a new culture where deep reasoning over massive data is much more accessible for everyone.
Tom: It’s clear that this paper lays down a solid foundation for how we approach sparse attention in future architectures, and it sets the stage for some really exciting follow-up research into scaling these techniques further.
Jane: And that leads us perfectly into looking at how these results translate into real-world performance metrics across different model sizes.
More episodes
- 2610.12148-Large-Scale Benchmarking of Quantum Neural Network Configurations for Financial Time Series Forecasting
- 2610.10857-Self-Supervised Keyframe Discovery for Horizon-Invariant Behavior Cloning
- 2610.10768-Strategic Investment Decision Making for Value Creation in Energy Transition: A Reinforcement Learning Approach
- 2610.10858-RFChipAgent: Multi-Agentic AI Flow for Analog/RF Chip Design
- 2610.10613-Temporal transformer CAN encoder with federated lightweight heads for anomaly detection
- 2610.10616-When Routing Reveals Membership: Privacy Leakage from MoE Router Telemetry
- 2610.10655-Nullify: Null-Space Activation Steering for Training-Free LLM Unlearning
- 2610.11031-Language Modeling is Monotone Compression
- 2610.01253-Context-Aware Error Mitigation Orchestration for Hybrid Quantum Reinforcement Learning on NISQ Systems
- 2604.24201-CMGL: Confidence-guided Multi-omics Graph Learning for Cancer Subtype Classification