Crimson AI NewsA CrimsonLingua Network service
EN ع
← Back to news
Research paper Hugging Face

AgSpec Boosts Coding-Agent Throughput Up to 4.76x via Retrieval-Based Speculative Decoding

AI By Crimson AI Hugging Face Papers 4 October 2026 · 00:00 9 views
Share: X Telegram

Hugging Face paper AgSpec introduces corpus and draft-length policies that let retrieval-based speculative decoding work inside coding-agent pipelines, reaching up to 4.37x throughput at batch size 1 and 4.76x at batch size 16.

AgSpec Boosts Coding-Agent Throughput Up to 4.76x via Retrieval-Based Speculative Decoding

Key points

Retrieval-based speculative decoding (SD) accelerates language-model generation by drafting tokens copied from existing text, an approach well suited to coding agents that repeatedly reproduce code, logs, and earlier attempts. However, existing retrieval methods struggle inside agent pipelines: much of the reusable text is absent from their corpora or stored in a format that differs from what the agent actually emits, and their fixed draft lengths ignore the fact that acceptable draft length varies across agents and shifts over turns.

To address this, the paper presents AgSpec, a framework that supplies the corpus and draft-length policies that existing retrieval engines lack in coding-agent settings. AgSpec retrieves from three sources — session, workspace, and global corpora — retaining the ongoing session trajectory and indexing opened files in the agent's own emission format.

AgSpec also manages draft length in two stages: it bounds each agent's draft length with an offline-profiled cap, then adapts that length online using feedback from the verification step. This combination targets the variability that fixed-length drafters cannot capture.

On two repository-level multi-agent coding benchmarks, AgSpec outperformed five retrieval-based drafters and EAGLE-3 in most evaluated settings, raising generation throughput over autoregressive decoding by up to 4.37x at batch size 1 and 4.76x at batch size 16. The authors report roughly four times higher throughput than autoregressive decoding overall.

The paper further notes that AgSpec remains effective on benchmarks without a repository or a multi-agent pipeline, suggesting its gains generalize to coding agents more broadly.

MetricResult
Throughput vs. autoregressive decoding (batch size 1)up to 4.37x
Throughput vs. autoregressive decoding (batch size 16)up to 4.76x
Overall throughput vs. AR decoding (reported)~4x
Baselines outperformed5 retrieval-based drafters and EAGLE-3
Evaluation settingTwo repository-level multi-agent coding benchmarks
Source
Hugging Face · Hugging Face Papers
Related news
Research paper
Hugging Face 15 Oct 2026

New Survey Maps How Multimodal AI Agents Remember and Evolve

A Hugging Face survey proposes a two-axis framework for multimodal agent memory, separating how information is formed and represen...

3
Research paper
Hugging Face 15 Oct 2026

CriticOPD Fixes On-Policy Distillation by Letting Teachers Critique Student Errors

Hugging Face researchers introduce CriticOPD, a method that restores the teacher's ability to recover from student mistakes during...

4
Research paper
Hugging Face 15 Oct 2026

ActionOPD: Distilling Agent Decisions, Not Tokens

A new Hugging Face paper proposes ActionOPD, an action-level on-policy distillation method that aligns a student agent's decisions...

4