TraceSpec: Understanding and Improving Speculative Decoding for LLM Agents

Jihao Zhao, Shuaishuai Zu, Pengfei Li, Biao Qin, Guanghuan Fang +2 more
10/30/2026
cs.CL

No confident code implementation found for this paper.

Abstract

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.

Show full abstract

We present TraceSpec, a framework connecting trajectory evaluation with adaptive draft training. It combines dynamic execution with fixed-prefix replay and introduces TraceSpec-Traj, a corpus of 10,000 training states and 2,500 test states spanning browsing and software engineering. Analysis of five speculative baselines reveals that aggregate acceptance can rise with context length while declining within matched late browsing actions. Workload and phase further distinguish these trends, motivating supervision guided by trajectory conditions. TraceSpec trains on intermediate assistant turns and allocates a fixed prediction budget using state-conditioned estimates of prefix-aware acceptance gaps. Across three target sizes and two temperatures, it improves replay throughput by 12.5% to 22.6% over its DSpark base. Qwen3-4B ablations show that adaptive allocation increases accepted length by 3.3% to 10.0% over fixed full-turn supervision, with additional comparisons substantiating the roles of state conditioning and consecutive-token agreement. The resulting evaluation resources, trajectory findings, and training strategy connect the analysis of agent execution to practical draft improvement.

View on arXivView PDF

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. Any repos shown below are weak matches — verify before relying on them.

No code implementations found yet.

Know of an implementation? Let us know in the comments below!

Similar Papers

Cite this paper

@article{zhao2026tracespec,
  title  = {TraceSpec: Understanding and Improving Speculative Decoding for LLM Agents},
  author = {Jihao Zhao and Shuaishuai Zu and Pengfei Li and Biao Qin and Guanghuan Fang and Ben Feng and Baochuan Yang},
  year   = {2026},
  eprint = {2610.41177},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2610.41177v1}
}

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/2610.41177.svg)](https://codeofpaper.com/paper/2610.41177)

Discussion