Benchmarking LLMs Under a Unified Toolchain: Methods and Practices

    This guide explains how to run fair horizontal comparisons of large language models by holding everything except the model constant. It covers the four layers of an evaluation framework, a standard procedure for onboarding models, principles for controlling variables, task set design, metric definitions, common sources of bias, and how to read and report results.

    1. Why a Unified Evaluation Environment Is Needed

    Horizontal model evaluations often suffer from too many variables. Differences in model capability get mixed up with toolchains, prompts, run modes, and timeout settings, so the conclusions often cannot be attributed to a specific cause. When two runs produce different results, teams struggle to tell whether the model itself changed or whether a configuration was quietly modified.

    The first principle of evaluation, therefore, is to make the model the only variable. The framework should provide a single, unified entry point. Every model under comparison completes the same task under the same conditions and leaves a traceable record.

    2. The Four Components of an Evaluation Framework

    A practical evaluation framework usually includes the following four layers.

    1. Model access layer: Manages model providers, access credentials, and model identifiers. It normalizes models from different sources into one calling convention.
    2. Agent runtime layer: Runs the task loop, including model inference, tool calls, result handling, and termination decisions. The run mode must be fixed. For example, every model should use standard mode, and no individual model should switch to another mode.
    3. Skills and tools layer: Provides general capabilities such as web search, documentation lookup, code execution, and file reading and writing. All models should access the same set of tools, and tool versions should be pinned.
    4. Recording layer: Stores the complete log of each run, the generated artifacts, latency, token usage, and failure reasons. Without a complete record, analysis and reproduction are not possible.

    If any one of these four layers is not unified, the conclusions will be affected.

    3. Standard Steps for Onboarding a Model

    Onboarding a new model usually takes only a few steps, but each step has details that need attention.

    1. Add the model provider in the framework’s settings page, and select the matching provider type.
    2. Enter the access credentials. Inject credentials through environment variables or a secrets management service. Do not write them into configuration files, and do not let them appear in logs.
    3. Try to fetch the list of available models. A newly released model may not be discovered automatically, in which case register the model identifier manually. The model identifier must match the name in the provider’s documentation exactly.
    4. Send a minimal test request to confirm that connectivity, authentication, and the response format all work.

    The access configuration can be described with the following structure, which makes it easier to version and reuse:

    1. providers:
    2. - id: provider-a
    3. type: standard-compatible
    4. api_key_env: PROVIDER_A_KEY
    5. base_url: https://api.example.com/v1
    6. models:
    7. - name: model-x-latest
    8. enabled: true
    9. - name: model-y-latest
    10. enabled: true

    The configuration references only the name of the environment variable that holds the key. It does not store the key value.

    4. Principles for Controlling Variables

    Controlling variables is the core of horizontal evaluation. Variables fall into three categories.

    Fixed variables include the run mode, the tool set, the full prompt text, the task input, the timeout, the retry count, and the output format requirements. These must be identical across all models, and the report should list each one.

    The only independent variable is the model under test.

    Reasoning effort parameters need special attention. Each provider defines reasoning levels differently, so using one value everywhere does not necessarily produce equivalent settings. There are two common approaches. The first uses each provider’s default level and notes this in the report. The second compares models at the same semantic level and explains how the levels were mapped. Both approaches are valid. What matters is documenting the choice clearly.

    The evaluation should also run fully automatically from start to finish. If evaluators change prompts midway, correct errors by hand, or supply missing information to a model, they contaminate the results. If an intervention is unavoidable, record its time and content, and mark that run separately.

    Finally, a single run is subject to chance. The same model may give different answers to the same task. Run each task set multiple times, and report the distribution of results instead of relying on one result.

    5. Designing the Task Set

    The task set determines what the evaluation can show. If only one type of question is used, the conclusions apply only to that type. Cover the following categories.

    • Code generation: Write runnable functions or modules from a requirement description. Use the unit test pass rate as the acceptance criterion.
    • Bug fixing: Provide code that contains an error along with a failing test, and ask the model to locate and fix the problem.
    • Information retrieval and summarization: Ask the model to gather information with a search tool and produce a summary with sources. Score the results on factual accuracy and source completeness.
    • Multi-step document analysis: Provide a set of long documents, and ask the model to extract information step by step, compare differences, and produce structured conclusions.

    Each category should have clear acceptance criteria. Use test scripts to judge tasks that can be verified automatically. For tasks that are hard to automate, create a scoring rubric, and have at least two reviewers score independently.

    Task descriptions can be stored in a uniform structure for reuse and traceability:

    1. task_id: code-gen-003
    2. category: 代码生成
    3. prompt_version: v1.2
    4. input_files: [spec.md, fixtures/]
    5. acceptance:
    6. type: automated
    7. script: tests/run_code_gen_003.sh
    8. timeout_seconds: 900

    Update the task set regularly. Public evaluation questions may already appear in model training data. Keep a portion of private questions, and rotate them periodically.

    6. Metric Collection and Definitions

    Define metrics before the evaluation begins. Choosing metrics after seeing the results introduces subjective bias. The common metrics are listed below.

    Metric Definition Purpose
    Completion rate Share of tasks that produce a final result before the timeout Measures stability
    Acceptance pass rate Share of tasks that pass automated tests or the scoring rubric Measures correctness
    Tool call count Average number of tool calls per task Measures execution efficiency
    End-to-end latency Time from task submission to output Measures response speed
    Token usage Total input and output tokens Measures cost
    Failure classification Timeouts, tool errors, format errors, wrong results, and similar categories Identifies weaknesses

    Failure classification is the most valuable of these metrics. Two models can have the same pass rate for entirely different reasons. One model may time out frequently, while another may return wrong results without reporting an error. The risks of using these two models differ greatly.

    7. Common Biases and How to Investigate Them

    Several kinds of bias appear often in practice.

    1. Skill directory drift: If the set of locally installed skills changes during testing, different models may end up using different tools. Check the version and hash of the skill directory before each test.
    2. Network fluctuation: A timeout may come from the network or from the model’s own latency. Log connection errors and model response timeouts separately, and count them separately.
    3. Prompt version drift: If a prompt is modified during testing, results from before and after the change cannot be compared. Manage prompts with version numbers, and record the version used in each run.
    4. Unclear model version: An alias in a model identifier may point to different underlying versions over time. Record the actual version information returned by the API. If the API does not return it, record the test date instead.
    5. Evaluation set leakage: Public questions may appear in training data, which inflates results. Cross-check results using private questions and rewritten questions.

    The basic approach to investigation is to first make the experiment reproducible, then discuss the results. When any result looks abnormal, check these variables in the logs first.

    8. Interpreting Results and Writing the Report

    A single overall score does not explain much. Report results by task category, and include distributions, failure classifications, and resource consumption.

    The report should include the experiment environment and version inventory, a description of fixed and independent variables, the composition of the task set, a metrics table for each task category, representative failure cases, and known limitations. The limitations section matters most. Examples include small sample sizes, task categories without automated verification, and reasoning levels that could not be fully aligned. These notes help readers judge the scope of the conclusions.

    When interpreting results, distinguish statistically meaningful differences from practically meaningful ones. A two-point difference in pass rate may not matter in real use. Judge the difference against the variation observed across repeated runs.

    9. Practical Recommendations

    • Write down your assumptions and pass/fail criteria before running the evaluation.
    • Keep the framework configuration, prompts, and task set under version control.
    • Retain complete raw logs for every evaluation so results can be reviewed later.
    • Make evaluation a routine process, rerun it regularly, and track how model capability changes across versions.
    • When evaluation results inform model selection, weigh cost, latency, stability, and data compliance requirements together. Do not rely on a single score.

    A unified evaluation environment costs little to set up, but it substantially improves the credibility of comparison conclusions. Teams selecting models or building internal benchmarks should put variable control and recording mechanisms in place first.