atlas

Research map / Architectures and efficiency / Attention and transformers

QUEST: Query-Aware Sparsity for Efficient Long-Context LLM Inference

ICML 2024 · Architectures and efficiency › Attention and transformers · approach: Sparse attention for long-context LLMs · 1 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.

Quest proposes a training-free, query-aware KV cache page selection method that uses per-page min/max key metadata to estimate page criticality and attends only to the top-K pages, speeding up long-context decoding.

Problem

Long-context LLM decoding is slowed by loading the full KV cache during self-attention, and existing KV cache eviction methods discard tokens based on history or current state, losing tokens that become critical for later queries.

Approach

Keep the full KV cache but, per page of keys, store channel-wise min and max key vectors; for each new query compute an upper bound on page attention scores from these and attend only to the top-K pages, so critical tokens are chosen dynamically per query.

Key results

Measured effects reported in the paper

What was changedWhereMeasuredEffect
Use query-aware page selection instead of historical-attention KV evictionLongChat-7b-v1.5-32k · Passkey retrieval, 10k tokens, budget 64accuracy: 1% -> 99% (H2O); 1% -> 99% (TOVA); 1% -> 99% (StreamingLLM)Helped
Use query-aware page selection instead of historical-attention KV evictionYarn-Llama-2-7b-128k · Passkey retrieval, 100k tokens, budget 1024accuracy: 2% -> 96% (H2O); 2% -> 96% (TOVA); 1% -> 96% (StreamingLLM)Helped
Use query-aware page selection instead of historical-attention KV evictionLongChat-7b-v1.5-32k · Passkey retrieval, 10k tokens, budget 512accuracy: 8% -> 100% (TOVA); 5% -> 100% (StreamingLLM); 3% -> 100% (H2O)Helped
Use query-aware page selection instead of historical-attention KV evictionYarn-Llama-2-7b-128k · Passkey retrieval, 100k tokens, budget 2048accuracy: 2% -> 100% (H2O); 2% -> 100% (TOVA); 2% -> 100% (StreamingLLM)Helped
Use Quest with token budget 2048 and FP16 weights instead of full-cache FlashInferLlama2-7B · Decode, 32K sequence lengthinference speedup: 1.74×Helped
Use Quest with token budget 2048 and 4-bit weight quantization instead of full-cache FlashInferLlama2-7B · Decode, 32K sequence lengthinference speedup: 2.23×Helped
Use Quest attention instead of FlashInfer full attentionLlama2-7B · Self-attention, 32K sequence length, token budget 2048self-attention speedup: 7.03×Helped
Use Quest instead of TOVA at the same accuracy targetLongBench GovReport · Lossless accuracy comparisoninference speedup: 3.82×Helped
Use Quest instead of TOVA at the same accuracy targetLongBench TriviaQA · Lossless accuracy comparisoninference speedup: 4.54×Helped
Use a 1K-token Quest budget instead of full KV cacheLongChat-7b-v1.5-32k · LongBenchaccuracyNo clear effect
Use Quest instead of H2O, TOVA, or StreamingLLMLongChat-7b-v1.5-32k · LongBench, six datasets and various KV cache budgetsaccuracyHelped
Use Quest with a 4096-token budget instead of full KV cacheLongChat-7b-v1.5-32k · PG19 testperplexityNo clear effect

Surprising findings

Limitations

Experimental setup

Datasets: PG19 passkey retrieval LongBench

Benchmarks: PG19 passkey retrieval LongBench NarrativeQA LongBench HotpotQA LongBench Qasper LongBench TriviaQA LongBench GovReport LongBench MultiFieldQA

Metrics: perplexity accuracy recall rate latency speedup

Baselines: H2O TOVA StreamingLLM FlashInfer SparQ

Builds on: FlashInfer PagedAttention H2O StreamingLLM

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