HEXGEN-FLOW: Optimizing LLM Inference Request Scheduling for Agentic Text-to-SQL

You Peng, Youhe Jiang, Wenqi Jiang, Chen Wang, Binhang Yuan

TL;DR

HEXGEN-FLOW is a novel scheduling framework designed specifically for multi-stage, agentic Text-to-SQL workflows running on heterogeneous GPU clusters. By combining global workload-balanced dispatching with local, urgency-driven priority queues, it slashes P95 tail latency by up to 1.56× and boosts throughput by up to 1.81× compared to state-of-the-art LLM serving systems.

What Problem Does This Paper Address?

Agentic Text-to-SQL systems use iterative LLM loops to turn natural language questions into complex, executable database queries. Unlike standard single-shot LLM tasks, these workflows involve multiple interdependent stages: schema linking, candidate generation, self-correction, and evaluation.

An illustration of the multi-stage agentic Text-to-SQL workflow and its inter-stage dependencies.

Existing LLM serving frameworks (like vLLM or TensorRT-LLM) treat every inference request as an independent task. This creates three massive headaches when deploying agentic workflows in enterprise production environments:

  1. Inter-stage dependencies: Delays in early stages cascade down, causing violations of end-to-end Service Level Objectives (SLOs).
  2. Workflow and infrastructure heterogeneity: Request lengths vary wildly across stages, and enterprise clusters often mix different GPU generations (e.g., A100, L40, A6000), meaning the same request performs differently depending on where it lands.
  3. Varying SLO constraints: Multi-tenant environments demand fine-grained, per-query deadline awareness to prevent slower queries from starving urgent ones.

Methods

The authors introduce HEXGEN-FLOW, a framework built around a two-level hierarchical scheduling architecture to address these challenges:

The HEXGEN-FLOW system architecture, featuring a global coordinator, an online simulator, and local priority queues.
  • Global Coordinator (Workload-Balanced Dispatching): Instead of using naive round-robin routing, the global coordinator routes incoming requests by balancing estimated execution time (prefill + decoding costs) against each instance's current queue backlog. This ensures heavy tasks land on powerful GPUs while lighter tasks fill residual capacity on slower ones.
  • Local Priority Queue (Urgency-Driven): Each GPU instance maintains its own queue. It dynamically recomputes a per-request SLO budget right before execution, accounting for any delays or "time debits" accumulated in previous stages. It then ranks requests using a Least-Laxity-First (LLF) style urgency metric.
  • Simulator-Guided $\alpha$-Tuning: A lightweight, CPU-based simulator runs online to dynamically tune the hyperparameter $\alpha$, which controls the trade-off between raw execution speed and cluster load balancing. If a sliding-window monitor detects a significant tail-latency degradation (via a statistical t-test), the simulator replays recent traces to find the optimal $\alpha$ configuration.

Datasets

The framework was evaluated using realistic agentic workflows (CHESS and MAC-SQL) across several benchmark traces:

  • BIRD-bench: A popular cross-domain Text-to-SQL dataset. The authors generated Traces 1, 2, and 3 using the LLAMA3.1-70B model on financial and formula1 databases, spanning simple, moderate, and challenging queries.
  • Spider 1.0: Used to create Trace 4 to test generalizability with the MAC-SQL workflow and a QWEN3-30B model across 9 new domains (e.g., dog kennels, cars).
  • Mixed Workloads: Traces 5 and 6 augmented the BIRD traces with 25% and 50% independent single-shot LLM requests to simulate shared enterprise hardware environments.

Key Insights and Ideas

  • Dynamic Slack Reallocation: If a self-correction stage takes longer than expected (e.g., due to multiple debugging rounds), HEXGEN-FLOW automatically subtracts that time from the remaining stages. This tightens downstream budgets and instantly boosts their urgency in local queues, keeping the overall query on track.
  • Exploiting Hardware Heterogeneity: Instead of treating all GPUs identically, HEXGEN-FLOW strategically pairs task characteristics with hardware capabilities. For instance, it allocates computationally intensive generation stages to faster chips (like A100s) and lighter schema-linking tasks to slower ones (like L40s).
  • Zero-Overhead Simulation: By running the trace-driven hyperparameter tuning entirely on the CPU using historical window data, the system adapts to sudden traffic spikes or workload drifts with virtually zero impact on active GPU serving performance.

Key Results

Across diverse traces and hardware setups (including both homogeneous and heterogeneous GPU clusters):

  • Tail Latency: HEXGEN-FLOW reduced P95 tail latency by 1.42× to 1.56× compared to state-of-the-art frameworks like vLLM, QLM, and Ray Serve.
  • Throughput: It achieved a 1.49× to 1.81× increase in query throughput.
  • Ablation Validation: Replacing the workload-balanced dispatcher with a standard round-robin approach increased tail latency by up to 35%, proving that hardware-aware routing is critical for mixed clusters.

Limitations and Future Work

While highly optimized for Text-to-SQL, the current implementation is tailored specifically to the sequential and parallel structures of SQL generation agents. The authors note that extending and validating this hierarchical scheduling framework to support more generalized, arbitrary agentic Directed Acyclic Graph (DAG) workflows remains an important direction for future research.

Summary updated

BibTeX
@inproceedings{peng2026hexgen,
  author = {You Peng and Youhe Jiang and Wenqi Jiang and Chen Wang and Binhang Yuan},
  title = {{HEXGEN-FLOW: Optimizing LLM Inference Request Scheduling for Agentic Text-to-SQL}},
  booktitle = {ICDE},
  year = {2026},
  doi = {10.1109/icde65706.2026.00134},
}
Figure