sPTC: Speculative Tool Calling Overlaps Execution With Token Generation

CShorten30 · x · 2026-08-25

Alex Zhang introduces Speculative Programmatic Tool Calling (sPTC): a general technique that speculates on upcoming tool calls during code generation in a harness and queues them early, overlapping them with token generation and REPL execution time. The name is precise: like CPU speculative execution, work is done optimistically and only rarely discarded when necessary. He came up with the idea, built a version, and wrote the solo blog post all within 72 hours.

Related event: sPTC: Speculative Tool Calling Speeds Up Code Agents(3 posts)→

Original post →

More from coding & agent

coding & agent channel →