A cheap ‘indexer’ scores past tokens and full attention runs only over the top-scoring ones.
Goes back toApr 2019Generating Long Sequences with Sparse Transformers
Instead of attending to every previous token, a lightweight indexer ranks the context and selects a fixed budget of the most relevant tokens; the expensive attention pass then runs only over that subset. DeepSeek V4 and GLM 5.x use this to keep per-token cost nearly flat while the context grows to a million tokens. Quality holds up because most attention mass concentrates on few tokens anyway.
Share of new models that have included sparse top-k attention over time.
Open any of these on hfviewer to find this block in the interactive architecture graph.
Browse all 78 models with this in the catalog →
hfviewer renders the full architecture of 3,500+ Hugging Face models as interactive graphs. Hover any block to see what it does, with this model’s real numbers.
Browse all model graphs →