paper-with-me

Papers

Long-Context Inference with Retrieval-Augmented Speculative Decoding

2025-02-27 · Guanzheng Chen, Qilong Feng, Jinjie Ni, Xin Li, Michael Qizhe Shieh

The emergence of long-context large language models (LLMs) offers a promising alternative to traditional retrieval-augmented generation (RAG) for processing extensive documents. However, the computational overhead of long-context inference, particularly in managing key-value (KV) caches, presents significant efficiency challenges. While Speculative Decoding (SD) traditionally accelerates inference using smaller draft models, its effectiveness diminishes substantially in long-context scenarios due to memory-bound KV cache operations. We present Retrieval-Augmented Speculative Decoding (RAPID), which leverages RAG for both accelerating and enhancing generation quality in long-context inference. RAPID introduces the RAG drafter-a draft LLM operating on shortened retrieval contexts-to speculate on the generation of long-context target LLMs. Our approach enables a new paradigm where same-scale or even larger LLMs can serve as RAG drafters while maintaining computational efficiency. To fully leverage the potentially superior capabilities from stronger RAG drafters, we develop an inference-time knowledge transfer dynamic that enriches the target distribution by RAG. Extensive experiments on the LLaMA-3.1 and Qwen2.5 backbones demonstrate that RAPID effectively integrates the strengths of both approaches, achieving significant performance improvements (e.g., from 39.33 to 42.83 on InfiniteBench for LLaMA-3.1-8B) with more than 2x speedups. Our analyses reveal that RAPID achieves robust acceleration beyond 32K context length and demonstrates superior generation quality in real-world applications.

📄 PDF Abstract BibTeX arXiv:2502.20330

Code (1)

john-ai-lab/rapid 공식 구현 pytorch

Tasks

Computational EfficiencyRAGRetrievalRetrieval-augmented GenerationTransfer Learning

Methods 이 논문이 사용한 방법론

Refunds@Expedia|||How do I get a full refund from Expedia? “How do I get a full refund from Expedia? How do I get a full refund from Expedia? – Call ☎️ +1-(888) 829 (0881) or +1-805-330-4056 or +1-805-330-4056 for Quick Help &…
Weight Decay 설명 없음
Attention Dropout Attention Dropout is a type of dropout used in attention-based architectures, where elements are randomly dropped out of the…
Dense Connections Dense Connections, or Fully Connected Connections, are a type of layer in a deep neural network that use a linear operation where every input is connected to every output…
Linear Layer A Linear Layer is a projection $\mathbf{XW + b}$.
Layer Normalization Unlike batch normalization, Layer Normalization directly estimates the normalization statistics from the summed inputs…
BPE Byte Pair Encoding, or BPE, is a subword segmentation algorithm that encodes rare and unknown words as sequences of subword units. The intuition is that various word…
Residual Connection 설명 없음

Similar Papers 제목 키워드 기반

RASD: Retrieval-Augmented Speculative Decoding

2025-03-05 · Guofeng Quan, Wenfeng Feng, Chuzhan Hao, Guochao Jiang 외

Speculative decoding accelerates inference in large language models (LLMs) by generating draft tokens for target model verification. Current approaches for obtaining draft tokens rely on lightweight draft models or addit…

Retrieval

SpecAgent: A Speculative Retrieval and Forecasting Agent for Code Completion

2025-10-20 · George Ma, Anurag Koul, Qi Chen, Yawen Wu 외 arxiv

Large Language Models (LLMs) excel at code-related tasks but often struggle in realistic software repositories, where project-specific APIs and cross-file dependencies are crucial. Retrieval-augmented methods mitigate th…

Code Completion

RACER: Retrieval-Augmented Contextual Rapid Speculative Decoding

2026-04-16 · Zihong Zhang, Zuchao Li, Lefei Zhang, Ping Wang 외 arxiv

Autoregressive decoding in Large Language Models (LLMs) generates one token per step, causing high inference latency. Speculative decoding (SD) mitigates this through a guess-and-verify strategy, but existing training-fr…

SpecExtend: A Drop-in Enhancement for Speculative Decoding of Long Sequences

2025-05-27 · Jungyoub Cha, Hyunjong Kim, Sungzoon Cho

Speculative decoding is a widely adopted technique for accelerating inference in large language models (LLMs), but its performance degrades on long inputs due to increased attention cost and reduced draft accuracy. We in…

16kLong-Context Understanding

Speculative RAG: Enhancing Retrieval Augmented Generation through Drafting

2024-07-11 · Zilong Wang, Zifeng Wang, Long Le, Huaixiu Steven Zheng 외

Retrieval augmented generation (RAG) combines the generative abilities of large language models (LLMs) with external knowledge sources to provide more accurate and up-to-date responses. Recent RAG advancements focus on i…

ARCRAGRetrievalRetrieval-augmented Generation+1