Inferensys

Glossary

Anchors

Anchors are high-precision, if-then rules that sufficiently 'anchor' a prediction locally, ensuring the decision remains fixed regardless of changes to other feature values.
Data engineer managing feature store on laptop, feature definitions visible, casual data engineering session.
HIGH-PRECISION LOCAL EXPLANATIONS

What is Anchors?

Anchors are high-precision, if-then rules that sufficiently 'anchor' a prediction locally, ensuring the decision remains fixed regardless of changes to other feature values.

An anchor is a model-agnostic, local explanation method that identifies a decision rule with extremely high precision. Formally, an anchor rule A satisfies P(premise | A) ≥ τ, meaning that when the rule's conditions are met, the model's prediction is fixed with a user-specified confidence level τ, regardless of perturbations to non-anchor features. This provides a sufficiency condition for a specific prediction.

Unlike LIME, which learns a linear surrogate model, Anchors uses a multi-armed bandit algorithm to efficiently search for the shortest rule with maximal coverage. The resulting IF-THEN rules are intuitive and state that if certain feature conditions hold, the prediction is guaranteed to remain stable. This makes Anchors particularly valuable for high-stakes auditing where understanding the exact boundary conditions of a decision is critical.

HIGH-PRECISION LOCAL RULES

Key Features of Anchors

Anchors provide if-then rules that sufficiently 'anchor' a prediction locally, ensuring the decision remains fixed regardless of changes to other feature values.

01

High-Precision Guarantee

Anchors are designed to maximize precision—the proportion of instances covered by the rule where the prediction holds. Unlike LIME, which optimizes for fidelity, Anchors explicitly guarantee that a rule achieves a user-specified precision threshold (e.g., 95%) with high probability. This is achieved through a PAC (Probably Approximately Correct) learning framework that provides statistical guarantees.

  • Precision target: User-defined, typically 90-99%
  • Confidence level: Statistical bound on the precision estimate
  • Coverage trade-off: Higher precision often reduces the number of instances the rule applies to
02

If-Then Rule Structure

Anchors generate human-readable logical rules composed of feature predicates. Each rule takes the form: "IF condition A AND condition B THEN prediction Y." These conditions are expressed in natural, domain-relevant terms rather than abstract feature weights.

  • Predicate types: Categorical thresholds (e.g., age > 30), categorical values (e.g., education = Masters)
  • Rule sparsity: Rules typically contain 1-5 conditions for interpretability
  • Example: "IF income > $50K AND credit_score > 700 THEN loan_approved = Yes"
03

Perturbation-Based Construction

Anchors are built using a bottom-up construction algorithm that iteratively adds feature predicates to maximize coverage while maintaining the precision constraint. The algorithm generates synthetic perturbations of the instance being explained and evaluates candidate rules against the model's behavior on these perturbations.

  • Multi-armed bandit: Efficiently explores the space of candidate rules using KL-LUCB algorithm
  • Perturbation strategy: Samples from a perturbation distribution around the instance
  • Beam search: Maintains a beam of candidate rules, expanding the most promising ones
04

Local Sufficiency Condition

The core principle behind Anchors is local sufficiency: a rule is sufficient if, when the rule conditions are met, changes to other features do not change the prediction. This formalizes the intuition that the identified features are the "anchors" that fix the prediction in place.

  • Invariance property: Prediction remains stable under perturbations of non-anchor features
  • Neighborhood definition: Defined by the perturbation distribution around the instance
  • Contrast with LIME: LIME approximates the decision boundary locally; Anchors identify a region where the prediction is invariant
05

Coverage Optimization

While precision is the primary constraint, Anchors optimize for coverage—the proportion of instances in the perturbation space that satisfy the rule conditions. Higher coverage means the explanation applies more broadly, making it more useful for understanding model behavior across similar cases.

  • Coverage-precision trade-off: Relaxing precision requirements increases achievable coverage
  • Global insight: High-coverage anchors reveal systematic model behaviors
  • Submodular optimization: Coverage exhibits diminishing returns, guiding efficient rule construction
06

Model-Agnostic Applicability

Anchors are fully model-agnostic, requiring only query access to the model's prediction function. This makes them applicable to any black-box classifier, including deep neural networks, gradient-boosted trees, and ensemble methods. No gradient information or internal model access is needed.

  • Input types: Tabular data, text (via word presence predicates), and images (via superpixel predicates)
  • Output types: Works with any classification model producing probability scores
  • Limitation: Computational cost scales with the number of model queries required for perturbation evaluation
ANCHOR EXPLANATIONS

Frequently Asked Questions

Clear answers to common questions about high-precision rule-based explanations that guarantee locally consistent predictions.

Anchors are high-precision, if-then rules that sufficiently 'anchor' a prediction locally, ensuring the decision remains fixed regardless of changes to other feature values. Introduced by Ribeiro et al. in 2018, an anchor explanation takes the form: 'If condition A holds, then the prediction is B with high probability.' Unlike LIME, which provides linear approximations, anchors guarantee that for any instance satisfying the anchor conditions, the model's prediction will be the same with a specified level of precision (typically ≥95%). This makes them particularly valuable in high-stakes domains like credit scoring or medical diagnosis, where you need to know exactly which feature ranges lock in a decision.

Prasad Kumkar

About the author

Prasad Kumkar

CEO & MD, Inference Systems

Prasad Kumkar is the CEO & MD of Inference Systems and writes about AI systems architecture, LLM infrastructure, model serving, evaluation, and production deployment. Over 5+ years, he has worked across computer vision models, L5 autonomous vehicle systems, and LLM research, with a focus on taking complex AI ideas into real-world engineering systems.

His work and writing cover AI systems, large language models, AI agents, multimodal systems, autonomous systems, inference optimization, RAG, evaluation, and production AI engineering.