# AttentionIndex: Accelerating Learned Sparse Attention with a Causal Inverted-File Index

arXiv: https://arxiv.org/abs/2611.02508 · HTML: https://mlsanity.com/paper/2611.02508/

## Key facts

- No citing papers in the map yet (data through 26 Nov 2026).
- Builds on 14 of its 48 references that are in the map.
- Submitted 2 Nov 2026.

## Builds on (most cited first, 14 of 14)

- [An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale](https://mlsanity.com/paper/2010.11929/) (2020)
- [DINOv2: Learning Robust Visual Features without Supervision](https://mlsanity.com/paper/2304.07193/) (2023)
- [RoFormer: Enhanced Transformer with Rotary Position Embedding](https://mlsanity.com/paper/2104.09864/) (2021)
- [Virchow2: Scaling Self-Supervised Mixed Magnification Models in Pathology](https://mlsanity.com/paper/2408.00738/) (2024)
- [HEST-1k: A Dataset for Spatial Transcriptomics and Histology Image Analysis](https://mlsanity.com/paper/2406.16192/) (2024)
- [CellViT: Vision Transformers for Precise Cell Segmentation and Classification](https://mlsanity.com/paper/2306.15350/) (2023)
- [Spatially Resolved Gene Expression Prediction from H&E Histology Images via Bi-modal Contrastive Learning](https://mlsanity.com/paper/2306.01859/) (2023)
- [Accurate Spatial Gene Expression Prediction by integrating Multi-resolution features](https://mlsanity.com/paper/2403.07592/) (2024)
- [CellViT++: Energy-Efficient and Adaptive Cell Segmentation and Classification Using Foundation Models](https://mlsanity.com/paper/2501.05269/) (2025)
- [A Foundation Model for Spatial Proteomics](https://mlsanity.com/paper/2506.03373/) (2025)
- [MIPHEI-ViT: Multiplex Immunofluorescence Prediction from H&E Images using ViT Foundation Models](https://mlsanity.com/paper/2505.10294/) (2025)
- [A Multimodal Foundation Model of Spatial Transcriptomics and Histology for Biological Discovery and Clinical Prediction](https://mlsanity.com/paper/2604.03630/) (2026)
- [Towards Scalable Context-Aware Single-Cell Spatial Transcriptomics Prediction from Histology Images](https://mlsanity.com/paper/2609.36429/) (2026)
- [spora: A Unified Multimodal Dataset and Platform for Spatial Proteomics](https://mlsanity.com/paper/2610.24002/) (2026)

## Abstract (arXiv)

Learned sparse attention, used in production models such as DeepSeek-V4 and GLM-5, lets each query attend to only k keys chosen by a lightweight indexer, but the indexer still scores every key in the prefix. At one million tokens, this selection takes more than half of prefill time. Two-stage selection over contiguous blocks, as in HiSA, reduces this cost, but its recall declines as context grows at a fixed candidate budget. We present AttentionIndex, which routes each query over an inverted-file index that groups indexer keys by similarity and refines the candidates with the native indexer score. AttentionIndex builds the index during prefill, making new keys searchable immediately, reusing previous clustering to keep maintenance cheap, and exposing each query only to clusters built from its own prefix. On GLM-5.3 and DeepSeek-V4-Flash at one million tokens, AttentionIndex delivers 1.3-1.8 times the prefill throughput of exhaustive selection, and at throughput within 5% of HiSA, it recovers 17.0 and 10.0 percentage points more of the exhaustive top-k, respectively. AttentionIndex also improves accuracy on long-context benchmarks by up to 18.4 percentage points over HiSA at the same candidate budget.
