HilbertA: Hilbert-Curve–Aligned Sparse Attention for 2D Structured Data

Shaoyi Zheng, Wenbo Lu, Yuxuan Xia, Shenji Wan
Proceedings of the 43rd International Conference on Machine Learning, PMLR 306:163439-163462, 2026.

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$\times$ attention acceleration and 1.44$\times$ end-to-end speedup on Flux.1-dev, and up to 2.30$\times$ attention acceleration with 1.57$\times$ faster time-to-first-token on Qwen3-VL-8B inference.

Cite this Paper


BibTeX
@InProceedings{pmlr-v306-zheng26m, title = {{H}ilbert{A}: {H}ilbert-Curve–Aligned Sparse Attention for 2{D} Structured Data}, author = {Zheng, Shaoyi and Lu, Wenbo and Xia, Yuxuan and Wan, Shenji}, booktitle = {Proceedings of the 43rd International Conference on Machine Learning}, pages = {163439--163462}, year = {2026}, editor = {Zhang, Tong and Dudik, Miroslav and Jaggi, Martin and Agarwal, Alekh and Li, Sharon and Schuurmans, Dale and Zhu, Jerry and Berkenkamp, Felix and Dong, Hanze and Bietti, Alberto}, volume = {306}, series = {Proceedings of Machine Learning Research}, month = {06--11 Jul}, publisher = {PMLR}, pdf = {https://raw.githubusercontent.com/mlresearch/v306/main/assets/zheng26m/zheng26m.pdf}, url = {https://proceedings.mlr.press/v306/zheng26m.html}, 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$\times$ attention acceleration and 1.44$\times$ end-to-end speedup on Flux.1-dev, and up to 2.30$\times$ attention acceleration with 1.57$\times$ faster time-to-first-token on Qwen3-VL-8B inference.} }
Endnote
%0 Conference Paper %T HilbertA: Hilbert-Curve–Aligned Sparse Attention for 2D Structured Data %A Shaoyi Zheng %A Wenbo Lu %A Yuxuan Xia %A Shenji Wan %B Proceedings of the 43rd International Conference on Machine Learning %C Proceedings of Machine Learning Research %D 2026 %E Tong Zhang %E Miroslav Dudik %E Martin Jaggi %E Alekh Agarwal %E Sharon Li %E Dale Schuurmans %E Jerry Zhu %E Felix Berkenkamp %E Hanze Dong %E Alberto Bietti %F pmlr-v306-zheng26m %I PMLR %P 163439--163462 %U https://proceedings.mlr.press/v306/zheng26m.html %V 306 %X 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$\times$ attention acceleration and 1.44$\times$ end-to-end speedup on Flux.1-dev, and up to 2.30$\times$ attention acceleration with 1.57$\times$ faster time-to-first-token on Qwen3-VL-8B inference.
APA
Zheng, S., Lu, W., Xia, Y. & Wan, S.. (2026). HilbertA: Hilbert-Curve–Aligned Sparse Attention for 2D Structured Data. Proceedings of the 43rd International Conference on Machine Learning, in Proceedings of Machine Learning Research 306:163439-163462 Available from https://proceedings.mlr.press/v306/zheng26m.html.

Related Material