The Metric Trap in LLM Cybersecurity Benchmarks

    A large-scale cybersecurity benchmark consumed roughly 11.7 billion tokens across multiple mainstream LLMs, yet its most important finding was not which model ranked first. It was that the same models can swap rankings entirely depending on how repeated samples are aggregated. This article breaks down single-run, pooled, and stable recall, explains why long-tail security tasks produce high variance, converts inference cost into cost per effective hit, and outlines a five-step evaluation framework with layered routing for reliable LLM security analysis under budget constraints.

    1. Where the Problem Started: What a 11.7-Billion-Token Benchmark Revealed

    A recent large-scale cybersecurity capability benchmark consumed about 11.7 billion tokens across several mainstream LLMs, running multiple rounds of repeated sampling on vulnerability and risk-clue identification tasks. The value of this kind of benchmark is not “who came first.” It exposed a long-overlooked problem: the same set of models can produce completely reversed rankings when scored under different statistical definitions.

    Two highly counterintuitive observations stood out in the raw results:

    • One model had the highest recall under a three-run pooled definition, at 28/32, ahead of other frontier models (25–26/32). But its first-pass result was only 17/32, and only 10 samples were hit in all three runs.
    • An open-source, self-deployable model scored 25/32 in its official release, just one sample behind the strongest model, while inference cost was about 69.8% lower.

    Together, these two points lead to one conclusion: recall is an extremely sampling-sensitive metric, and quoting recall without variance has no engineering meaning.

    2. Breaking Down the Metrics: Pooled, Single-Run, and Stable Recall

    Assume the evaluation set contains N=32 known risk points, and the model samples independently K=3 times. Three definitions are commonly used:

    1. Single-run recall = hits in one round / N (performance of a single pass)
    2. Pooled recall = union of hits / N (union across three runs)
    3. Stable recall = intersection of hits / N (hit in all three runs)

    The mathematical relationship between the three is the key. Pooled recall increases monotonically with K: the larger K is, the better it looks. But it measures a “theoretical ceiling,” meaning “run it a few more times and it will eventually hit.” Stable recall measures “reproducible, deterministic capability,” which is what production environments actually depend on.

    A quantitative walkthrough with the raw data: pooled 28, first pass 17, stable 10. More rigorously, let the hit sets of the three runs be A, B, and C, so |A∪B∪C|=28, |A∩B∩C|=10, and |A|=17. This implies that 18 samples were “non-stable hits,” hitting in some runs and missing in others. Nearly two-thirds of the hits came from luck rather than capability.

    3. Why LLMs Show Such High Variance on Security Tasks

    Cybersecurity analysis is a classic “long-tail plus weak-signal” task: evidence is scattered across logs, configurations, dependency manifests, and call chains, and it requires multi-hop reasoning. Sampling temperature, how context is organized, and the order in which evidence is presented can all significantly change the output. The sources of variance fall into four categories:

    1. Sampling randomness: with a non-zero temperature, the same prompt produces different conclusions across runs.
    2. Context truncation: overly long context gets cut off, and critical evidence is lost.
    3. Prompt sensitivity: slight changes in question wording or field order can flip the conclusion.
    4. Task ambiguity: evaluation samples themselves admit multiple reasonable interpretations, so the judging standard is not unique.

    Therefore, any single benchmark run should be treated as one sample draw, not a capability measurement.

    4. Cost Efficiency: Turning “69.8% Cheaper” into a Decision-Ready Number

    Looking at unit price alone leads to misjudgment. Introduce cost per effective hit:

    1. Cost efficiency = single-run inference cost / stable recall

    If a model’s unit price is only 30.2% of a frontier model’s, with a stable recall of 10/32, while the frontier model’s stable recall is assumed to be 12/32, the cost per effective hit may still be lower. A more practical engineering approach is layered routing: use a low-cost model to screen the full volume, and use a high-capability model only to re-check high-risk samples.

    1. def route(sample, cheap, strong, risk_threshold=0.7):
    2. r1 = cheap.analyze(sample) # full-volume initial screening
    3. if r1.risk_score < risk_threshold:
    4. return r1 # low risk, pass through directly
    5. r2 = strong.analyze(sample) # high risk, second review
    6. return merge(r1, r2) # merge evidence and conclusions

    This structure can pull effective recall back close to frontier levels while keeping total cost near the low-cost option.

    5. A Reusable Evaluation Framework: The Five-Step Method

    1. Fix the evaluation set and judging standard: define a single ground truth for each risk point and remove ambiguous samples.
    2. Sample multiple rounds and record the distribution: use at least K=3, and output all three metric sets (single-run, pooled, stable).
    3. Report variance, not the mean: provide the standard deviation and confidence interval of hit counts.
    4. Add a cost dimension: use cost per effective hit as the final ranking criterion.
    5. Run ablation studies: vary temperature, context length, and evidence order separately to locate the sources of variance.

    Illustrative summary table structure:

    Model tier Single-run recall Pooled recall Stable recall Relative cost Cost per effective hit
    Frontier closed-source 17–20 25–28 10–12 100% High
    Open-source self-hosted 14–18 25 8–10 30.2% Low

    6. Practical Recommendations

    • Do not make procurement decisions based on leaderboard pooled values; always request stable recall and variance data.
    • Build a small internal evaluation set first, covering the real risk patterns of your own tech stack.
    • Use multi-model voting: take the majority conclusion across three samples to significantly improve consistency.
    • Preserve the evidence chain: require the model to output its localization basis, making manual review and auditing easier.
    • Keep cost elastic: run inference services on a container platform, with logging services and monitoring alerts for quality tracking, object storage for evaluation samples and results, and a message queue for peak shaving.

    7. Conclusion

    “First in pooled recall” and “poor stability” are not contradictory; they are two sides of the same model under different statistical definitions. What truly determines the ceiling of security capability is stable recall and variance, while what determines whether it can scale into production is cost per effective hit. Upgrading evaluation from “run once and read the score” to “multi-round sampling + variance reporting + cost conversion + layered routing” is how you build a reliable LLM security analysis pipeline under budget constraints.