Adamas: Hadamard Sparse Attention voor Efficiënte Inferentie in Lange Contexten
Adamas: Hadamard Sparse Attention for Efficient Long-Context Inference
October 21, 2025
Auteurs: Siyuan Yan, Guo-Qing Jiang, Yuchen Zhang, Xiaoxing Ma, Ran Zhu, Chun Cao, Jingwei Xu
cs.AI
Samenvatting
Grote taalmodellen (LLM's) ondersteunen tegenwoordig contextvensters van honderdduizenden tot miljoenen tokens, wat toepassingen mogelijk maakt zoals samenvatting van lange documenten, grootschalige codesynthese, vraag-antwoord over meerdere documenten en aanhoudende dialogen met meerdere beurten. Deze uitgebreide contexten verergeren echter de kwadratische kosten van zelf-attentie, wat leidt tot ernstige latentie bij autoregressieve decodering. Bestaande methoden voor sparse aandacht verminderen deze kosten, maar zijn afhankelijk van heuristische patronen die moeite hebben met het terugvinden van cruciale sleutel-waarde-paren voor elke query, wat resulteert in nauwkeurigheidsverlies. Wij introduceren Adamas, een lichtgewicht maar uiterst nauwkeurig sparse-attentiemechanisme ontworpen voor inferentie met lange context. Adamas past de Hadamard-transformatie, bucketisatie en 2-bit compressie toe om compacte representaties te produceren, en benut Manhattan-afstandschatting voor efficiënte top-k selecties. Experimenten tonen aan dat Adamas de nauwkeurigheid van volledige aandacht evenaart met slechts een budget van 64 tokens, bijna verliesvrije prestaties bereikt bij 128 tokens, en tot 8x hogere sparseheid ondersteunt dan eerdere state-of-the-art (SOTA) methoden, terwijl het tot 4,4x versnelling in zelf-attentie en 1,5x end-to-end versnelling biedt op sequenties van 32K lengte. Opmerkelijk is dat Adamas vergelijkbare of zelfs lagere perplexiteit bereikt dan volledige aandacht, wat de effectiviteit ervan onder agressieve sparseheid benadrukt.
English
Large language models (LLMs) now support context windows of hundreds of
thousands to millions of tokens, enabling applications such as long-document
summarization, large-scale code synthesis, multi-document question answering
and persistent multi-turn dialogue. However, such extended contexts exacerbate
the quadratic cost of self-attention, leading to severe latency in
autoregressive decoding. Existing sparse attention methods alleviate these
costs but rely on heuristic patterns that struggle to recall critical key-value
(KV) pairs for each query, resulting in accuracy degradation. We introduce
Adamas, a lightweight yet highly accurate sparse attention mechanism designed
for long-context inference. Adamas applies the Hadamard transform,
bucketization and 2-bit compression to produce compact representations, and
leverages Manhattan-distance estimation for efficient top-k selections.
Experiments show that Adamas matches the accuracy of full attention with only a
64-token budget, achieves near-lossless performance at 128, and supports up to
8x higher sparsity than prior state-of-the-art (SOTA) methods while delivering
up to 4.4x self-attention and 1.5x end-to-end speedups on 32K-length sequences.
Remarkably, Adamas attains comparable or even lower perplexity than full
attention, underscoring its effectiveness in maintaining accuracy under
aggressive sparsity.