Introducing DuoAttention: Our new framework slashes both memory and latency for long-context LLMs…
@Guangxuan_Xiao5,5 тыс. подписчиков
31 108 просмотров
10 комментариев
Комментарии из оригинального поста в X (Twitter)

@Guangxuan_Xiao
Paper: Code:
15 отметок «Нравится»

@Guangxuan_Xiao
DuoAttention leverages the insight that only a few attention heads, called Retrieval Heads, need full attention for long contexts, while the rest, Streaming Heads, focus on recent tokens and don't require full attention.
14 отметок «Нравится»

@Guangxuan_Xiao
DuoAttention uses a lightweight, optimization-based algorithm with synthetic data to identify retrieval heads accurately.
8 отметок «Нравится»

@Guangxuan_Xiao
We apply a constant KV cache and efficient "Streaming Attention" to streaming heads, which can accelerate both pre-filling and decoding.
6 отметок «Нравится»

@Guangxuan_Xiao
DuoAttention provides comparable accuracy as full attention on the Needle-in-a-Haystack benchmark using a 25% full attention ratio on the MHA model and a 50% full attention ratio on the GQA model.
8 отметок «Нравится»

@Guangxuan_Xiao
DuoAttention provides a better KV budget and accuracy trade-off on LongBench benchmarks.
5 отметок «Нравится»

@Guangxuan_Xiao
DuoAttention significantly reduces long-context inference memory by up to 2.55× for MHA and 1.67× for GQA models while speeding up decoding by up to 2.18× and 1.50×.
6 отметок «Нравится»

@Guangxuan_Xiao
DuoAttention can also accelerate pre-filling by up to 1.73× and 1.63× for MHA and GQA models, respectively.
7 отметок «Нравится»

@Guangxuan_Xiao
Notably, combined with quantization, DuoAttention enables Llama-3-8B decoding with 3.3 million context length on a single A100 GPU.
14 отметок «Нравится»

@apolmig
guys, you always build and share awesome stuff with the community, just bravo!! thanks
1 отметка «Нравится»