atlas

Research map / Architectures and efficiency / Attention and transformers

Bifurcated Attention for Single-Context Large-Batch Sampling

ICML 2024 · Architectures and efficiency › Attention and transformers · approach: Sparse attention for long-context LLMs

Read the paperCheck your idea against 108,967 papers

AI-extracted summary. Written by AI from the paper's full text. Numbers and claims can be wrong or missing context, so check the paper before you cite or build on it.

Proposes context-aware bifurcated attention, which splits incremental-decoding attention into shared-context and per-sample KV parts to cut KV memory IO during single-context batch sampling, combined with multi-query/multi-group attention.

Problem

Incremental decoding in single-context batch sampling is memory-IO bound because the shared context KV cache is loaded once per batch index, causing latency to grow with batch size and context length.

Approach

Split the attention computation during incremental decoding into a context part (shared KV loaded once, broadcast across the batch) and a decoding part (per-sample KV), joined by concatenation/summation. This yields identical outputs and FLOPs but reduces KV memory IO by up to b-fold when context dominates, and it composes with multi-query attention.

Key results

Measured effects reported in the paper

What was changedWhereMeasuredEffect
Use bifurcated attention instead of SDPA7B multi-head model, compiled, batch size 16 · 8k contextper-token latency (ms): 26.19 -> 12.60Helped
Use bifurcated attention instead of SDPA7B multi-head model, compiled, batch size 16 · 16k contextper-token latency (ms): OOM -> 18.46Helped
Use bifurcated attention instead of SDPA7B multi-head model, batch size 1 · 32k contextper-token latency (ms): 44.94 -> 39.97Helped
Use bifurcated attention instead of SDPA7B multi-head model, compiled, batch size 2 · 32k contextper-token latency (ms): OOM -> 29.34Helped
Increase the number of attention groups (ablation)Generalized multi-query attention · Validation loss versus model sizevalidation lossHelped
Increase the number of attention groups (ablation)Generalized multi-query attention · Multilingual HumanEval and MBXP, 13 programming languagespass rateHelped
Increase multi-query model size by 1.1 times (ablation)Multi-query model compared with multi-head · Capability-matched model comparisonmodel size: 1.104 timesHelped

Surprising findings

Limitations

Experimental setup

Datasets: MBPP HumanEval MBXP

Benchmarks: MBPP Multilingual HumanEval MBXP

Metrics: per-step latency pass@n pass@top3 validation loss latency (ms)

Baselines: multi-head attention multi-query attention SDPA kernel

Builds on: multi-query attention generalized multi-query attention GPT-Fast

Closest papers by meaning

Writing a paper in this area? scime draft is a free LaTeX editor with AI included, real-time co-authors and a check of your references and venue rules before you submit. It also imports OpenAI Prism projects.

Open scime draft

Get the next scime Dispatch and a monthly field update

Free. We send a confirmation link first; every email has a one-click unsubscribe. Privacy