Speculate While You Reason: Teaching Agents to Predict Their Next Tool Call via Joint Agent-Speculator RL

Jiabao Ji, Yujian Liu, Li An, Rohit Jain, Gungor Polatkan +2 more
7/28/2026
cs.AI
rl

No confident code implementation found for this paper.

Abstract

Large language model agents often spend substantial wall-clock time waiting for tool call results. Tool-call speculation can hide this latency by predicting and pre-executing an agent's next tool call if the prediction matches the agent's eventual tool call, but existing speculators are typically separate draft models or cached traces that are poorly aligned with the deployed agent's own behavior.

Show full abstract

We identify this speculator-agent gap and show that the target agent itself is a strong next-call speculator. This points to a simpler design: unifying the agent and speculator within the same model. In this paper, we introduce the self-speculating agent, a single model that both solves tasks in agent mode and predicts its next tool call from partial trajectories in speculator mode, fully reusing prefix KV cache. To enable this dual-mode agent without degrading performance, we propose a joint agent-speculator reinforcement learning method, which derives speculation targets from the agent's own rollouts and alternates agent and speculator updates. Across agentic search QA and conversational tool-use agentic tasks, our method improves average next tool-call Hit@1 from 44.1 to 61.2 for Qwen3-4B and from 48.9 to 66.3 for Qwen3.5-4B, while preserving agent task success.

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{ji2026speculate,
  title  = {Speculate While You Reason: Teaching Agents to Predict Their Next Tool Call via Joint Agent-Speculator RL},
  author = {Jiabao Ji and Yujian Liu and Li An and Rohit Jain and Gungor Polatkan and Siyu Zhu and Shiyu Chang},
  year   = {2026},
  eprint = {2607.25816},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2607.25816v1}
}

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

Discussion