paper-with-me

Papers

SeerAttention: Learning Intrinsic Sparse Attention in Your LLMs

2024-10-17 · Yizhao Gao, Zhichen Zeng, Dayou Du, Shijie Cao, Hayden Kwok-Hay So, Ting Cao, Fan Yang, Mao Yang

Attention is the cornerstone of modern Large Language Models (LLMs). Yet its quadratic complexity limits the efficiency and scalability of LLMs, especially for those with a long-context window. A promising approach addressing this limitation is to leverage the sparsity in attention. However, existing sparsity-based solutions predominantly rely on predefined patterns or heuristics to approximate sparsity. This practice falls short to fully capture the dynamic nature of attention sparsity in language-based tasks. This paper argues that attention sparsity should be learned rather than predefined. To this end, we design SeerAttention, a new Attention mechanism that augments the conventional attention with a learnable gate that adaptively selects significant blocks in an attention map and deems the rest blocks sparse. Such block-level sparsity effectively balances accuracy and speedup. To enable efficient learning of the gating network, we develop a customized FlashAttention implementation that extracts the block-level ground truth of attention map with minimum overhead. SeerAttention not only applies to post-training, but also excels in long-context fine-tuning. Our results show that at post-training stages, SeerAttention significantly outperforms state-of-the-art static or heuristic-based sparse attention methods, while also being more versatile and flexible to adapt to varying context lengths and sparsity ratios. When applied to long-context fine-tuning with YaRN, SeerAttention can achieve a remarkable 90% sparsity ratio at a 32k context length with minimal perplexity loss, offering a 5.67x speedup over FlashAttention-2.

📄 PDF Abstract BibTeX arXiv:2410.13276

Code (1)

microsoft/seerattention 공식 구현 pytorch

Methods 이 논문이 사용한 방법론

Softmax The Softmax output function transforms a previous layer's output into a vector of probabilities. It is commonly used for multiclass classification. Given an input vector $x$…
Attention 설명 없음

Similar Papers 제목 키워드 기반

SeerAttention-R: Sparse Attention Adaptation for Long Reasoning

2025-06-10 · Yizhao Gao, Shuming Guo, Shijie Cao, Yuqing Xia 외

We introduce SeerAttention-R, a sparse attention framework specifically tailored for the long decoding of reasoning models. Extended from SeerAttention, SeerAttention-R retains the design of learning attention sparsity t…

4kGPU

Attention is Naturally Sparse with Gaussian Distributed Input

2024-04-03 · Yichuan Deng, Zhao Song, Chiwun Yang

The computational intensity of Large Language Models (LLMs) is a critical bottleneck, primarily due to the $O(n^2)$ complexity of the attention mechanism in transformer architectures. Addressing this, sparse attention em…

Computational Efficiency

Full Attention Strikes Back: Transferring Full Attention into Sparse within Hundred Training Steps

2026-05-16 · Yanke Zhou, Yiduo Li, Hanlin Tang, Maohua Li 외 arxiv

Long-context inference in large language models is bottlenecked by the quadratic cost of full attention. Existing efficient alternatives often rely either on native sparse training or on heuristic token eviction, creatin…

Intrinsic Language-Guided Exploration for Complex Long-Horizon Robotic Manipulation Tasks

2023-09-28 · Eleftherios Triantafyllidis, Filippos Christianos, Zhibin Li

Current reinforcement learning algorithms struggle in sparse and complex environments, most notably in long-horizon manipulation tasks entailing a plethora of different sequences. In this work, we propose the Intrinsical…

Decision Makingreinforcement-learningReinforcement Learning

Changing the Environment Based on Empowerment as Intrinsic Motivation

2014-06-03 · Christoph Salge, Cornelius Glackin, Daniel Polani

One aspect of intelligence is the ability to restructure your own environment so that the world you live in becomes more beneficial to you. In this paper we investigate how the information-theoretic measure of agent empo…

Decision MakingMinecraft