NOSA: Native and Offloadable Sparse Attention

summary

Video file (mp4)

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

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

← Home