Abstract
As machine learning models are increasingly deployed in high-stakes domains, the demand for rigorous, interpretable explanations of their decisions has grown. This paper presents a unified logical framework for Explainable AI (XAI) centered on the concept of the "complete reason." By characterizing sufficient reasons as prime implicants and necessary (contrastive) reasons as prime implicates of a specific Boolean formula, the authors provide a formal bridge between two traditionally distinct types of explanations. We detail efficient algorithms for computing these reasons in decision trees and decision graphs, demonstrating that symbolic logic can provide scalable and exact explanations even for models handling complex numeric data.
Introduction
In the field of Explainable AI (XAI), users typically seek two types of justifications for a model's output. The first is the sufficient reason: the minimal set of features that guarantees a specific outcome (e.g., "The loan was denied because the applicant has low income and a poor credit score"). The second is the necessary reason, often called a contrastive explanation: the minimal set of features that must change to flip the decision (e.g., "If the applicant's income were higher, the loan would have been approved").
While sufficient reasons have been extensively studied, computing necessary reasons—particularly for multi-class models and numeric features—remains computationally intensive. Furthermore, these two explanation types are often treated as separate algorithmic problems. This paper addresses these challenges by introducing a single mathematical foundation—the complete reason—from which both sufficient and necessary explanations can be derived through logical duality.
The Complete Reason Framework
The core innovation of this work is the definition of the complete reason: a Boolean formula that characterizes exactly why a decision was made for a specific instance. Once this formula is extracted from a classifier, the classifier itself becomes redundant for the purpose of explanation; all subsequent queries are performed directly on the logical representation.
Logical Duality
The authors prove a fundamental duality within this framework:
- Sufficient Reasons correspond to the prime implicants of the complete reason.
- Necessary Reasons correspond to the prime implicates of the complete reason.
This formalization provides a rigorous footing for contrastive explanations, which are often discussed intuitively in XAI literature but lack a unified mathematical definition across different model types.
Tractable Representations
To ensure computational efficiency, the authors demonstrate that for decision trees and decision graphs, the complete reason can be represented as a monotone, $\lor$-decomposable Negation Normal Form (NNF). This specific logic circuit structure is significant because it allows for operations that are typically NP-hard to be performed in linear or polynomial time relative to the size of the representation.
Handling Numeric Data
Unlike traditional methods that rely on complex binarization of continuous variables, this framework discretizes numeric features based on the specific thresholds used within the decision nodes of the model. This approach preserves a "weak test-once" property, ensuring that the resulting logic remains tractable without losing the precision of the original model's decision boundaries.
Algorithms for Explanation
The paper introduces two primary algorithms designed to navigate the complete reason:
- SNR (Shortest Necessary Reasons): An output-polynomial time algorithm that identifies the minimal feature sets required to alter a decision. Because it leverages the $\lor$-decomposable NNF structure, it is highly efficient.
- SSR (Shortest Sufficient Reasons): Although finding the absolute shortest sufficient reason is theoretically NP-complete, the authors developed an incremental algorithm utilizing caching and pruning. This allows the algorithm to perform effectively on real-world models where standard baselines often fail.
Empirical Evaluation
The proposed methods were evaluated across fifteen benchmarks, including:
- OpenML Datasets: Ten standard datasets (e.g., adult, compas, mnist-784) used to train J48 decision trees.
- Bayesian Network Classifiers: Five complex decision graphs (e.g., andes, math-skills) compiled from Bayesian networks.
The benchmarks included both categorical and numeric features, with some models containing thousands of features and millions of nodes.
Key Results
- Computational Speed: The SNR algorithm consistently generated necessary reasons in less than a millisecond, even for large-scale trees, outperforming standard prime implicate algorithms by several orders of magnitude.
- Scalability: The SSR algorithm demonstrated significant practical utility, succeeding on thousands of instances where standard symbolic reasoners timed out. The framework proved capable of handling decision graphs with millions of nodes, such as the math-skills benchmark.
- Targeted Explanations: The authors showed that the complete reason can be modified to find "targeted" contrastive explanations—identifying what must change to move a classification to a specific target class rather than just any alternative class.
Conclusion
By unifying sufficient and necessary reasons under the umbrella of formal logic, this research provides a robust and efficient path forward for XAI. The use of tractable logical representations like NNFs allows for exact explanations that scale to large, real-world decision models. While currently optimized for symbolic models like decision trees and graphs, future work may extend these "closed-form" logical solutions to approximate the behavior of black-box models, such as deep neural networks, further broadening the applicability of the complete reason framework.
Summary updated