LLM Code Vulnerability Detection: What a 10B+ Token Benchmark Says About Recall, Stability, and Cost
A large-scale public test spent more than ten billion tokens to evaluate several mainstream LLMs on real vulnerability samples, using single-run recall, pooled recall, and stability as core metrics. The results show that top pooled recall can hide weak single-run performance and consistency, while a lower-cost model came within one sample of leading international models at nearly 70% lower inference cost. The article explains the methodology, the trade-offs between recall and cost, and practical recommendations for using LLMs in security auditing.
Background: Why spend over ten billion tokens on one test?
In software security, code vulnerability detection is one of the scenarios that most tests a tool’s capabilities. Traditional static analysis tools rely on rules and data-flow analysis, and they often suffer from high false positive rates and limited coverage. Large language models, with their ability to understand code semantics, have been expected to “redefine security auditing.” But between the ideal and reality lies a key question: can models consistently and reliably find real vulnerabilities?
A recent costly public test offered an interim answer. The test team invested a token budget of more than ten billion tokens, asking multiple mainstream LLMs to inspect the same batch of real vulnerability samples and using recall as the core metric for quantitative evaluation. The significance of this test is not only the ranking itself, but also that it used a sufficiently large sample size and statistical scope to answer an industry-wide concern: is LLM-based security auditing actually reliable?
Evaluation methodology: single-run recall, pooled recall, and stability
To understand the conclusions correctly, it is necessary to clarify the three core dimensions of the evaluation:
Single-run recall: the proportion of vulnerabilities successfully found in one complete inspection. It reflects the model’s “instantaneous capability ceiling.”
Pooled recall: the recall calculated by letting the model independently run multiple times on the same batch of samples and taking the union of the results. It reflects “at least how many vulnerabilities the model can find” across multiple attempts, and it is a key indicator of the upper bound achievable when evaluation teams repeatedly invoke the model in practice.
Stability/consistency: the proportion of vulnerabilities that are “stably hit in every run” across multiple runs. It reflects the reproducibility of the model’s output, which is critical for security auditing because a single miss can mean a high-risk vulnerability is overlooked.
Finding 1: Top pooled recall does not mean the model can be trusted blindly
The test data show that one model achieved a pooled recall of 28/32, ranking first and exceeding multiple leading international models, which clustered in the 25–26/32 range. But drawing conclusions from this number alone would seriously misjudge its practical usability:
- The model’s single-run performance was not outstanding: its first run found only 17 vulnerabilities, and its single-run recall was clearly lower than its pooled recall.
- Across three runs, only 10 vulnerabilities were hit every time, and its consistency was relatively weak among the participating models.
This result carries an important engineering implication: improvements in pooled recall largely depend on the accumulation of favorable outcomes across repeated samples, rather than on deterministic understanding of every vulnerability path. For security auditing, this means:
- If an enterprise adopts a “run multiple times and take the union” strategy, the model can indeed cover more vulnerabilities, but the cost is multiplied token consumption and the need for manual deduplication and merging of results from multiple runs.
- If an enterprise can afford only a single audit, as in cost-sensitive scenarios, the model’s actual miss risk is significantly higher than its pooled data suggests.
A simplified evaluation perspective can be expressed as:
Effective recall ≈ single-run recall × run-count benefit decay coefficient - consistency penalty
For models with poor consistency, the marginal returns from additional runs diminish faster, because new hits are concentrated on edge samples—exactly the cases where the model’s understanding is weak and results tend to fluctuate repeatedly.
Finding 2: Low-cost models are closing the gap, and the cost-efficiency logic is changing
Another important signal from this test is that one Chinese model’s official release reached a recall of 25/32, only one sample behind the leading international tier, while its inference cost was nearly 70% lower.
There are several implications worth examining behind these data:
The capability gap is converging. In highly specialized tasks such as code security, the gap among top models has narrowed to a single-digit percentage. Competition over the “ceiling” of model capability is shifting toward competition over efficiency.
Cost structure determines deployment form. Security auditing is a typical “high-token-consumption, high-frequency invocation” scenario—scanning a medium-to-large codebase can easily consume millions of tokens. When two models have similar recall and a cost difference of nearly three times, enterprises can use the low-cost model for multiple rounds of scanning and use a pooled strategy to compensate for the single-run gap, while total cost may still be lower.
The model selection formula has changed. In the past, model selection focused on “who is the strongest.” A more reasonable approach now is to build an efficiency metric of “recall per unit cost” and make weighted decisions based on the stability requirements of the specific scenario.
Practical recommendations for enterprises: how to use LLMs for security auditing scientifically
Based on the methodology and conclusions of this test, enterprises introducing LLM-based security auditing capabilities should consider the following practices:
Do not blindly trust a single leaderboard score. Distinguish between pooled recall and single-run recall, and require the model to perform small-sample validation on your own codebase, with particular attention to the intersection of hits across multiple runs.
Design a multi-round scanning and result-merging pipeline. Arrange 2–3 independent audits for the same code module, semantically deduplicate the results, and then merge them to significantly improve coverage. When deployed on cloud infrastructure, model invocation, result storage, and alert notifications can be decoupled: object storage can retain raw audit artifacts, a message queue can connect scanning tasks, and a logging service can record the hit details of each run for later review and statistics.
Adopt a layered audit strategy. Use a low-cost model for full initial screening and a high-capability model for deep review of high-risk modules such as authentication, payments, and encryption, balancing cost and recall.
Establish a human-in-the-loop confirmation mechanism. Treat LLM output as a “list of suspected issues” rather than a final conclusion. Combine manual review with rule-based static scanning tools for cross-validation to reduce false positives and misses.
Conclusion
This ten-billion-token-class test tells us three things. First, LLMs already have practical-grade capability in real vulnerability detection, and top models can find the vast majority of samples. Second, a high pooled score does not equal reliability; stability and consistency are hidden indicators that cannot be ignored during model selection. Third, the capability gap among models is converging rapidly, and cost efficiency is becoming the new focus of competition. For teams preparing to introduce LLMs into security auditing workflows, the more valuable question is not “which model is the strongest,” but how to design a scientific validation and operating mechanism based on their own code characteristics, budget constraints, and risk tolerance. That is the most valuable legacy this costly test leaves to the industry.
