TraceSpec: Understanding and Improving Speculative Decoding for LLM Agents
Reading guide · Based on sections of the original paper
Why read this
Practitioners who train or evaluate draft models for browsing or coding agents will find a replay corpus, a diagnostic protocol, and a budget-allocation recipe with controlled ablations.
What the authors found
- On fixed-prefix replay of 2,500 TraceSpec-Traj test states, TraceSpec raised native-PyTorch generation throughput by 12.5% to 22.6% over its DSpark base, across Qwen3-4B/8B/14B targets at T=0 and T=1. It led throughput in 15 of 18 settings overall. 4.3. Inference Efficiency
- In Qwen3-4B ablations with matched effective-event budgets, adaptive allocation raised accepted length by 3.3% to 10.0% over fixed full-turn supervision. Full-turn supervision itself added 3.9% to 10.2% over final-turn-only training. 4.5. Training Ablations
- For Qwen3-8B at T=0, aggregate online browsing acceptance rose with context length. However, on task-paired late actions (step ≥20), DSpark acceptance fell from 6.194 to 5.322 tokens/round between 8k–16k and 16k–32k contexts (95% CI [-1.205, -0.473]). The matched software-engineering differences for EAGLE-3 and DSpark had intervals spanning zero. 3.2.3. Late Actions within Matched Tasks
Main limitation
The headline gains are replay results. In live agent execution, greedy throughput gains were only 1.4% to 5.5%, and episode latency was compared only among the original three baselines, not TraceSpec. SWE-bench edit and test feedback was also simulated. Appendix C Supplementary Results and Paired Estimation
Where to start
4.5. Training Ablations · Check how each ablation isolates supervision scope, allocation, state conditioning and prefix-aware scoring, and which workload and temperature settings drive the largest margins.
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. 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.