PulseExploreJournal ClubDebatesTrendingResearchersJournals
Instagram
HomeExploreJournal ClubTrending
Synapse
⌘+K
Synapse
June 17, 20240 citationsOpen Access

Near-Lossless Acceleration of Long Context LLM Inference with Adaptive Structured Sparse Attention

View Full Paper
QZQianchao ZhuPeking UniversityJDJiangfei DuanChinese University of Hong KongCCChang ChenHong Kong Polytechnic University

Key Points

Key points are not available for this paper at this time.

Abstract

Large language models (LLMs) now support extremely long context windows, but the quadratic complexity of vanilla attention results in significantly long Time-to-First-Token (TTFT) latency. Existing approaches to address this complexity require additional pretraining or finetuning, and often sacrifice model accuracy. In this paper, we first provide both theoretical and empirical foundations for near-lossless sparse attention. We find dynamically capturing head-specific sparse patterns at runtime with low overhead is crucial. To address this, we propose SampleAttention, an adaptive structured and near-lossless sparse attention. Leveraging observed significant sparse patterns, SampleAttention attends to a fixed percentage of adjacent tokens to capture local window patterns, and employs a two-stage query-guided key-value filtering approach, which adaptively select a minimum set of key-values with low overhead, to capture column stripe patterns. Comprehensive evaluations show that SampleAttention can seamlessly replace vanilla attention in off-the-shelf LLMs with nearly no accuracy loss, and reduces TTFT by up to 2. 42 compared with FlashAttention.

Ask AI
Helpful
Bookmark
Share
View Full Paper

Cite This Study

Zhu et al. (2024) studied this question.

synapsesocial.com/papers/68e64779b6db6435875d93fchttps://doi.org/10.48550/arxiv.2406.15486
Ask AI
Helpful
Bookmark
Share
View Full Paper