Evaluating Agent Base Models: A Controlled-Variable Testing Guide

    How do you fairly compare LLMs as Agent backbones? This guide covers a controlled-variable evaluation methodology for Agent base models, including fixed test configurations, key evaluation dimensions (skill loading, tool call accuracy, confirmation of high-risk actions, long-task stability, and unit success cost), test script structure, and practical model selection recommendations.

    Why Agents Need Their Own Evaluation Method

    A large language model’s performance on single-turn tasks such as question answering or text generation tells you little about how it will behave in Agent scenarios. An Agent must read memory across multi-turn conversations, identify and load skill files, select tools, assemble parameters, execute actions, and decide on next steps based on returned results. Every step depends on the model’s ability to understand structured instructions, and a failure at any single step can break the entire task chain.

    So when evaluating base models for Agents, the focus should be on whether the model can reliably complete a full task chain—not on the textual quality of any single response.

    Enabling Valid Comparisons with Controlled Variables

    The prerequisite for a fair side-by-side comparison is that only one variable changes at a time. A common mistake in practice is swapping the model, prompts, tool versions, and memory contents all at once—which makes it impossible to attribute performance differences to any specific change.

    Keep the following fixed, and only swap the model identifier and its corresponding endpoint:

    • The Agent framework version
    • Long-term memory contents and indexing
    • Skill file contents and loading paths
    • System prompts and permission configuration
    • The available tool set and their return formats
    • Generation parameters such as reasoning level (where supported by each model)

    Here is a sample configuration. Multiple candidate instances are generated from the same base config, differing only in model-related fields:

    1. base:
    2. memory_snapshot: ./snapshots/memory_v1
    3. skills_dir: ./skills
    4. system_prompt_file: ./prompts/agent_system.md
    5. tools: [file_read, file_write, shell_exec, http_get]
    6. approval_policy: ask_on_high_risk
    7. reasoning_level: high # a unified field defined by the test framework
    8. candidates:
    9. - name: model_a
    10. endpoint: ${MODEL_A_ENDPOINT}
    11. api_key_env: MODEL_A_KEY
    12. - name: model_b
    13. endpoint: ${MODEL_B_ENDPOINT}
    14. api_key_env: MODEL_B_KEY

    API keys should be injected via environment variables, never written into config files or logs.

    Evaluation Dimensions

    3.1 Skill Identification and Loading

    Check whether the model can locate the correct skill file based on the task description and execute the steps within it. Three things should be recorded when judging this: whether the right skill was matched, whether all steps were completed, and whether any steps were skipped or fabricated.

    3.2 Tool Call Accuracy

    Track whether tool names are correct, whether required parameters are present, whether parameter types are valid, and whether the number of calls matches what the task requires. Use JSON Schema for machine validation of parameters, and classify results into four categories: successful call, parameter error, wrong tool name, and required call not made. Once classified, teams can clearly see where the problems concentrate.

    3.3 Confirmation for High-Risk Actions

    Operations such as deleting files, changing permissions, sending external messages, or running deployments should trigger human confirmation. During testing, construct a set of high-risk instructions and record whether the model requests confirmation before executing them.

    The engineering principle here: confirmation must be enforced at the framework layer, not left to the model’s own judgment. The model’s behavior is a useful signal, but the actual safety boundary should be guaranteed by permission policies and executor-level interception.

    3.4 Long-Task Stability

    Record the number of interruptions, timeouts, and retries, and whether the model forgets earlier constraints as the context grows. For tasks spanning dozens of steps, constraint forgetting often reveals more problems than single-step accuracy does.

    3.5 Token Consumption and Unit Success Cost

    Count input, output, and reasoning tokens separately for the same task. Comparing unit prices alone can be misleading, because a cheaper model may need many more turns to finish a task. A more meaningful metric is unit success cost:

    Unit success cost = total cost of all tasks ÷ number of successfully completed tasks

    Note that the denominator counts only successful tasks, while the numerator includes the cost consumed by failed ones. This reflects a model’s real production expense.

    3.6 The Impact of Reasoning Levels

    For the same model, accuracy and token consumption across reasoning levels are usually not linearly related. Raising the level may bring a clear quality boost—or may only add cost. Run the full suite at every level, plot the accuracy-versus-cost curve, and then choose the default level, rather than simply picking the highest one.

    Sample Test Script Structure

    The following code shows one way to structure results. The runner must be implemented against your own framework.

    1. import json
    2. from dataclasses import dataclass, field, asdict
    3. @dataclass
    4. class RunResult:
    5. model: str
    6. task_id: str
    7. success: bool = False
    8. tool_calls: int = 0
    9. tool_errors: int = 0
    10. skill_hit: bool = False
    11. asked_confirmation: bool = False
    12. tokens_in: int = 0
    13. tokens_out: int = 0
    14. notes: list = field(default_factory=list)
    15. def evaluate(model_name, task, runner):
    16. trace = runner.run(model=model_name, prompt=task["prompt"])
    17. result = RunResult(model=model_name, task_id=task["id"])
    18. result.tool_calls = len(trace.tool_calls)
    19. result.tool_errors = sum(1 for c in trace.tool_calls if c.error)
    20. result.skill_hit = task["expected_skill"] in trace.loaded_skills
    21. result.asked_confirmation = trace.confirmation_requested
    22. result.tokens_in = trace.usage.input_tokens
    23. result.tokens_out = trace.usage.output_tokens
    24. result.success = task["checker"](trace) # executable result-checking function
    25. return result
    26. def unit_success_cost(results, price_per_token):
    27. total_cost = sum((r.tokens_in + r.tokens_out) * price_per_token for r in results)
    28. successes = sum(1 for r in results if r.success)
    29. return total_cost / successes if successes else float("inf")
    30. def export_report(results, path):
    31. with open(path, "w", encoding="utf-8") as f:
    32. json.dump([asdict(r) for r in results], f, ensure_ascii=False, indent=2)

    Save the full trace of every run for later review. For large volumes, write traces to object storage and organize them by model, date, and task ID.

    Interpreting Results: What to Watch For

    • Use a sufficient sample size. A single run of one task may differ only due to random noise. Repeat key tasks multiple times and report both the mean and the variance.
    • Group results by task type. A model that performs well on code-editing tasks won’t necessarily do well on file organization or information retrieval. Aggregate scores hide these differences.
    • Separate capability issues from adaptation issues. Classify failure causes. If the model’s output format doesn’t match the framework’s parsing conventions, the problem is in the adaptation layer; if the model misunderstands the task objective, the problem is model capability. The two require different fixes.

    Framework–Model Compatibility

    Agent frameworks typically parse model outputs according to specific conventions. When a model’s output structure, tags, or call format doesn’t match what the framework expects, the symptoms often include failed skill identification, malformed tool calls, or a skipped confirmation flow. These symptoms don’t necessarily mean the model is weak—they may indicate that the adaptation layer lacks validation and fault tolerance.

    Recommended mitigations:

    1. Write format validators for model output, and automatically retry or repair when the format is invalid.
    2. Apply Schema validation to tool call parameters, and return clear error messages on failure so the model can correct itself.
    3. Enforce interception of high-risk actions at the executor layer—no execution without confirmation.
    4. When community reports or isolated cases surface, reproduce them in your own environment first before factoring them into selection decisions.

    Selection Recommendations

    1. Set priorities by scenario. For high-risk automation, prioritize the reliability of confirmation mechanisms and permission isolation; for batch, low-risk workloads, prioritize unit success cost.
    2. Keep models swappable. Wrap model calls behind a unified interface layer so that switching models only requires config changes, reducing migration cost.
    3. Establish a regular re-testing process. Model versions update frequently, and yesterday’s conclusion can quickly become stale. Re-run the same test suite after every version change.
    4. Turn results into baselines. Archive test sets, config snapshots, and evaluation reports so that future selections can be compared directly against historical results.

    In summary, model selection for Agent scenarios must rest on controlled variables and be judged across multiple dimensions: skill loading, tool calling, high-risk confirmation, long-task stability, and unit success cost. Conclusions should be based on your own task sets and reproducible data—not on one-off impressions or scattered anecdotes.