Agent Efficiency Benchmark: Model Latency and Retry Analysis

    This article presents a controlled benchmark comparing four mid-sized models on the same complex agentic task. While all four completed the task, end-to-end execution time ranged from about 17 minutes to nearly 90 minutes. The article breaks down where that time went—action turns, tool-call accuracy, service stability, retry strategy, and context management—and offers practical guidance for building faster, more reliable agent execution pipelines.

    1. Introduction: From Generation Speed to Agent Execution Efficiency

    As agent (Agent) applications move into production, developers are shifting what they look for in the underlying large language model. The industry used to focus on single-inference throughput and time-to-first-token. In real tasks, however, a model must run multiple reasoning rounds, call external tools, read intermediate results, and self-correct before delivering an acceptable artifact. The evaluation criteria therefore need to move from “how many characters per second” to “how long does it take to complete a complex task end to end, and how many retries does it require.”

    A common misconception is that smaller models positioned as low-cost or high-speed are naturally better suited for agent tasks. This article revises that view based on a set of controlled experiments. The results show that four models in the mid-size parameter range all completed the same complex task, but end-to-end time varied from roughly a dozen minutes to nearly an hour and a half. The difference did not come from inference speed alone; it was the combined result of action turns, tool-call efficiency, service stability, and context management.

    2. Experiment Design: A Fair Benchmark with Controlled Variables

    To make latency data comparable, environmental noise must be removed as much as possible. This experiment used a single-variable control strategy, designed as follows.

    2.1 Fixed Factors

    • Execution framework (Harness): the same agent orchestration framework, responsible for prompt assembly, tool registration, loop control, and result persistence;
    • Task goal: build a prototype of a creative collaboration system with multiple pages and multiple components working together;
    • Materials and context: identical input requirement documents, design assets, and reference code snippets, with the same context window configuration;
    • Tool environment: the same toolset and permissions for browser automation, file read/write, and command execution;
    • Acceptance rules: a preset automated check script and a manual review checklist to determine whether the task was “completed.”

    2.2 Variable

    Only the underlying inference model was swapped, denoted Model A, Model B, Model C, and control Model D. All four belong to mid-size model families that emphasize inference cost and response speed; the control model provides a horizontal reference.

    2.3 Metrics

    The experiment recorded more than “success or failure.” It collected the following process metrics:

    1. End-to-end time (including failed rerun time);
    2. Number of action turns (interaction rounds between the Agent and the framework);
    3. Number of tool calls and failure rate;
    4. Number of automatic retries triggered and backoff strategy;
    5. Frequency of context overflow or truncation.

    3. Results: All Four Finished, but the Paths Were Very Different

    All four models eventually passed acceptance, but by very different paths.

    • Model A: completed in one pass in about 17 minutes, with no full rerun and the lowest tool-call failure rate;
    • Model B: the first round failed and triggered a full rerun, totaling about 1 hour 12 minutes;
    • Model C: no full rerun, but 3 internal automatic retries, totaling 88 minutes;
    • Control Model D: failed twice in a row under the default retry strategy, then completed after adjusting backoff parameters, with the first success at about 1 hour 04 minutes.

    The most valuable part of this data is not the final screenshot but “where the time went.” Model A spent almost all of its time on effective output; Model B burned much of its time “starting over”; Model C’s time was scattered across multiple local rollbacks; Model D’s time was mainly spent waiting on backoff and repeating requests.

    4. Root-Cause Analysis: Four Sources of Latency Differences

    4.1 Action Turns: Redundant Rounds Are a Hidden Cost

    Each time an agent completes a “think–call–observe” loop, it consumes one round of context and one inference. If a model tends to break a large task into overly fine steps or repeatedly confirms information it already has, the number of action turns can balloon. More turns not only add time linearly but also accelerate context growth, further degrading later reasoning quality and creating a negative feedback loop.

    4.2 Tool Calls: Parameter Accuracy Determines Rework Rate

    Tool-call failures usually stem from three problems: parameter structures that do not match the contract, incorrect path or field references, and incomplete parsing of returned results. A single failed call often brings two to three extra rounds of interaction for correction. Improving the clarity of tool descriptions (schema) and adding strong validation and error feedback on the framework side can noticeably reduce rework.

    Illustrative framework-side validation logic:

    1. def safe_call(tool, args, max_retry=2):
    2. for attempt in range(max_retry + 1):
    3. ok, err = validate(tool.schema, args)
    4. if ok:
    5. return tool.run(args)
    6. args = repair(args, err) # Feed structured errors back to the model
    7. raise ToolCallError("schema invalid after repair")

    4.3 Service Stability and Retry Strategy: Full Reruns Are the Most Expensive

    Under high concurrency, inference services may time out, get rate-limited, or return truncated output. In these cases, the cost of a “local retry” and a “full rerun” differs by an order of magnitude. A default retry strategy with a fixed short interval tends to hit the rate-limit window repeatedly; exponential backoff with jitter can significantly reduce the probability of consecutive failures.

    1. delay = min(base * 2 ** attempt, cap) + random_jitter()

    It is worth emphasizing that a full rerun invalidates all completed artifacts and is the single largest amplifier of end-to-end time.

    4.4 Context Management: Compression Strategy Affects Long-Term Stability

    In long tasks, message history keeps accumulating. If the framework uses a “keep everything” strategy, it quickly hits the window limit and triggers truncation, and the model may lose key constraints. A layered strategy of “summary + key artifact index” can preserve the goal, acceptance criteria, and list of completed files within a limited window, maintaining stable output.

    5. Practical Recommendations: Building an Efficient Agent Execution Pipeline

    1. Use end-to-end time and retry count as core metrics, rather than generation speed alone;
    2. Implement structured tool validation and error feedback at the framework layer to reduce wasted turns;
    3. Adopt a retry strategy with exponential backoff and jitter, and distinguish “local retry” from “full rerun”;
    4. Introduce a checkpoint mechanism so that failures can resume from the interruption point instead of starting over;
    5. Use layered context compression, explicitly maintaining the task goal, acceptance rules, and artifact list;
    6. Move acceptance scripts earlier so the model can self-check before submission, lowering the chance of final failure.

    For cloud deployment, you can combine a container platform to host the execution sandbox, object storage to save intermediate artifacts, and logging and monitoring/alerting services to observe turn counts and failure rates, forming an observable and traceable engineering loop. In agent engineering scenarios like this, Baidu AI Cloud typically provides supporting capabilities through combinations of general cloud product categories.

    6. Conclusion

    “Low cost” and “high speed” are only one facet of a model’s positioning and cannot predict the real efficiency of agent tasks on their own. This controlled experiment shows that, with the framework, task, and acceptance rules held constant, differences in end-to-end time between models are mainly determined by action turns, tool-call accuracy, service stability, and context management strategy. For developers, the right path to optimizing an agent system is to put retry and recovery at the framework layer, validation and self-checking in the process layer, and observability in the infrastructure layer—achieving order-of-magnitude efficiency gains under the same model conditions.