Paper: 2602.08426 Authors: Xinghao Wang, Pengyu Wang, Xiaoran Liu, Fangxu Liu, Jason Chu, Kai Song, Xipeng Qiu Categories: cs.CL, cs.LG
Abstract
This paper addresses fundamental inefficiencies in block-sparse attention mechanisms for long-context LLMs. The authors identify that the common approach of mean pooling combined with RoPE (Rotary Position Embeddings) creates “blind spots” for local positional information by filtering out high-frequency signals. Prism solves this by separating block selection into high-frequency and low-frequency components using energy-based temperature calibration. The method is training-free and achieves accuracy parity with full attention while delivering up to 5.1x speedup.
Key Contributions
- Identification of the blind spot problem: Mean pooling over RoPE-encoded representations filters high-frequency positional signals
- Spectral decomposition for block selection: Separating attention block scoring into frequency components
- Energy-based temperature calibration: Adaptive calibration that accounts for frequency-dependent energy distributions
- Training-free deployment: No fine-tuning required, directly applicable to existing models
The Problem: Blind Spots in Block-Sparse Attention
Block-Sparse Attention Background
For long sequences, full attention with complexity becomes prohibitive. Block-sparse attention divides the key-value sequence into blocks and selects only the most relevant blocks to attend to, reducing computation significantly.
The standard approach:
- Divide keys into blocks of size :
- Compute a representative for each block (typically mean pooling):
- Score each block:
- Select top- blocks and compute full attention only within those blocks
The RoPE + Mean Pooling Problem
RoPE encodes position by rotating embedding dimensions at different frequencies:
where is the position and defines frequency for dimension .
When mean pooling is applied over a block of RoPE-encoded keys, the averaging acts as a low-pass filter. High-frequency components — which encode fine-grained local positional information — cancel out due to destructive interference:
This creates “blind spots” where the block selection mechanism cannot distinguish between blocks that differ primarily in local positional patterns, leading to incorrect block selection and degraded accuracy.
The Prism Solution
Spectral Decomposition
Prism separates the block selection into two parallel pathways:
- Low-frequency pathway: Captures semantic similarity (content-based relevance)
- High-frequency pathway: Captures local positional patterns (position-based relevance)
For each query-block pair, two scores are computed:
where the superscripts denote frequency-filtered versions of the representations.
Frequency Separation
The dimensions of the RoPE-encoded representations are partitioned based on their rotation frequency :
- Low-frequency dimensions: where (slow rotation, semantic content)
- High-frequency dimensions: where (fast rotation, positional detail)
This partition is natural because RoPE assigns monotonically decreasing frequencies across dimensions.
Energy-Based Temperature Calibration
The two frequency components have different energy scales, so their scores are not directly comparable. Prism introduces adaptive temperature calibration:
where the temperatures are computed based on the energy distribution of each frequency band:
This ensures both components contribute proportionally to the final block selection score.
Experimental Results
Accuracy Parity with Full Attention
Across multiple long-context benchmarks:
- Prism achieves accuracy within 1% of full attention on most tasks
- Significantly outperforms standard block-sparse attention (mean pooling baseline)
- Particularly strong on tasks requiring precise positional retrieval (needle-in-a-haystack)
Speedup
- Up to 5.1x speedup over full attention on long sequences
- Overhead of spectral decomposition is negligible compared to attention computation savings
- Speedup scales with sequence length as the sparsity ratio increases
Comparison with Other Sparse Attention Methods
Prism outperforms existing block-sparse methods that use:
- Simple mean pooling (the blind spot problem)
- Learned block selection (requires training, less generalizable)
- Fixed sparsity patterns (cannot adapt to content)
Ablation Studies
- Frequency threshold: The optimal split point balances semantic and positional information
- Temperature calibration: Removing calibration significantly degrades performance, confirming the importance of energy normalization
- Block size: Prism’s advantage is most pronounced with larger blocks where mean pooling loses more high-frequency information
Analysis
Why High Frequencies Matter
High-frequency RoPE components encode the precise position within a local window. For tasks like:
- Retrieval: Finding a specific piece of information requires knowing exactly where it is
- Coreference: Resolving references depends on relative position
- Recency: Distinguishing recent from distant context requires positional precision
Without high-frequency signals, block selection becomes “position-blind” within local regions, selecting blocks based only on semantic similarity.
Visualization of Block Selection
The authors visualize block selection patterns showing:
- Standard mean pooling misses blocks containing positionally relevant information
- Prism correctly identifies these blocks through the high-frequency pathway
- The two pathways are complementary, each catching blocks the other misses
Significance
Prism elegantly solves a fundamental problem in efficient long-context attention. By identifying the spectral blind spot created by mean pooling over RoPE representations and providing a principled decomposition solution, it achieves the best of both worlds: the efficiency of block-sparse attention with the accuracy of full attention. The training-free nature makes it immediately deployable, and the theoretical grounding in signal processing provides a clear understanding of why it works.
论文: 2602.08426 作者: Xinghao Wang, Pengyu Wang, Xiaoran Liu, Fangxu Liu, Jason Chu, Kai Song, Xipeng Qiu 分类: cs.CL, cs.LG
摘要
本文解决了长上下文LLM中块稀疏注意力机制的根本低效问题。作者发现,均值池化与RoPE(旋转位置嵌入)的常见组合通过过滤高频信号为局部位置信息创建了”盲点”。Prism通过使用基于能量的温度校准将块选择分离为高频和低频分量来解决这个问题。该方法无需训练,在实现与全注意力精度持平的同时提供最高5.1倍的加速。
主要贡献
- 盲点问题的识别:对RoPE编码表示的均值池化过滤了高频位置信号
- 块选择的频谱分解:将注意力块评分分离为频率分量
- 基于能量的温度校准:考虑频率依赖能量分布的自适应校准
- 无需训练的部署:不需要微调,直接适用于现有模型
问题:块稀疏注意力中的盲点
块稀疏注意力背景
对于长序列, 复杂度的全注意力变得不可行。块稀疏注意力将键值序列分成块,只选择最相关的块进行注意力计算,显著减少计算量。
标准方法:
- 将键分成大小为 的块:
- 计算每个块的代表(通常是均值池化):
- 对每个块评分:
- 选择前 个块,仅在这些块内计算全注意力
RoPE + 均值池化问题
RoPE通过以不同频率旋转嵌入维度来编码位置:
其中 是位置, 定义维度 的频率。
当对RoPE编码的键块应用均值池化时,平均操作充当低通滤波器。高频分量——编码细粒度局部位置信息——由于相消干涉而抵消:
这创建了”盲点”,块选择机制无法区分主要在局部位置模式上不同的块,导致错误的块选择和精度下降。
Prism解决方案
频谱分解
Prism将块选择分为两个并行路径:
- 低频路径:捕获语义相似性(基于内容的相关性)
- 高频路径:捕获局部位置模式(基于位置的相关性)
对于每个查询-块对,计算两个分数:
其中上标表示表示的频率过滤版本。
频率分离
RoPE编码表示的维度根据其旋转频率 进行划分:
- 低频维度: 的 (慢旋转,语义内容)
- 高频维度: 的 (快旋转,位置细节)
这种划分是自然的,因为RoPE在维度间分配单调递减的频率。
基于能量的温度校准
两个频率分量具有不同的能量尺度,因此它们的分数不能直接比较。Prism引入自适应温度校准:
其中温度 基于每个频带的能量分布计算:
这确保两个分量按比例贡献于最终的块选择分数。
实验结果
与全注意力的精度持平
在多个长上下文基准上:
- Prism在大多数任务上达到全注意力1%以内的精度
- 显著优于标准块稀疏注意力(均值池化基线)
- 在需要精确位置检索的任务上特别强(大海捞针)
加速
- 在长序列上相比全注意力最高5.1倍加速
- 频谱分解的开销与注意力计算节省相比可忽略不计
- 加速随序列长度扩展,因为稀疏率增加
与其他稀疏注意力方法的比较
Prism优于使用以下方法的现有块稀疏方法:
- 简单均值池化(盲点问题)
- 学习的块选择(需要训练,泛化性较差)
- 固定稀疏模式(无法适应内容)
分析
为什么高频很重要
高频RoPE分量编码局部窗口内的精确位置。对于以下任务:
- 检索:找到特定信息需要知道它的确切位置
- 共指:解析引用依赖于相对位置
- 近因性:区分近期和远期上下文需要位置精度
没有高频信号,块选择在局部区域内变得”位置盲”,仅基于语义相似性选择块。
意义
Prism优雅地解决了高效长上下文注意力中的一个根本问题。通过识别均值池化在RoPE表示上创建的频谱盲点并提供有原则的分解解决方案,它实现了两全其美:块稀疏注意力的效率与全注意力的精度。无需训练的特性使其可以立即部署,信号处理中的理论基础提供了对其工作原理的清晰理解。