LLM Vulnerability Discovery Benchmark: A Methodology Review Based on 11.7 Billion Tokens

    This article breaks down a large-scale evaluation of LLM vulnerability discovery capabilities, covering the rationale for high-cost benchmarking, four key design constraints that keep results credible, and how to interpret pooled recall versus stable hit rate. It also offers practical guidance for enterprises adopting AI-driven security workflows, along with common pitfalls to avoid when selecting and deploying models.

    1. Why Run a High-Cost Model Security Evaluation?

    Before adopting large language models in security operations, the question teams ask most often is simple: can they actually find real vulnerabilities? Demo videos cannot answer that. Only a reproducible evaluation can. A real-world test consuming roughly 11.7 billion tokens is valuable not because of the size of the number, but because it answers three questions in an engineering-driven way: what is the upper limit of a model’s vulnerability discovery ability, how consistent is it, and is the cost per unit acceptable.

    Traditional vulnerability detection relies on rules and pattern matching. Its strengths are deterministic behavior and explainable results; its weakness is poor sensitivity to unknown variants and cross-file logic flaws. Introducing LLMs is not about replacing rules, but about filling the gap that requires understanding context before a judgment can be made. The objective function of the evaluation therefore has to change as well: it is not enough to measure whether a model can hit a target; you also need to measure consistency across repeated runs.

    2. Evaluation Design: Four Constraints That Make Results Trustworthy

    1. Use New Samples

    The samples are recently disclosed real vulnerabilities mapped into real code repository context. The core purpose is to reduce the chance that the model answers from memory. Training data has a knowledge cutoff, so newer samples better reflect genuine reasoning ability rather than recall.

    2. Replace Single Judgments with Repeated Runs

    Running each sample three times is the most overlooked yet most important part of the whole method. Vulnerability localization is exploratory, and model output is sensitive to prompts, retrieval order, and how full the context window is. Single-run variance is extremely high.

    3. Restrict External Access

    Network access is disabled so that conclusions come from the code and the model’s own knowledge rather than live vulnerability advisories retrieved on the fly. This step separates retrieval ability from analysis ability.

    4. Set an Exploration Budget

    Each run is capped at a maximum number of interaction turns (for example, 30), simulating the limited time and compute budget of real development scenarios and avoiding distorted results produced by unlimited trial and error.

    3. Reading the Metrics: Pooled Recall Is Not Stable Hit Rate

    The most notable finding for developers is this: one model ranked first in pooled recall across three runs (28 hits out of 32 samples), yet its first run hit only 17, and only 10 were hit in all three runs.

    This exposes two different metrics:

    • Pooled recall: the union of three runs, measuring the capability ceiling.
    • Stable hit rate: hit in all three runs, measuring how dependable the model is.

    Illustrative calculation logic:

    1. runs = [set(run1), set(run2), set(run3)]
    2. pooled = set().union(*runs) # capability ceiling
    3. stable = set.intersection(*runs) # stable hits
    4. print(len(pooled), len(stable))

    For engineering adoption, the stable hit rate usually matters more than the ceiling. Security workflows need repeatable conclusions, and a model that only “occasionally finds” issues is hard to embed directly in automated gates. It fits better as an assistive step in front of human review.

    Another finding worth noting: an open-source-oriented model’s general availability version missed only one sample compared with the top-ranked model, at significantly lower cost. In most enterprise scenarios, the cost-performance inflection point may fall outside the highest-scoring range. Model selection should therefore weigh budget and call frequency rather than chasing the top of a leaderboard.

    4. From Evaluation to Deployment: Practical Advice for Enterprises

    1. Use models in layers: assign high-frequency, low-complexity tasks such as code change review, dependency risk flagging, and secret leak screening to models, and leave complex logic flaws to experts.
    2. Run dual verification: for critical modules, use two independent runs and only auto-advance when the conclusions agree; route disagreements to humans.
    3. Make results explainable: require the model to output the vulnerability location, trigger path, and remediation advice so developers can verify quickly and avoid alert fatigue from black-box warnings.
    4. Make cost observable: use monitoring, alerting, and logging services to track token consumption and the hit conversion ratio, then decide the calling tier based on data.
    5. Isolate data and stay compliant: source code is a core asset and should be carried by container platforms and pipelines with access control and audit capabilities to prevent source code leakage.

    5. Common Pitfalls

    • Looking only at leaderboard rankings while ignoring variance.
    • Evaluating with old vulnerabilities, which overestimates real capability.
    • Treating model output directly as a conclusion without human confirmation.
    • Ignoring differences caused by prompts and context organization; the same model can perform noticeably differently under different engineering wrappers.

    6. Conclusion

    The real takeaway from this large-scale test is the methodology, not the rankings: build a trustworthy evaluation with new samples, repeated runs, network isolation, and budget caps, then characterize model capability with both pooled recall and stable hit rate. For development teams, general-purpose capabilities commonly offered by cloud providers such as Baidu AI Cloud (for example, logging services, monitoring and alerting, and container platforms) can serve as the infrastructure for running such evaluations and deployment workflows. The final basis for model selection should be the stable hit rate and unit cost that match your own code scale and risk tolerance.