TLDR: A new study developed a method to rigorously test formal AI explainers, applying it to the widely used PyXAI toolkit. The research uncovered significant bugs in PyXAI’s ability to generate correct and minimal explanations for machine learning models, highlighting the critical need for validating these tools to ensure trustworthy AI.
In the rapidly evolving landscape of artificial intelligence, the ability to understand why an AI model makes a particular decision is becoming as crucial as the decision itself. This field, known as Explainable Artificial Intelligence (XAI), aims to build trust and transparency in complex machine learning systems. While formal methods in XAI offer strong theoretical guarantees of rigor, a recent research paper highlights a critical gap: the practical validation of these formal explainers.
A new study titled “Uncovering Bugs in Formal Explainers: A Case Study with PyXAI” by Xuanxiang Huang, Yacine Izza, Alexey Ignatiev, and Joao Marques-Silva, delves into this very issue. The researchers developed a novel and robust methodology to assess the correctness of formal explainers and applied it to PyXAI, a widely used, publicly available formal explainer for tree-based machine learning models. The findings reveal that PyXAI frequently computes incorrect explanations across most of the datasets analyzed, underscoring the vital importance of such validation processes.
The Challenge of Trustworthy AI Explanations
Many popular XAI solutions, while widely adopted, are known to sometimes lack rigor and can produce erroneous results. Formal explainability, which leverages formal methods, offers an alternative by aiming to compute rigorous and guaranteed-correct explanations. These explanations are often model-based, meaning they are inherently correct given the underlying machine learning model. However, like any software, practical implementations of these formal explainers can contain bugs, which can severely undermine the promise of rigorous XAI and erode trust in AI systems.
Previous work on validating formal explainers has been limited, often focusing on certification for specific types of classifiers, which can be computationally intensive and not easily generalizable. This new research takes a different approach, focusing on the practical validation of results from formal explainers without aiming for full certification.
A Novel Validation Framework
The core of the paper’s contribution is a sophisticated framework for validating explanations. This framework operates by comparing the outputs of different formal explainers without assuming any of them are inherently correct. It designates one explainer as the “untrusted target” (T), another as a “reference” (R) that provides additional information like proof traces, and a third as a “second explainer” (S) used in specific situations where T and R alone are insufficient. Crucially, the framework also relies on the ability to directly query the machine learning model (M) itself to confirm predictions at specific data points.
The study focuses on two main types of explanations: Abductive Explanations (AXps) and Contrastive Explanations (CXps). An AXp identifies a minimal set of features that are sufficient to guarantee a model’s prediction. A CXp, on the other hand, pinpoints a minimal set of features that, if changed, would alter the model’s prediction.
PyXAI Under the Microscope
For their case study, the researchers chose PyXAI as the target explainer (T). They used RFxpl as the reference explainer (R) and XReason as the second explainer (S). Experiments were conducted on 27 binary classification datasets, primarily using Random Forests and Boosted Trees. The validation process involved meticulously checking whether PyXAI’s computed AXps and CXps met the formal definitions of correctness and minimality, using RFxpl and XReason for cross-verification and the original ML model for witness validation.
The results were striking. While RFxpl showed no identified errors throughout the experiments, PyXAI exhibited significant issues. For AXps, a notable percentage of explanations were found to be incorrect, not even representing “weak abductive explanations” (meaning they didn’t even satisfy the basic sufficiency condition). An even larger fraction of AXps, while technically sufficient, were not subset-minimal, meaning they contained redundant features. Similar problems were observed with CXps, where many explanations were either incorrect or not minimal.
For instance, in one case study, PyXAI generated an AXp for a Random Forest that claimed a specific set of features guaranteed a prediction. However, the validation framework, by querying the ML model, found a “witness point” where those same features led to a different prediction, proving PyXAI’s explanation was fundamentally wrong. Another example showed PyXAI producing a non-minimal CXp, suggesting a single feature change would flip a prediction, when in reality, no such flip would occur.
Also Read:
- Understanding the Computational Cost of Explaining Machine Learning Decisions
- Unmasking AI Vulnerabilities: A New Approach to Red-Teaming Activation Probes
Implications for AI Development and Trust
The high percentage of incorrect and non-minimal explanations generated by PyXAI, a widely used tool, raises serious concerns about the general reliability of formal explainers and any conclusions drawn from their use. This research serves as a critical reminder that even theoretically sound approaches require rigorous practical validation to ensure their trustworthiness.
The methodology proposed in this paper provides a valuable framework for developers and researchers to systematically uncover bugs in formal XAI tools. This is a crucial step towards building more reliable and truly explainable AI systems, fostering greater trust and accountability in their deployment. The full research paper can be accessed here: Uncovering Bugs in Formal Explainers.


