arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2603.04460cs.LGcs.AI
收藏

VSPrefill:用于长上下文预填充的垂直斜线稀疏注意力与轻量级索引

VSPrefill: Vertical-Slash Sparse Attention with Lightweight Indexing for Long-Context Prefilling

School of Computer Science and Technology(计算机科学与技术学院)

Chen Guanzhong

AI总结:

VSPrefill通过轻量级索引和垂直斜线结构提升长上下文预填充效率,实现高精度与高速度的平衡。

摘要:

在预填充阶段,自注意力的二次复杂性阻碍了大语言模型的长上下文推理。现有的稀疏注意力方法在上下文适应性、采样开销和微调成本之间面临权衡。我们提出了VSPrefill,一种需要轻量级训练的机制,利用注意力分布中的垂直斜线结构模式。我们的紧凑型VSIndexer模块通过在键值表示中加入RoPE,预测上下文感知的重要性分数,用于垂直列和斜线对角线。这种方法在不修改骨干参数的情况下构建稀疏掩码,其复杂度为线性。在推理过程中,自适应累积阈值策略为每一层分配稀疏预算,而融合内核在需要时执行注意力计算并合并索引。在LongBench和RULER基准上评估Qwen3-4B-Instruct和LLaMA-3.1-8B-Instruct,VSPrefill在128k上下文长度下保持了98.35%的完整注意力精度,同时实现了4.95倍的平均加速。这些结果在精度和效率之间的权衡中建立了新的帕累托前沿。

英文摘要:

The quadratic complexity of self-attention during the prefill phase impedes long-context inference in large language models. Existing sparse attention methods face a trade-off among context adaptivity, sampling overhead, and fine-tuning costs. We propose VSPrefill, a mechanism requiring lightweight training that uses the vertical-slash structural pattern in attention distributions. Our compact VSIndexer module predicts context-aware importance scores for vertical columns and slash diagonals from key-value representations augmented with RoPE. This approach constructs sparse masks with linear complexity without modifying the backbone parameters. During inference, an adaptive cumulative-threshold strategy allocates sparsity budgets per layer, while a fused kernel executes attention with on-the-fly index merging. Evaluated on Qwen3-4B-Instruct and LLaMA-3.1-8B-Instruct across the LongBench and RULER benchmarks, VSPrefill preserves 98.35% of the full attention accuracy while delivering a 4.95x average speedup at a context length of 128k. These results establish a new Pareto frontier in the trade-off between accuracy and efficiency.

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

↑