Пропустить навигацию
Introducing DuoAttention: Our new framework slashes both memory and latency for long-context LLMs…
0:00 / 1:00

Introducing DuoAttention: Our new framework slashes both memory and latency for long-context LLMs…

Guangxuan Xiao

@Guangxuan_Xiao5,5 тыс. подписчиков

Открыть в X
291 отметка «Нравится»СкачатьОригинальный пост

31 108 просмотров

Introducing DuoAttention: Our new framework slashes both memory and latency for long-context LLMs without sacrificing performance! By applying full KV cache only to critical heads, we achieve: ⚡ 2.55x memory reduction ⚡ 2.18x decoding speedup ⚡ 3.3M tokens on a single A100 GPU

10 комментариев

Комментарии из оригинального поста в X (Twitter)

  • Фото профиля Guangxuan Xiao

    @Guangxuan_Xiao

    Paper: Code:

    15 отметок «Нравится»

  • Фото профиля Guangxuan Xiao

    @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

    @Guangxuan_Xiao

    DuoAttention uses a lightweight, optimization-based algorithm with synthetic data to identify retrieval heads accurately.

    8 отметок «Нравится»

  • Фото профиля Guangxuan Xiao

    @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

    @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

    @Guangxuan_Xiao

    DuoAttention provides a better KV budget and accuracy trade-off on LongBench benchmarks.

    5 отметок «Нравится»

  • Фото профиля Guangxuan Xiao

    @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

    @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

    @Guangxuan_Xiao

    Notably, combined with quantization, DuoAttention enables Llama-3-8B decoding with 3.3 million context length on a single A100 GPU.

    14 отметок «Нравится»

  • Фото профиля Miguel Guerrero

    @apolmig

    guys, you always build and share awesome stuff with the community, just bravo!! thanks

    1 отметка «Нравится»