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

Batch Query Processing and Optimization for Agentic Workflows

Junyi Shen, Noppanat Wadlom, Yao LuarXiv 2025 · DOI

Abstract

As Large Language Model (LLM) applications evolve from simple one-shot prompts to complex "agentic workflows," the efficiency gap between logical orchestration and physical execution has widened. This paper introduces Halo, a system that treats multi-step agentic tasks—involving tool use, web search, and multi-agent collaboration—as structured database queries. By employing a cost-aware optimizer to jointly schedule GPU-based LLM calls and CPU-based tool operations, Halo eliminates redundant computations and maximizes hardware utilization. Experimental results demonstrate that Halo achieves up to a 3.6× speedup in batch processing and a 2.6× improvement in online throughput compared to existing state-of-the-art baselines.

1. Introduction

The paradigm of LLM interaction is shifting toward agentic workflows, where models act as planners that interact with external environments via SQL databases, web search APIs, and specialized sub-agents. While current LLM serving engines (e.g., vLLM) excel at optimizing individual requests, they often treat complex workflows as "black boxes," leading to significant system-level inefficiencies.

Current orchestration frameworks like LangGraph focus on agent logic but neglect performance "plumbing." This fragmentation results in redundant executions where multiple agents query identical data, "pipeline bubbles" where GPUs remain idle during CPU-bound tool calls, and context fragmentation that degrades KV-cache efficiency.

Common patterns in agentic workflows including Mixture of Experts, Map-Reduce, ReACT, and Cascade Summary.

2. The Halo System Architecture

Halo addresses these challenges by modeling agentic workflows as Structured Query Plan Directed Acyclic Graphs (DAGs). The system architecture is divided into three primary stages: parsing, optimization, and execution.

2.1 The Parser

The Parser ingests declarative workflow specifications (e.g., YAML) and decouples logical dependencies. It identifies LLM-specific operations and external tool calls (SQL, HTTP, local functions), treating each as a discrete, schedulable unit.

2.2 The Optimizer

Unlike traditional rule-based schedulers, Halo utilizes an epoch-based Dynamic Programming (DP) solver. This "white-box" cost model is aware of the GPU's internal state, including loaded model weights and "warm" KV-caches. By strategically placing tasks on specific workers, the optimizer maximizes cache reuse and minimizes the overhead of model switching.

The Halo system architecture, featuring a Parser, Optimizer, and Processor to manage workflow DAGs and execution plans.

2.3 The Processor

The runtime engine implements two key techniques:

  • Request Coalescing: Merging identical tool calls from concurrent agents into a single execution to reduce redundant I/O.
  • Wavefront Execution: Overlapping CPU-bound tool tasks with GPU-bound LLM tasks to ensure continuous hardware utilization.

3. Evaluation and Results

The researchers evaluated Halo across six benchmarks representing diverse agentic patterns, including IMDb-Diamond (data merging), FineWiki-LongChain (deep reasoning), and TPCH-Trident (analytical aggregation). Testing was conducted using Qwen3 (14B/32B) and GPT-OSS (20B) models.

3.1 Performance Gains

Halo demonstrated substantial performance improvements:

  • Batch Inference: Achieved up to 3.6× faster processing than OpWise and up to 400× faster than naive vLLM execution.
  • Online Throughput: Improved streaming throughput by up to 2.6×.
  • Resource Efficiency: Reduced cumulative GPU usage by approximately 2.0×, significantly lowering operational costs.

4. Discussion and Limitations

The core insight of Halo is the treatment of agents as query plans, allowing the application of database optimization principles to the LLM ecosystem. State-awareness regarding model residency and KV-cache signatures proved critical for effective scheduling.

However, several areas remain for future exploration. Halo currently focuses on single-machine, multi-GPU environments; extending its white-box control to multi-node clusters will require network-aware scheduling. Additionally, the system currently maintains strict semantic preservation, precluding "higher-level" optimizations like model-swapping for cost-accuracy trade-offs. Future work will investigate dynamic logical plan rewrites to further enhance flexibility.

This summary is based on research from the National University of Singapore.

Summary updated

BibTeX
@misc{shen2025batch,
  author = {Junyi Shen and Noppanat Wadlom and Yao Lu},
  title = {{Batch Query Processing and Optimization for Agentic Workflows}},
  year = {2025},
  eprint = {2509.02121},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2509.02121},
}
Figure