Skip to content

Anchor explanation

An anchor is a rule that preserves a model prediction with high conditional probability. A 100-query example separates empirical precision, coverage and confidence.

An anchor explanation is an if–then rule whose conditions hold for a particular input and preserve its model-predicted label with high probability under a specified perturbation distribution. For a quant inspecting a credit-risk flag, it identifies a region where the classifier tends to repeat that flag while other inputs vary.

A rule needs two probabilities

Let f(x)f(x) be the label being explained and A(z)=1A(z)=1 mean that input zz satisfies every condition in the rule. The original Anchors paper defines precision and coverage using a distribution DD:
prec⁡D(A)=PZ∼D(f(Z)=f(x)∣A(Z)=1),cov⁡D(A)=PZ∼D(A(Z)=1).\operatorname{prec}_D(A)=\mathbb{P}_{Z\sim D}\bigl(f(Z)=f(x)\mid A(Z)=1\bigr), \qquad \operatorname{cov}_D(A)=\mathbb{P}_{Z\sim D}\bigl(A(Z)=1\bigr).
The rule must also satisfy A(x)=1A(x)=1. Precision is conditional probability of agreement with the model. Coverage measures how often the rule applies. Neither measures correctness against observed outcomes.
Unlike LIME, which fits a local surrogate, an anchor provides explicit conditions for applying its explanation. Those conditions do not specify a complete global model.

Ten covered inputs, nine repeated predictions

Consider a synthetic borrower xx that a classifier flags. A candidate rule is:
If the leverage category is “high” and the past-due flag is “yes”, predict the same “flag” label as the classifier gave xx.

These are fictional feature categories, not lending criteria. Freeze the rule before inspecting 100 equally weighted, held-out queries from the declared reference distribution. Ten satisfy both conditions. The classifier flags nine of those ten and clears one:

QuantityCalculationEmpirical result
Precision9 matching model predictions / 10 covered inputs0.90
Coverage10 covered inputs / 100 total inputs0.10
The rule has 90% empirical precision and 10% empirical coverage. Dividing nine by 100 would mix the two questions: that is the fraction both covered and agreeing, not the conditional agreement rate.
Synthetic 100-query grid: the rule covers 10 inputs. Of those 10, nine repeat the explained model label and one differs. Empirical coverage is 10 percent and empirical precision is 90 percent; no outcome labels are used.
Synthetic 100-query grid: the rule covers 10 inputs. Of those 10, nine repeat the explained model label and one differs. Empirical coverage is 10 percent and empirical precision is 90 percent; no outcome labels are used.
The coverage denominator is all 100 queries; the precision denominator is only the 10 satisfying the rule. The other 90 queries provide no information about conditional agreement in this illustration.

There are no realised default labels in this calculation. The nine agreeing predictions could all be wrong about defaults. Equally, agreement does not show that changing leverage or curing arrears would cause a different financial outcome; those claims require different evidence.

A high sample fraction is not a certificate

For a fixed rule with independent agreement trials, suppose its true conditional agreement probability were only 0.80. The chance of seeing at least nine agreements in ten trials would be

(109)(0.8)9(0.2)+(0.8)10=0.3758096384.\binom{10}{9}(0.8)^9(0.2)+(0.8)^{10} =0.3758096384.
That is about 37.6%. This is an illustrative sampling calculation, not an estimate of this rule’s unknown true precision. It shows why observing nine out of ten cannot by itself establish a population precision of at least 90%. Searching many rules and reporting only the most favourable sample fraction adds selection risk.

What the search is trying to establish

Alibi’s official explanation describes a search that adds predicates, keeps promising candidates through beam search, and allocates model queries using a multi-armed-bandit procedure. The objective favours coverage subject to a precision threshold and a separate confidence requirement. Adding conditions cannot increase coverage under the same DD, although precision need not increase monotonically.

The precision target τ\tau and confidence level 1−δ1-\delta answer different questions: how reliable should the rule’s predictions be under DD, and how confidently has the sampling procedure established that reliability? A search estimate alone does not establish the guarantee. Alibi also documents cases where discretised features prevent meeting the precision requirement and a non-eligible rule is returned. Inspect eligibility and uncertainty, not merely the printed rule.

The distribution is part of the explanation

Sampling from D(⋅∣A)D(\cdot\mid A) means generating inputs that satisfy the rule while varying the remaining features according to the chosen sampler. Alibi’s tabular method uses training data and discretised numerical features. The resulting statement is relative to that construction; it does not cover arbitrary possible inputs.

In the credit example, a sampler that breaks the relationship between debt, assets and the leverage category may test implausible borrowers. A historical sampler may also miss a new lending population. Record the reference data, feature bins, dependency assumptions, model version and search settings alongside the explanation. Recheck the rule when that context changes. High fidelity to a classifier can faithfully expose a flawed classifier.

For the mechanics of expressing regions as conditions, Decision Trees: Splitting Criteria and Pruning develops readable feature-space partitions. Its preview is public and the full lesson requires membership. A predictive tree learns its partitions from response data; an anchor instead explains the behaviour of a model already in place.

Sources

  • Ribeiro, M. T., Singh, S. and Guestrin, C. (2018), Anchors: High-Precision Model-Agnostic Explanations, “Anchors as High-Precision Explanations”, equation (1), and “Efficiently Computing Anchors”, equations (2)–(4). Definitions, conditional perturbations and the precision-constrained coverage objective.
  • Alibi Explain, Anchors, “Concepts and use-case insights”, “Tabular Data”, “Efficiently Computing Anchors” and “Usage”, checked 1 November 2026. Search, confidence controls and non-eligible outputs. The borrower example, sampling calculation and figure here are original teaching constructions, not outputs from an Anchors implementation.
Last updated
  • anchor explanation
  • explainability
  • classification
  • model fidelity
  • conditional probability
← Back to the glossaryBack to top ↑