Benchmarking LLM Agent Efficiency Under a Fixed Runtime Framework
Why controlling variables matters when comparing models for agent workloads: this article walks through an experiment that fixes the runtime framework, task definition, inputs, and acceptance criteria while swapping only the underlying model. It covers the experiment design, observed completion times across four models, four factors that drive agent efficiency (action rounds, tool call quality, service stability, and context management), and practical recommendations for engineering model selection.
Why Use Controlled Variables for Model Comparison
When teams choose a foundation model for their agent stack, they often rely on unit price, inference speed, or benchmark leaderboard scores. These metrics capture part of a model’s capability, but they fail to answer a more practical question: in real multi-step tasks, which model gets the job done faster and more reliably?
During agent execution, the model is only one part of the decision loop. The system also goes through multiple rounds of planning, invokes browser and file tools, reads pages and assets, and retries after errors. A change in any of these steps alters the total runtime. If you vary the runtime framework, prompts, toolset, and acceptance criteria at the same time, the results cannot be attributed to the model itself.
The controlled-variable method requires fixing every other condition and allowing only one variable to change. Only then can observed differences be explained as differences caused by the model.
Experiment Design: What to Fix and What to Swap
The basic structure of this experiment is as follows:
- Runtime framework: a single unified agent runtime, including scheduling logic, tool registration, and log format.
- Task definition: one shared requirements document describing a small collaboration system with multiple modules, page interactions, and data linking.
- Input assets: identical design mockups, sample data, and reference pages.
- Context: identical system instructions, project conventions, and initial file structure.
- Browser environment: the same headless browser version and viewport configuration.
- Acceptance rules: a unified functional checklist and screenshot comparison rules.
The experiment configuration can be written as a standalone file for reproducibility and auditing:
experiment:harness: unified-agent-runtime # fixed, identical for all groupstask: collaboration_system_v1 # fixed task descriptioninputs:assets_dir: ./assets # fixed assetscontext_file: ./context.md # fixed contextbrowser:engine: headlessviewport: 1440x900acceptance:checklist: ./acceptance.yaml # fixed acceptance rulesvariable:model: ${MODEL_NAME} # the only variableretry_policy:max_attempts: 3backoff: exponential
The retry policy is part of the runtime framework. If different groups use different retry configurations, a new variable is introduced and the comparison loses its meaning.
Observations: Completion Time Is Not Execution Efficiency
All four models eventually completed the task, but their completion times differed significantly.
Model A finished in 17 minutes, the shortest of the four groups.
Model B failed on its first run and only completed after a full rerun, for a cumulative time of 1 hour 12 minutes. The failure log showed that the first run could not recover within the framework, so the entire round had to be restarted.
Model C avoided a full rerun but went through 3 automatic retries internally, finishing in 88 minutes. The result passed, but most of the intermediate time cost came from retries.
Model D failed twice under the default retry policy and only succeeded after switching to an extended backoff strategy. From start to first success, it took 1 hour 4 minutes, with 85 retries in total.
This data shows that looking only at final outcomes hides process costs. Two models can deliver the same pages, but one may rely on massive retries to get there.
Four Factors That Affect Efficiency
- Number of Action Rounds
Action rounds are the number of decision steps between receiving the task and producing the result, where each round includes reasoning and tool calls. Too many rounds usually indicates probing, backtracking, or repeated checking. When evaluating, record both the total round count and the average time per round; otherwise it is hard to pinpoint why something is slow.
- Tool Call Quality
Tool call success rate and parameter accuracy directly affect efficiency. Common issues include wrong parameter types, path typos, and misreading return structures. Logging the return status and retry reason for every call lets you classify problems into three categories—model decisions, tool interfaces, or environment configuration—making targeted fixes easier.
- Service Stability and Retry Policy
Response latency and intermittent errors from the model service amplify task duration. A common approach is exponential backoff with random jitter:
import randomimport timedef call_with_backoff(fn, max_attempts=5, base=1.0, cap=30.0):for attempt in range(1, max_attempts + 1):try:return fn()except TransientError:if attempt == max_attempts:raisedelay = min(cap, base * (2 ** (attempt - 1)))time.sleep(delay * random.uniform(0.5, 1.0))
Here TransientError should be replaced with the transient error types used in your actual project. Backoff parameters directly affect cumulative time, so they must be fixed and fully documented in the experiment.
- Context Management
Context grows continuously over long tasks. If the model cannot effectively retain key conventions, it will repeatedly re-read files and re-confirm requirements, increasing the number of action rounds. Context compression, key-information summaries, and file indexing are common countermeasures.
Engineering Recommendations for Model Selection
Based on this experiment, consider the following steps when selecting a model:
- Define the acceptance checklist for your business task before running the evaluation; do not adjust the criteria after seeing results.
- Run each group multiple times at minimum, recording time to first success, final completion time, retry count, and human intervention count.
- Break total time down into inference time, tool execution time, and waiting time to locate bottlenecks.
- Score service stability separately, including error rate, timeout rate, and latency variance.
- Review cost metrics alongside efficiency metrics; avoid deciding based on price alone or speed alone.
Limitations of This Experiment
Each group in this experiment had a small sample size, and single-run results can be affected by service load, network conditions, and randomness. The conclusions apply to this task scenario and cannot be directly generalized to all development tasks. Future work should add more task types, more repetitions, and different time windows to build a more stable benchmark.
Conclusion
A model’s nominal speed and price describe only part of its capability. Real agent efficiency depends on the combined effect of action rounds, tool call quality, service stability, and context management. Only with a controlled-variable design—and by recording both process and outcome metrics—can you reach conclusions that actually guide engineering decisions.
