atlas

Research map / Architectures and efficiency / Attention and transformers

MInference 1.0: Accelerating Pre-filling for Long-Context LLMs via Dynamic Sparse Attention

NeurIPS 2024 · Architectures and efficiency › Attention and transformers · approach: Sparse attention for long-context LLMs · 29 citations (OpenAlex)

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 MInference, a training-free dynamic sparse attention method that assigns each head a sparse pattern (A-shape, Vertical-Slash, Block-Sparse) offline and builds input-dependent sparse indices online to speed up long-context LLM pre-filling.

Problem

Pre-filling long prompts is dominated by quadratic attention cost, making time-to-first-token of long-context LLMs very slow (e.g., 30 minutes for 1M tokens on one A100), and existing sparse or approximate methods lose accuracy or add too much overhead when applied to pretrained long-context LLMs.

Approach

Identify three recurring sparse attention patterns (A-shape, Vertical-Slash, Block-Sparse), choose the best pattern and sparsity budget per head with a kernel-aware offline search that measures attention-output recall at real GPU FLOPs, then estimate dynamic indices cheaply online (last-64-query attention for vertical/slash lines, mean-pooled 64-block attention for block-sparse) and run custom Tri

Key results

Measured effects reported in the paper

What was changedWhereMeasuredEffect
Replace dynamically built sparse indices with static indices for Vertical-Slash and Block-Sparse heads (ablation)MInference · InfiniteBench, LLaMA-3-8B-262KAvg. score: 38.8 -> 31.9Hurt
Use only the Block-Sparse pattern (ablation)MInference · InfiniteBench, LLaMA-3-8B-Instruct-262KAvg. score: 38.8 -> 18.7Hurt
Use only the Vertical-Slash pattern (ablation)MInference · InfiniteBench, LLaMA-3-8B-Instruct-262KAvg. score: 38.8 -> 37.1Hurt
Use only vertical lines and retain the top-1 slash line (ablation)MInference · InfiniteBench, LLaMA-3-8B-Instruct-262KAvg. score: 38.8 -> 18.6Hurt
Use only slash lines and retain the top-1 vertical line (ablation)MInference · InfiniteBench, LLaMA-3-8B-Instruct-262KAvg. score: 38.8 -> 35.9Hurt
Add dynamic sparse-index construction instead of static indices (ablation)MInference · InfiniteBench KV retrieval, LLaMA-3-8B-262KRetr.KV score: 0.2 -> 12.8Helped
Use dynamic sparse attention instead of full attentionMInference · RULER 4K–128K, LLaMA-3-8B-262KAvg. score: 84.4 -> 87.0Helped
Use dynamic sparse attention instead of full attentionMInference · RULER 4K–128K, Yi-9B-200KAvg. score: 78.1 -> 74.7Hurt
Use dynamic sparse attention instead of full attentionMInference · RULER 4K–128K, GLM-4-9B-1MAvg. score: 88.0 -> 89.6Helped
Apply MInference prefill attentionLLaMA-3-8B, 1M-token prompt · PrefillLatency: 30 mins to 3 minsHelped
Increase prompt length from 100K to 1M tokens while using MInferenceLLaMA-3-8B on A100 · PrefillSpeedup: 1.8×, 4.1×, 6.8×, and 10×Helped

Surprising findings

Limitations

Experimental setup

Datasets: KV retrieval synthetic data (30k tokens, one validation sample) for pattern search

Benchmarks: InfiniteBench RULER Needle In A Haystack PG-19

Metrics: accuracy perplexity latency speedup

Baselines: StreamingLLM StreamingLLM w/ dilated StreamingLLM w/ strided InfLLM Ours w/ static SnapKV

Builds on: StreamingLLM FlashAttention PIT Triton InfLLM

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