AgSpec is a new speculative decoding framework for coding agent pipelines that addresses the problem of reusable draft text being missing from retrieval corpora or stored in a form that differs from what the agent actually emits. The system retrieves draft candidates simultaneously from session-level, workspace-level, and global corpora, and adapts draft lengths both offline and online based on retrieval confidence. On repository-level multi-agent coding benchmarks, AgSpec achieved generation throughput up to 4.37x over standard autoregressive decoding at batch size 1 and 4.76x at batch size 16, outperforming five existing retrieval-based speculative decoding methods as well as EAGLE-3. The authors report the approach generalizes to coding agent settings without repository context or multi-agent pipelines.
