An anchor explanation is a model-agnostic, local explanation method that identifies a set of feature conditions—an "anchor"—that sufficiently guarantees a prediction with high probability. Unlike LIME, which approximates a decision boundary with a linear surrogate, anchors construct precise if-then rules. If the anchor's conditions hold, changes to any other feature values outside the rule will not alter the model's output, providing a formal coverage-guarantee for the explanation.
Glossary
Anchor Explanations

What is Anchor Explanations?
Anchor explanations provide high-precision if-then rules that guarantee a model's prediction will remain unchanged regardless of changes to other feature values not specified in the rule.
The algorithm uses a multi-armed bandit formulation to efficiently search for the rule with the highest coverage while maintaining a user-specified precision threshold, typically 95%. This approach directly addresses LIME's limitation of unclear explanation boundaries. Anchors are particularly effective for tabular data and text classification, where the resulting rules are intuitive for human auditors and compliance officers who require definitive, non-approximate justifications for automated decisions.
Key Features of Anchor Explanations
Anchor explanations provide if-then rules that guarantee a prediction with high probability, regardless of changes to other features. They are a critical evolution of LIME for high-stakes auditing.
The Precision Guarantee
Unlike standard feature attribution, an anchor is a rule with a formal precision guarantee. If the anchor's conditions are met, the model's prediction is fixed with a user-specified probability (e.g., 95%). This provides a sufficiency condition for the prediction, making it highly reliable for compliance and debugging.
Coverage vs. Precision Trade-off
Anchors explicitly balance coverage (how often the rule applies) and precision (how often it is correct). A highly precise anchor might have low coverage, applying only to a narrow set of cases. The algorithm searches for the rule with the highest coverage that still meets the precision target.
Perturbation-Based Construction
Anchors are built using a multi-armed bandit algorithm. The process systematically perturbs the input instance and queries the black-box model. It iteratively adds feature conditions to the rule candidate that maximize the precision gain, stopping when the desired precision threshold is reached.
Model-Agnostic and Post-Hoc
As a true model-agnostic method, anchors require only black-box access to the model's prediction function. They are applied post-hoc, meaning they can explain any pre-trained classifier without modifying its architecture or training pipeline, making them ideal for auditing third-party or legacy systems.
Human-Readable If-Then Rules
The output is a natural if-then rule that is inherently interpretable. For example: "IF age > 30 AND income < $50k THEN the loan is denied." This format maps directly to business logic and regulatory requirements, unlike a list of numerical feature importance scores.
Anchors vs. LIME
While LIME provides a local linear approximation, anchors provide a logical region of validity. A LIME explanation might highlight important words, but an anchor specifies exactly which words must be present to guarantee the sentiment. This moves from correlation to a sufficiency condition, reducing ambiguity for the auditor.
Enabling Efficiency, Speed & Accuracy
Intelligent Analysis, Decision & Execution
We build AI systems for teams that need search across company data, workflow automation across tools, or AI features inside products and internal software.
Talk to Us
Search across company data
Give teams answers from docs, tickets, runbooks, and product data with sources and permissions.
Useful when people spend too long searching or get different answers from different systems.

Automate internal workflows
Use AI to route work, draft outputs, trigger actions, and keep approvals and logs in place.
Useful when repetitive work moves across multiple tools and teams.

Add AI to products and internal tools
Build assistants, guided actions, or decision support into the software your team or customers already use.
Useful when AI needs to be part of the product, not a separate tool.
Frequently Asked Questions
Clear answers to common questions about anchor explanations, the high-precision if-then rules that guarantee model predictions remain stable under specified conditions.
An anchor explanation is a high-precision if-then rule that sufficiently guarantees a model's prediction will remain unchanged regardless of changes to other feature values not specified in the rule. It works by identifying a set of feature conditions—the anchor—such that when these conditions hold, the prediction is fixed with a user-specified probability threshold (typically 95% or higher). The algorithm uses a multi-armed bandit approach to efficiently search the space of possible rules, evaluating candidate anchors by generating perturbed samples and measuring how often the prediction stays the same when the anchor conditions are satisfied. Unlike LIME, which provides a weighted linear approximation, anchors deliver crisp, logical rules that are easy for humans to verify and act upon.
Related Terms
Core concepts that define how high-precision if-then rules guarantee prediction stability regardless of changes to non-anchor features.
Precision and Coverage
The two fundamental metrics for evaluating anchor quality. Precision measures the fraction of instances where the anchor rule correctly predicts the model's output, while coverage quantifies how many instances in the dataset satisfy the anchor's conditions. A perfect anchor achieves precision ≥ a user-specified threshold (e.g., 0.95) with maximum possible coverage.
- Precision: Proportion of correct predictions among instances where the anchor applies
- Coverage: Probability that the anchor applies to a randomly drawn instance
- Trade-off: Higher precision typically reduces coverage, requiring careful threshold selection
Multi-Armed Bandit Construction
The algorithmic backbone of anchor discovery, framing the search for high-precision rules as a multi-armed bandit problem. Each candidate feature condition is treated as an arm, and the algorithm sequentially selects arms to add to the anchor while estimating precision through perturbation sampling. This approach efficiently explores the combinatorial space of possible rules without exhaustive enumeration.
- Uses KL-LUCB (Lower-Upper Confidence Bound) strategy for arm selection
- Balances exploration of new conditions with exploitation of known high-precision rules
- Provides statistical guarantees on precision estimates
Perturbation Distribution
The mechanism for generating synthetic neighbors around the instance being explained. Unlike LIME's Gaussian perturbations, anchor explanations use a discrete perturbation space that respects feature semantics—masking words in text, occluding superpixels in images, or sampling from empirical marginal distributions for tabular data. The perturbation strategy directly impacts which anchors are discoverable.
- Text: Replaces tokens with UNK or samples from vocabulary
- Tabular: Samples values from training data marginal distributions
- Images: Masks superpixels while preserving spatial structure
Anchor as Sufficient Condition
An anchor is formally defined as a sufficient condition for a prediction: if the anchor rule holds, the model's prediction remains fixed with high probability regardless of changes to other features. This contrasts with LIME's linear approximations, which only capture local decision boundary slopes. Anchors provide if-then guarantees that are inherently easier for non-technical stakeholders to audit and trust.
- Formal property: P(prediction = y | anchor holds) ≥ τ
- τ (tau): User-defined precision threshold, typically 0.95
- Non-anchor features: Free to vary arbitrarily without breaking the guarantee
Bottom-Up Rule Construction
The iterative process of building anchors by starting with an empty rule and greedily adding feature predicates. At each step, candidate conditions are evaluated using the multi-armed bandit to select the addition that maximizes coverage while maintaining precision above the threshold. The algorithm terminates when no further conditions can be added without dropping below the precision requirement.
- Empty anchor: Initially applies to all instances (maximum coverage, low precision)
- Greedy addition: Each step adds the condition that yields highest coverage gain
- Stopping criterion: Precision falls below τ or no candidates remain
Anchor vs. LIME Comparison
While both are model-agnostic, local explanation methods, anchors provide fundamentally different guarantees. LIME produces a linear approximation of the decision boundary, which may be inaccurate in highly non-linear regions. Anchors produce logical rules with precision guarantees, making them more suitable for high-stakes applications where explanation reliability is critical.
- LIME: Weighted linear model, no formal precision guarantees
- Anchors: If-then rules with statistical precision bounds
- Interpretability: Anchors are self-contained rules requiring no understanding of feature weights
- Computational cost: Anchors are more expensive to compute due to bandit search

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.
Partnered with leading AI, data, and software stack.
How We Work
Custom AI workflows for your Business
One-fit-all AI don't work for modern businesses. At Inferensys, we aim to understand your business & custom requirements; which we use to define most efficient agentic workflows, the data, and the tools for your business.
01
Review the use case
We understand the task, the users, and where AI can actually help.
Read more02
Pick the right approach
We define what needs search, automation, or product integration.
Read more03
Build the first useful version
We implement the part that proves the value first.
Read more04
Improve from there
We add the checks and visibility needed to keep it useful.
Read moreThe first call is a practical review of your use case and the right next step.
Talk to Us