# FFTSparse: Relative-Position Correlation Guided Sparse Attention for Long-Context Language Models

*Zemin Chao, Cen Jianhe, Qianhui Xu, Guangzhi Ge, Zhixin Qi, Hongzhi Wang*

[NeurIPS page](https://neurips.cc/virtual/2026/poster/149510) · [OpenReview](https://openreview.net/forum?id=pbAu7eSrEE) · [Open on the map](../papers.html#p149510)

Category: [Efficient LLM Inference & Training](../pcat/14.md) › [Sparse Long-Context Attention](../pgroup/226.md) · Type: new method · Keywords: sparse attention, long-context models, FFT cross-correlation, O(N log N), prefilling speedup

Areas: [Long Context](../areas/longcontext.md) › Long-context mechanisms › Efficient attention; [Model Architectures & Sequence Modeling](../areas/architectures.md) › Language Model Architectures › Sparse Attention

## Summary
FFTSparse introduces a hybrid block-sparse attention framework that uses FFT-based cross-correlation to identify diagonal stripe patterns, achieving up to 7.4× prefilling speedup with negligible overhead.

## Explained to a 5-year-old
Imagine a big computer that reads long stories. It looks at every word together, which takes a lot of time. We make it only look at words that are near each other, like looking at nearby pages. To decide which words to look at, we use a special math trick that works like a fast song. This helps the computer finish reading much quicker, almost instantly.

## Explained to a 5-year-old, longer
A big computer program called a language model can read very long texts. To understand the text, it compares each word with every other word, which is slow. We want it to be faster, so we only compare words that are close to each other. The computer can find which words are close by using a math trick that looks at patterns like a song. This trick works in a special way that makes the computer think about the words in groups. After finding the groups, the program only pays attention to those nearby words. This makes the work much lighter because it does not need to look at everything. The new method also decides how to group words for each part of the brain inside the program. Tests show that the program runs much faster, up to seven times quicker for very long texts. It still understands the text well, giving good results. The extra work to figure out the groups is almost nothing compared to the whole process. This helps people use big language models on smaller computers without waiting long.

## For a technical reader
FFTSparse addresses the quadratic cost of attention in long-context LLMs by identifying a block-sparse pattern based on diagonal stripe correlations. It computes these correlations in the frequency domain using FFT, reducing pattern detection from O(N²) to O(N log N). A lightweight head-pattern module then applies tailored masks to each attention head, incurring only 0.02% overhead relative to full attention. Empirical results show up to 7.4× prefilling speedup at 128K sequence length while preserving downstream performance. The approach is a drop-in replacement for standard attention that can be integrated into existing transformer pipelines.

## Problem
Long-context language models suffer from quadratic attention complexity during prefilling, and existing sparse attention methods are inefficient because they require O(N²) scoring to determine sparsity patterns.

## Method
The approach formulates the identification of dominant attention lags as a cross-correlation problem in the frequency domain using the Fast Fourier Transform, reducing pattern detection to O(N log N), and adds a lightweight module to categorize head patterns and apply tailored masking.

## Results
The approach achieves up to a 7.4× prefilling speedup at a 128K sequence length with only 0.02% mask construction overhead while maintaining competitive downstream performance on long-context benchmarks.

## Contributions
A frequency-domain cross-correlation technique for identifying diagonal stripe sparsity patterns and a lightweight head-pattern categorization module that together enable efficient O(N log N) sparse attention identification.

## Practical relevance
It enables efficient long-context inference on existing LLMs, allowing faster deployment without sacrificing performance.

## Research questions this paper is counted under

- [How can we reduce the quadratic attention cost and memory usage of large language models for long contexts while preserving performance?](../q/4.md)

This page was written by language models from the title and abstract of each paper, and the answers were checked by two other models. It can be wrong: check the paper itself. [Suggest a correction](../feedback/?on=p/149510)
