Skip to content

AgSpec: Pushing the Limits of Retrieval-Based Speculative Decoding in Coding Agent Pipelines

Oct 2026 · 0 citations · 38 references
Computer Science

TL;DR

AgSpec is a framework that supplies the corpus and draft-length policies that existing retrieval engines lack in coding-agent pipelines, and remains effective on benchmarks without a repository or a multi-agent pipeline, showing that its gains generalize to coding agents broadly.

Abstract

Retrieval-based speculative decoding (SD) drafts tokens by copying continuations from existing text, which suits coding agents that repeatedly reproduce code, logs, and earlier attempts. Yet existing methods fall short in agent pipelines: much of the reusable text is missing from their corpora or stored in a form that differs from what the agent emits, and their draft lengths ignore that accept length varies across agents and drifts over turns. We present AgSpec, a framework that supplies the corpus and draft-length policies that existing retrieval engines lack in coding-agent pipelines. AgSpec retrieves from session, workspace, and global corpora, retaining the ongoing session trajectory and indexing opened files in the agent's emission format. It bounds each agent's draft length with an offline-profiled cap and adapts the length online from verification feedback. On two repository-level multi-agent coding benchmarks, AgSpec outperforms five retrieval-based drafters and EAGLE-3 in most evaluated settings, raising generation throughput over autoregressive decoding up to 4.37$\times$ at batch size 1 and 4.76$\times$ at batch size 16. AgSpec also remains effective on benchmarks without a repository or a multi-agent pipeline, showing that its gains generalize to coding agents broadly.

View source

Similar papers

Preprint Oct 2026

TraceSpec: Understanding and Improving Speculative Decoding for LLM Agents

LLM agents execute tasks through repeated model calls over evolving histories of reasoning, actions, and tool feedback. Aggregate speculative-decoding metrics merge these distinct decisions, providing limited guidance on where draft supervision is needed. We present TraceSpec, a framework connecting trajectory evaluati...

Jihao Zhao, Shuai-Shuai Zu, Peng-Fei Li et al. · 0 citations
Preprint Nov 2026

CompressionBench: How can your coding agents compress LLMs?

Recursive self-improvement requires AI systems to improve the models and infrastructure used by subsequent systems. LLM compression offers a concrete efficiency objective: retain a pretrained model's behavior within a smaller model storage budget. We study whether coding agents can carry out this step autonomously. We...

Xin Zhong, Zhi-Feng Li, Zhi-Ming Wang et al. · 0 citations
Preprint Nov 2026

SpecPilot: Autonomous Algorithm Discovery and Systems Optimization for Speculative Decoding

Speculative decoding accelerates memory-bound LLM decoding with a lightweight drafter, and parallel drafters extend this speedup by drafting a whole block in one forward pass, but it remains unclear whether their released systems attain the full speedup that parallel drafting permits.

Kun-Jun Li, Wen-Hao Chai, Yihao Liang et al. · 0 citations
Open access Oct 2026

PromptBridge: AI Coding Agents you can Trigger from Chat and Trust

AI coding agents such as Claude Code, Cursor, Codex, and OpenCode have matured into capable multi-step software engineers, yet nearly all of them still assume a developer is sitting at a terminal. PromptBridge removes that assumption by connecting six messaging platforms, Telegram, Discord, Slack, Microsoft Teams, GitH...

Tripti Singh, Dolly Verma, Parineeta Jha · 0 citations
#artificial intelligence Preprint Nov 2026

SKIM: Pruning Large Language Model Agents via Selective Knowledge Informed Masking

Large Language Model (LLM) agents are increasingly deployed under structured generation, where grammar constraints enforce output format at inference time. Whereas existing compression methods target unconstrained generation, we first identify a fundamental mismatch: under structured generation, grammar constraints red...

Moonseok Choi, Jongwon Jeong, Minki Kang et al. · 0 citations

Related blog posts

MIT News · Artificial Intelligence Dec 1, 2026

A new form of memory helps robots learn complex skills

The method uses large vision-language models to teach smaller models how to remember key details about a robot’s surroundings, making the machines more reactive and resourceful.

MIT News · Artificial Intelligence Nov 23, 2026

Many languages, one common neural code

Analyzing speakers of 21 languages, an MIT study using multilingual AI finds the human brain may represent meaning in much the same way.

We use cookies to run the site and, with your consent, for analytics and to show ads. See our Cookie Policy.