- The paper introduces SPORK, a method that reduces tool-wait latency in LLM agents through self-speculative forking.
- It employs a prefix-cache fork, dynamic confidence gating, and partial-token acceptance to achieve up to an 18% reduction in P95 latency.
- The approach integrates with existing systems without retraining, preserving model accuracy while minimizing idle tool execution time.
Self-Speculative Forking for Latency Reduction in Agentic LLM Inference
Motivation and Bottleneck Characterization
The paper addresses the predominant latency bottleneck inherent in current LLM-agent architectures adopting the ThoughtโActionโObservation (ReAct) workflow. In this paradigm, the model serially reasons, emits a tool call, then idles while awaiting tool execution before resuming with the observed result. Empirical profiling on several agent benchmarks reveals that tool execution typically constitutes 16โ37% of end-to-end wall time (Figure 1), with tail latencies dominated by outliers in tool response duration. This tool-wait is recalcitrant to optimization since its roots lie in external API latency, network, and I/O constraintsโfactors not ameliorated by hardware scaling or token-level speculative decoding.
Figure 1: Tool execution accounts for 16โ37% of end-to-end wall time across agent tasks, highlighting its role as the critical latency bottleneck.
Empirical Insights Enabling Self-Speculation
The authors identify that instruction-tuned LLMs, such as Qwen3-32B, frequently "know" the upcoming tool call well before concluding their chain-of-thought (CoT) reasoning. Analyses show that a speculative probe, forked from the main thread immediately after emitting the first token and constrained to decode the tool-call prefix, yields a tool name prediction matching the main thread with accuracy ranging from 74.6% to 99.6% across five benchmarks (Figure 2). Argument-exact match rates are lower initially but rise monotonically as CoT context increases, reaching 97.5% at the chainโs end (Figure 3).
Figure 2: Fork-at-start probes predict the exact tool call name across a range of tasks, demonstrating early intent in agentic LLMs.
Figure 3: Fork accuracy in argument-exact matches increases with the observed CoT context, supporting dynamic gating.
The accuracy gap between tool name and argument prediction motivates the adoption of a dynamic, logprob-based confidence gate. The forked probe's token-level logprobabilities exhibit separability between correct and incorrect predictions, enabling an adaptive commit threshold. The design capitalizes on the empirical finding that most rejected probes nonetheless share a substantial verified prefix (median 18 tokens) with the final tool call (Figure 4).
Figure 4: Even when probes are rejected, a recoverable token prefix is present, enabling draft-based partial acceptance.
SPORK Method and System Design
The "Spork" system operationalizes these insights through three composable mechanisms:
- D1 (Prefix-Cache Forking): Forks a probe immediately following the main's first token, leveraging KV-cache sharing to minimize probe dispatch overhead and open the speculative window (Figure 5). This ensures probe cost is negligible compared to tool execution time and avoids prefix contention.
- D2 (Adaptive Confidence Gate): The probe streams its logprobs; upon surpassing a predefined confidence threshold on the tool name, speculative tool execution is triggered. The threshold (typically ฮธ=0.90) maximizes F1 and filters out mispredictions with high precision (Figure 6).
- D3 (Partial-Token Accept/Draft Verification): On strict rejection (argument mismatch), the main decode only emits the suffix after verifying and accepting the maximal matching prefix from the probe (Figure 7). This mechanism recycles speculative computation and reduces wasted decode tokens.
Figure 5: System overviewโSpork overlaps tool execution with chain-of-thought reasoning via probe forking and confidence gating.
Figure 6: Confidence gate threshold selection cleanly separates correct from incorrect probes using token logprobs.
Figure 7: Partial-token accept mechanism verifies and admits the probe's matching prefix, reducing redundant decode operations.
Quantitative Evaluation
Spork is integrated as a controller over standard vLLM APIs and requires no retraining, auxiliary predictors, or offline traces. Experiments are performed on dense and MoE LLMs (Qwen3-32B, Qwen3.5-35B-A3B, Qwen3-4B) on benchmarks including GAIA, HotpotQA, BrowseComp, and tau2-bench.
Key results:
- On Qwen3-32B (GAIA), Spork achieves an 18% P95โ latency reduction (131.9โs โ 108.1โs), with mean speedup scaling monotonically as tool latency increases (up to 1.18ร at a 5โs tool floor).
- Task accuracy (EM, F1) is preserved within 1pp of baseline, occasionally improving, due to strict speculative acceptance gating (Figure 8). No correctness loss is observed because partial-tip drafts only admit tokens matching the main model's greedy output.
- Ablations verify that latency reductions are orthogonal and additive to token-level speculative decoding (Figure 9). D1 is optimal for mean/P50 latency; the synergy of D2+D3 dominates the tail.
- The system outperforms or matches external-drafter approaches, as shown by higher acceptance rates and lower incidence of wasted speculative tool executions (Figure 10).
- Sporkโs benefit is neutral or negative only when overlap windows vanish (short tools or non-CoT models) or when forced probes diverge from the agentโs native tool-call schema.
Figure 11: Spork reduces P95โ tail latency across all tested models and benchmarks.
Figure 8: Task accuracy is preserved or improved across all configurations and scales due to strict speculative verification.
Figure 9: Full Spork (D1+D2+D3) configuration achieves optimal tail latency by integrating all three mechanisms.
Figure 10: Self-speculation yields greater overlap and higher acceptance rates than smaller cross-model drafters.
Figure 12: Spork operates at or above break-even across the tool-latency envelope, with realized speedup matching cost model predictions.
Practical and Theoretical Implications
Spork demonstrates that tool-wait bottlenecks in agentic LLM inference can be mitigated, in many settings, using self-speculationโwithout added model complexity, retraining, or trace collection. The critical precondition is the early availability of actionable intent within the active modelโs decode trajectory, which is empirically robust for instruction-tuned agents using JSON-based tool APIs. The theoretical framework with explicit cost modeling allows practitioners to anticipate the speedup regime based on measurable parameters (ฮฑ, tool time fraction, overlap, probe overhead), offering clear guidance for deployment feasibility.
The architectural implication is that tool-level self-speculation via cache sharing and dynamic gating is orthogonal and composable with lower-level speculative decoding techniques, including draft models, n-gram drafting, or dynamic early exit. The method's training-free nature and generic deployment suggest applicability to new agent workloads without retraining cost or workflow engineering.
Future Directions
Spork currently limits speculation to read-only, idempotent tools, sidestepping side effect management. Supporting write/non-idempotent tools would necessitate transactional semantics and agent-state checkpointing for speculative rollbackโdirections compatible with, e.g., Atomix. Deep engine integration and dynamic probe scheduling can further shrink probe overhead under heavy batching. Finally, systematic exploration of early intent emergence in alternative tool-call formats may delineate both failure modes and transferability boundaries for next-generation agentic systems.
Conclusion
Spork establishes that agentic LLMs often encode their next tool call well in advance of completion, and that this early intent can be harnessed for tool-level speculative execution. The methodology delivers measurable latency benefits on real-world benchmarks and is robust to model and architectural variations, provided the CoT window and schema regularity hold. Sporkโs design principles and cost-analysis framework lay the foundation for further advances in agentic LLM inference acceleration under practical deployment constraints.