LLM Recall in Cybersecurity Evaluation: Why Pooled Recall Is Not Enough

    This article explains why a top pooled recall score does not prove a large language model is the most capable for cybersecurity evaluation. It defines pooled recall, per-run recall, and stable hits, shows how sampling randomness, context handling, and long-tail samples create large gaps between single-run and pooled results, and outlines engineering practices for trustworthy evaluation, including fixed datasets, repeated runs, controlled decoding, stratified metrics, and recall-first thresholds for model selection.

    1. The Starting Problem: Why “First in Recall” Does Not Mean “First in Capability”

    In cybersecurity scenarios, one of the core goals of evaluating a large language model (LLM) is to determine whether it can find all the risk clues hidden in large volumes of logs, alerts, code, and configurations. The source material presents a typical set of observations: a general-purpose LLM achieved a pooled recall of 28 across three runs on 32 preset samples, higher than the 25 to 26 of the comparison models. However, its first single-run recall was only 17, and only 10 samples were hit in all three runs.

    These numbers reveal a frequently overlooked fact: pooled recall measures “union capability,” meaning a sample counts as long as it is hit at least once across three attempts. What engineering deployment depends on, however, is “single-run reliability.” A model can accumulate a high score across multiple sampling rounds while still missing nearly half of the targets in any single real invocation. Therefore, an evaluation report must present pooled recall, the per-run recall distribution, and the stable hit count together to reflect real-world usability.

    2. Definitions and Calculation Methods for the Three Metrics

    To avoid ambiguity, the following definitions are recommended:

    • Pooled recall: the union of hit sets across multiple runs divided by the total number of samples.
    • Per-run recall: the number of hits in each independent run divided by the total number of samples; report the mean, minimum, and variance.
    • Stable hit: the number of samples hit in all runs, reflecting consistency.

    Illustrative statistical logic (language-agnostic pseudocode):

    1. runs = [run_eval(model, dataset) for _ in range(3)]
    2. pooled = union(runs) / len(dataset)
    3. per_run = [len(r) / len(dataset) for r in runs]
    4. stable = intersection(runs) / len(dataset)
    5. report(pooled, mean(per_run), min(per_run), stable)

    When pooled recall is 28/32, the first run is 17/32, and stable hits are 10/32, about 18 samples depend on “hitting only after multiple attempts,” and 8 of those appear only in the union, which are incidental hits. In production, such results would be treated directly as missed-detection risk.

    3. Why Single-Run and Pooled Results Differ So Much

    First, sampling randomness. Default decoding strategies amplify path branching in long-context reasoning tasks, so the same prompt may follow different analysis chains.

    Second, differences in context organization. Security analysis often requires repeated jumps among log fragments, call chains, and configuration items; small changes in retrieval and ranking can alter the model’s attention allocation.

    Third, drift in prompts and judgment criteria. If determining a “hit” relies on manual review, the completeness of the evidence chain triggered by different runs varies, which can easily produce borderline misjudgments.

    Fourth, the long tail of the task itself. The distribution of real risk samples is highly uneven; a few samples require cross-file correlation, and a single inference pass can hardly cover all clues.

    4. Engineering Practices for Trustworthy Evaluation

    1. Fix the evaluation set and annotation standards: for each sample, specify the “evidence points that must be hit,” distinguishing core evidence from supporting evidence.
    2. Run multiple independent evaluations and report the distribution: at least three runs, outputting the mean, minimum, variance, and stable hits.
    3. Control decoding and context: fix the random seed or use low-randomness decoding, and standardize the context window and the number of retrieved items.
    4. Use stratified statistics: group by sample difficulty and the number of cross-file evidence items, and observe the model’s decay curve across difficulty bands.
    5. Introduce a cost-sensitive perspective: security scenarios care more about missed detections, so a recall-first threshold can be used, with recall for high-risk samples tracked separately.

    5. Recommendations for Deployment

    If evaluation results are to be used for model selection, “stable hits” and the “minimum per-run recall” should be treated as hard thresholds, while pooled recall should serve only as a reference upper bound. In engineering, a workflow of “multiple sampling + result aggregation + manual review” can be adopted, using a message queue to handle batch tasks, object storage to retain raw evidence, and logging and monitoring services to track hit changes in each run. If an organization wants compute and platform support with a lower barrier to entry, it can build a reproducible evaluation pipeline using general-purpose container platforms and logging and monitoring capabilities offered by Baidu AI Cloud.

    6. Conclusion

    The value of recall evaluation lies not in producing a nice-looking union number, but in exposing the stability boundary of a model in real single invocations. Only by including pooled recall, the per-run distribution, and stable hits in the report together can LLM evaluation in cybersecurity move from “comparable scores” to “usable conclusions.”