ICML2026
HilbertA: Hilbert-Curve–Aligned Sparse Attention for 2D Structured Data
Shaoyi Zheng, Wenbo Lu, Yuxuan Xia, Shenji Wan
Abstract
Designing sparse attention for 2D image data in diffusion and vision-language models requires reconciling spatial locality with hardware-efficient execution: handcrafted 2D sparsity patterns preserve spatial structure but often induce uncoalesced memory access, limiting practical speedups on modern GPUs. We present HilbertA , a 2D-aware sparse attention mechanism that reorders image tokens along a Hilbert curve, converting local spatial neighborhoods into contiguous memory segments for efficient GPU execution. To enable communication beyond local tiles, HilbertA shifts attention windows along the Hilbert-ordered sequence across layers and uses a small central shared region, preserving contiguous access while supporting cross-tile information flow. Across diffusion and vision-language models, HilbertA delivers consistent efficiency gains while maintaining competitive quality, achieving up to 4.16× attention acceleration and 1.44× end-to-end speedup on Flux.1-dev, and up to 2.30× attention acceleration with 1.57× faster time-to-first-token on Qwen3-VL-8B inference.