How to Evaluate Multi-Step Task Execution in LLM Agents
This article explains why accuracy on single questions does not show whether an LLM agent can complete real tasks. It walks through a typical multi-step workflow, proposes six evaluation dimensions with a sample scoring function, and covers how to build a reproducible test environment, design test cases, classify common failure modes, and use evaluation results to improve agent systems.
1. Correct Answers Are Not Enough
Traditional model evaluation usually relies on accuracy in question answering. Each question has a standard answer, and the model only needs to output a text response that can be graded. This approach measures knowledge and reasoning, but it cannot show whether a model can independently finish a task in a real business setting.
Agent scenarios have different requirements. A single task typically requires the model to break down a goal on its own, call retrieval tools, read web pages, organize data, generate files, call external APIs, and deliver the result. If any step fails, the final result may be unusable. Evaluation should therefore shift from asking “Is a single response accurate?” to asking “Does the entire task chain complete successfully?”
This shift has two direct consequences. First, evaluation must record the execution process, not only the final output. Second, scoring must distinguish “partially completed” from “fully completed.” Otherwise, it is hard to measure the actual performance gap between two models.
2. The Execution Chain of a Typical Agent Task
Consider the task “filter information from public web pages and generate a visual report.” The full chain usually has five steps:
- Web retrieval: Visit the specified pages and filter candidate items by keyword or ranking.
- Information extraction and summarization: Extract fields such as title, rating, and date from the pages, and remove duplicate and invalid data.
- Structured organization: Write the results into a table and standardize field types and units.
- Code generation: Generate charts or a page from the table data, making sure the displayed data matches the source table.
- Result delivery: Send the file to the specified location and confirm that it was received.
Each step has its own failure modes. Retrieval may return outdated pages. Extraction may miss fields. Organization may shift columns. Code may hardcode data. Delivery may fail due to insufficient permissions while the model still reports the task as completed. The evaluation framework needs to check each of these nodes individually.
3. Evaluation Dimensions
We recommend building a scoring system around the following six dimensions.
1. End-to-End Completion Rate
Measure whether the task produces all required deliverables within the specified time. This is the most intuitive metric, but it yields only a binary result, so it must be read together with the other dimensions.
2. Step Completion
Split the task into several checkpoints and score by the number passed. Using the example above, checkpoints could include “obtained at least ten candidate items,” “all filter conditions took effect,” “the table contains the required fields,” “the page opens normally,” and “the file was delivered successfully.”
3. Tool Call Accuracy
Check the order, parameters, and error handling of tool calls. Typical problems include missing parameters, duplicate calls, and failing to retry after a timeout, or retrying endlessly.
4. Output Quality
Output quality covers structural completeness, data consistency, and format compliance. Data consistency is the key focus: compare the raw values returned by tools with the values in the final file.
5. Process Stability
Run the same task multiple times and measure how much the success rate fluctuates. A single successful run does not prove much. We recommend running each test case at least five to ten times.
6. Cost and Latency
Record the number of calls, token consumption, and total time to judge whether an approach is viable in production.
The following sample code shows a weighted scoring function that combines these dimensions:
from dataclasses import dataclass@dataclassclass RunResult:completed: bool # Whether all deliverables were producedcheckpoints_passed: int # Number of checkpoints passedcheckpoints_total: inttool_errors: int # Number of tool call errorsdata_mismatches: int # Number of fields where the output differs from the source datadef score_run(r: RunResult) -> float:"""Returns a composite score between 0 and 100. Weights can be adjusted to business needs."""if r.checkpoints_total == 0:return 0.0step_score = r.checkpoints_passed / r.checkpoints_totalcompletion = 1.0 if r.completed else 0.0penalty = min(0.1 * r.tool_errors + 0.05 * r.data_mismatches, 0.5)raw = 0.4 * completion + 0.6 * step_score - penaltyreturn round(max(raw, 0.0) * 100, 1)
Weights should be transparent. A heavy weight on completion can hide many errors during the process. A heavy weight on steps can overlook failures in final delivery. Keep both as separate metrics rather than reporting only one combined score.
4. Building a Reproducible Test Environment
Reproducibility determines whether evaluation results can be trusted. We recommend the following practices:
- Environment isolation: Keep test accounts separate from production accounts, and use test workspaces as delivery targets.
- Least privilege: Give the agent only the permissions the task requires, such as read-only access to specified pages and write access to a specified directory.
- Version tracking: Record the model version, tool versions, prompt version, and evaluation date.
- Fixed inputs: Use the same starting conditions for the same set of test cases. When web content changes quickly, save snapshots.
- Full logging: Record the inputs, return values, and latency of every tool call to support later review.
For test cases that access public websites, also comply with the target site’s terms of service and robots protocol. Limit request rates to avoid putting load on the site.
5. Key Points for Test Case Design
A good test case meets three conditions: its goal is clear, its process is observable, and its results are verifiable.
A clear goal means the task description contains no ambiguity. For example, “filter popular content” requires a definition of popular. Specify whether it means ranking by rating, by engagement, or by a combined ranking over time, and give the weight of each factor.
An observable process means key steps leave traces, such as intermediate files, call logs, or screenshots. Without intermediate traces, you cannot tell whether the model actually retrieved the information or fabricated the results.
Verifiable results means a program or a person can check the deliverables. For tables, check row counts, field names, and value ranges. For visual pages, check whether the displayed data matches the table and whether the page renders without external dependencies.
6. Common Failure Modes and Mitigations
- Silently ignored constraints: The model does not apply a condition such as “filter by release date” and does not report that it skipped it. Mitigation: Require the output to list the result of each filter condition.
- Hallucinated data: The table contains values that do not appear in the retrieved results. Mitigation: Keep the original snapshot and check key values against it.
- Format drift: Dates in the same column use different formats, or numbers and text are mixed together. Mitigation: Run schema validation before delivery.
- False success: Delivery fails, but the final report says the task is complete. Mitigation: Use delivery receipts, not the model’s self-report, as the basis for judging success.
- Broken external dependencies: The generated page references resource URLs that no longer work. Mitigation: Require the page to embed its styles and data instead of relying on external links.
7. Using Evaluation Results for Improvement
The value of evaluation lies in guiding improvement. Process the results in the following order.
First, group failures by failure mode and identify the most frequent problems. Second, separate model problems from tool problems. For example, a timeout may come from network instability rather than a lack of reasoning ability. Third, add constraints for high-frequency problems, such as validation steps, receipt checks, or manual confirmation points. Fourth, add manual confirmation for irreversible operations, such as deleting data, sending content externally, or changing permissions.
In enterprise environments, an evaluation pipeline can use object storage to keep web snapshots, message queues to decouple the steps, a logging service to record call chains, and monitoring with alerts to catch drops in success rate. Combining these general capabilities turns evaluation from a one-time experiment into continuous quality assurance.
8. Practical Recommendations
Teams can start by selecting three to five representative tasks, defining checkpoints and scoring rules, and running them weekly while tracking trends. Once the metrics are stable, gradually expand the number of test cases to cover more business scenarios.
