paper-with-me

홈 › Papers

Sparser Block-Sparse Attention via Token Permutation

2025-10-24 · Xinghao Wang, Pengyu Wang, Dong Zhang, Chenkun Tan, Shaojun Zhou, Zhaoxiang Liu, Shiguo Lian, Fangxu Liu, Kai Song, Xipeng Qiu arxiv

Scaling the context length of large language models (LLMs) offers significant benefits but is computationally expensive. This expense stems primarily from the self-attention mechanism, whose $O(N^2)$ complexity with respect to sequence length presents a major bottleneck for both memory and latency. Fortunately, the attention matrix is often sparse, particularly for long sequences, suggesting an opportunity for optimization. Block-sparse attention has emerged as a promising solution that partitions sequences into blocks and skips computation for a subset of these blocks. However, the effectiveness of this method is highly dependent on the underlying attention patterns, which can lead to sub-optimal block-level sparsity. For instance, important key tokens for queries within a single block may be scattered across numerous other blocks, leading to computational redundancy. In this work, we propose Permuted Block-Sparse Attention (\textbf{PBS-Attn}), a plug-and-play method that leverages the permutation properties of attention to increase block-level sparsity and enhance the computational efficiency of LLM prefilling. We conduct comprehensive experiments on challenging real-world long-context datasets, demonstrating that PBS-Attn consistently outperforms existing block-sparse attention methods in model accuracy and closely matches the full attention baseline. Powered by our custom permuted-FlashAttention kernels, PBS-Attn achieves an end-to-end speedup of up to $2.75\times$ in long-context prefilling, confirming its practical viability. Code available at https://github.com/xinghaow99/pbs-attn

📄 PDF Abstract BibTeX arXiv:2510.21270

Code (0)

등록된 구현이 없습니다.

Tasks

Computational Efficiency

Similar Papers 제목 키워드 기반

S2O: Early Stopping for Sparse Attention via Online Permutation

2026-02-26 · Yu Zhang, Songwei Liu, Chenqian Yan, Sheng Lin 외 arxiv

Attention scales quadratically with sequence length, fundamentally limiting long-context inference. Existing block-granularity sparsification can reduce latency, but coarse blocks impose an intrinsic sparsity ceiling, ma…

RainFusion2.0: Temporal-Spatial Awareness and Hardware-Efficient Block-wise Sparse Attention

2025-12-30 · Aiyue Chen, Yaofu Liu, Junjian Huang, Guang Lian 외 arxiv

In video and image generation tasks, Diffusion Transformer (DiT) models incur extremely high computational costs due to attention mechanisms, which limits their practical applications. Furthermore, with hardware advancem…

Video GenerationImage Generation

Brainformers: Trading Simplicity for Efficiency

2023-05-29 · Yanqi Zhou, Nan Du, Yanping Huang, Daiyi Peng 외

Transformers are central to recent successes in natural language processing and computer vision. Transformers have a mostly uniform backbone where layers alternate between feed-forward and self-attention in order to buil…

ToDo: Token Downsampling for Efficient Generation of High-Resolution Images

2024-02-21 · Ethan Smith, Nayan Saxena, Aninda Saha

Attention mechanism has been crucial for image diffusion models, however, their quadratic computational complexity limits the sizes of images we can process within reasonable time and memory constraints. This paper inves…

The Power of Selecting Key Blocks with Local Pre-ranking for Long Document Information Retrieval

2021-11-18 · Minghan Li, Diana Nicoleta Popa, Johan Chagnon, Yagmur Gizem Cinar 외

On a wide range of natural language processing and information retrieval tasks, transformer-based models, particularly pre-trained language models like BERT, have demonstrated tremendous effectiveness. Due to the quadrat…

Information RetrievalRetrieval