atlas

Research map / Architectures and efficiency / Attention and transformers

Spotlight Attention: Towards Efficient LLM Generation via Non-linear Hashing-based KV Cache Retrieval

NeurIPS 2025 · Architectures and efficiency › Attention and transformers · approach: KV cache eviction and compression · 0 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 Spotlight Attention, which replaces linear LSH hashing with a learned two-layer MLP hash function trained with a Bradley-Terry ranking loss to retrieve top-k KV cache tokens during decoding, reaching near-oracle retrieval with 128-bit codes and up to 3x throughput.

Problem

Token-level KV cache retrieval for LLM decoding relies on linear LSH hashing, which needs very long hash codes (~1024 bits) because queries and keys occupy two narrow, nearly orthogonal cones, causing poor encoding and storage overhead.

Approach

Replace random linear hyperplanes with a learned non-linear MLP hashing function (sign of an MLP output) trained with a Bradley-Terry pairwise ranking loss that separates top-k from non-top-k attention scores, with the LLM frozen and only the hash modules trained layer-wise on a small calibration set.

Key results

Measured effects reported in the paper

What was changedWhereMeasuredEffect
Replace linear LSH with trained non-linear MLP hashingSpotlight retrieval on LLaMA2-7B · PG19, top-2% retrievalIoU: 0.05 -> 0.41Helped
Train linear LSH hashing (ablation)LSH retrieval on LLaMA2-7B · PG19, top-2% retrievalIoU: 0.17 -> 0.20No clear effect
Replace Quest with Spotlight at a smaller token budgetLLaMA3-8B · ProofPile, 98% versus 96.9% prunedperplexity: 11.631 -> 3.621Helped
Use hash-based retrieval without local windows or sink tokensLLaMA3-8B · LongBench output fidelityRouge-L similarity: 0.44 -> 0.58Helped
Compress decoding with Spotlight retrievalLLaMA3-8B · 5-shot learning, fixed budget 20win rate: 38% -> 62%Mixed
Change model size while using Spotlight Top-2% (ablation)Qwen2.5 · PG19perplexity: 13.828 -> 13.510 (1.5B); 11.112 -> 9.930 (7B); 8.416 -> 8.261 (14B)Mixed
Train the hashing function on C4 instead of Arxiv + Book (ablation)Spotlight on LLaMA3-8B · PG19perplexity: 8.977 -> 8.958Helped
Train the hashing function on Github Code instead of Arxiv + Book (ablation)Spotlight on LLaMA3-8B · PG19perplexity: 8.977 -> 8.891Helped
Train the hashing function on C4 instead of Arxiv + Book (ablation)Spotlight on LLaMA3-8B · Mathperplexity: 3.621 -> 3.631Hurt
Train the hashing function on Github Code instead of Arxiv + Book (ablation)Spotlight on LLaMA3-8B · Codeperplexity: 5.434 -> 5.393Helped

Surprising findings

Limitations

Experimental setup

Datasets: ArXiv Books C4 GitHub Code PG19 ProofPile CodeParrot LongBench Needle-in-a-Haystack LM-Eval-Harness tasks

Benchmarks: PG19 ProofPile CodeParrot Needle-in-a-Haystack LongBench LM-Eval-Harness 5-shot

Metrics: IoU perplexity Rouge-L throughput latency accuracy

Baselines: Oracle top-k LSH top-k Quest MagicPIG H2O

Builds on: MagicPIG Quest angular LSH RankNet

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