Principle:SeldonIO Seldon core Model Explainability Integration
| Field | Value |
|---|---|
| Overview | Adding model explainability capabilities to deployed models using Alibi Explain integration. |
| Domains | MLOps, Explainability |
| Related Implementation | SeldonIO_Seldon_core_Seldon_Model_CRD_Explainer |
| Knowledge Sources | Repo (https://github.com/SeldonIO/seldon-core), Doc (https://docs.seldon.io/projects/alibi), Paper (Anchors: https://arxiv.org/abs/1804.06506) |
| Last Updated | 2026-02-13 00:00 GMT |
Description
Seldon Core 2 supports explainability through the Model CRD's spec.explainer section. The explainer field links an explanation model to a base model (via modelRef) or pipeline (via pipelineRef). The explainer type specifies the algorithm (e.g., anchor_text, anchor_tabular). The explainer model artifact is served by MLServer's Alibi-Explain runtime.
The explainability integration involves three components:
- Explainer model artifact -- a serialized Alibi Explain instance stored at a remote URI, loaded by the Alibi-Explain MLServer runtime
- Base model or pipeline reference -- the
modelReforpipelineReffield that tells the explainer which model to explain (the black box) - Explainer type -- the algorithm used for generating explanations (e.g.,
anchor_textfor NLP models,anchor_tabularfor tabular data models)
When an inference request is sent to an explainer model, the Alibi-Explain runtime:
- Receives the input data
- Calls the base model/pipeline as a black box to get predictions
- Applies the explanation algorithm (e.g., anchor perturbation) to identify decision-relevant features
- Returns the explanation alongside or instead of the raw prediction
Theoretical Basis
Model explainability provides human-interpretable explanations for predictions. Anchor explanations identify minimal sufficient conditions ("anchors") that guarantee the same prediction. The explainer uses the base model as a black box, perturbing inputs to find the decision boundary.
The Anchor algorithm (Ribeiro et al., 2018) works as follows:
- Perturbation -- The algorithm generates perturbed versions of the input by randomly replacing features (words for text, values for tabular data).
- Precision estimation -- For each candidate anchor (subset of features), the algorithm estimates the probability that fixing those features maintains the original prediction.
- Beam search -- A beam search algorithm efficiently explores the space of possible anchors, adding features one at a time.
- Sufficient condition -- The algorithm terminates when it finds a minimal set of features (the anchor) whose precision exceeds a configurable threshold (typically 95%).
For text models (anchor_text), anchors identify the minimal set of words in the input that, when present, guarantee the same classification regardless of the surrounding context.
For tabular models (anchor_tabular), anchors identify feature value ranges that are sufficient for the prediction.
Usage
This principle applies when adding interpretability to deployed models or pipelines in production, including:
- Explaining sentiment analysis predictions by identifying which words drive the classification
- Explaining tabular model predictions by identifying which feature values are decision-relevant
- Integrating explainability into multi-modal pipelines as a branch step
- Meeting regulatory or compliance requirements for model transparency
Related Pages
- SeldonIO_Seldon_core_Seldon_Model_CRD_Explainer -- implements this principle with concrete Model CRD YAML for explainer configuration
- SeldonIO_Seldon_core_Multi_Modal_Pipeline_Composition -- integrates with pipeline composition where explainers are pipeline branches
- SeldonIO_Seldon_core_Seldon_Pipeline_CRD_Multi_Modal -- used by the speech-to-sentiment pipeline which includes an explainer step
- SeldonIO_Seldon_core_HuggingFace_Model_Resource_Definition -- extends the Model CRD pattern with explainer-specific fields
Implementation:SeldonIO_Seldon_core_Seldon_Model_CRD_Explainer