Abstract
While most research focuses on enhancing the reasoning capabilities of AI agents, system efficiency remains a critical bottleneck for real-world deployment. This paper investigates the sources of latency in agentic systems, revealing that web environment interactions—fetching and parsing HTML—can account for over 50% of total execution time. We introduce SpecCache, a framework that leverages speculative execution to prefetch web data using a lightweight draft model. Our results demonstrate that SpecCache reduces web-related overhead by up to 3.2×, significantly improving the responsiveness of agentic systems without compromising accuracy.
Introduction
Modern "agentic" systems, such as OpenAI’s Deep Research or DeepSeek-R1, are designed to interact dynamically with the web to retrieve up-to-date information. However, as these systems transition from research labs to production environments, their efficiency becomes a major hurdle. A critical gap exists in our understanding of where time is spent in the agentic loop: is the primary bottleneck the LLM's reasoning time or the environment it interacts with? Furthermore, traditional caching strategies are often ineffective due to the near-infinite action space of the internet, where a single page may contain hundreds of potential next steps.
Decomposing Agentic Latency
To identify these bottlenecks, we conducted an empirical study benchmarking 15 models across five major providers. We decomposed end-to-end latency into two primary components: LLM API latency and Web Environment latency.
Our findings reveal a "50% Rule": in web-based agentic systems, the environment (fetching and parsing HTML) contributes as much as 53.7% of the total latency. The median latency for fetching and parsing a root URL is approximately 6 seconds, creating a significant bottleneck that persists regardless of the model's reasoning speed.
SpecCache: Speculative Action for Web Agents
To mitigate web latency, we introduced SpecCache, a framework that applies the principles of speculative execution to agentic actions. The system operates in three stages:
- Drafting: While the primary "Target Model" (e.g., o4-mini) is reasoning, a smaller, faster "Draft Model" (e.g., GPT-4.1-mini) predicts the next three likely actions.
- Asynchronous Prefetching: The system executes these predicted actions (crawling the web pages) in parallel with the Target Model’s reasoning process.
- Verification: When the Target Model finally decides on an action, it checks the cache. If the Draft Model guessed correctly, the result is returned instantly, effectively "hiding" the web latency behind the model's thinking time.
Results and API Volatility
Beyond environment overhead, we observed extreme instability in LLM API response times. The same request to the same model can vary in latency by up to 69.21× depending on provider load and time of day.
SpecCache achieved a hit rate of 83.3% on the WebWalkerQA benchmark using o4-mini as the target model. Compared to random caching, SpecCache improved the cache hit rate by up to 58×. Additionally, we found that infrastructure-level optimizations, such as utilizing priority processing tiers, can significantly reduce both average latency and variance, suggesting that reliable performance currently requires both algorithmic and infrastructure-level solutions.
Conclusion
SpecCache demonstrates that "speculative action" is a powerful paradigm for reducing the latency of agentic systems by overlapping I/O with compute. While this addresses the environment bottleneck, future work must still tackle the volatility of API response times and the total number of reasoning rounds required for complex tasks. As agents become more autonomous, optimizing these systemic interactions will be as vital as improving the underlying models themselves.
Summary updated