Coding agents for systems research: pick the problem, then build the loop
Over the past year I built two benchmarks where coding agents do real ML-systems work, and I'm now building an agent that optimizes a customer's LLM serving system for hours, and improves itself while it runs. The lesson I keep relearning: the model matters less than the loop around it. This post covers the one decision that comes first (which problem to give the agent) and the three parts of the loop that decide whether its results can be trusted. It ends with two ways that strong agents still get stuck.
The three projects
- ServerBench. A coding agent gets a firewalled GPU container with model weights and a naive server that handles one request at a time, and has hours to turn it into a specialized LLM serving system. We grade by replaying stateful sessions against the server it leaves behind, with a hidden correctness check. Across 11 agent models, the best agent-built system reached 4.87× the vLLM reference on cost efficiency.
- CompressionBench. The agent gets a pinned BF16 checkpoint, a storage budget of 8–32 GiB, an offline container with compression toolchains and a public checker. It can mix quantization, pruning, low-rank factorization and distillation. When the clock runs out, a hidden verifier it never sees judges the submission once: size, GPU memory, perplexity on hidden inputs and decode latency.
- ServeForge and S800 (in progress). ServeForge, led by Zhuoming Chen, turns one customer's serving engagement (their model, GPUs, traffic, behaviour tests and prices) into a gradable task for a coding agent with a root shell and twelve hours. On my branch I'm building S800, the serving agent: a method, serving skills, subagents and a finish gate, plus Hermit, a loop that revises S800's harness during the engagement from what its own runs show.
0Pick the right problem
Before any harness work, ask two questions about the problem. Can a program tell, without a human, whether a candidate is better? And can the agent try many candidates in the time you have? Systems performance work often answers yes to both: you can run the candidate on a workload and measure it. Audrey Cheng and colleagues make the same argument in Barbarians at the Gate, calling the approach AI-driven research for systems.
The second question is where the hard cases live. A serving system takes minutes to rebuild and a 30-minute replay to judge, so an 8-hour ServerBench run gets a handful of honest measurements. In ServeForge a traffic run is twenty minutes of the one GPU, so even a twelve-hour engagement gets a few dozen. A compressed 27B checkpoint takes longer still to produce and evaluate. The fewer tries a problem allows, the more each one has to count, and the more the harness has to decide what to try.
1Environment: the sandbox and the start point
ServerBench and CompressionBench run agents in Harbor sandboxes: a container
with a GPU, the model weights, the toolchain and nothing else, with the network cut once the image is built so the agent cannot
download a finished answer. ServeForge gives every agent the same pinned engine, machine and brief, on local GPUs or cloud
sandboxes, plus a single added command, finish. In all three, the grader's traffic, tests and thresholds never enter the
sandbox.
The start point is part of the environment, and it shapes the search. ServerBench starts from a correct but naive server, so every gain is the agent's own work and the baseline cannot be gamed. ServeForge starts from the opposite end: the customer's own serving command on a production engine, measured at several loads, so the agent has to beat a deployment someone already tuned. A start point too far from the goal wastes the run on boilerplate; one too close leaves only flags to turn, which is exactly where the first failure mode below begins.
2Reward: define the goal as one number
The reward should be what you would actually pay for. In ServerBench it is token value per dollar of GPU cost, counted only for requests that meet the latency targets. A server that is fast but answers wrongly earns nothing, and so does one that is accurate but too slow. ServeForge pays income per GPU-hour at the customer's prices, and only if the server comes up, at least 99% of requests complete, hidden probes match the reference engine and every behaviour test passes.
The agent will optimize anything you measure, so the reward has to say what may not be traded. In ServeForge, five of the eight graded DeepSeek runs on two tasks raised their income by lowering precision: a recurrent state served in bf16 where the task gives fp32, or an fp8 KV cache on a BF16 checkpoint. They measured $38–74 per GPU-hour against the customer's $22–33, and every one scored zero. None of them tripped a speed or latency gate; each broke the rule written into the agent's instructions: a server must compute, for every request, what the checkpoint itself would compute.
3Verification: grade files, not claims
Nothing the agent reports is graded. In ServerBench, the grader boots the server from the files the agent froze and replays sessions the agent never saw; a run whose frozen tree does not boot gets no verdict at all. CompressionBench runs its hidden verifier exactly once, after the deadline. ServeForge re-creates the deliverable from its files on a fresh server, runs the grader's traffic on a seed that never entered the sandbox, and checks every gate against a deliberately dishonest server before trusting it. Then a stronger model reads what the run actually changed and rules it clean, likely hacking or hacked.
The precision cases above were caught this way: each server measured well on its own numbers, and each was a different system from the one the customer asked for.
Two ways strong agents still get stuck
The loop makes results trustworthy. It does not make the search good. Across our ServerBench and ServeForge runs with DeepSeek, Sonnet and Opus models, two failure modes kept showing up, and they look the same across model families.
1 · They settle into a local optimum
On the ServerBench task that serves Qwen3.5-9B, every run of one Opus model built a capable engine (paged KV cache, prefix reuse, CUDA graphs) and then spent its remaining hours refining it. Their p90 time per output token landed between 49.8 and 60 ms. The best DeepSeek run reached 35.8 ms. None crossed the task's 23.5 ms bar by tuning. The one run that did, at 13.1 ms, added a different idea: speculative decoding with the model's own multi-token-prediction heads.
data table
| agent | p90 TPOT (ms) |
|---|---|
| Opus 5, 7 runs with logs | 49.8–60 |
| SGLang baseline | 39.7 |
| DeepSeek V4.1 Flash, best of 2 | 35.8 |
| Opus 5.5 with speculative decoding | 13.1 |
| task bar | 23.5 |
ServeForge shows the same shape one level down. Four DeepSeek runs spent their engagement on configuration: 30 to 47 runs of the stock engine with different flags and not one run of a changed engine, including seven hours of 300-second flag comparisons inside a 42% run-to-run swing. Flags pay first and then level off, and an agent that measures one small gain at a time never sees the hill it is standing on.
2 · They commit to one idea and never leave it
The second failure is earlier and more costly: the agent picks a path in the first hour and treats it as fixed. Both Sonnet 5 runs on the Gemma-4 task kept the stock Hugging Face forward pass and tuned around it. One of them measured its time per token at 204–224 ms in eight of its own replays and changed nothing about the design that caused it. The runs that met the latency bar on that task had all written their own engine. A DeepSeek run on the 9B task saw its server emit doubled tokens and called them "an artifact I've seen all along" instead of questioning the path that produced them.
Across families the pattern is the same: each model made recognisably the same design decisions run after run, and those decisions predicted its result better than run-to-run noise did. Strength does not cure it either: even the strongest ServeForge run so far rode a plateau to the end, with repeated attempts at one design and re-validation, and no new best in its second half. More hours do not fix this, because the agent spends the extra hours on the path it already chose.
What I'm trying next
Both failures are search problems, so in S800 the fixes go into the harness rather than the prompt. Four are in place or in progress:
- Leaps beside the steps. The step loop takes the largest loss and keeps a change when it beats the current best, which "climbs fast and stops at the nearest hill." When two or three changed engines in a row set no new best, S800 starts a leap: a redesign built in its own worktree, judged once and whole, while the steps continue.
- A reviewer when progress stalls. After three candidate runs with no gain, a reviewer subagent reads the runs and says whether to continue, switch or drop the current path. And dropping an engine design for flag tuning because it looks risky or slow is reviewed as likely hacking, not accepted as a finding.
- Memory of causes, not just scores. Each failure that recurred in two runs is written as a cause with its precondition (config tuning past its local optimum; a plateau ridden to the end), so the next engagement recognises the situation instead of repeating it.
- A harness that revises itself, in code. Hermit watches each benchmark the agent files, accounts in code where the GPU's and the agent's time went, and when the largest loss is worth it, revises S800's harness mid-run: a policy knob moved, or a tool built and plugged in. Our first version could also end a review in a note to the agent; two evolves deployed ten changes of wording, and none could be shown to raise anything. So now a step is always a revision that code can check and take back.
None of this solves the problem yet. But it changes where I spend my time: less on prompting agents, more on choosing problems with honest feedback and on building loops that push agents off the path they would otherwise never leave.
ServerBench, CompressionBench and ServeForge are joint work with my collaborators at CMU's InfiniAI Lab, led by Prof. Beidi Chen. Numbers come from our run records: the ServerBench analysis of past runs on the Qwen3.5-9B and Gemma-4 E4B tasks (Oct 2026), and ServeForge's results ledger and failure tables for S800 (Nov 2026). Model names are those of the runs. Code: ServerBench · CompressionBench.