Evaluating LLMs for Agent Workloads: Methods and Practice
Generic leaderboards measure single-turn knowledge, not closed-loop agent performance. This article explains the mismatch, six measurable agent capabilities, a four-dimension metric set (accuracy, latency, tokens, cost), evaluation-framework practices, common pitfalls, and how to run evaluation as a CI pipeline.
1. The starting problem: generic leaderboards and agent scenarios are structurally mismatched
When choosing a large language model, many teams look at leaderboard rankings first. Those rankings measure knowledge coverage and reasoning on single-turn Q&A. Agent scenarios instead require getting dozens of actions right in a real environment. Mixing the two leads to the wrong conclusions.
The mismatch comes from three points:
- Different interaction form. Leaderboard items are mostly static input and a single output. Agent tasks need the model to read environment feedback and revise plans in a loop—a closed-loop control problem.
- Different evaluation target. Leaderboards score text quality. Agents are scored on whether the task actually completed: files written correctly, APIs invoked successfully, state converged.
- Different cost of failure. A wrong single-turn answer is a low score. A parameter hallucination at step 7 of a long chain can roll back an entire pipeline—error accumulation.
A few tenths of a percent of movement on a general benchmark therefore cannot be used to infer capability change in agent settings. The two skill sets do not even share the same training objectives.
2. Break “agent capability” into measurable dimensions
Evaluation starts by defining what is being measured. Split at least six layers, with separate items and separate statistics for each:
- Tool-call correctness: choosing the right tool, filling required parameters, leaving optional parameters empty instead of fabricating them.
- Complex instruction following: fully decomposing instructions that include branches, priorities, and negative constraints, without dropping implicit constraints.
- Timed and persistent tasks: across turns and sessions, remembering the goal and completed steps without repetition or drift.
- Long-chain execution: on tasks of 20+ steps, detecting errors and rolling back rather than failing all the way through.
- Multi-agent collaboration: clear subtask boundaries in a coordinator–worker split, and no information loss at aggregation.
- Throughput and stability: tail latency, timeout rate, and output truncation under high concurrency.
Each layer needs its own pass criteria. Do not merge the six into one mega-task with a single score. Mixing would average away real changes such as “tool calling got worse while instruction following improved.”
3. A four-dimension metric system: accuracy, latency, tokens, and cost
3.1 Accuracy: separate outcome correctness from process correctness
Outcome correctness means the final state meets the goal. Process correctness means the call sequence is valid (no overreach, no redundancy, no infinite loops). Record both numbers, and also step inflation: actual steps divided by the human-annotated optimal step count. Step inflation is an early sign of cost runaway and is often hidden by accuracy.
3.2 Latency: look at the distribution, not the mean
A mean of 52 seconds has almost no engineering meaning. Collect P50/P90/P99 and timeout rate. Total agent latency is the sum of step latencies; tails get amplified:
end-to-end latency ≈ Σ(per-step inference latency) + Σ(tool execution latency) + queueing latency
If single-step P99 is 3× the mean, worst-case time for a 30-step task approaches the timeout threshold.
3.3 Token use: split input, output, and cache hits
For the same task, replaying the full context versus incremental summaries can differ by several times in tokens. Fix the context-management policy during evaluation, or you are measuring policy differences, not model differences.
3.4 Cost: convert with a single formula
def cost_per_1k_calls(avg_in, avg_out, price_in, price_out, cache_hit=0.0):"""price unit: currency per million tokens; returns cost per 1,000 calls"""billable_in = avg_in * (1 - cache_hit)per_call = (billable_in * price_in + avg_out * price_out) / 1e6return per_call * 1000
A shared formula puts “faster but more expensive” and “slower but cheaper” on the same table.
4. Building the evaluation framework
- Sandboxed environment: all tool calls hit an isolated environment, never production, so runs are repeatable.
- Layered task set: unit-level (single tool), chain-level (within 10 steps), and long-horizon (30+ steps) each get a defined share so long-horizon items are not diluted.
- Automated judging: score with state assertions, not text similarity—e.g. target file content hash, API status codes, final database row counts.
- Pin randomness and versions: record model version, prompt version, temperature, and context policy. Any change is a new experiment.
- Failure attribution: label failures as wrong tool, parameter hallucination, missed instruction, lost state, or timeout, to produce a trackable defect distribution.
5. Common mistakes
- Replacing scenario evaluation with a general leaderboard: the ranking can reverse.
- Accuracy only, ignoring steps and tokens: you get a plan that “works but you cannot afford.”
- Ignoring context-strategy as a variable: engineering optimizations get misread as model capability.
- One-shot evaluation: models and prompts keep changing; without a regression baseline you cannot tell gain from regression.
6. Shipping it: evaluation as a pipeline
Hook evaluation into continuous integration. Each prompt or model-version change triggers layered regression and four curves: accuracy, P90 latency, average tokens, and cost per 1,000 calls. Feed the same metrics into logging and alerting, with thresholds on timeout rate and cost spikes. Run on a general container platform for elastic scale and isolation, and store evaluation data in object storage for replay.
Selection then shifts from “which model is stronger” to “under the current task mix, which configuration is best within accuracy and cost constraints”—the question agent engineering actually needs to answer.
