Quilt cuts memory and time for sparse attention in ai models

QUILT: Rethinking Sparse-Attention Prefill through Shared Query Execution

Machine Learning

Summary

Processing long pieces of text quickly is hard because machines repeatedly handle the same information in inefficient ways. The authors noticed that nearby parts of the text often reuse the same data, so their system named QUILT groups these parts together to avoid repeated work. This approach reduces the time and memory needed, speeding up responses without losing accuracy. Their tests show significant improvements over previous methods for this kind of task.

What this means in practice

  • For ai infrastructure engineers: Speed up transformers managing long input sequences by optimizing memory reuse and reducing latency in sparse attention kernels.
  • For gpu hardware developers: Design accelerator-friendly sparse attention algorithms that better utilize hardware tiles by sharing key-value data across queries hierarchically.

Authors

Zhenduo Zhao, Qihui Zhou, Mingcong Song, Zhiyi Chen, Chuangguan Ye, Fengfan Hou, Zequn Gong, Jing Li, Hongjie Si, Guoping Long

Abstract

Sparse attention reduces the cost of long-context attention, but existing kernels typically process queries independently, repeatedly loading and dequantizing KV entries shared across queries. We observe substantial overlap in the KV entries selected by neighboring queries, creating opportunities for cross-query reuse. We present QUILT, a workload-aware sparse-attention execution mechanism that jointly processes neighboring queries and reuses shared KV entries to reduce redundant memory traffic and computation. QUILT introduces Shift-and-Compare Set Decomposition (SCSD), which transforms irregular set operations into regular data-parallel primitives suitable for modern accelerators, and pipelines SCSD with attention computation to hide its overhead. Cascaded sharing captures reuse hierarchically at multiple granularities. A tile-aware execution strategy balances sharing granularity with hardware tile utilization and selectively removes low-importance query-specific tails to eliminate underutilized tiles. We evaluate QUILT on LongBench using GLM-5.3 and DeepSeek-3.2 under both tensor and sequence parallelism. Compared with the state-of-the-art sparse-attention kernel, QUILT reduces average kernel latency by up to 55.1% and processed KV data by up to 55.9%, while reducing time-to-first-token (TTFT) latency by up to 36.8% with negligible accuracy degradation.