NOSA: Native and Offloadable Sparse Attention

Fuente: arXiv
Enregistré dans:
Détails bibliographiques
Auteurs principaux: Huang, Yuxiang, Wang, Pengjie, Han, Jicheng, Zhao, Weilin, Su, Zhou, Sun, Ao, Lyu, Hongya, Zhao, Hengyu, Wang, Yudong, Xiao, Chaojun, Han, Xu, Liu, Zhiyuan
Format: Preprint
Publié: 2025
Sujets:
Accès en ligne:
Tags: Ajouter un tag
Pas de tags, Soyez le premier à ajouter un tag!
_version_ 1866912856843223040
author Huang, Yuxiang
Wang, Pengjie
Han, Jicheng
Zhao, Weilin
Su, Zhou
Sun, Ao
Lyu, Hongya
Zhao, Hengyu
Wang, Yudong
Xiao, Chaojun
Han, Xu
Liu, Zhiyuan
author_facet Huang, Yuxiang
Wang, Pengjie
Han, Jicheng
Zhao, Weilin
Su, Zhou
Sun, Ao
Lyu, Hongya
Zhao, Hengyu
Wang, Yudong
Xiao, Chaojun
Han, Xu
Liu, Zhiyuan
contents 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.
format Preprint
id arxiv_https___arxiv_org_abs_2510_13602
institution arXiv
publishDate 2025
record_format arxiv
spellingShingle NOSA: Native and Offloadable Sparse Attention
Huang, Yuxiang
Wang, Pengjie
Han, Jicheng
Zhao, Weilin
Su, Zhou
Sun, Ao
Lyu, Hongya
Zhao, Hengyu
Wang, Yudong
Xiao, Chaojun
Han, Xu
Liu, Zhiyuan
Computation and Language
Artificial Intelligence
Machine Learning
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.
title NOSA: Native and Offloadable Sparse Attention
topic Computation and Language
Artificial Intelligence
Machine Learning
url https://arxiv.org/abs/2510.13602