Sparser Block-Sparse Attention via Token Permutation
Abstract
Lay Summary
Long-context language models can read long documents, code, and conversations, but this is slow because attention becomes expensive as the input grows. Block-sparse attention speeds this up by skipping unnecessary blocks, but important tokens can scatter across many blocks, limiting the savings. We propose Permuted Block-Sparse Attention, which rearranges tokens within causal segments so important tokens are grouped into denser blocks. This makes block-sparse attention more efficient while preserving correctness and requiring no model retraining. On long-context benchmarks, our method keeps accuracy close to full attention and achieves up to 2.75× faster prefilling with custom GPU kernels, making long-context LLMs more practical and efficient.