Reducing Batch Makespan for LLM Agent Workloads through Inference-Environment Coordination

Wei Feng, Meiling Chen, Boxiao Chen, Lu Liu, Bin Zi, Libin Ye, Xingyu Lu, Lei Xu and 1 others

Ant Group

Published November 12, 2026 · on the feed November 16, 2026 · ▲ 3 · arXiv 2611.16661

The abstract

Efficient batch execution of agent tasks is critical to LLM training and development workflows, including benchmark evaluation, synthetic-data generation, and RL rollouts. Since these tasks alternate between LLM inference and environment interaction, we present coordinated optimizations to reduce batch makespan, the time required to complete all tasks in a batch. For hybrid LLMs, a workload-based resource model guides GPU-memory allocation between key-value (KV) cache and recurrent state and provides a reference sample concurrency to exploit parallelism while limiting recomputation. Trajectory-aware routing and scheduling promote cache reuse while balancing worker load. Under constrained environment capacity, we decouple sample admission from environment execution and introduce Chain-Advancing Action Scheduling (CAAS), which prioritizes long chains using observed progress to shorten the batch tail. Controlled replay combines actual inference with recorded environment responses and durations for ablations of individual optimizations. Live evaluations with Ling-3.0-Flash and Ling-3.1-Flash on the BFCL, SWE-bench Multilingual, WideSearch, and MCP-Atlas benchmarks demonstrate makespan reductions of 10.4% to 65.0%, while evaluation scores remain aligned. Furthermore, these methods have been successfully applied to training and evaluation workflows for the Ling-3.x model series, accelerating the model-development cycle.

The Brief

2:19

A short podcast summary of the paper. Written and voiced by AI.

Transcript

Reducing Batch Makespan for LLM Agent Workloads through Inference-Environment Coordination. By Wei Feng and eight others, from Ant Group. Published on the twelfth of November.

Running agent tasks efficiently in batches is critical to how language models are trained and developed: benchmark evaluation, synthetic-data generation and RL rollouts all depend on it. The measure that matters is batch makespan, the time needed to complete every task in a batch. These tasks alternate between LLM inference and interaction with an environment, so a batch can be held up on either side. And because the whole batch must finish before it counts as done, a few long tasks at the end can set the time for all of them.

The response is a set of coordinated optimizations, spanning inference and environment together rather than tuning either one alone. On the inference side, they decide how memory is allocated and where each request is sent. On the environment side, they decide which actions run first when capacity is short. Each piece targets makespan directly.

For hybrid LLMs, a workload-based resource model guides how GPU memory is split between the key-value cache and the recurrent state. It also supplies a reference sample concurrency, to exploit parallelism while limiting recomputation. Routing and scheduling are trajectory-aware, promoting cache reuse while keeping worker load balanced.

When environment capacity is constrained, sample admission is decoupled from environment execution. Chain-Advancing Action Scheduling, or CAAS, then prioritizes long chains using their observed progress, to shorten the tail of the batch. For ablations, a controlled replay combines actual inference with recorded environment responses and durations, so each optimization can be isolated.

Live evaluations used Ling-3.0-Flash and Ling-3.1-Flash on four benchmarks: BFCL, SWE-bench Multilingual, WideSearch, and MCP-Atlas. Makespan fell by between ten point four percent and sixty-five percent, while evaluation scores stayed aligned. The methods have also been applied to the training and evaluation workflows of the Ling-3.x model series, accelerating its development cycle.

A batch finishes when its slowest task finishes. Shortening that tail without moving the scores is the target here, and the gains come from treating the model and its environment as one pipeline to schedule. Memory, routing and action order are each tuned with the whole batch in view, and the same methods are already in use on a real model series, not only in the benchmarks.

The deep dive

6:26

A longer episode, written from the whole paper. Written and voiced by AI.

Transcript

Reducing Batch Makespan for LLM Agent Workloads through Inference-Environment Coordination. By Wei Feng and eight others, from Ant Group. Published on the twelfth of November. This is the long version: the whole paper rather than the abstract.

Benchmark evaluation, synthetic-data generation and reinforcement learning rollouts all run agent tasks in batches, and the next stage waits for the whole batch. What matters is batch makespan: the time until the last task finishes. Serving systems usually optimize something else, the latency of single requests. Agent tasks make it harder, because each trajectory alternates between model inference and environment interaction, such as a tool call or a code run. The Ling Team at Ant Group attacks the problem in three places: how a worker divides its cache memory, where and when each request runs, and the order in which environment jobs are dispatched.

Two facts set up everything else. First, successive turns of one trajectory share a growing input prefix, so a worker still holding that prefix's cached state can skip recomputing it. Second, the models are hybrids. Ling three point oh Flash combines Multi-head Latent Attention with Kimi Delta Attention, so reuse needs two kinds of state: a key-value cache that grows with cached tokens, and a recurrent state of fixed size. SGLang keeps them in separate pools inside one memory budget. If the split does not match the workload, one pool runs out while the other sits partly empty. Meanwhile, harnesses such as MCP-Atlas use one task-level concurrency limit, tying how many samples are active to how many environment jobs can run.

The first mechanism is a capacity model. From historical trajectory profiles, it estimates a typical trajectory's key-value footprint at its final turn, next to the fixed recurrent-state footprint. Only one recurrent state is kept per trajectory, because the latest one summarizes the whole prefix. Each pool's memory divided by its footprint says how many trajectories it could hold, and joint capacity is the smaller of the two. The chosen memory ratio balances them, and that balanced number, rounded down, becomes a reference sample concurrency per worker: a guide, not a hard cap.

Next, routing and scheduling. Every request carries a trajectory label. Load-bounded consistent hashing maps the label onto a ring to find a home worker, unless that worker's in-flight load exceeds the average times a load-bound factor, in which case it walks clockwise to the first worker under the bound. Inside each worker, routing-prefix scheduling keeps a least-recently-used set of labels recently admitted to a batch. Queued requests with those labels go first, ranked by cached prefix length. Only they are checked against the prefix cache, and each only once, which keeps scheduling cheap.

Last, the environment. Sample admission is decoupled from environment execution, with a separate cap on running jobs. With more samples active, queues lengthen, so dispatch order matters. Chain-Advancing Action Scheduling sorts waiting jobs first by arrival band, protecting earlier jobs, then by completed inference turns, deeper chains first, then by bucketed inference duration, then entry order. Depth stands in for a long trajectory, so no prediction of remaining length is needed.

Controlled replay runs real inference against recorded environment responses and durations, so configurations face identical work. On one worker, the model-derived operating points land close to the best measured makespans on all three workloads. Push concurrency too far and reuse collapses: new prefill work jumps roughly elevenfold on SWE-bench Multilingual. Routing-prefix scheduling beats first-come first-served at the highest concurrencies, with less priority-calculation time than SGLang's depth-first weighted policy. The load-bounded router gives the shortest makespan of three routing policies on every workload, by spreading load more evenly.

The comparison that most directly tests the thesis is a second baseline the abstract never mentions. On SWE-bench Multilingual, the authors raised the baseline's concurrency to match the optimized setup, keeping its cache split and policies. It got slower. Makespan rose from about one hundred and sixty-seven minutes to about one hundred and ninety-eight, and cache reuse fell from ninety-eight point three percent to eighty-seven point five. At that same concurrency, the optimized setup held reuse at ninety-eight point six percent and cut makespan by twenty-four point four percent. Parallelism alone is not the win. Parallelism that keeps the cache is.

On MCP-Atlas, with environment capacity held at three jobs, the combined optimizations cut mean makespan from four hundred and sixty-six minutes to one hundred and sixty-eight for the smaller model. Chain-Advancing Action Scheduling contributed only a further three point one percent of that. Evaluation scores stayed aligned throughout.

There is no limitations section, only a future-work discussion of hierarchical caching, eviction for hybrid models, and makespan under latency targets. Live results average three runs per configuration, with no error bars. Replay measures efficiency, not correctness. Every experiment uses the authors' own Ling models on one GPU type. The capacity model ignores fragmentation, and the authors concede its balanced ratio may not be optimal. And makespan is not latency: against the tuned baseline, the optimized SWE runs had slower individual requests. The method trades single-request speed for batch completion.

The idea to carry away is that an agent batch is a pipeline with two kinds of server, and the slowest trajectory decides when it ends. Cache split, routing, scheduling and admission serve one goal: keep work ready for the GPUs without discarding the cached prefixes that make that work cheap. Across four benchmarks, batch makespan fell by between ten point four and sixty-five percent with scores aligned.

Paper Quest · 7 chapters · about 39 min

Play this paper

Learn it by doing: make the calls the authors made, guess the result before you see it, and defend it in a viva graded on your own words. Chapter 1 is right here.

Chapter 1 🧩 · The problem

Every quest starts with a wall. Here it is a batch that can't finish until its slowest task does.

You run a batch of agent tasks for a benchmark evaluation. Each task alternates between asking the model for its next step and waiting on tools, code or services for the result.

The road ahead

  1. 1 · The problem ~6 min A batch of agent tasks only counts as done when its slowest task ends, and it can stall on the model side or the tool side.
  2. 2 · What came before ~3 min
  3. 3 · The key idea ~8 min Cut the time the whole batch takes by coordinating model memory, request routing and tool-job ordering, rather than tuning single requests.
  4. 4 · Choose your own research ~3 min
  5. 5 · Build the method ~8 min Four steps: size the cache pools, route by trajectory, separate admission from tool execution, then dispatch tool jobs by observed progress.
  6. 6 · The experiment ~6 min You’ll guess: The coordinated optimizations cut batch completion time for Ling-3.0-Flash and Ling-3.1-Flash on four agent benchmarks. What happened to the evaluation scores?
  7. 7 · The viva ~5 min Three questions from the examiners, answered in your own words. Win it for the paper’s trophy.
Join free to play the whole quest ›

Free, with Google or an email address. Your stars and progress are kept.

KipQuest: the day’s AI research, as podcasts and quests. All papers Android app Privacy Contact Episodes are written and voiced by AI from each paper. Summaries can contain mistakes: the paper is the source.