How to Evaluate a New-Generation Open-Source LLM: Focus on Long-Horizon Engineering Tasks
Evaluating a new open-source large language model requires more than benchmark scores and leaderboard rankings. This article explains why engineering teams should shift their focus from raw model capability to real-world delivery, introduces four core metrics for assessing performance on long-horizon engineering tasks—first-attempt success rate, average tool calls, verifiable result ratio, and cost per successful task—and provides a practical framework for building reproducible evaluation pipelines, integrating and replacing models safely, and making sound adoption decisions.
- Start with the Purpose of Evaluation
When evaluating a new open-source LLM, the common approach is to look at leaderboard rankings, benchmark scores, and launch-day demos. These signals show how the model performs on specific test sets, but they rarely answer the question engineering teams care about most: once integrated, can it reduce manual intervention, and can it complete real tasks at an acceptable cost?
The evaluation mindset should therefore shift from “how strong is the model” to “how much usable output does the model produce on our tasks.” The former describes a capability ceiling; the latter describes delivery capability. Between the two lie task distribution, tooling, context quality, and failure-handling mechanisms—and the gap caused by these factors is often larger than the gap in any single benchmark score.
- The Real Challenges of Long-Horizon Engineering Tasks
Writing one correct function is only a small part of a programming task. Real engineering scenarios typically involve the following difficulties:
- Understanding legacy repositories. A codebase may have accumulated years of historical conventions, hidden dependencies, and incomplete documentation. The model must build a local understanding of the project through directory structure, call relationships, and existing tests.
- Cross-file changes. A single requirement may touch interface definitions, business logic, configuration files, and test cases simultaneously. Missing any one of them will break the build.
- Running and verifying. The model needs to execute tests, parse error stack traces, and determine whether a failure is caused by the code, the environment, or the test itself.
- Iterative correction. Every round of changes alters the context. If the model forgets earlier constraints, or keeps modifying the same spot, the task falls into a loop.
Long-horizon tasks are characterized by many steps and accumulating errors. A small deviation in step one may not surface until step ten. For this reason, the quality of a single response cannot represent overall performance—evaluation must be conducted at the level of complete tasks.
- Four Core Evaluation Metrics
The following four metrics measure how a model performs on engineering tasks. Each metric should be computed over the same batch of tasks in the same environment, so results are comparable.
3.1 First-Attempt Success Rate
Definition: the proportion of tasks that pass acceptance on the first attempt, with no additional prompts and no mid-task human correction.
Calculation: the number of first-attempt successes divided by the total number of tasks. Acceptance criteria should be defined in advance—for example, all relevant tests pass and no new static-analysis errors are introduced.
This metric comes closest to the meaning of “autonomous delivery.” The higher the value, the fewer interventions the team needs. Note that the first-attempt success rate is highly sensitive to task definition. The same model can score very differently on tasks with different levels of granularity, so task size should be kept consistent and noted in the report.
3.2 Average Number of Tool Calls
Definition: the mean number of tool calls required to complete a task. Tools include reading files, searching code, executing commands, and running tests.
This metric reflects exploration efficiency. A low call count does not necessarily indicate strong capability—it may mean the model gave up too early. A high call count may indicate repeated trial and error, wasting context and compute. Read this metric together with the first-attempt success rate: if two models have similar success rates, the one with fewer tool calls is usually faster and cheaper.
3.3 Verifiable Result Ratio
Definition: the proportion of outputs that can be backed by tests, logs, or structured checks.
Some models produce plausible-sounding change descriptions without providing verifiable evidence. This metric requires every “completed” conclusion to correspond to an objective record, such as a test exit code, captured test output, a list of changed files, or a structured check report. The more complete the evidence, the faster reviewers can judge whether the result is trustworthy, and the lower the review cost.
3.4 Total Cost per Successful Task
Definition: the total cost of completing all tasks, divided by the number of successful tasks. Total cost includes model inference fees, costs from failed retries, compute costs of the evaluation environment, and labor costs converted from human review time.
Judging by unit price alone is misleading. A cheaper model that needs multiple retries to succeed may end up costing more than a pricier model with a high one-shot success rate. When calculating, all costs from failed tasks must be included in the numerator.
The following sample code shows how to compute these four metrics from task logs. It is for illustrating the calculation logic only; field names can be adapted to your own log format.
from dataclasses import dataclass@dataclassclass TaskRecord:passed_first_try: bool # Whether the task passed acceptance on the first attempt without human interventiontool_calls: int # Number of tool callsverifiable: bool # Whether the result is backed by tests or logscost: float # Total cost of the task (including retries)success: bool # Whether the task ultimately passed acceptancedef summarize(records: list[TaskRecord]) -> dict:total = len(records)successes = [r for r in records if r.success]return {"first_try_success_rate": sum(r.passed_first_try for r in records) / total,"avg_tool_calls": sum(r.tool_calls for r in records) / total,"verifiable_ratio": sum(r.verifiable for r in records) / total,"cost_per_success": sum(r.cost for r in records) / max(len(successes), 1),}
- Building a Reproducible Evaluation Process
Once the metrics are defined, you still need a stable evaluation process. Otherwise, numbers collected at different times or in different environments cannot be compared.
- Build a task set. Sample from historical requirements, bug tickets, and refactoring tasks, covering different difficulty levels and modules. Each task must have explicit acceptance criteria, and sensitive data must be removed. A minimum of three tiers is recommended: bug fixes, incremental features, and cross-module refactoring.
- Fix the environment. Dependency versions, base runtime environment, test data, and timeouts must all be fixed. Environmental differences can cause significant variation in the same model’s performance.
- Control randomness. Use consistent sampling parameters, run each task multiple times, and record the distribution of results rather than a single run.
- Trust test results. Automated tests are the primary criterion. Human spot checks are used to catch cases where “tests pass but the implementation is unreasonable,” such as bypassing assertions or hardcoding return values.
- Record everything in a structured way. Log every tool call, every failure reason, and every retry for later analysis.
The evaluation set should also be refreshed regularly. If the same tasks are used for a long time, teams may optimize against them, driving scores up without any real capability improvement.
- Integration, Replacement, and Governance Design
Once evaluation passes, the next step is integration. A good integration design keeps the model replaceable and avoids coupling with business code.
- Unified interface layer. Place an adapter layer between the application and the model, encapsulating prompt templates, tool definitions, and response formats. Business code depends only on the adapter interface, so switching models requires only configuration changes.
- Configuration-driven switching. Keep model identifiers, sampling parameters, maximum output length, and timeout policies in configuration files under version control. Example:
agent:model: candidate-model-v2temperature: 0.2max_tool_calls: 30timeout_seconds: 600fallback_model: current-production-model
- Gradual rollout. Let the new model handle low-risk tasks first, such as documentation fixes and unit test additions, then expand the scope step by step. Compare against the baseline at each stage and proceed only after predefined metrics are met.
- Least-privilege access. Give the model only the minimal set of tools needed to complete its tasks. Write permissions should be restricted to specific directories or branches, and merges still require human approval.
- Secrets and sensitive information. Inject credentials via environment variables or a secrets management service—never into code, prompts, or logs. Code snippets sent to the model must pass a sanitization check.
Auditing and traceability. Save the input, tool call sequence, output, and acceptance result of every task so the team can diagnose problems when they occur.
A Decision Framework for Team Adoption
For most teams, the safest approach is to establish a baseline first, then run a small-scale pilot.
Step one: record metrics for the current solution. Whether it is manual development or an existing model, you need a comparable set of numbers as a reference.
Step two: set thresholds. For example, the first-attempt success rate must not fall below a certain ratio of the baseline, cost per successful task must stay within a budget cap, and the verifiable result ratio must reach an agreed level. Thresholds should be defined based on business risk rather than copied from generic standards.
