arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~
arXiv 2601.17702cs.CLcs.LG
收藏

S$^3$-Attention:基于注意力对齐的内源检索用于内存受限的长上下文推理

S$^3$-Attention:Attention-Aligned Endogenous Retrieval for Memory-Bounded Long-Context Inference

bupt(北京邮电大学)

Qingsen Ma, Dianyun Wang, Yaoye Wang, Lechen Ning, Sujie Zhu, Xiaohang Zhang, Jiaming Lyu, Linhao Ren, Zhenbo Xu, Zhaofeng He

AI总结:

S3-Attention通过内存优先的内源检索方法,解决长上下文推理中的内存和噪声效率问题,提升模型在信息密集场景下的鲁棒性。

摘要:

大型语言模型越来越多地应用于多文档和长形式输入,但长上下文推理仍存在内存和噪声效率低下的问题。键值(KV)缓存与上下文长度呈线性增长,而外部检索方法往往返回语义相似但因果无关的段落。我们提出了S3-Attention,一种以内存优先的推理时间框架,将长上下文处理视为注意力对齐的内源检索。S3-Attention通过轻量级稀疏自编码器将临时键和查询投影转换为top-k稀疏特征标识符,并在单次流式扫描过程中构建基于CPU的倒排索引,将特征映射到token位置或跨度。这种设计使KV缓存可以完全丢弃,并通过扫描块大小限制GPU内存使用。在生成过程中,利用特征共激活来检索紧凑的证据跨度,可选地融合BM25进行精确的词汇匹配。在统一的LongBench评估协议下,使用固定提示、解码和匹配的token预算,S3-Hybrid在多个模型家族中接近全上下文推理,并在某些信息密集的设置中提高了鲁棒性。我们还报告了当前原型的工程限制,这导致比优化的全KV基线更高的实际时间延迟,这促使未来进行底层优化。

英文摘要:

Large language models are increasingly applied to multi-document and long-form inputs, yet long-context inference remains memory- and noise-inefficient. Key-value (KV) caching scales linearly with context length, while external retrieval methods often return lexically similar but causally irrelevant passages. We present S3-Attention, a memory-first inference-time framework that treats long-context processing as attention-aligned endogenous retrieval. S3-Attention decodes transient key and query projections into top-k sparse feature identifiers using lightweight sparse autoencoders, and constructs a CPU-based inverted index mapping features to token positions or spans during a single streaming scan. This design allows the KV cache to be discarded entirely and bounds GPU memory usage by the scan chunk size. At generation time, feature co-activation is used to retrieve compact evidence spans, optionally fused with BM25 for exact lexical matching. Under a unified LongBench evaluation protocol with fixed prompting, decoding, and matched token budgets, S3-Hybrid closely matches full-context inference across multiple model families and improves robustness in several information-dense settings. We also report an engineering limitation of the current prototype, which incurs higher wall-clock latency than optimized full-KV baselines, motivating future kernel-level optimization.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑