Anchors are a model-agnostic local explanation method in explainable AI that describes a single prediction with an if-then rule: a small set of feature conditions which, when they hold, keep the model’s prediction the same with high probability, regardless of the values of the remaining features. A rule such as “if income is above 60,000 and no missed payments, then approve” is said to anchor the prediction.
The method was introduced in 2018 by Ribeiro, Singh and Guestrin, the authors of LIME, as high-precision model-agnostic explanations. It addresses a weakness of linear surrogate explanations: their unclear scope. An anchor states exactly where the explanation applies and how reliable it is there, which makes it one of the most readable tools in the Explainable AI toolbox. The approach is also referred to as anchor explanations.
How an anchor rule is defined
An anchor is defined by two quantities computed over a perturbation distribution around the instance being explained. Precision is the probability that the model returns the original prediction for perturbed samples that satisfy the rule. Coverage is the share of samples from the distribution that satisfy the rule at all, which measures how widely the rule applies.
The method searches for a rule whose precision exceeds a user-set threshold, commonly 0.95, and among such rules prefers the one with the highest coverage. Shorter rules usually cover more cases, so the objective naturally rewards concise explanations.
| Quantity | Meaning | Typical setting or range |
|---|---|---|
| Precision threshold | Required probability that the prediction holds | 0.90 to 0.99, default 0.95 |
| Coverage | Share of perturbed samples matching the rule | From under 1% to over 50% |
| Confidence level | Statistical certainty that precision exceeds the threshold | Controlled by a delta parameter, often 0.1 |
| Rule length | Number of conditions in the anchor | Usually 1 to 5 predicates |
| Tolerance | Allowed error in precision estimates | Small epsilon such as 0.15 |
How the search for anchors works
Finding an anchor is a combinatorial search problem, because the number of possible feature-condition combinations grows quickly. The original algorithm builds rules bottom-up with beam search: it starts from an empty rule, adds one predicate at a time, and keeps the most promising candidates at each step.
Evaluating each candidate requires querying the model on many perturbed samples. To keep this affordable, the method treats candidate selection as a multi-armed bandit problem and uses the KL-LUCB algorithm, which samples more heavily from candidates whose precision is still uncertain. The search stops when a rule passes the threshold with the required statistical confidence.
How perturbations are generated depends on the data type, as the following table shows.
| Data type | Predicate form | Perturbation method |
|---|---|---|
| Tabular | Feature in a discretized bin | Resample unfixed features from training data |
| Text | Specific word is present | Replace other words with UNK or similar words |
| Images | Superpixel is kept | Replace other superpixels with noise or blur |
| Structured events | Field equals a value | Draw other fields from a reference set |
Anchors compared with other local explanations
Anchors differ from feature attribution methods such as LIME and KernelSHAP in the form of the answer: attribution assigns a numeric weight to every feature, while an anchor gives a sufficient condition and ignores everything else. This makes anchors closer to rule-based reasoning that domain experts already use.
| Method | Output form | Scope stated | Main strength |
|---|---|---|---|
| Anchors | If-then rule with precision | Yes, via coverage | Clear validity boundary |
| LIME | Linear feature weights | No | Shows direction of influence |
| KernelSHAP | Additive Shapley values | No | Theoretical consistency guarantees |
| Counterfactual explanation | Minimal change that flips output | Single alternative point | Actionable recourse |
In user studies reported by the original authors, people given anchors predicted model behavior on new instances more accurately and with less effort than people given linear explanations, mainly because they knew when not to apply the explanation. Anchors are complementary to contrastive explanations: an anchor says why the prediction stays, a counterfactual says what would change it.
Practical use and tooling
Anchors fit situations where stakeholders need short, auditable statements about individual decisions, such as credit adverse-action review, claim triage or content moderation appeals. Open-source implementations exist in the original anchor library and in the Alibi Explain package, which supports tabular, text and image data.
- Discretize numeric features thoughtfully, because bin edges become the conditions a reader will see.
- Report precision and coverage next to every rule so readers can judge its reliability.
- Fix the random seed and sample budget when anchors are used for audit records.
- Aggregate many anchors across instances to sketch a rough global picture of model behavior.
Limitations of anchor explanations
The precision guarantee holds only with respect to the chosen perturbation distribution. If perturbations produce unrealistic samples, a rule can look reliable while saying little about real inputs, a concern related to explanation faithfulness. Results also depend on discretization choices, which can hide thresholds the model actually uses.
| Problem | Cause | Mitigation |
|---|---|---|
| Very low coverage | Instance lies near a decision boundary | Report it and add a counterfactual |
| Long, complex rules | Many interacting features | Lower precision slightly or regroup features |
| Unstable results | Sampling noise in the bandit search | Increase sample budget and fix seeds |
| High compute cost | Thousands of model queries per instance | Batch queries and cache predictions |
Anchors also do not reveal how much each condition matters or which features push toward the opposite class, so practitioners often pair them with an attribution method when a full picture is required.
In everyday language
An anchor is a short rule that explains one decision made by an AI model. It says: as long as these few facts are true, the answer stays the same. Other details do not matter much.
Imagine a bank model that approves a loan. The anchor might say that a high income and a clean payment history are enough for approval. It also tells you how often the rule is right and how many people it fits. So you know when you can trust it and when you cannot.
Seen in the real world
An insurance company uses a gradient-boosted classifier to flag motor claims for manual fraud review. Investigators complained that SHAP bar charts were hard to discuss with claimants, so the analytics team added anchor explanations to the review screen, set at a precision threshold of 0.95.
For one flagged claim, the anchor read: if the policy is less than 30 days old and the claimed repair cost is above the 90th percentile for that vehicle model, then the claim is flagged, with precision 0.97 and coverage 4%. The investigator could check both facts in seconds and explain the review to the customer in one sentence.
Over a quarter, the team found that average review preparation time fell noticeably, and that low-coverage anchors reliably pointed to borderline cases that deserved a closer look rather than an automatic decision.