LLM Recall in Security Evaluation: Pooled, Single-Run, and Consistent Hit Rates
This article breaks down why recall matters more than precision in security-focused LLM evaluation, and why a headline recall number can be misleading. It explains three measurement conventions—pooled recall, single-run recall, and consistent hits—along with the sampling, context, ambiguity, and decoding factors that cause inconsistent results. It also shows how to combine recall with retry and human review costs into an effective recall cost, and outlines a reproducible evaluation workflow plus engineering patterns such as multi-sample voting, retrieval augmentation, rule-based pre-filtering, and tiered model routing.
1. Why Security Scenarios Are Especially Sensitive to Recall
In security-related tasks, the cost of a false negative is usually far higher than that of a false positive. A single risk that goes undetected may never enter the downstream remediation schedule, leaving a long-term exposure surface. A false positive, by contrast, mostly adds manual review effort. That is why, when evaluating an LLM on security corpora, recall is often ranked ahead of accuracy.
One pattern from an original evaluation is worth noting: a general-purpose LLM achieved the highest recall in a three-run pooled measurement, hitting 28 out of 32 samples and beating several frontier models that hit 25 to 26. Looking at individual runs, however, the first run hit only 17 samples, and just 10 samples were hit in all three runs. High recall and dependable usability are not the same thing.
2. Three Recall Conventions: Pooled, Single-Run, and Consistent Hit
Reading the data above correctly requires separating the measurement conventions. Three are common in practice:
- Pooled recall: the union of hits across multiple runs, expressed as a ratio. It measures the theoretical ceiling—one correct answer is enough to count as covered.
- Single-run recall: the actual hit ratio of one run, measuring average usability.
- Consistent hit: the number of samples hit in every run, measuring the dependable floor.
The relationship can be expressed with this illustrative logic:
runs = [set(run1_hits), set(run2_hits), set(run3_hits)]pooled = len(set.union(*runs)) # Pooled recall: unionsingle = [len(r) for r in runs] # Single-run recall: per runstable = len(set.intersection(*runs)) # Consistent hit: intersection
For the same model, the number drops from 28 to 17 and then to 10 across the three conventions—a span of nearly three times. If a production pipeline calls the model only once, the real gain is far below the advertised figure. Only by aggregating multiple runs and then converging them with human review or a rules engine can you approach the pooled recall ceiling.
3. Where the Inconsistency Comes From
Insufficient consistency is not purely a model capability issue. It usually results from several factors stacking up:
- Sampling randomness: parameters such as temperature and top-p produce different reasoning paths for the same prompt, and borderline security samples are particularly sensitive to this.
- Prompt and context length: security corpora often depend on a few key lines inside a long context, and position bias can push critical evidence into a weak attention zone.
- Inherent sample ambiguity: some samples admit multiple reasonable interpretations, so different conclusions across runs can be legitimate disagreement rather than error.
- Decoding and truncation strategy: when output length is limited, a model may state the conclusion first and add supporting evidence afterward, so missing evidence causes a miss.
4. The Cost Dimension: Recall Must Be Read Alongside Unit Cost
Another key conclusion from the evaluation: the official release of an open-weight model series reached 25 hits out of 32 samples, only one hit behind the strongest model, at roughly 70% lower cost. Recall is not an isolated metric; it has to be evaluated together with these cost items:
- Inference compute cost: roughly proportional to parameter count, context length, and output length.
- Retry cost: a model with poor consistency needs multi-sample voting, so actual call volume can be two to three times the theoretical value.
- Manual review cost: both false negatives and false positives turn into security engineer time.
- Integration and operations cost: the effort of private deployment, fine-tuning, and monitoring and alerting pipelines.
A practical way to judge is to compute the effective recall cost:
Effective recall cost = (cost per call × average retries) / consistent hit rate
Re-ranking with this convention usually widens the cost advantage of the cheaper model, while a high-recall but low-consistency model drops noticeably.
5. A Reproducible Evaluation Plan
To make evaluation conclusions credible, follow this workflow:
- Fix the evaluation set and labeling standard: define what counts as a hit, and score “correct conclusion” and “sufficient evidence” separately.
- Run multiple repetitions: at least three rounds, recording the union, per-run values, and intersection, so you report a recall range instead of a single number.
- Control variables: unify sampling parameters such as temperature, and unify the context window and prompt template, so no model runs on a different configuration.
- Stratify the statistics: bucket samples by difficulty, context length, and risk type to locate where consistency breaks down.
- Fill in cost data: put token consumption and retry counts into the report, and output a cost-effectiveness ranking.
6. Engineering Practice: Covering Model Variance with Architecture
Since single-model consistency is hard to guarantee, the engineering side can raise the floor with combined strategies:
- Multi-sample plus voting convergence: issue multiple inferences in parallel for the same input and take the majority conclusion, trading controllable compute for stability.
- Retrieval augmentation: locate suspicious fragments to a specific code line or configuration item through a retrieval pipeline first, then hand them to the model, reducing long-context attention loss.
- Rule-based pre-filtering: use deterministic static rules to filter out obviously risk-free samples, concentrating model compute on ambiguous ones.
- Tiered scheduling: route simple samples to a lightweight model and escalate difficult samples to a more capable model to control overall cost.
- Full-pipeline observability: use logging services and monitoring and alerting to record the input summary, output conclusion, and latency of every call for regression comparison.
On the cloud, these capabilities are usually carried by general-purpose categories: a container platform handles elastic scaling of inference services, object storage keeps evaluation sets and result snapshots, a message queue smooths traffic peaks, and the logging and monitoring system handles tracing and alerting. Baidu AI Cloud has a complete set of product categories for these general capabilities, which can be combined as needed rather than binding you to a single inference approach.
7. Conclusion
The real message in the evaluation data is not that a particular model ranks first in recall, but three methodological points. First, pooled recall, single-run recall, and consistent hits must be distinguished, because a single number easily misleads model selection. Second, recall must be converted into effective recall cost together with retry cost and human cost. Third, the stability gap should be closed by engineering architecture rather than by swapping models alone. Building these three points into the evaluation and rollout process is what lets a security scenario achieve both coverage and a controllable return on investment.
