vLLM · SGLang · real GPUs

LMSysDojo Building Scalable Analytical Agents for Optimizing LLM Serving Systems

  • Junyan Cheng1,3
  • Xingqi Cui2,3
  • Kaiqiang Xu3
  • Chun-Liang Li3
  • Tomas Pfister3
  • Jinsung Yoon3
  • Rui Meng3

1Dartmouth College2Rice University3Google

Agents optimize live vLLM and SGLang deployments on real GPUs and are scored against the human expert's merged fix. Predicting each candidate fix's gain before building it, then building only the best of ten checked predictions, lifts a Claude Code agent from 57–60% to 73–83% of the expert's gain, still with one measurement per item. View the LMSysDojo playgrounds →

Watch an agent find a gap

A real playground · vLLM 4696

Watch an agent find a gap

  1. 01 · A live deployment

    vLLM 0.4.2 serves longchat-7b-16k on one H100 with prefix caching on: a closed loop of 400 requests, each a 14,800-token shared prefix plus 200 unique tokens. Mean latency: 0.758 s per request.

  2. 02 · Locate the gap

    The analyzer profiles the baseline. The GPU is busy under 40% of the time: the single engine thread spends 55 ms per request naming the prompt's 938 blocks, and py-spy puts 34.5% of its samples in hash_of_block.

  3. 03 · Predict the gain

    Each block re-hashes its whole prefix, so the work grows as O(L²). A microbenchmark gives 54.8 → 0.33 ms per request, 30% of the run's wall time, and because the benchmark runs closed-loop at fixed concurrency, mean latency falls by that fraction. Three independent analyzers predict −25%, −29% and −30.1% E2E.

  4. 04 · Implement once

    Only the highest-predicted analysis is built. The implementer chains each block's hash on the previous one and memoises it: O(L²) becomes O(L).

  5. 05 · Measure against the expert

    One deployment on the scoring node: 0.758 → 0.461 s. That is 1.65× against the expert's 1.29×, a normalized gain of 221%.

Built from the paper's case study: the predictions of three structured analyses and the measured delivery of attempt 3.

Overview

An environment, an agent, and a way to train it

LMSysDojo has three parts that close one loop. The environment turns real performance PRs into reproducible playgrounds with measured, expert-calibrated rewards. Gap analysis is an agent that predicts a fix's gain before building it. Analysis RL trains the analyzer on the gains those playgrounds measure.

01Environment

LMSysDojo

Reproducible optimization playgrounds rebuilt from merged vLLM and SGLang performance PRs, scored against the human expert's fix on real GPUs.

39,411 PRs → 900 setups → 100 items

Explore the environment
02Agent

Gap analysis

An analyzer locates a bottleneck, proposes a mechanism and predicts its gain before an implementer builds it. Selecting, structuring and checking that prediction turns analysis into a scaling axis.

57–60% → 73–83% of the expert's gain

Explore gap analysis
03Training

Analysis RL

Every playground returns a measured, checked reward. Analysis RL trains only the analyzer on those gains, on an asynchronous infrastructure built for 42-minute rewards.

4.7× groups/hour · RL 9B = untrained 27B at K = 8

Explore analysis RL

01 · EnvironmentPlaygrounds rebuilt from real performance PRs

A serving system's speed depends jointly on engine code, hardware, model and workload, and engines like vLLM and SGLang are already heavily optimized: most configurations offer little headroom. LMSysDojo mines the engines' development history for setups with known headroom and an expert's measured fix to score against.

1.77×
expert E2E speedup over the benchmark, geometric mean
1–8
H100 GPUs per item, dense, MoE and vision-language models
1.5h
agent wall-clock budget, one final patch per item
5
serving metrics: E2E, TTFT, ITL, output tokens/s, requests/s
The LMSysDojo pipeline: a playground constructor scans, segments, parses, measures and profiles merged PRs; each PR becomes a playground whose problem and fix stay sealed; an evaluation environment runs the agent in a sandbox on a Slurm GPU node, checks validity, and scores its normalized gain.
The LMSysDojo pipeline, followed for one performance PR. The playground constructor scans the merged PRs of vLLM and SGLang, segments each performance PR into the commits before and after the expert's patch, parses only its deployment setup into a setup card, an engine configuration and a GuideLLM workload, then measures the expert's speedup and profiles the baseline on the target hardware. Each PR becomes a playground whose problem statement and fix stay sealed. The evaluation environment runs the agent in an interaction sandbox on a Slurm-allocated GPU node, checks its delivery, and scores its normalized gain. The speedups shown are Fig. 1's example.

Paper figure: The LMSysDojo pipeline ↗

Scored against the expert

Each item fixes the system (the engine at a pre-PR commit with its launch configuration), the workload and hardware, and the expert's merged patch. A patch is graded by how much of the expert's improvement it recovers:

normalized gain= speedup of the patch − 1speedup of the expert's fix − 1

0% is no change, 100% matches the expert, and anything above 100% beats the expert. Any valid improvement counts, even in different files: the expert sets the scale, not a ceiling (item gains are capped at 3× the expert's gain for stability).

Four properties

01Reference-calibrated

Every playground is anchored to a merged optimization PR whose gain we re-measure, so each patch is graded against that expert on the same hardware.

02Reusable, diverse setups

900 measured setups across serving subsystems, each with a setup card, launch configuration, expert trace and baseline profiles.

03Unified setup and metrics

Every playground drives the live server with GuideLLM and records E2E latency, TTFT, ITL, output tokens/s and requests/s.

04Refreshable and sealed

New upstream PRs enter by merge date for temporal splits, while the expert fix, commit hash and git history stay sealed away.

From 39,411 PRs to 100 benchmark items

Only 2.3% of merged PRs are documented, reconstructable optimizations, and finding headroom without them is hard: when agents chose the model, workload and launch configuration on pinned releases, none of 150 attempts beat the 1.075× noise floor. Filtering the 900 setups for clean measurement and headroom, then keeping every qualifying post-cutoff item and a stratified sample of earlier ones, yields LMSysDojo-100: dense, MoE and vision-language models across all major subsystems, split into a dev set and two held-out sets merged before and after Opus 5's knowledge cutoff (2026-05-01). To add statistical power to the two 35-item held-out splits, a second held-out benchmark, LMSysDojo-Ext100, takes 100 more corpus items, 50 merged before the cutoff and 50 after, screened for headroom on the metric each PR set out to improve rather than on E2E. Three systems-performance experts audited every setup card and workload in both benchmarks against a written checklist.

  1. 39,411 merged PRs scanned (vLLM 20,969 · SGLang 18,442)
  2. 900 measured setups (607 · 293)
  3. 100 benchmark items (76 · 24): dev 30, held-out pre-cutoff 35, held-out post-cutoff 35

Paper figure: Benchmark composition ↗ Browse the 900 playgrounds and their measurements →

What the agent sees, and what stays sealed

The PR is used only offline. From the agent's view, it is simply optimizing a standalone serving deployment.

Visible in the sandbox
  • Baseline source and environment
  • Setup card: deployment configuration and a brief scenario theme
  • Pre-recorded profiles: PyTorch profiler, nsys, py-spy
  • The node's GPUs and a local benchmark script
Sealed away
  • PR text and discussion
  • Commit hashes and git history (repacked into one commit)
  • The expert's fix, and any hint about the gap
  • Internet access; every tool call and file read is audited

CheckSame work

Static checks reject launch-flag or environment changes; request-bound runs must match the baseline's request count within 5%.

CheckSame outputs

Greedy decoding on 100 fixed prompts must match the first 32 tokens, with top-5 log-probabilities within 0.01.

ScoreOne measurement

The validated patch is deployed once on a separate single-tenant node under the full benchmark. One final patch per item.

02 · AgentGap analysis: predict the gain before building it

A single Claude Code agent on Opus 5 reaches 57% and 60% of the expert's gain on the two held-out splits. In one session it entangles diagnosis with implementation, committing early to one hypothesis with no quantitative way to compare alternatives before its single measurement. Systems researchers argue differently: across 50 recent LLM serving papers, the justification follows one structure.

Locate the gap, find a fix, predict the gain. Inspect the profiles to find where, and by how much, the deployment loses time; design a mechanism that removes wasted work or spends a slack resource to relieve the bottleneck; and compute its gain from profile quantities, experimental evidence and stated assumptions, independently of the code.
LMSysDojo and gap analysis at a glance: diverse real-world setups as playgrounds; parallel analyzers each predict a gain and only the highest-predicted mechanism is implemented; the patch is scored by normalized gain against the expert.
At a glance. (1) Real serving setups rebuilt from merged PRs serve as playgrounds. (2) Parallel gap analysis runs independent analyzers; each locates a gap, proposes a mechanism and predicts its gain, and only the highest-predicted mechanism is implemented. (3) The patch is scored by its normalized gain against the expert's fix on the same setup.

Paper figure: At a glance ↗

Why focus on the analysis

An analyzer locates the gap, explains why it costs that much, proposes a mechanism and predicts its gain, then its code changes are discarded. A separate implementer builds the mechanism from the analysis alone. Re-running only the implementer on a fixed analysis barely changes an item's outcome, and a smaller analyzer hurts far more than a smaller implementer. Search effort pays at the analysis.

97–98%
less squared median spread when the analysis is held fixed
0.010 vs 0.067
within-item std. of log speedup, implementer only vs. whole pipeline

Parallel: select on the prediction

Run K independent analyzers, implement only the highest predicted gain, and measure once. Extra samples help only when there is a prediction to select on: an LLM ranker over ten finished patches stays near the single-run mean, while ten single-agent sessions that each also state a predicted gain do about as well as ten analyses (65.8% against 68.3% over the 70 held-out items). Because only the winning analysis is implemented, ten analyses cost USD 57 per item against USD 85 for ten self-selected sessions, and run side by side they take 1.2 hours against 0.95 for one session; chaining sessions would instead make the wall clock grow with K.

Paper figure: Gap analysis on the held-out items ↗

Structured: a prediction you can trace

The analyzer ships its prediction as a deterministic program, analyze(C, E, A): SQL queries over the baseline profiles (C), its own experimental evidence (E), and stated assumptions with a value and a reason (A). Any other number counts as undeclared, and every input can be traced and perturbed. Giving a free-form analyzer the same SQL handle C changes its score by only +1.0 point with one analysis and −0.5 with ten, so structure helps through the program, not through access to the profiles.

Iterative: check, then refine

Before anything is built, a sensitivity check perturbs the program's inputs, and an assumption audit, a read-only agent session, checks each stated assumption against the code and profiles. A rejected analysis goes back to a fresh analyzer with the findings, up to three times; the checks reject 48% of held-out candidates, which deliver 1.22× against 1.78× for those that pass.

Paper figure: Structured and iterative gap analysis ↗

Results

Normalized gain on the held-out splits of LMSysDojo-100 with claude-opus-5 on Claude Code; every method is charged one final deployed measurement per item. Two controls test where the gain comes from: in + self-select, each of ten single-agent sessions also states a predicted gain and the patch with the highest one is kept (+ structured states it as an analyze(C, E, A) program), and + corpus access gives the free-form analyzer the SQL handle C.

SetupUSD / itemPre-cutoff E2EPost-cutoff E2E
Vanilla7.4957.060.1
+ ranker75.0258.365.6
+ self-select84.6062.470.0
+ structured87.6066.575.7
Gap analysis9.7455.162.2
+ corpus access9.8956.661.9
+ parallel57.2664.773.2
+ corpus access + parallel58.7663.674.2
Structured gap analysis10.0464.662.1
+ parallel60.2670.777.3
+ iterative94.0373.182.7

The gains hold on 100 new held-out items

On LMSysDojo-Ext100, run with the same frozen prompts, budgets and check threshold, every parallel configuration again beats the single agent on both splits, by 14.7 to 21.5 points, while gap analysis without parallel selection stays close to it.

Held-out split (E2E)Single agentStructured + parallel+ iterative
LMSysDojo-100, pre-cutoff (n = 35)57.070.773.1
LMSysDojo-100, post-cutoff (n = 35)60.177.382.7
LMSysDojo-Ext100, pre-cutoff (n = 50)95.1110.9111.0
LMSysDojo-Ext100, post-cutoff (n = 50)64.680.286.1

Analysis-time scaling reaches the human expert

Still implementing and measuring a single winner, scaling to K = 50 analyses per item on the post-cutoff split lifts all three gap-analysis variants from 62–64% to the expert's level. Auditing before selection resists the optimizer's curse, where one over-claimed estimate hijacks a large pool: iterative gap analysis crosses the human fix by K = 40 and reaches 103.8% at K = 50, for USD 452 of agent cost per item. Fifty analyses without the checks reach 99.6–100.7% for USD 269–284, while fifty self-selected sessions, each building its own patch, reach 95.6% for USD 423.

Paper figures: Analysis-time scaling to K = 50 ↗Cost and verification break-even ↗

Certifying a serving change in production takes cluster stress tests, regression suites and canary rollouts, so a deployed verification is expensive, and that is when deeper analysis pays. With one such verification added to each item's agent cost, structured + parallel at K = 10 costs less per point of gain than a single agent session once verification costs more than about USD 180, and iterative gap analysis becomes the cheapest per point once it costs more than about USD 420.

The same progression holds across model families. On the Antigravity CLI, structured gap analysis with parallel selection over five analyses lifts Gemini 3.1 Pro from 58.4% to 65.4% and Gemini 3.8 Flash from 68.6% to 76.9% on LMSysDojo-100's post-cutoff split, and from 44.7% to 62.1% and from 63.2% to 77.3% on Ext100's 50 post-cutoff items.

03 · TrainingAnalysis RL: train the analyzer on measured gains

Every playground returns a measured, checked speedup, so LMSysDojo can also train agents. As the whole solver, an untrained open model gives GRPO nothing to learn from. Analysis RL trains only the analyzer, where outcome variance concentrates, while a frozen claude-opus-5 implementer builds each analysis as written.

Whole solver · Qwen3.8-27B

Delivered only 120 patches in 268 groups of eight rollouts, and no item showed the reward spread that GRPO learns from.

Analyzer only · Qwen3.5-9B

64% of rollouts deliver a patch and 67% fall in groups with reward spread.

Paper figure: Why train the analyzer ↗

Three infrastructure challenges, each with its fix

Training on measured rewards runs into three problems. As the whole solver, an untrained model times out in 76% of groups, and none of them has reward spread. Serving the policy, training it and measuring its deliveries draw on the same 112 GPUs, and the demand among them keeps shifting. And each reward takes a median of 42 minutes from rollout start to measurement end (32 to 63 from the 10th to the 90th percentile): 4.5 minutes of staging, a 20-minute analysis, a 5-minute build by the frozen implementer, a 5-minute measurement on a GPU, and the waits between them. Analysis RL, elastic nodes and asynchronous execution address them in turn.

Paper figures: Training agents in LMSysDojo ↗Asynchronous streaming ↗Elastic fleet ↗

4.7×
groups trained per hour vs. a synchronous loop
384
seats for concurrent analysis sessions on CPU workers
16
data-parallel policy replicas
97%
prefix-cache hit rate with cache-aware routing
48s
to load new weights into running servers

Reward and objective

RewardMeasured, never predicted

The median log speedup over E2E, TTFT and ITL, clipped to [−1, 2]; zero for an invalid patch or a build that departs from the analysis. The predicted gain never enters the reward, so over-claiming cannot raise it.

ObjectiveGRPO on groups of eight

Full-parameter GRPO on eight analyses per item: a step takes 24 groups, at least 8 of them valid (rewards spread by at least 0.03), with a leave-one-out advantage and a truncated importance weight for policy lag. No KL term or reference model.

FleetElastic, never released

Every GPU node stays held by a long-lived job and changes role inside its allocation: a measurement-pool node drains to join a training step, then returns.

Paper figure: Throughput against a synchronous loop ↗

A 9B analyzer that matches an untrained one three times its size

Trained on 100 one-GPU corpus items disjoint from the benchmark, a Qwen3.5-9B analyzer improves on LMSysDojo-100, which training never sees, at every K on both splits: on held-out items from 7.4% to 16.3% of the expert's gain at K = 8, matching an untrained Qwen3.5-27B of the same family three times its size. RL and parallel selection compound: selecting among eight analyses adds 5.9 points for the base analyzer and 12.2 for the trained one.

Analyzer (held-out)K=1248
Qwen3.5-27B, untrained5.67.311.616.3
Qwen3.5-9B, untrained1.52.44.87.4
Qwen3.5-9B + analysis RL4.17.211.516.3

Paper figure: Analysis RL training ↗

Release

Toolkit, benchmark, corpus, infrastructure, model

We will release the LMSysDojo toolkit, the LMSysDojo-100 and LMSysDojo-Ext100 benchmarks, the 900-setup corpus, the RL infrastructure and the RL-trained analyzer.

Toolkit

LMSysDojo

Playground constructor, sandbox, checker and scorer.

soon
Benchmarks

LMSysDojo‑100 and Ext100

100 items with dev and temporal held-out splits, and 100 more held-out items.

soon
Corpus

900 measured setups

Setup cards, configurations, expert traces and baseline profiles.

soon
Infrastructure

Asynchronous RL

Streaming rollouts, elastic fleet and in-place weight loading.

soon
Model

RL-trained analyzer

Qwen3.5-9B trained with analysis RL.

soon

Citation

@misc{2612.lmsysdojo-analytical-agents-llm-serving,
      title={LMSysDojo: Building Scalable Analytical Agents for Optimizing LLM Serving Systems},
      author={Junyan Cheng and Xingqi Cui and Kaiqiang Xu and Chun-Liang Li and Tomas Pfister and Jinsung Yoon and Rui Meng},
      year={2026},
      publisher={alphaXiv},
      url={https://www.alphaxiv.org/abs/2612.lmsysdojo-analytical-agents-llm-serving},
}