Back to glossary

Term

Recall

Recall (hit rate, sensitivity) measures the share of all actually existing relevant cases that a system finds. Formula: relevant cases found divided by all relevant cases that truly exist. Requires a known ground truth.

Recall — explained in detail

Recall (also called hit rate or, in statistics, sensitivity) answers the question: of all the cases that are genuinely relevant, how many did the system actually catch? Recall is calculated as the number of correctly found relevant cases (true positives) divided by the sum of true positives and missed cases (false negatives). The value ranges from 0 to 1, or 0 to 100 percent. Important: recall can only be computed when a ground truth is known — that is, when the total number of relevant cases is established.

In the context of AI-assisted code analysis, a high recall means the model finds a large share of the bugs that actually exist in the code. A low recall means many real defects slip through undetected (false negatives). On its own, recall says nothing about how many of the reported findings are actually correct — that is what the counterpart metric precision captures.

Example / Practical use

Suppose a codebase provably contains 20 real bugs (the ground truth). A model reports 15 findings, of which 12 are actual bugs and 3 are false alarms. Then recall is 12 out of 20, that is 0.6 or 60 percent — 8 real bugs were missed. The precision of the same run is 12 out of 15, that is 0.8 or 80 percent. This exact pair of numbers is what you need to compare two models fairly: a model that finds more bugs (higher recall) but produces more false alarms (lower precision) is not automatically better — it depends on the use case. In benchmarks, recall and precision are often combined into the F1 score, the harmonic mean of the two values.

Precision measures the share of correct findings among all reported findings (how clean the model is), recall the share of found cases among all that truly exist (how complete it is). A false positive is a single false alarm — a reported finding that is not a real case; many false positives lower precision. A false negative is a missed real case; many of those lower recall. The two metrics typically trade off against each other: lowering the threshold to find more raises recall, but usually at the expense of precision. The general recall described here should not be confused with context recall, a specialised RAG evaluation metric for the completeness of retrieved contexts.

Entdecke mehr

Themenuebersicht