Cybersecurity Model Evaluation: Recall, Stability, and Cost

    This article explains how to evaluate security models used for code auditing, vulnerability analysis, and security investigation. It breaks recall into three distinct metrics—single-run recall, multi-run aggregate recall, and stable hit ratio—and shows why a higher aggregate number does not automatically mean a stronger model. It also covers precision, false positives, report actionability, cost accounting on a consistent basis, and how to design a reproducible evaluation. Readers will learn how to turn evaluation numbers into reliable engineering decisions rather than a simple score display.

    1. Start by Defining What Was Actually Found

    When people use large models to assist with code auditing, vulnerability analysis, and security investigation, they usually look at one number first: how many issues the model found. But that number only becomes meaningful when the evaluation target, the matching criteria, and the execution budget are clearly defined.

    The source material presents a set of phenomena worth discussing: in a sample containing 32 target issues, three merged rounds covered 28 issues, but the first round alone found only 17, and only 10 were found in all three rounds. Another result emphasizes that a lower-cost approach can achieve recall close to that of a more expensive one.

    These figures are suitable for studying evaluation methodology, but they are not enough to directly derive the overall superiority of one model in an enterprise production environment. Because the complete test protocol, issue distribution, false-positive statistics, and cost breakdown are missing, this article treats these numbers only as analysis material for the given sample, and does not extend them into a product ranking or a universal performance conclusion.

    The technical question truly worth discussing is: how to distinguish coverage capability, repeat-run stability, and effective discovery per unit of cost.

    2. Three Recall Metrics Answer Three Different Questions

    2.1 Single-Run Recall: How Much One Execution Covers

    Let the confirmed set of target issues be G, and the set of issues correctly found in a given run be D. Single-run recall is:

    Recall = |D ∩ G| ÷ |G|

    Finding 17 of 32 target issues gives a single-run recall of about 53.1%.

    This metric is closer to the default operating mode of many real business scenarios: one code commit triggers one check, and one finished task outputs one report. If a deployment runs only one round, you should not use the three-round merged result to promise coverage.

    However, a single result cannot fully represent model capability either. Input organization, context truncation, generation randomness, and tool execution failures can all affect the outcome. Therefore, you should report the mean, minimum, maximum, and variance across multiple independent runs, rather than showing only the best single run.

    2.2 Multi-Run Aggregate Recall: How Much More Budget Covers

    Let the sets correctly found in three rounds be D₁, D₂, and D₃. Aggregate recall is:

    Aggregate Recall = |(D₁ ∪ D₂ ∪ D₃) ∩ G| ÷ |G|

    Three rounds together covering 28 target issues corresponds to an aggregate recall of 87.5%.

    This reflects the coverage ceiling of multi-round search, not the reliability of any single round. Different rounds may follow different data-flow paths, or focus on different files or issue types, so they can complement each other.

    But this improvement comes with a clear engineering cost: more inference requests, longer execution time, and more candidate reports that need deduplication and verification. When evaluating a multi-round approach, these costs should be counted as well, rather than comparing only the merged coverage number.

    2.3 Stable Hit Ratio: Which Issues Are Found Repeatedly

    Issues correctly found in all three rounds belong to the stable hit set under repeated execution:

    Stable Hit Ratio = |D₁ ∩ D₂ ∩ D₃ ∩ G| ÷ |G|

    If only 10 issues were found in all three rounds, this ratio is 31.25%.

    This shows that some results are found repeatedly, but a large portion of hits still depends on the specific round. It prompts evaluators to examine repeatability further, rather than concluding directly that the model is “unreliable.”

    The reason is that the stable hit ratio is still affected by issue difficulty, input variation, and the execution protocol. If the three rounds each use a different audit task, this metric no longer measures repeatability under the same conditions. Therefore, when reporting stability, you must also state whether the inputs, task requirements, tool permissions, and execution limits were consistent across rounds.

    3. Why Higher Aggregate Recall Should Not Be Read as “Stronger”

    3.1 More Runs Usually Mean More Chances to Find

    As long as reports can be correctly verified, merging more rounds will not shrink the cumulative set of correct findings. So multi-round aggregate results and single-round results should not be compared directly.

    A fair comparison needs at least one shared basis:

    • The same number of runs;
    • The same total cost budget;
    • The same execution time limit;
    • The same input scope and tool permissions;
    • The same manual verification resources.

    These bases cannot always be satisfied at once. You should choose the primary constraint according to the business goal and disclose the other differences. For example, pre-commit checks care more about latency, while a dedicated security audit may care more about coverage.

    3.2 With Few Issues, a Single Issue Moves the Result Significantly

    In a sample of 32 target issues, finding one more issue raises recall by about 3.1 percentage points.

    So a difference of one or two issues may not be enough to prove a stable and transferable capability gap. You need to further observe issue types, difficulty distribution, repeat-run results, and whether the same trend holds in cross-project tests.

    In particular, avoid generalizing a lead on one small sample into a lead across all code languages, business architectures, and vulnerability types.

    3.3 Aggregation Requires Correct Deduplication, Not Simple Addition

    The same root cause may generate multiple reports: one located at the call entry, one near the dangerous operation, and another describing a different trigger path for the same issue.

    Counting by report quantity directly would inflate the discovery count.

    Deduplication should be based on root cause, dangerous operation, input source, and fix location, not just title or text similarity. Conversely, issues that occur in different locations with independent causes should not be wrongly merged just because their descriptions look similar.

    4. Looking Only at Recall Ignores False Positives and Actionability

    Recall answers “how many of the known target issues were found,” but it does not answer “how many of the output reports are real.”

    Precision is defined as:

    Precision = Number of Correct Findings ÷ Total Number of Candidate Findings

    If a model outputs a large number of suspicious leads, it may cover more real issues, but it also increases the verification burden on security engineers. So precision, false-positive count, and manual review time should be reported together with recall.

    The actionability of a security report matters just as much. A valuable candidate finding usually needs to include:

    • The issue location and related call relationships;
    • How external input reaches the dangerous operation;
    • The preconditions required to trigger the issue;
    • Why existing protections are insufficient;
    • A verifiable scope of impact;
    • Fix recommendations and their applicable conditions.

    “This might be a risk here” counts only as an audit lead. Only when the evidence is strong enough to support a judgment can it enter the confirmed set.

    Note in particular: if the ground truth of the evaluation set is incomplete, a report that does not match the ground truth cannot automatically be judged a false positive. A reviewer should decide whether it is a new finding and record the basis for that decision.

    5. Cost Advantage Must Rest on the Same Measurement Basis

    The cost difference in the source material reminds us to pay attention to the execution budget beyond the model itself. But without the billing scope and task configuration, a given percentage cannot be applied directly to other scenarios.

    The cost of a real security audit can usually be broken down as:

    Total Cost = Inference Cost + Tool Execution Cost + Orchestration and Storage Cost + Manual Verification Cost

    If the results support a release decision, you also need to consider the waiting cost caused by execution latency and the extra consumption from failed retries.

    5.1 Consumption Scale Does Not Equal Audit Value

    A token is one of the units used to measure text processed by a model, and it does not correspond in a fixed way to the number of Chinese characters or lines of code.

    Large token consumption may come from broader code coverage, or from repeated reads, redundant context, and repeated generation of invalid reports. Total consumption scale alone cannot tell whether the audit was thorough, let alone prove a security effect.

    More valuable metrics include:

    • Average cost per confirmed issue;
    • Number of confirmed issues under a fixed budget;
    • New correct findings gained per additional round;
    • Average verification time per candidate report;
    • The proportion of audits completed within a given time limit.

    5.2 Low Inference Cost Does Not Necessarily Mean Low Total Cost

    If an approach has a lower generation cost but needs more retries or produces more false positives, it may shift cost onto the manual review stage.

    Conversely, even if a single run costs more, it may lower the overall audit cost as long as it reduces invalid reports and shortens verification time.

    So enterprise selection should compare end-to-end results under the same workload, not just the per-call price.

    6. How to Design a Reproducible Security Evaluation

    6.1 First Define the Task Boundary and Threat Model

    Before evaluation, write clearly what the model needs to identify: input validation flaws, access control problems, sensitive data leakage, or configuration and dependency risks.

    Also make clear what information the model can access, including code scope, configuration files, interface descriptions, and runtime evidence. Misses caused by missing necessary context should be recorded separately from issues that cannot be identified even with complete information.

    6.2 Build a Reviewed Set of Issues

    Each target issue should have a clear root-cause description, the conditions under which it holds, and a verification basis. Data labeled only as “suspected risk” is not suitable as the denominator for a strict recall calculation.

    The dataset should also include vulnerability-free samples, as well as samples that look similar on the surface but have effective protections, to test whether the model can recognize security boundaries rather than alerting on every dangerous operation it sees.

    In addition, avoid heavy overlap between evaluation samples and public answers, which causes information contamination. When necessary, you can use non-public audit samples and independently confirmed variants, but you cannot assume a vulnerability still holds just because the code was modified.

    6.3 Fix the Execution Protocol and Keep Complete Records

    It is recommended to record:

    • Input content and version;
    • Task instructions and how context is organized;
    • Tool access permissions and execution limits;
    • Timeout, failure, and retry rules;
    • Output, consumption, and time for each round;
    • The reviewer’s judgment and reasoning.

    Failed runs should not be silently deleted. Timeouts, parse failures, and tool-call exceptions are all part of production availability. The report can show capability metrics for successful runs and the completion rate across all runs separately.

    6.4 Report Both Overall Metrics and Layered Results

    Overall recall is good for a quick overview but tends to hide specific weaknesses. You should further break results down by issue type, severity, cross-file analysis needs, and context completeness.

    Severity-weighted metrics can serve as a supplement, but the weights must be set in advance and cannot replace the raw finding counts. Otherwise, evaluation results are easily influenced by subjective weight settings.

    7. Turning Multi-Round Auditing into a Controllable Engineering Process

    Multi-round auditing should not just resubmit the same code repeatedly. A more practical approach is to give each round a clear responsibility.

    The first round establishes the code structure, input entry points, and a list of high-risk operations; the second round checks validation and access-control boundaries along key data flows; the third round verifies the preconditions of the first two rounds’ candidate issues and actively looks for counterexamples.

    This division of labor aims to improve analytical complementarity, but whether it beats repeated runs under the same configuration must be confirmed through controlled experiments, and cannot be promised in advance as a recall improvement.

    The engineering process can be organized as:

    Code and configuration input → scope division → candidate issue generation → root-cause deduplication → evidence verification → risk grading → manual confirmation → fix verification

    Each stage should keep traceable records. The model is suited to lead discovery, evidence organization, and fix-recommendation generation, but a vulnerability cannot be automatically confirmed based only on a generated natural-language report.

    The multi-round process should also set stopping conditions, such as: reaching the total budget, reaching the time limit, or several consecutive rounds producing no new confirmed issues. The key here is “confirmed issues,” not “new text reports.”

    8. From Evaluation Results to Enterprise Acceptance

    What an enterprise needs is not an isolated high score, but a security capability that can stably fit into the development process.

    For pre-commit checks, focus on latency, false-positive control, and result repeatability; for periodic dedicated audits, you can add budget for multi-round search and evidence verification; for high-risk releases, the model results should complement manual audits, static checks, and dynamic verification.

    At acceptance, at least four questions should be answered:

    1. How many real issues does one run typically find?
    2. Under the same conditions, how much do results vary across repeated runs?
    3. How much time and total cost does each confirmed issue require?
    4. Is the output enough to support locating, fixing, and verifying?

    In the end, aggregate recall represents coverage capability after increasing the search budget, the stable hit ratio reflects repeated discovery, precision determines the review burden, and end-to-end cost determines whether an approach can run sustainably. Only by placing these dimensions under a unified, transparent, and reproducible protocol can cybersecurity model evaluation turn from a “number display” into a reliable basis for engineering decisions.