How Agent Evaluation Should Move from Single-Turn QA to Task Chains: Methods, Metrics, and Deployment Costs

    This guide explains how to evaluate LLM agents on full task chains rather than single-turn answers. It covers four core capability areas, how to make results comparable across setups, a reproducible evaluation loop, a rough method for estimating local GPU memory, and a practical selection process with common pitfalls.

    1. Why Agent Evaluation Needs to Move from Single-Turn QA to Task Chains

    Early LLM evaluations relied mainly on multiple-choice questions and short-text question answering. These tests measured knowledge coverage and single-turn reasoning. Agents are used differently. A model must read the state of its environment, plan steps, call tools, observe the results, and adjust its strategy when errors occur. An effective evaluation therefore needs to cover the entire task chain, not only whether the final answer is correct.

    An evaluation design should answer three questions. Is the task close to real work scenarios? Can each step in the process be recorded and reviewed? Can the results be reproduced across different times and environments?

    2. Four Core Capabilities and Their Task Formats

    2.1 Engineering Changes in Existing Codebases

    These tasks require the model to understand the directory structure, dependencies, and test cases of a real repository. The model must first locate the problem, then modify code across multiple files, and finally run the tests to verify the changes. The main evaluation points include:

    • Retrieval: Can the model quickly find the relevant modules in a large repository instead of searching blindly?
    • Scope control: Does the model change only the necessary files and avoid introducing unrelated changes?
    • Verification: Does the model run the tests after making changes, and does it iterate based on failure messages?

    Evaluations should record both the pass rate and the average number of changed lines. A model with a high pass rate but scattered changes loses practical value in team collaboration.

    2.2 Generating a Complete Project from Requirements

    Given a natural-language requirement, the model must output a runnable, complete project. This includes the directory design, module division, configuration files, and dependency declarations. These tasks test architectural design and consistency across multiple files.

    There are three common failure modes. Interface names are inconsistent across files. The entry file or dependency declarations are missing. The functionality appears complete but lacks error handling. Evaluations should include a separate check for each failure mode, rather than summarizing overall quality with a single “does it run” metric.

    2.3 Multi-Tool Sequential Calls and Error Recovery

    In real business workflows, agents often call several tools in sequence. For example, an agent might query data, run a calculation, and then write the results. When a step returns an error midway through the task, the key difference in capability is whether the model can read the error message, correct its parameters, and continue.

    An evaluation set should include three types of samples: the normal path, recoverable errors (such as a parameter format mismatch), and unrecoverable errors (such as insufficient permissions). For unrecoverable errors, the correct behavior is to stop and report the problem, not to retry repeatedly or fabricate results.

    2.4 Cross-Industry Professional Tasks and Computer Operation

    These tasks cover document processing, spreadsheet analysis, interface operation, and other areas. They require the model to plan long sequences of steps and ensure that the final deliverable is usable. Evaluations should focus on delivery reliability: Is the output file complete? Can the data sources be traced? Do the steps contain any undeclared assumptions?

    3. The Limits of Horizontal Comparison

    Comparability between evaluation results is often overlooked. At least five variables affect results:

    1. Agent framework: Differences in tool description format, system prompts, and retry strategies can cause the same model to perform noticeably differently.
    2. Context length: More history and file content usually improve success on long tasks, but also increase cost.
    3. Reasoning effort: Some models allow adjustment of the thinking budget. Enabling it may improve accuracy, but it also increases latency and cost.
    4. Number of runs: Agent tasks are stochastic, so single results can vary widely. Run each task multiple times and report the mean and distribution.
    5. Anti-cheating rules: Whether external network access is allowed and whether reading the reference answers is prohibited directly determines whether a result is valid.

    Results are only directly comparable when obtained under the same conditions. When conditions differ, list every parameter in the report and limit the conclusion to “performance under this setup.”

    4. Building a Reproducible Evaluation Script

    The code below shows a general evaluation loop. It highlights three things: multiple runs, retention of process logs, and judgment based on a deterministic check function. The code only illustrates the structure. Replace the interfaces with those that match your team’s environment.

    1. import json
    2. from statistics import mean, stdev
    3. def run_task(agent, task, seed):
    4. trace = []
    5. state = task.initial_state()
    6. for _ in range(task.max_steps):
    7. action = agent.decide(state, trace, seed=seed)
    8. trace.append(action)
    9. state, done = task.apply(action, state)
    10. if done:
    11. break
    12. return {
    13. "success": task.check(state),
    14. "steps": len(trace),
    15. "trace": trace,
    16. }
    17. def evaluate(agent, tasks, runs=5):
    18. report = {}
    19. for task in tasks:
    20. scores = []
    21. for seed in range(runs):
    22. result = run_task(agent, task, seed)
    23. scores.append(1.0 if result["success"] else 0.0)
    24. with open(f"logs/{task.id}_{seed}.json", "w", encoding="utf-8") as f:
    25. json.dump(result, f, ensure_ascii=False, indent=2)
    26. report[task.id] = {
    27. "mean": mean(scores),
    28. "stdev": stdev(scores) if runs > 1 else 0.0,
    29. }
    30. return report

    Some notes on the code:

    • Save the full trace for every run so that failure causes can be reviewed later.
    • Report the mean and standard deviation instead of drawing conclusions from a single result.
    • task.check should be a deterministic function that does not rely on the model’s self-evaluation.
    • Fix the model’s sampling randomness through the seed parameter of the inference interface. The seed in this code only controls the scheduling logic.

    5. Estimating GPU Memory and Cost for Local Deployment

    Local deployment is an important dimension of cost. You can roughly estimate the memory used by model weights with the following formula:

    Weight memory (GB) ≈ parameter count (billions) × bits per parameter ÷ 8

    For example, a 100B-parameter model quantized to 4 bits needs about 100 × 4 ÷ 8 = 50 GB for its weights. The actual footprint also includes runtime overhead and the KV cache. The KV cache grows with context length and concurrency. When processing long documents or running multiple tasks in parallel, memory requirements are usually much higher than the weights alone.

    This estimate has two limitations. First, the accuracy loss and actual footprint differ across quantization methods. Second, memory management strategies vary considerably between inference frameworks. Before finalizing a choice, measure peak memory and generation speed on the target hardware.

    6. A Practical Selection Process

    1. Define the business scenario, such as code maintenance, document automation, or a tool-calling customer service agent. List the three to five capabilities that matter most.
    2. Build an internal test set for each capability. Draw the samples from real business tasks rather than relying only on public leaderboards.
    3. Fix the evaluation conditions. Record the agent framework, context length, inference parameters, and number of runs.
    4. Calculate both quality and cost metrics. These include the cost per task or deployment cost, average task time, and the manual handling time required after failures.
    5. Run a small-scale gradual rollout before deciding whether to switch fully.

    Public leaderboards can serve as a first-pass reference, but their results often differ from a team’s real tasks. A model that ranks highly on a leaderboard may not perform best in a specific business context.

    7. Common Pitfalls

    • Treating a single demonstration as evidence of stable capability.
    • Looking only at average scores and ignoring the distribution of failure types.
    • Overlooking hidden costs, such as retry counts, manual review time, and investment in data compliance.