RACER: Retrieval-Augmented Contextual Rapid Speculative Decoding

Zihong Zhang, Zuchao Li, Lefei Zhang, Ping Wang, Hai Zhao
4/16/2026
cs.CLcs.AI

Official code: hkr04/RACER (7 stars, last commit 2026-04-13).

Abstract

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-free variants face trade-offs: retrieval-based drafts break when no exact match exists, while logits-based drafts lack structural guidance. We propose $\textbf{RACER}$ ($\textbf{R}$etrieval-$\textbf{A}$ugmented $\textbf{C}$ont$\textbf{e}$xtual $\textbf{R}$apid Speculative Decoding), a lightweight and training-free method that integrates retrieved exact patterns with logit-driven future cues. This unification supplies both reliable anchors and flexible extrapolation, yielding richer speculative drafts. Experiments on Spec-Bench, HumanEval, and MGSM-ZH demonstrate that RACER consistently accelerates inference, achieving more than $2\times$ speedup over autoregressive decoding, and outperforms prior training-free methods, offering a scalable, plug-and-play solution for efficient LLM decoding. Our source code is available at $\href{https://github.com/hkr04/RACER}{https://github.com/hkr04/RACER}$.

View on arXivView PDF

Code Implementations(1)

hkr04/RACEROfficial100%

[ACL 2026 Findings] RACER: Retrieval-Augmented Contextual Rapid Speculative Decoding

71C++, CythonAug 7, 20256 months ago

Similar Papers

Cite this paper

@article{zhang2026racer,
  title  = {RACER: Retrieval-Augmented Contextual Rapid Speculative Decoding},
  author = {Zihong Zhang and Zuchao Li and Lefei Zhang and Ping Wang and Hai Zhao},
  year   = {2026},
  eprint = {2604.14885},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2604.14885v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2604.14885.svg)](https://codeofpaper.com/paper/2604.14885)

Discussion