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

需要多少密集注意力?面向混合长上下文模型中全/GQA层的Oracle引导稀疏预填充

How Much Dense Attention is Necessary? Oracle-Guided Sparse Prefill for Full/GQA Layers in Hybrid Long-Context Models

Technical Report, First Release(技术报告,首次发布)

Hongxing Wang, Harenome Razanajato, Zhen Zhang, Yujie Yuan, Hongsheng Liu

AI总结:

研究在混合长上下文模型中,通过Oracle引导的稀疏预填充减少密集注意力计算,在保持任务性能的同时实现加速,并验证了可行性、索引器质量和运行时加速潜力。

摘要:

长上下文预填充仍然昂贵,因为即使在包含局部、稀疏、线性或循环组件的混合模型中,全/GQA层仍然对整个历史序列进行评分。我们研究了在显式支持粒度和top-k预算下,需要多少密集注意力来保持任务级行为。我们为现有的GQA检查点引入了一种注意力质量top-k oracle:对于每个层和查询位置,它计算密集注意力,选择头平均的token支持,并仅在该支持上重新计算注意力。该oracle是一个诊断参考,而非可部署的加速器,并将稀疏预算可行性从索引器误差和运行时实现效果中分离出来。在Qwen家族的检索密集型评估中,每个查询的最长oracle行与密集注意力相差在1个点以内,而Qwen3.5-9B在4K到100K的RULER风格扫描中相差在0.48个点以内。在oracle的指导下,我们通过KL蒸馏从密集注意力质量分布中训练了一个头折叠的辅助索引器,同时保持骨干网络冻结。使用分别蒸馏的Qwen3.5-0.8B和Qwen3.5-9B索引器,报告的16K/32K验证宏观差距分别为+2.04和+1.13个点,这被视为质量保持而非改进;融合的选择块共享支持可能引入更大的实现差距。初步的单卡TTFT测量显示,与密集FlashAttention-2基线相比,蒸馏索引器的稀疏服务加速比在NPU上对Qwen3.5-0.8B为1.71倍,在GPU上对Qwen3.5-9B为1.93倍。额外的随机初始化压力行达到3.44倍,表明稀疏运行时存在提升空间,但输出质量未经验证。本次发布首次分离了oracle可行性、蒸馏索引器质量和运行时提升空间,将完全匹配的质量-延迟前沿留待未来工作。

英文摘要:

Long-context prefill remains expensive because full/GQA layers still score the historical sequence, even in hybrid models with local, sparse, linear, or recurrent components. We study how much dense attention is needed to preserve task-level behavior under explicit support granularity and top-k budgets. We introduce an attention-mass top-k oracle for existing GQA checkpoints: for each layer and query position, it computes dense attention, selects head-averaged token support, and recomputes attention only on that support. The oracle is a diagnostic reference, not a deployable accelerator, and separates sparse-budget feasibility from indexer error and runtime realization effects. On Qwen-family retrieval-heavy evaluations, the longest per-query oracle rows stay within 1 point of dense, and a Qwen3.5-9B RULER-style sweep from 4K to 100K stays within 0.48 points. Guided by the oracle, we derive a head-collapsed auxiliary indexer trained by KL distillation from dense attention-mass distributions while keeping the backbone frozen. With separately distilled Qwen3.5-0.8B and Qwen3.5-9B indexers, the reported 16K/32K validation macro gaps are +2.04 and +1.13 points, treated as quality preservation rather than improvement; fused selection-block-shared support can introduce a larger realization gap. Preliminary single-card TTFT measurements show distilled-indexer sparse serving speedups of 1.71x for Qwen3.5-0.8B on NPU and 1.93x for Qwen3.5-9B on GPU against its dense FlashAttention-2 baseline. Additional random-init stress rows reach 3.44x, indicating sparse-runtime headroom but not validated output quality. This first release separates oracle feasibility, distilled-indexer quality, and runtime headroom, leaving a fully matched quality-latency frontier to future work.

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

↑