AgSpec fixes speculative decoding for coding agents
Researchers from KAIST and Seoul National University introduced AgSpec, a retrieval-based speculative decoding method for coding agents. The bottleneck was format mismatch: the index stores files as they sit on disk, while agents emit code as diffs or escaped JSON, breaking token matches. Indexing files in multiple emission formats nearly doubled accepted draft length on repository-level edits.
- AgSpec indexes files in raw, unified-diff and JSON-escaped formats at once
- Accepted draft length on repository edits nearly doubled
- Three corpora with distinct lifetimes: session, workspace and global references
- Draft caps are tuned per agent role, from planner to coder
Read next
AI