Evaluating LLM Vulnerability Discovery: Benchmark Design, Metrics, and Cost Practices
This article breaks down a large-scale benchmark that consumed roughly 11.7 billion tokens to compare mainstream LLMs on real vulnerability identification tasks. It explains how to design contamination-resistant evaluations, why pooled recall alone is misleading, and which metrics—first-shot recall, stable hits, and cost per stable hit—better predict production reliability. It also covers capability boundaries, reproducibility requirements, and a four-step approach for integrating model evaluation into code audit and security workflows.
1. Why a “10-Billion-Token” Benchmark Matters to Developers
A cloud vendor’s security team recently published a large-scale model capability benchmark that consumed roughly 11.7 billion tokens to compare more than a dozen mainstream LLMs on real vulnerability identification tasks. Such an investment is unrealistic for most teams, but the methodology behind it is highly valuable: model comparison is shifting from “single-turn question-answering accuracy” to a three-dimensional evaluation of long-horizon exploration, statistical stability, and return per unit cost.
For developers and security teams, the real pain point is not “which model ranks first,” but rather: under a limited budget, how do you decide whether a model is worth integrating into code auditing, dependency governance, secret scanning, and similar workflows? Using that report as background material, this article strips away product-specific details and abstracts a general-purpose evaluation and adoption methodology.
2. Benchmark Design: Preventing Models from “Reciting Answers”
The first principle of a high-quality benchmark is preventing data contamination. The report selected 32 cases from recently disclosed real vulnerabilities and required models to locate the issues within real code repositories. This design reflects three considerations:
- Timeliness: Newly disclosed vulnerabilities are unlikely to be covered by training corpora, reducing memory-based answering.
- Realism: Real repositories contain noise, legacy baggage, and similar patterns, making them closer to production environments than hand-crafted toy samples.
- Verifiability: Each case has a clear ground truth, enabling automated scoring.
The evaluation loop logic is shown below (pseudocode):
for model in models:for case in cases: # 32 real vulnerability casesfor run in range(3): # repeat each case 3 timestrace = model.explore(repo=case.repo, max_turns=30, internet=False)hits[model][case] |= trace.found(case.ground_truth)
Key constraints include: 3 runs per model per case, at most 30 exploration turns per run, and no internet access. Disabling internet access is necessary; otherwise, models may directly retrieve vulnerability disclosure pages, invalidating the evaluation.
3. Core Metrics: Look Beyond Recall to Stability
The most easily misread point in the report is that “ranking first in pooled recall” does not mean “strongest.” Take a reasoning-oriented model as an example: it hit 28/32 across three pooled runs, ranking first; however, its first run hit only 17 cases, and only 10 cases were hit in all three runs. This indicates extremely high variance in its capability distribution: very strong when it succeeds, and nearly failing everything when it does not.
Four metrics are therefore recommended to characterize performance together:
- Pooled Recall: The union hit rate across three runs, measuring the “capability ceiling.”
- First-shot Recall: The single-run hit rate, measuring “out-of-the-box usability.”
- Stable Hit: The number of cases hit in all three runs, measuring “reliability.”
- Cost per Stable Hit: Incorporating price into the denominator, measuring “cost-effectiveness.”
A practical decision rule is: if two models have similar pooled recall, but A’s stable hits are twice those of B, then A is more suitable for an automated pipeline, because pipelines cannot tolerate the randomness of “sometimes good, sometimes bad.”
4. The Cost Dimension: What a 70% Cheaper Tie Means
Another conclusion in the report is that a domestic open-source model’s official release achieved 25/32 recall, only one case behind the leader, at roughly 69.8% lower cost. From an engineering perspective, this result matters more than the top rank itself:
- Budget flexibility: With the same budget, the number of repeated samples can be increased from 3 to 8–10, trading sampling redundancy for recall stability.
- Scalability: Code auditing is a high-frequency, full-repository, continuously triggered task; unit cost determines whether you can “scan everything” rather than “sample-scan.”
- Private deployment friendliness: Open-weight models can be deployed in your own environment, meeting security requirements that code must not leave your domain.
The following strategy can be used in engineering to trade off cost and benefit:
def choose_model(cases, budget):# Under a budget constraint, prioritize maximizing "stable hits per dollar"ranked = sorted(models, key=lambda m: m.stable_hits / m.price_per_run, reverse=True)for m in ranked:runs = budget // m.price_per_runif runs >= len(cases) * 3:return m, runsreturn ranked[0], budget // ranked[0].price_per_run
5. Capability Boundaries: What the Report Did Not Cover Also Matters
The evaluation explicitly did not include higher capability tiers or models with more recent cutoff dates, meaning the conclusions are time-sensitive and cannot be extrapolated into a “permanent ranking.” When building your own evaluation, developers should note three boundary declarations: the list of evaluated models and version snapshots, the evaluation time window, and uncovered capability tiers. Without these three items, the reproducibility of the report drops significantly.
6. Adoption Advice: Integrating Evaluation into the Development Workflow
To reuse this methodology in your own code repositories, a four-step approach is recommended:
- Build an internal benchmark set: Select 20–50 cases from historically fixed vulnerabilities, de-identify them, and freeze them, updating regularly to prevent contamination.
- Dual-metric gating: In CI, track both first-shot recall and stable hits simultaneously; alert if either falls below a threshold, avoiding “good-looking averages but poor experience.”
- Tiered scheduling: Use low-cost models for full scans of low-risk repositories, and high-capability models with multiple sampling votes for high-risk or core modules.
- Observability: Integrate logging and monitoring/alerting services to record token consumption, hit paths, and failure reasons for each exploration turn, forming a data loop for continuous optimization.
When implementing on the cloud, you can combine general-purpose capabilities such as object storage (for storing de-identified samples and evaluation reports), container platforms (for isolating model inference and scanning tasks), message queues (for peak shaving and batch task scheduling), and logging and monitoring services (for cost attribution and stability observation), without binding to any vendor’s proprietary interfaces.
7. Conclusion
The real lesson from the “11.7-billion-token test” is not that a particular model won, but a shift in evaluation paradigm: vulnerability discovery capability must be measured jointly by multi-run sampling, stable hits, and unit cost. For teams, the most reliable path is to build their own small-scale, sustainable, contamination-resistant benchmark, using stability rather than peak performance as the selection criterion, so that LLMs can truly integrate into the security development workflow.
