NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

ThunderAgent: A Fast, Simple, and Program-Aware Agentic Inference System

Hao Kang, Ziyang li, Weili Xu, Xinyu Yang, Yinfang Chen, Junxiong Wang, Beidi Chen, Tushar Krishna, Chenfeng Xu, Simran Arora

TL;DR

Agentic workflows, where LLMs use tools to solve complex problems, are bottlenecked by inefficient resource management. ThunderAgent introduces a "program-aware" approach that treats entire agent workflows as first-class entities, leading to significant improvements in throughput and resource utilization compared to existing systems. This work is crucial for making large-scale agent deployment more cost-effective and scalable.

What Problem Does This Paper Address?

Modern AI agents, powered by Large Language Models (LLMs), are increasingly used for complex tasks that involve multiple steps of reasoning and interacting with external tools (like code interpreters or web browsers). Current systems that run these "agentic workflows" typically treat each LLM call or tool execution as an independent request. This leads to a fragmented view of the overall workflow, resulting in inefficient management of critical resources like KV cache (which stores LLM's memory) and tool execution environments. Specifically, these systems struggle with:

  • KV Cache Thrashing: When memory is tight, the system might evict parts of an agent's "memory" (KV cache) to make room for new requests, even if that memory will be needed again soon. This forces the agent to re-compute its past reasoning, drastically slowing things down.
  • Memory Imbalance: In multi-node systems, requests from the same agent might be pinned to specific nodes, leading to some nodes being overloaded while others are underutilized.
  • Tool Resource Management: Systems don't effectively track when tool environments (like sandboxes or API connections) are no longer needed, leading to resource leakage and slow setup times for new tasks.

These issues collectively degrade performance, increase costs, and limit the scalability of agentic systems.

Methods

ThunderAgent tackles these problems by introducing a novel "program-aware" abstraction and scheduler:

  • LLM Programs Abstraction: The core idea is to represent an entire agentic workflow as a single "LLM Program." This program carries metadata about its identifier, execution phase (reasoning vs. acting), resource needs, and scheduling status. This provides an end-to-end view of the workflow, unlike request-based systems.
  • Program-Aware Scheduler: Based on the LLM Program abstraction, ThunderAgent implements a scheduler that optimizes for throughput and resource utilization. Key mechanisms include:
  • State-Aware Pausing: If a backend system faces memory pressure, ThunderAgent can selectively pause "acting" programs (those currently using tools) to preserve memory for "reasoning" programs. This avoids arbitrary KV cache eviction.
  • Dynamic Migration: To address memory imbalance across nodes, ThunderAgent uses a global waiting queue. This allows paused programs to be resumed on any available node, not just their original one, effectively balancing load.
  • Program-Aware Tool Resource Management: ThunderAgent couples tool resource lifecycles with the program's status. It uses "lifecycle hooks" to automatically clean up tool environments (like Docker containers) when a program terminates. It also enables asynchronous environment preparation, meaning tool environments can be set up in the background while the LLM is reasoning, hiding initialization latency.
  • Cost Model: A cost model is introduced to guide scheduling decisions, balancing the cost of recomputation (due to KV cache thrashing) against the cost of idle caching (when tools are being used). This model informs the time-decay function for prioritizing which programs to evict.

Datasets

The paper evaluates ThunderAgent on several benchmarks and agentic workflows:

  • SWE-Bench Lite: Used for evaluating coding agents.
  • HLE-Bench: Used for routing agents.
  • ScienceAgentBench: Used for scientific discovery agents.
  • OpenHands: Used for coding and scientific discovery agents.
  • mini-SWEAgent: A lightweight coding agent workflow.
  • ToolOrchestra: A system for routing agents with potentially variable tool call times.
  • R2E-Gym: Used for RL rollout evaluations.

No new datasets were introduced; existing benchmarks were used to demonstrate performance improvements.

Key Insights and Ideas

  • The "Program" is Key: The fundamental insight is that treating individual requests is insufficient for efficient agentic inference. A holistic, "program-aware" view of the entire workflow is necessary to manage resources effectively.
  • Balancing Act for KV Cache: The paper highlights the trade-off between KV cache hit rates and overall throughput, especially when tool execution times are unpredictable. Simply maximizing hit rates can lead to high idle caching costs. ThunderAgent's dynamic approach to balancing these costs is crucial.
  • Asynchronous Tool Prep is a Game Changer: Hiding the latency of tool environment setup by doing it asynchronously during LLM reasoning significantly boosts performance for tool-heavy agents.
  • Global Queue Solves Node Imbalance: The simple yet effective idea of a global waiting queue for paused programs allows for dynamic load balancing across nodes, overcoming the limitations of static node pinning.

Key Results

ThunderAgent demonstrates significant performance gains across various agentic tasks:

  • Serving Throughput: Achieved 1.5-3.6× throughput improvements compared to state-of-the-art systems like vLLM and Continuum.
  • RL Rollout Throughput: Showed 1.8-3.9× throughput improvements in RL rollout scenarios.
  • Memory Savings: Achieved up to 4.2× disk memory savings by effectively managing tool resources.
  • KV Cache Hit Rate: Achieved near-optimal KV cache hit rates (around 100%) in predictable scenarios and dynamically traded off hit rate for better compute utility in stochastic scenarios.
  • Scalability: ThunderAgent scales well with the number of GPU nodes, closely tracking ideal linear scaling.

Limitations and Future Work

  • Limitations:
    • The paper notes that while ThunderAgent improves end-to-end latency, it might slightly increase the latency of individual running programs by triggering KV cache thrashing during the switching process.
  • The performance of exponential decay (a key component of the scheduler) can be slightly suboptimal on workloads with near-deterministic tool execution times compared to linear decay, though exponential decay is more robust overall.
  • Future Work:
    • The authors suggest that ThunderAgent's program-aware abstraction could be extended to support more complex agentic workflows and resource types.
  • Further exploration of optimal scheduling policies and hyperparameter tuning for diverse agentic tasks is implied.
  • The integration into frameworks like SkyRL and NVIDIA Dynamo suggests a path towards wider adoption and further development.

Summary updated

BibTeX
@inproceedings{kang2026thunderagent,
  author = {Hao Kang and Ziyang li and Weili Xu and Xinyu Yang and Yinfang Chen and Junxiong Wang and Beidi Chen and Tushar Krishna and Chenfeng Xu and Simran Arora},
  title = {{ThunderAgent: A Fast, Simple, and Program-Aware Agentic Inference System}},
  booktitle = {International Conference on Machine Learning},
  year = {2026},
  url = {https://openreview.net/forum?id=kR4iOTaAOJ},
}
Figure