Benchmarking AI Agent Efficiency Across Models Under a Fixed Execution Harness
Selecting an agent model based only on per-token price and generation speed misses the real drivers of task duration: decision turns, tool calls, service stability, and context usage. This article presents a controlled cross-model evaluation method under a fixed execution harness, defines six core metrics, interprets a four-model comparison, and outlines practical retry and backoff patterns for reliable agent benchmarking.
1. Why Cross-Model Evaluation Is Needed
Agent tools can receive a requirement, plan steps autonomously, call browser and file tools, and ultimately complete page construction or data processing. When teams select a model, they often start with unit price and generation speed. These two metrics describe only part of a model’s characteristics. How long a task ultimately takes depends on how many decision turns the model needs, how many tool calls it makes per turn, whether the server is stable, and how the context window is used.
Therefore, evaluation needs to answer three questions. First, under completely identical conditions, how much does end-to-end duration differ across models? Second, where does failure occur: model inference, tool invocation, or the server? Third, what is the recovery cost after failure? Looking only at whether the final task is completed cannot answer these three questions.
2. Evaluation Design: Fix Variables First
The premise of cross-model evaluation is controlling variables. If any of the following changes—the execution framework, task description, input assets, browser version, context organization method, or acceptance rules—the result cannot be attributed to the model itself.
It is recommended to fix the following five categories of conditions:
- Execution framework: Keep scheduling logic, available tool set, maximum turns, and timeout consistent.
- Tasks and assets: Use the same copy of requirement text, design files, images, and data files, and record checksums.
- Context: Keep system prompts, history truncation strategy, and knowledge injection method consistent.
- Runtime environment: Keep browser version, viewport size, network egress, and concurrency consistent.
- Acceptance rules: Use the same automated check scripts and the same scoring sheet for manual scoring.
The experiment configuration can be recorded in a declarative file for reproducibility and auditability:
experiment:harness: fixed-v1task_id: collab-system-001assets_sha256: "<asset-bundle-checksum>"browser:version: "pinned"viewport: [1440, 900]limits:max_turns: 120timeout_minutes: 120acceptance: rules/acceptance-v3.yamlmodels:- label: model-a- label: model-b- label: model-c- label: model-d
Model labels use neutral codenames to avoid mixing brand information into records and reports, and to reduce preconceptions during review.
3. Core Metric System
Recording only “success or failure” is insufficient for comparing efficiency. At minimum, record the following six categories of metrics.
- End-to-end duration: The total time from task assignment to acceptance. If a mid-task failure requires a full rerun, record both the time to first success and the total time including reruns. These have different meanings and should be presented separately in reports.
- Action turns: The number of times the agent calls the model to make a decision. The more turns, the greater the cumulative impact of per-inference latency.
- Tool calls: Total number of calls, success rate, and average response time. Failed tool calls often reveal more than successful ones.
- Retry count: Distinguish framework-level retries from automatic retries at the model service layer. Count them separately; otherwise, the true failure rate may be overestimated or underestimated.
- Service stability: The frequency and time distribution of timeouts, rate limits, connection interruptions, and server errors.
- Context usage: The curve of input token count per turn, and the number of times compression or truncation occurs.
Raw logs should be retained for every metric. Summary numbers should serve only as an index; when reviewing, return to the trajectory to confirm the cause.
4. Interpreting a Set of Controlled Experiments
The following data comes from four controlled runs under the same execution harness. The four models are referred to as Model A, Model B, Model C, and Model D. The results are as follows.
| Model | Result | Duration | Main observation |
|---|---|---|---|
| Model A | Completed | About 17 minutes | No full rerun |
| Model B | Completed | About 72 minutes including rerun | First run failed; full rerun |
| Model C | Completed | About 88 minutes | No full rerun; framework auto-retried 3 times internally |
| Model D | Completed | About 64 minutes cumulative to first success | Failed twice consecutively under the default backoff strategy; succeeded after backoff adjustment; one run accumulated 85 retries |
Three judgments can be drawn from this dataset.
First, the model with the shortest duration had fewer action turns and smooth tool calls in this task. End-to-end duration directly reflects the product of decision turns and per-turn latency. As long as one stage slows down, total duration increases noticeably.
Second, no full rerun does not mean no extra cost. Model C did not trigger a full rerun, but it auto-retried three times internally, and total duration was about 88 minutes—longer than Model B’s approximately 72 minutes, which included one full rerun. This shows that retry cost must be included in total duration; it is not enough to look only at whether a visible failure occurred.
Third, failure sometimes comes from invocation strategy rather than model capability. Model D failed consecutively under the default backoff strategy and completed the task after backoff parameters were adjusted. This indicates that retry intervals need to match the server’s recovery rhythm. Attributing such failures directly to the model would lead to incorrect selection conclusions.
Note that this experiment has a limited sample size, with only one run per group. The conclusions should be treated as a method example rather than a stable ranking. Formal evaluation should repeat runs multiple times and report the median and distribution range.
5. Engineering Practices for Retry and Backoff
Retries are necessary, but poor design can amplify problems. Common mistakes include retrying all errors uniformly, using fixed retry intervals, having no attempt limit, and not counting retry time in total duration.
Reasonable practices are:
- Distinguish retryable errors (timeouts, rate limits, temporary connection errors) from non-retryable errors (parameter errors, permission errors).
- Use exponential backoff with random jitter to avoid multiple tasks retrying synchronously at the same moment.
- Set both a maximum attempt count and a total time budget; stop retrying when either limit is exceeded.
- Record the error type, wait time, and cumulative elapsed time for each retry.
Below is an illustrative implementation:
import loggingimport randomimport timelog = logging.getLogger("eval.retry")RETRYABLE = (TimeoutError, ConnectionError)def call_with_backoff(fn, max_attempts=5, base=2.0, cap=60.0, budget_s=600):"""Retry retryable errors with exponential backoff, bounded by attempt and total-time budgets."""started = time.monotonic()for attempt in range(1, max_attempts + 1):try:return fn()except RETRYABLE as exc:elapsed = time.monotonic() - startedif attempt == max_attempts or elapsed >= budget_s:log.error("Giving up after %d attempts: %s", attempt, exc)raisedelay = min(cap, base * 2 ** (attempt - 1))delay *= random.uniform(0.5, 1.0) # random jitterlog.warning("Attempt %d failed (%s); retrying in %.1f seconds", attempt, exc, delay)time.sleep(delay)
The budget_s parameter brings retry time into the task budget, preventing “unlimited retries” from extending total duration to an unacceptable level. The cumulative elapsed time in the logs can also map directly to evaluation metrics.
