跳到正文
arXiv (AI + Vision + Imaging)· Hao Zhang, Bin Xiao, Kefeng Zhang·· 2 天前AI 评分38

LongCat提出LRSA稀疏注意力:1024K上下文下键选择较DSA提速4.70倍

LongCat Recall Sparse Attention: Co-Designing Key Organization and Retrieval for Long-Context Inference

AI 导读

LongCat提出Recall Sparse Attention(LRSA),用时间分桶增量维护索引,结合细粒度代表与分页检索,解决长序列下检索全量历史成为瓶颈的问题。

正文 · 原文

arXiv:2611.27233v1 Announce Type: new Abstract: Retrieval-based sparse attention, exemplified by DeepSeek Sparse Attention (DSA), reduces attention computation by selecting a small subset of key-value entries. However, selecting these entries can still require searching the entire visible history. For long sequences, retrieval becomes a major bottleneck, limiting the efficiency gains from sparse attention. To address this problem, we propose LongCat Recall Sparse Attention (LRSA), which combines fine-grained representatives with paged retrieval in an incrementally maintained index. LRSA partitions the sequence into time buckets that can be indexed independently as new keys arrive, without regrouping existing history. Within each bucket, it organizes indexing keys into capacity-balanced directional groups and packs a fixed number of complete groups into each page, retaining a separate center for every group. These centers provide fine-grained representatives for page selection, after which refinement scores members of the selected pages together with sink, sliding-window, and visible unindexed candidates to select the final Top-$K$ logical positions. To execute this retrieval process efficiently, we store members in reordered pages, fuse construction stages according to group size, and share storage for overlapping fixed candidates across queries during chunked prefill. These choices support regular member access while reducing kernel launches during construction and repeated candidate transfers. Moreover, we integrate LRSA into SGLang to maintain the index during inference, overlapping asynchronous index construction for new buckets with subsequent computation and reusing compatible bucket indices and member pages after a prefix match in the original key-value pool. With a 1024K-token context, LRSA accelerates key selection by 4.70$\times$ over DSA and combined selection and attention by 35.60$\times$ over full attention.

来源:arXiv (AI + Vision + Imaging) · arxiv.org