Evaluating Agent Efficiency: Fix the Harness, Swap the Model
When the execution framework (harness) stays fixed and only the underlying model changes, four similarly-sized models all delivered the same task—but their total runtimes ranged from 17 minutes to 88 minutes. This article walks through a controlled experiment design for measuring real Agent efficiency, covering variable control, task design with machine-verifiable acceptance criteria, process metrics beyond final screenshots, retry and backoff strategy, and context management. It concludes with a reusable checklist for model and framework selection.
1. The Starting Problem: Leaderboard Scores Can’t Answer “Can It Get the Job Done?”
A recurring mistake in Agent engineering is treating a model’s general benchmark scores as a direct indicator of its delivery efficiency on real tasks. In reality, the same model run in a different execution framework (harness) can take several times longer to finish the same job; likewise, swapping the model inside the same framework produces equally large differences. The reason is simple: an Agent’s output is not the result of a single forward pass, but a multi-turn closed loop of “reason → tool call → observe → reason again.” Any jitter in any link is amplified into the total runtime.
Therefore, evaluating Agent efficiency requires single-variable control. This article uses one controlled experiment as a sample: the execution framework was held fixed while only the underlying model was replaced; the task, materials, context, browser environment, and acceptance rules all stayed identical. Four models of comparable parameter scale (referred to as Model A/B/C/D) all eventually delivered, but their process data diverged dramatically: Model A finished in about 17 minutes; Model B failed on the first attempt and re-ran the entire round, accumulating roughly 1 hour 12 minutes; Model C avoided a full re-run but triggered 3 automatic internal retries, totaling about 88 minutes; Model D failed twice under the default retry strategy and only succeeded after switching to extended backoff, with its first successful run accumulating about 1 hour 4 minutes.
The real value of this data lies not in the final screenshots, but in what it proves: positioning labels like “low cost” or “high speed” describe only one slice of a model’s capability. Real Agent efficiency is jointly determined by action turns, tool call quality, service stability, and context management.
2. Experiment Design: Lock the Variables to Get Comparability
2.1 Variable Inventory
| Dimension | Fixed item | Only variable |
|---|---|---|
| Execution framework | Same harness, same tool registry | Underlying model |
| Task | Same requirements doc and acceptance criteria | — |
| Materials | Same set of open images and seed data | — |
| Context | Unified 262K context window, 200K task budget | — |
| Environment | Same browser automation channel, same viewport config | — |
| Acceptance | Desktop 1440×1000, mobile 390×844, only one fix round allowed | — |
Fixing the harness is the key to this design. The harness determines prompt organization, tool descriptions, error-return formats, and retry logic. Without fixing it, the experiment measures framework differences rather than model differences.
2.2 Task Design: A Complex Product Problem with No Standard Answer
The task was a creative studio collaboration system. The input was only 6 open images plus seed data for members, assets, versions, and comments—no reference pages existed. The model had to derive the information architecture on its own and implement five states: project overview, moodboard, asset locating and commenting, version approval, and publish preview. It also had to support role-based permissions across three identities—creative director, designer, and client—and make asset drag-and-drop, comment anchoring, version switching, approve/reject, and state persistence across page reloads all work.
The design intent is clear: replace “recitable similarity” with “verifiable complexity,” forcing the model to plan and self-verify under real engineering constraints.
Acceptance logic should be scripted to avoid subjective judgment:
{"viewports": [{"w":1440,"h":1000},{"w":390,"h":844}],"states": ["overview","moodboard","asset_comment","version_approval","publish_preview"],"roles": ["director","designer","client"],"checks": [{"id":"drag_drop","type":"interaction","assert":"asset_moved"},{"id":"comment_anchor","type":"interaction","assert":"anchor_visible"},{"id":"version_switch","type":"interaction","assert":"version_changed"},{"id":"approve_reject","type":"permission","assert":"role_matrix_enforced"},{"id":"persist","type":"reload","assert":"state_kept"}],"fix_rounds": 1,"artifacts": ["code","screenshots","logs","review","metrics"]}
3. Process Metrics: More Informative Than Screenshots
Looking only at the final pages, all four models “passed.” Looking at the process, the conclusions differ completely. At minimum, collect these metrics:
- Wall-clock time: total time from task dispatch to acceptance, including all retries.
- Action turns: number of autonomous model decisions, reflecting planning efficiency.
- Tool call count and failure rate: distinguishes “few and precise” from “many and repetitive.”
- Retry count and retry level: framework-level full re-runs, step-level automatic retries, model self-correction.
- First-pass rate: the ratio of passing without any fixes.
- Fix round usage: whether the single allowed fix round was spent on functional defects or styling details.
An illustrative metrics structure:
{"model_alias": "A","wall_clock_sec": 1020,"action_turns": 46,"tool_calls": {"total": 132, "failed": 9},"retries": {"framework_level": 0, "step_level": 0},"first_pass": true,"fix_round_used": false,"context_peak_ratio": 0.71}
Looking at the results: Model A’s advantage came from “taking fewer wrong turns”—the lightest structure and a one-shot pass; Model B’s time was mostly swallowed by the full re-run; Model C used internal automatic retries to achieve the most complete, information-dense engineering implementation, at the cost of 88 minutes; Model D’s bottleneck was a mismatch between its retry strategy and default backoff parameters versus the server-side rate-limiting rhythm.
4. Retries and Backoff: An Underestimated Efficiency Lever
Model D’s case shows that Agent failures are often not capability problems but retry strategy problems. A default “fixed interval, few attempts” strategy will almost certainly exhaust its quota when hitting rate limits or transient unavailability. A more robust engineering approach is exponential backoff with random jitter, plus separating retryable from non-retryable errors:
def call_with_backoff(fn, max_attempts=6, base=1.0, cap=30.0):for attempt in range(max_attempts):try:return fn()except TransientError as e: # rate limits, timeouts, 5xxif attempt == max_attempts - 1:raisedelay = min(cap, base * (2 ** attempt))sleep(delay + random.uniform(0, delay * 0.3)) # jitter avoids synchronized retriesexcept PermanentError: # parameter errors, auth failuresraise # fail immediately, no pointless retries
Three key points: the backoff cap must exist, or long-tail waits will drag out total runtime; jitter breaks up concurrent retries; and error classification determines whether retrying makes sense. Retry counts and backoff durations should also be logged as separate metrics—otherwise this overhead hides inside total runtime and cannot be attributed.
5. Context Management: Budget Matters More Than Window Size
With a unified 262K context and 200K task budget, the model must decide for itself “what to remember.” Effective strategies in practice include: keeping acceptance criteria and state checklists in a persistent section; summarizing long material descriptions, logs, and screenshot results before they enter the context; and for failed attempts, keeping conclusions rather than full traces. Context utilization (peak / window) should be collected as a first-class metric—it usually correlates positively with action turns and is a key variable for explaining runtime differences.
6. Conclusions and a Reusable Checklist
The methodology from this controlled experiment transfers directly to any model or framework selection:
- Single variable: fix the harness and the entire environment; only swap the object under test.
- The task must have machine-verifiable complexity, not recitable similarity.
- Metrics should be process-centric: wall clock, turns, tool calls, retries, first-pass rate, context utilization.
- Configure and instrument retry strategy explicitly; use capped, jittered backoff and distinguish error types.
- Mandatorily preserve artifacts (code, screenshots, logs, review, metrics) to guarantee reproducibility.
- State conclusions with restraint: speed or cost positioning covers only part of a model’s capability—delivery efficiency is a systemic outcome.
To make this evaluation routine, containerize the pipeline, collect metrics through a unified logging service with monitoring and alerting, and archive artifacts in object storage—so every selection decision is backed by traceable data rather than one-off subjective impressions.
