Adamas: 효율적인 장문 컨텍스트 추론을 위한 Hadamard 희소 어텐션
Adamas: Hadamard Sparse Attention for Efficient Long-Context Inference
October 21, 2025
저자: Siyuan Yan, Guo-Qing Jiang, Yuchen Zhang, Xiaoxing Ma, Ran Zhu, Chun Cao, Jingwei Xu
cs.AI
초록
대규모 언어 모델(LLM)은 이제 수십만 개에서 수백만 개의 토큰에 이르는 컨텍스트 윈도우를 지원하여 장문 문서 요약, 대규모 코드 합성, 다중 문서 질의응답 및 지속적 다중 회차 대화와 같은 애플리케이션을 가능하게 합니다. 그러나 이러한 확장된 컨텍스트는 자기 주의력(self-attention)의 이차 비용을 악화시켜 자기회귀 디코딩에서 심각한 지연을 초래합니다. 기존의 희소 주의력 방법은 이러한 비용을 완화하지만, 각 질의(query)에 대한 중요한 키-값(key-value) 쌍을 회상하는 데 어려움을 겪는 경험적 패턴에 의존하여 정확도 저하를 초래합니다. 본 연구는 장문 컨텍스트 추론을 위해 설계된 경량이면서도 매우 정확한 희소 주의력 메커니즘인 Adamas를 소개합니다. Adamas는 Hadamard 변환, 버킷화(bucketization) 및 2비트 압축을 적용하여 컴팩트한 표현을 생성하고, 효율적인 상위 k개(top-k) 선택을 위해 Manhattan 거리 추정을 활용합니다. 실험 결과, Adamas는 단 64개의 토큰 예산으로 전체 주의력(full attention)의 정확도를 일치시키고, 128개 토큰에서는 거의 무손실 성능을 달성하며, 기존 최첨단(SOTA) 방법 대비 최대 8배 높은 희소성을 지원하면서 32K 길이 시퀀스에서 최대 4.4배의 자기 주의력 속도 향상과 1.5배의 종단 간(end-to-end) 속도 향상을 제공합니다. 특히 Adamas는 전체 주의력과 비슷하거나 더 낮은 퍼플렉서티(perplexity)를 달성하여 공격적인 희소성 조건에서도 정확도를 유지하는 효과성을 입증합니다.
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.