atlas

Research map / Large language models / Retrieval and knowledge

RAPID: Long-Context Inference with Retrieval-Augmented Speculative Decoding

ICML 2025 · Large language models › Retrieval and knowledge · approach: Long-context and personalized retrieval

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 RAPID, a speculative decoding method where a RAG-based draft model operating on retrieved short contexts speculates for a long-context target LLM, with a retrieval-augmented target distribution that transfers knowledge from the drafter during inference.

Problem

Speculative decoding loses its speed benefit in long-context inference because KV cache operations are memory-bound, and strict rejection sampling discards good candidates from stronger drafters.

Approach

Use a RAG drafter (the same-scale or even larger LLM given a retrieved short context) as the draft model for a long-context target, and modify the target distribution with an inference-time logit shift toward the drafter, derived as a distillation gradient step with the drafter as teacher.

Key results

Measured effects reported in the paper

What was changedWhereMeasuredEffect
Use a same-scale RAG drafter with retrieval-augmented target distributionLLaMA-3.1-8B · ∞Bench AVGscore: 39.33 -> 42.83Helped
Use a larger LLaMA-3.1-70B RAG drafter instead of the same-scale drafterLLaMA-3.1-8B · ∞Bench AVGscore: 42.83 to 49.98Helped
Use a same-scale RAG drafter with retrieval-augmented target distributionLLaMA-3.1-70B · ∞Bench AVGscore: 45.07 -> 50.62Helped
Use a same-scale RAG drafter with retrieval-augmented target distributionQwen2.5-7B · ∞Bench AVGscore: 38.12 -> 42.48Helped
Use a larger Qwen2.5-72B RAG drafter instead of the same-scale drafterQwen2.5-7B · ∞Bench AVGscore: 48.72 vs 42.48Helped
Use retrieval-augmented speculative decoding instead of TriForceLWM-Text-Chat-128K · LongBench v2 (Long, CoT)accuracy: 18.0 -> 21.6Helped
Use retrieval-augmented speculative decoding instead of TriForceLWM-Text-Chat-128K · LongBench v2 (Long, CoT)speedup: 1.27 -> 2.56Helped
Use retrieval-augmented speculative decoding instead of MInferenceLLaMA-3.1-8B · LongBench v2 (Long, CoT)accuracy: 30.9 -> 34.2Helped
Increase η from 20 to 30 with an LLaMA-3.1-8B drafter under unrelated retrieval (ablation)RAPID on LLaMA-3.1-8B · LongBench v2 (Long, CoT), unrelated retrievalΔAccuracy: 1.20 -> -2.40Hurt
Increase η from 20 to 30 with an LLaMA-3.1-70B drafter under unrelated retrieval (ablation)RAPID on LLaMA-3.1-8B · LongBench v2 (Long, CoT), unrelated retrievalΔAccuracy: 4.40 -> 6.60Helped
Increase η from 40 to 50 with an LLaMA-3.1-70B drafter under unrelated retrieval (ablation)RAPID on LLaMA-3.1-8B · LongBench v2 (Long, CoT), unrelated retrievalΔAccuracy: 6.60 -> 6.00Hurt
Increase η from 0 to 5 with an LLaMA-3.1-8B drafter under unrelated retrieval (ablation)RAPID on LLaMA-3.1-8B · LongBench v2 (Long, CoT), unrelated retrievalΔAccuracy: 1.20 -> 2.80Helped

Surprising findings

Limitations

Experimental setup

Datasets: InfiniteBench LongBench v2 MT-Bench-101

Benchmarks: InfiniteBench LongBench v2 MT-Bench-101 (adapted multi-turn dialogue)

Metrics: F1 accuracy ROUGE-L-Sum speedup prefill time acceptance rate quality score (1-10)

Baselines: LC (long-context target) RAG naive speculative decoding MagicDec TriForce MInference

Builds on: speculative decoding MagicDec StreamingLLM BGE-M3

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