On Computing Probabilistic Explanations for Decision Trees
Abstract
Formal XAI (explainable AI) is a growing area that focuses on computing explanations with mathematical guarantees for the decisions made by ML models.
Inside formal XAI, one of the most studied cases is that of explaining the choices taken by decision trees, as they are traditionally deemed as one of the most interpretable classes of models.
Recent work has focused on studying the computation of sufficient reasons , a kind of explanation in which given a decision tree T and an instance x , one explains the decision T ( x ) by providing a subset y of the features of x such that for any other instance z compatible with y , it holds that T ( z )
=
T ( x ) , intuitively meaning that the features in y are already enough to fully justify the classification of x by T .
It has been argued, however, that sufficient reasons constitute a restrictive notion of explanation.
For such a reason, the community has started to study their probabilistic counterpart, in which one requires that the probability of T ( z )
=
T ( x ) must be at least some value δ ∈ (0 , 1] , where z is a random instance that is compatible with y .
Our paper settles the computational complexity of δ -sufficient-reasons over decision trees, showing that both (1) finding δ -sufficient-reasons that are minimal in size, and (2) finding δ -sufficient-reasons that are minimal inclusion-wise, do not admit polynomial-time algorithms (unless PTIME = NP).
This is in stark contrast with the deterministic case ( δ = 1 ) where inclusion-wise minimal sufficient-reasons are easy to compute.
By doing this, we answer two open problems originally raised by Izza et al., and extend the hardness of explanations for Boolean circuits presented by Wäldchen et al.
to the more restricted case of decision trees.
On the positive side, we identify structural restrictions of decision trees that make the problem tractable, and show how SAT solvers might be able to tackle these problems in practical settings.
Introduction
Context.
The trust that AI models generate in people has been repetitively linked to our ability of explaining the decision of said models (Arrieta et al., 2020), thus suggesting the area of explainable
AI (XAI) as fundamental for the deployment of trustworthy models.
A sub-area of explainability that has received considerable attention over the last years, showing quick progress in theoretical and practical terms, is that of local explanations, i.e., explanations for the outcome of a particular input to an ML model after the model has been trained.
Several queries and scores have been proposed to specify explanations of this kind.
These include, e.g., queries based on prime implicants (Shih et al., 2018) or anchors (Ribeiro et al., 2018), which are parts of an instance that are sufficient to explain its classification, as well as scores that intend to quantify the impact of a single feature in the output of such a classification (Lundberg and Lee, 2017; Yan and Procaccia, 2021).
A remarkable achievement of this area of research has been the development of formal notions of explainability.
The benefits brought about by this principled approach have been highlighted, in a very thorough and convincing way, in a recent survey by Marques-Silva and Ignatiev (2022).
A prime example of this kind of approach is given by sufficient reasons , which are also known as prime implicant explanations (Shih et al., 2018) or abductive explanations (Ignatiev et al., 2021).
Given an ML model M of dimension n and a Boolean input instance x ∈ { 0 , 1 } n , a sufficient reason for x under M is a subset y of the features of x , such that any instance z compatible with y receives the same classification result as x on M .
In more intuitive words, y is a sufficient reason for x under
M if the features in y suffices to explain the output of M on x .
In the formal explainability approach, one then aims to find sufficient reasons y that satisfy one of the following optimality criteria: (a) they are minimum , i.e., there are no sufficient reasons with fewer features than y , or (b) they are minimal , i.e., there are no sufficient reasons that are strictly contained in y .
Problem.
The XAI community has studied for which Boolean ML models the problem of computing (minimum or minimal) sufficient reasons is computationally tractable and for which it is computationally hard (see, e.g., (Barceló et al., 2020; Marques-Silva et al., 2020, 2021)).
It has been argued, however, that for practical applications sufficient reasons might be too rigid , as they are specified under worst-case conditions.
That is, y is a sufficient reason for x under M if every “completion” of y is classified by M in the same way as x .
As several authors have noted already, there is a natural way in which this notion can be relaxed in order to become more suitable for real-world explainability tasks: Instead of asking for each completion of y to yield the same result as x on M , we could allow for a small fragment of the completions of y to be classified differently than x (Izza et al., 2021; Wäldchen et al., 2021; Wang et al., 2021).
More precisely, we would like to ensure that a random completion of y is classified as x with probability at least δ ∈ (0 , 1] , a threshold that the recipient of the explanation controls.
We call y a δ -sufficient reason for e under M .
The study of the cost of computing minimum δ -sufficient reasons for expressive Boolean ML models based on propositional formulas was started by Wäldchen et al.
They show, in particular, that the decision problem of checking if x admits a δ -sufficient reason of a certain size k under a model M , where M is specified as a CNF formula, is NP PP -complete.
This result shows that the problem is very difficult for complex models, at least in theoretical terms.
Nonetheless, it leaves the door open for obtaining tractability results over simpler Boolean models, starting from those which are often deemed to be “easy to interpret”, e.g., decision trees (Gilpin et al., 2018; Izza et al., 2020a; Lipton, 2018).
In particular, the study of the cost of computing both minimum and minimal δ -sufficient reasons for decision trees was initiated by Izza et al.
(2021, 2022), but nothing beyond the fact that the problem lies in NP has been obtained.
Work by Blanc et al.
(2021) has shown that it is possible to obtain efficient algorithms that succeed with a certain probability, and that instead of finding a smallest (either cardinality or inclusion-wise) δ -sufficient reason, find δ -sufficient reasons that are small compared to the average size of δ -sufficient reasons for the considered model.
Our results.
In this paper we provide an in-depth study of the complexity of the problem of minimum and minimal δ -sufficient reasons for decision trees.
We start by pinpointing the exact computational complexity of these
problems by showing that, under the assumption that PTIME ̸
= NP, none of them can be solved in polynomial time.
We start with minimum δ -sufficient reasons and show that the problem is hard even if δ is an arbitrary fixed constant in (0 , 1] .
Our proof takes as basis the fact that, assuming
PTIME ̸ = NP, the problem of computing minimum sufficient reasons for decision trees is not tractable (Barceló et al., 2020).
The reduction, however, is non-trivial and requires several involved constructions and a careful analysis.
The proof for minimal δ -sufficient reasons is even more difficult, and the result more surprising, as in this case we cannot start from a similar problem over decision trees: computing minimal sufficient reasons over decision trees (or, equivalently, minimal δ -sufficient reasons for δ = 1 ) admits a simple polynomial time algorithm.
Our result then implies that such a good behavior is lost when the input parameter δ is allowed to be smaller than 1 .
To deal with the high computational complexity of the problems, we look for structural restrictions of it that, at the same time, represent meaningful practical instances and ensure that these problems can be solved in polynomial time.
The first restriction, called bounded split number , assumes there is a constant c ≥ 1 such that, for each node u of a decision tree
T of dimension n , the number of features that are mentioned in both T u , the subtree of T rooted at u , and T − T u , the subtree of T obtained by removing T u , is at most c .
We show that the problems of computing minimum and minimal δ -sufficient reasons over decision trees with bounded split number can be solved in polynomial time.
The second restriction is monotonicity .
Intuitively, a Boolean ML model M is monotone , if the class of instances that are classified positively by M is closed under the operation of replacing 0 s with 1 s. For example, if M is of dimension 3 and it classifies the input (1 , 0 , 0) as positive, then so it does for all the instances in { (1 , 0 , 1) , (1 , 1 , 0) , (1 , 1 , 1) } .
We show that computing minimal δ -sufficient reasons for monotone decision trees is a tractable problem.
(This good behavior extends to any class of monotone ML models for which counting the number of positive instances is tractable; e.g., monotone free binary decision diagrams (Wegener, 2004)).
In spite of the intractability results we obtain in the paper, we show experimentally that our problems can be solved over practical instances by using SAT solvers.
This requires finding efficient encodings of such problems as conjunctive normal form ( CNF ) formulas, which we then check for satisfiability.
This is particularly non-trivial for probabilistic sufficient reasons, as it requires dealing with the arithmetical nature of the probabilities involved through a Boolean encoding.
Organization of the paper.
We introduce the main terminology used in the paper in Section 2, and we define the problems of computing minimum and minimal δ -sufficient reasons in Section 3.
The intractability of the these problems is proved in Section 4, while some tractable restrictions of them are provided in Section 5.
Our Boolean encodings can be found in Section 6.
Finally, we discuss some future work in Section 7.
Background
An instance of dimension n , with n ≥ 1 , is a tuple x ∈ { 0 , 1 } n .
We use notation x
[ i ] to refer to the i -th component of this tuple, or equivalently, its i -th feature.
Moreover, we consider an abstract notion of a model of dimension n , and we define it as a Boolean function M : { 0 , 1 } n → { 0 , 1 } .
That is,
M assigns a Boolean value to each instance of dimension n , so that we focus on binary classifiers with Boolean input features.
Restricting inputs and outputs to be Boolean makes our setting cleaner while still covering several relevant practical scenarios.
A partial instance of dimension n is a tuple y ∈ { 0 , 1 , ⊥} n .
Intuitively, if y [ i ] = ⊥ , then the value of the i -th feature is undefined.
Notice that an instance is a particular case of a partial instance where all features are assigned value either 0 or 1 .
Given two partial instances x , y of dimension n , we say that y is subsumed by x , denoted by y ⊆
x , if for every i ∈ { 1 , . . . , n } such that y [ i ] ̸ = ⊥ , it holds that
y
[ i ] = x [ i ] .
That is, y is subsumed by x if it is possible to obtain x from y by replacing some undefined values.
Moreover, we say that y is properly subsumed by x , denoted by y ⊊ x ,
if y ⊆ x and y ̸
= x . Notice that a partial instance y can be thought of as a compact representation of the set of instances z such that y is subsumed by z , where such instances z are called the completions of y and are grouped in the set C OMP ( y ) .
A binary decision diagram (BDD) of dimension n is a rooted directed acyclic graph M with labels on edges and nodes such that: (i) each leaf (a node with no outgoing edges) is labeled with true or false ; (ii) each internal node (a node that is not a leaf) is labeled with a feature i ∈ { 1 , . . . , n } ; and
(iii) each internal node has two outgoing edges, one labeled 1 and the other one labeled 0 .
Every instance x ∈ { 0 , 1 } n defines a unique path π x = u 1 · · · u k from the root u 1 to a leaf u k of M such that: if the label of u i is j ∈ { 1 , . . . , n } , where i ∈ { 1 , . . .
, k − 1 } , then the edge from u i to u i + is labeled with x [ j ] .
Moreover, the instance x is positive, denoted by M ( x ) = 1 , if the label of u k is true ; otherwise the instance x is negative, which is denoted by M ( x ) = 0 .
A BDD M is free if for every path from the root to a leaf, no two nodes on that path have the same label.
A decision tree is simply a free BDD whose underlying directed acyclic graph is a rooted tree.
Probabilistic Sufficient Reasons
Sufficient reasons are partial instances obtained by removing from an instance x components that do not affect the final classification.
Formally, fix a dimension n .
Given a decision tree T , an instance x , and a partial instance y with y ⊆ x , we call y a sufficient reason for x under T if T ( x ) =
T ( z ) for every z ∈ C OMP ( y ) .
In other words, the features of y that take value either 0 or 1 explain the decision taken by T on x , as T ( x ) would not change if the remaining features (i.e., those that are undefined in y ) were to change in x , thus implying that the classification T ( x ) is a consequence of the features defined in y .
We say that a sufficient reason y for x under T is minimal , if it is minimal under the order induced by ⊆ , that is, if there is no sufficient reason y ′
for x under T such that y ′ ⊊ y .
Also, we define a minimum sufficient reason for x under T as a sufficient reason y for x under T that maximizes the value | y | ⊥ :
= |{ i ∈ { 1 , . . . , n } | y
[ i ] = ⊥}| .
It turns out that minimal sufficient reasons can be computed efficiently for decision trees with a very simple algorithm, assuming a sub-routine to check whether a given partial instance is a sufficient reason (not necessarily minimal) of another given instance.
As shown in Algorithm 1, the idea of the algorithm is as follows: start with a candidate answer y which is initially equal to x , the instance to explain, and maintain the invariant that y is a sufficient reason for x , while trying to remove defined components from y until no longer possible.
It is not hard to see that one can check whether a partial instance y is a sufficient reason for an instance x in linear time over decision trees (Audemard et al., 2021).
This algorithm is well known (see e.g., (Huang et al., 2021)), and relies on the following simple observation, tracing back to Goldsmith et al.
Observation 1.
For any class of models C , if a partial instance y of dimension n is a sufficient reason for an instance x under a model M ∈ C , but not a minimal sufficient reason, then there is a partial instance ˆ y which is equal to y except that ˆ y
[ i ] = ⊥ , y
[ i ] ̸ = ⊥ for some i ∈ { 1 , . . . , n } which is also a sufficient reason for x under M .
Algorithm
1 y ← x 2 while true do reduced ← false for i ∈ { 1 , . . . , n } do ˆ y ← y
ˆ y
[ i ] ← ⊥ if CheckSufficientReason ( T, ˆ y , x ) then
y ← ˆ y reduced ← true break if ( reduced then return y
The following theorem shows a stark contrast between the complexity of computing minimal and minimum sufficient reasons over decision trees.
Theorem 1 (Barceló et al.
Assuming PTIME ̸
= NP , there is no polynomial-time algorithm that, given a decision tree T and an instance x of the same dimension, computes a minimum sufficient reason for x under T .
Arguably, the notion of sufficient reason is a natural notion of explanation for the result of a classifier.
However, such a concept imposes a severe restriction by asking all completions of a partial instance to be classified in the same way.
To overcome this limitation, a probabilistic generalization of sufficient reasons was proposed by Wäldchen et al.
(2021) and Izza et al.
More precisely, this notion allows to settle a confidence δ ∈ (0 , 1] on the fraction of completions of a partial instance that yield the same classification.
false true false true
T p ( ∅ ) =p ( { 1 } ) =p ( { 2 } ) =p ( { 3 } ) =p ( { 1 , 2 } ) =p ( { 1 , 3 } ) =p ( { 2 , 3 } ) =p ( { 1 , 2 , 3 } ) =
Definition 1 (Probabilistic sufficient reasons) .
Given a value δ ∈ (0 , 1] , a δ -sufficient reason ( δ -SR for short) for an instance x under a decision tree T is a partial instance y such that y ⊆ x
and
Pr z [ T ( z ) =
T ( x ) | z ∈ C OMP ( y )] := |{ z ∈ C OMP ( y )
| T ( z ) =
T ( x ) }| 2 | y | ⊥ ≥ δ.
Minimal and minimum δ -sufficient reasons are defined analogously as in the case of minimal and minimum sufficient reasons.
Example 1.
Consider the decision tree T over features { 1 , 2 , 3 } shown in Figure 1 and the input instance x
= (1 , 1 , 1) .
Notice that T ( x ) = 1 .
For each X ⊆ { 1 , 2 , 3 } , we show the probability p ( X ) :
=
Pr z [ T ( z ) = 1 | z ∈ C OMP ( y X )] , where y X is the partial instance that is obtained from x by fixing y X
[ i ] = ⊥ for each i ̸∈ X .
We observe, for instance, that x itself is neither a minimum nor a minimal 1 -SR for x under T , as y { 1 , 3 }
= (1 , ⊥ , 1) is also a 1 -SR.
In turn, y { 1 , 3 } is both a minimal and a minimum 1 -SR for x under T .
The partial instance y { 1 , 3 } is not, however, a minimal or a minimum 3 / 4 -SR for x under T , as y { 1 } = (1 , ⊥ , ⊥ ) is also a 3 / 4 -SR.
Example 2.
Consider the decision tree T over features { 1 , 2 , 3 } shown in Figure 2 and the input instance x
= (1 , 1 , 1) .
Notice that T ( x ) = 1 .
Exactly as in Example 1, we display as well the probabilities p ( X ) for each X ⊆ { 1 , 2 , 3 } .
Interestingly, this example illustrates that Observationdoes not hold when δ < 1 .
Indeed, consider that y { 1 , 2 , 3 } is a 5 / 8 -SR which is not minimal, as y ∅ is also a 5 / 8 -SR, but if we remove any single feature from y { 1 , 2 , 3 } , we obtain a partial instance which is not a 5 / 8 -SR.
As illustrated on Example 2, it is not true in general that if y ′ ⊂
y then
[Equation]
which means that standard algorithms for finding minimal sets holding monotone predicates (see e.g., (Marques-Silva et al., 2013)) cannot be used to compute minimal δ -SRs.
The problems of computing minimum and minimal δ -SR on decision trees were defined and left open by (Izza et al., 2021, 2022).
These problems are formally defined as follows.
PROBLEM: :
Compute-Minimum-SR
INPUT :
A
decision tree T of dimension n
an instance x of dimen
sion
n
and δ ∈ (
OUTPUT :
A minimum δ -SR for x under
T
PROBLEM: :
Compute-Minimal-SR
INPUT :
A
decision
tree
T of dimension n
an instance x of dimen
sion
n
and
δ ∈ (0 , 1]
OUTPUT :
A minimal
δ
SR
for x under T
The Complexity of Probabilistic Sufficient Reasons on Decision Trees
In what follows, we show that neither Compute-Minimum-SR nor Compute-Minimal-SR can be solved in polynomial time (unless PTIME = NP).
We first consider the problem
false true false true   true true false
T p ( ∅ ) =p ( { 1 } ) =p ( { 2 } ) =p ( { 3 } ) =p ( { 1 , 2 } ) =p ( { 1 , 3 } ) =p ( { 2 , 3 } ) =p ( { 1 , 2 , 3 } ) =
Compute-Minimum-SR , and in fact prove a stronger result by considering the family of problems δ - Compute-Minimum-SR where δ ∈ (0 , 1] is assumed to be fixed.
More precisely, we obtain as a corollary of Theorem 1 that 1 - Compute-Minimum-SR cannot be solved efficiently.
Moreover, a non-trivial modification of the proof of this theorem shows that this negative result continues to hold for every fixed δ ∈ (0 , 1] .
Theorem 2.
Fix δ ∈ (0 , 1] .
Then assuming that PTIME ̸ = NP , there is no polynomial-time algorithm for δ - Compute-Minimum-SR .
Let us now look at the problem Compute-Minimal-SR .
When δ = 1 , this problem can be solved in polynomial time as stated in Theorem 1.
However, it is conjectured by Izza et al.
(2021) that assuming
PTIME ̸ = NP, this positive behavior does not extend to the general problem Compute-Minimal-SR , in which δ is an input confidence parameter.
Our main result confirms that this conjecture is correct.
Theorem 3.
Assuming that PTIME ̸ = NP , there is no polynomial-time algorithm for
Compute-Minimal-SR .
Proof sketch.
We first show that the following decision problem, called Check-Sub-SR , is NP-hard.
This problem takes as input a tuple ( T, x ) , for T a decision tree of dimension n , and x ∈ { 0 , 1 , ⊥} n a partial instance, and the goal is to decide whether there is a partial instance y ⊊ x with Pr z [ T ( z ) =
| z ∈ C OMP ( y )] ≥ Pr z [ T ( z )
= 1 | z ∈ C OMP ( x )] .
We then show that if Compute-MinimalSR admits a polynomial time algorithm, then Check-Sub-SR is in PTIME, which contradicts the assumption that PTIME ̸ = NP.
The latter reduction requires an involved construction exploiting certain properties of the hard instances for Check-Sub-SR .
To show that Check-Sub-SR is NP-hard, we use a polynomial time reduction from a decision problem over formulas in CNF , called Minimal-Expected-Clauses , and which we also show to be
NP-hard.
Both the NP-hardness of Minimal-Expected-Clauses and the reduction from MinimalExpected-Clauses to Check-Sub-SR may be of independent interest.
We now define the problem Minimal-Expected-Clauses .
Let φ be a CNF formula over variables
X = { x 1 , . . .
, x n } .
Partial assignments of the variables in X , as well as the notions of subsumption and completions over them, are defined in exactly the same way as for partial instances over features.
For a partial assignment µ over X , we denote by E ( φ, µ ) the expected number of clauses of φ satisfied by a random completion of µ .
We then consider the following problem for fixed k ≥(recall that a k - CNF formula is a CNF formula where each clause has at most k literals):
PROBLEM : k -Minimal-Expected-Clauses
INPUT : ( φ, σ ) , for φ a k - CNF formula and σ a partial assignment
OUTPUT :
Yes , if there is a partial assignment µ ⊊ σ such that E ( φ, µ ) ≥ E ( φ, σ ) and No otherwise
We show that k -Minimal-Expected-Clauses is NP-hard even for k = 2 , via a reduction from the well-known clique problem.
Finally, the reduction from k -Minimal-Expected-Clauses to
Check-Sub-SR builds an instance ( T, x ) from ( φ, σ ) in a way that there is a direct correspondence between partial assignments µ ⊆ σ and partial instances y ⊆ x , satisfying that
[Equation]
where m is the number of clauses of φ .
This implies that ( φ, σ ) is a Yes -instance for k -MinimalExpected-Clauses if and only if ( T, x ) is a Yes -instance for Check-Sub-SR .
Tractable Cases
We now study restrictions on decision trees that lead to polynomial time algorithms for
Compute-Minimum-SR or Compute-Minimal-SR , hence avoiding the general intractability results shown in the previous section.
We identify two such restrictions: bounded split number and monotonicity .
5.1 Bounded split number
Let T be a decision tree of dimension n .
For a set U of nodes of T , we denote by F ( U ) the set of features from { 1 , . . . , n } labeling the nodes in U .
For each node u of T , we denote by N ↓ u the set of nodes appearing in T u , that is, the subtree of T rooted at u .
On the other hand, we denote by N ↑ u the set of nodes of T minus the set of nodes N ↓ u .
We define the split number of the decision tree T to be
[Equation]
Intuitively, the split number of a decision tree T is a measure of the interaction (number of common features) between the subtrees of the form T u and their exterior.
A small split number allows us to essentially treat each subtree T u independently (in particular, the left and right subtrees below any node), which in turn leads to efficient algorithms for the problems Compute-Minimum-SR and
Compute-Minimal-SR .
Theorem 4.
Let c ≥ 1 be a fixed integer.
Both Compute-Minimum-SR and Compute-Minimal-SR can be solved in polynomial time for decision trees with split number at most c .
Proof Sketch.
It suffices to provide a polynomial time algorithm for Compute-Minimum-SR .
(The same algorithm works for Compute-Minimal-SR as a minimum δ -SR is in particular minimal.)
In turn, using standard arguments, it is enough to provide a polynomial time algorithm for the following decision problem Check-Minimum-SR : Given a tuple ( T, x , δ, k ) , where T is a decision tree of dimension n , x ∈ { 0 , 1 , ⊥} n is a partial instance, δ ∈ (0 , 1] , and k ≥ 0 is an integer, decide whether there is a partial instance
y ⊆
x such that n − | y | ⊥ ≤ k and Pr z [ T ( z ) =
| z ∈ C OMP ( y )] ≥ δ .
In order to solve Check-Minimum-SR over an instance ( T, x , δ, k ) , where T has split number at most c , we apply dynamic programming over T in a bottom-up manner.
Let Z ⊆ { 1 , . . .
, n } be the set of features defined in x , that is, features i with x
[ i ] ̸ = ⊥ .
Those are the features we could eventually remove when looking for y .
For each node u in T , we solve a polynomial number of subproblems over the subtree T u .
We define
[Equation]
In other words, Int ( u ) are the features appearing both inside and outside T u , while New ( u ) are the features only inside T u , that is, the new features introduced below u .
Both sets are restricted to Z as features not in Z play no role in the process.
Each particular subproblem is indexed by a possible size s ∈ { 0 , . .
. , k } and a possible set J ⊆
Int ( u ) and the goal is to compute the quantity:
[Equation]
where C u,s,J is the space of partial instances
y ⊆ x with n − | y | ⊥ ≤ s and such that y
[ i ] = x
[ i ] for i ∈ J and y
[ i ] = ⊥ for i
∈ Int ( u ) \ J .
In other words, the set J fixes the behavior on Int ( u ) (keep features in J , remove features in Int ( u ) \ J ) and hence the maximization occurs over choices on the set New ( u ) (which features are kept and which features are removed).
The key idea is that p u,s,J can be computed inductively using the information already computed for the children u 1 and u 2 of u .
Intuitively, this holds since the common features between T u 1 and T u 2 are at most c , which is a fixed constant, and hence we can efficiently synchronize the information stored for u 1 and u 2 .
Finally, to solve the instance ( T, x , δ, k ) we simply check whether p r,k, ∅ ≥ δ , for the root r of T .
5.2 Monotonicity
Monotonic classifiers have been studied in the context of XAI as they often present tractable cases for different explanations, as shown by Marques-Silva et al.
The computation of minimal sufficient reasons for monotone models was known to be in PTIME since the work of Goldsmith et al.
We show that this is also the case for computing minimal δ -SRs under a mild assumption on the class of models.
Let us define the ordering ⪯ for instances in { 0 , 1 } n as follows:
[Equation]
We can now define monotonicity as follows.
A model M of dimension n is said to be monotone if for every pair of instances x , z ∈ { 0 , 1 } n , it holds that x ⪯ z =
⇒ M ( x ) ≤ M ( z ) .
We now prove that the problem of computing minimal probabilistic sufficient reasons can be solved in polynomial time for any class C of monotone Boolean models for which the problem of counting positive completions can be solved efficiently.
Formally, the latter problem is defined as follows: given a model M ∈ C of dimension n and a partial instance y ∈ { 0 , 1 , ⊥} n , compute |{ x ∈
C OMP ( y ) | M ( x ) = 1 }| .
We call this problem C - Count-Positive-Completions
Theorem 5.
Let C be a class of monotone Boolean models such that the problem
C - Count-Positive-Completions can be solved in polynomial time.
Then Compute-Minimal-SR can be solved in polynomial time over C .
Proof sketch.
Consider a partial instance y of dimension n and i ∈ { 1 , . .
. , n } .
Suppose y [ i ] ̸ = ⊥ .
We write y \ { i } for the partial instance y ′
that is exactly equal to y save for the fact that y ′
[ i ] = ⊥ .
We make use of the following lemma, which is a probabilistic counterpart to Observation 1.
Lemma 1.
Let C be a class of monotone models, M ∈ C a model of dimension n , and x ∈ { 0 , 1 } n an instance.
Consider any δ ∈ (0 , 1] .
Then if y ⊆ x is a δ -SR for x under M which is not minimal, then there is a partial instance y \ { i } , for some i ∈ { 1 , . . . , n } , that is also a δ -SR for x under M .
With this lemma we can prove Theorem 5.
In fact, it can be shown then that a slight variant of
Algorithm 1 computes in polynomial time a minimal δ -SR for x under M .
As a corollary, the computation of minimal probabilistic sufficient reasons can be carried out in polynomial time not only over monotone decision trees, but also over monotone free BDDs.
Corollary 1.
The problem of computing minimal δ -SRs can be solved in polynomial time over the class of monotone free BDDs.
SAT to the Rescue!
Despite the theoretical intractability results presented earlier on, many NP-complete problems can be solved over practical instances with the aid of SAT solvers .
By definition, any NP-complete problem can be encoded as a CNF satisfiability (SAT) problem, which is then solved by a highly optimized program, a SAT solver .
In particular, if a satisfying assignment is found for the CNF instance, one can translate such an assignment back to a solution for the original problem.
In fact, this paradigm has been successfully used in the literature for other explainability problems (Ignatiev et al., 2021, 2022; Izza et al., 2020b).
The effectiveness of this approach is highly dependent on the particular encoding being used (Biere et al., 2009), where the aspect that arguably impacts performance the most is the size of the encoding, measured as the number of clauses of the resulting CNF formula.
In this section we present an encoding that uses some standard automated reasoning tools (e.g., sequential encondings (Sinz, 2005)) combined with ad-hoc bit-blasting (Biere et al., 2009), where the arithmetic operations required for probabilistic reasoning are implemented as Boolean circuits and then encoded as CNF by Tseitin transformations.
The appendix describes experimentation both over synthetic datasets and standard datasets (MNIST) and reports empirical results.
A recent report by Izza et al.
(2022) also uses automated reasoning for this problem, although through an SMT solver.
Let us consider the following decision version of the Compute-Minimum-SR problem.
PROBLEM: :
Decide-Minimum-SR
INPUT :
A decision tree T of dimension n , an instance x of dimension n , an integer k ≤ n , and δ ∈ (0 , 1]
OUTPUT :
Yes if there is a δ -SR y for x under T with | y | ⊥ ≤ k , and
No otherwise.
This problem is NP-complete.
Membership is already proven by Izza et al.
Hardness follows directly from Theorem 2, as if one were able to solve Decide-Minimum-SR in polynomial time, then a simple binary search over k would allow solving Compute-Minimum-SR in polynomial time.
6.1 Deterministic Encoding
Let us first propose an encoding for the particular case of δ = 1 .
First, create Boolean variables
f i for i ∈ { 1 , . . . , n } , with f i representing that
y
[ i ] ̸ = ⊥ , where y is the desired δ -SR.
Then, for every node u of the tree T , create a variable r u representing that node u is reachable by a completion of y , meaning that there exists a completion of y that goes through node u when evaluated over T .
We then want to enforce that:
r ROOT = 1 , where ROOT is the root of T .
This means that the root is always reachable.
The desired δ -SR y satisfies n − | y | ⊥ ≤ k , meaning that (cid:80) ni =
1 f i ≤ k . 3.
If T ( x ) = 1 , and F is the set of false leaves of T , then r ℓ = 0 for every ℓ ∈ F .
This means that if we want to explain a positive instance, the completions of the explanation y must all be positive (recall we assume δ = 1) , and thus no false leaf should be reachable.
Conversely, If T ( x ) = 0 , and G is the set of true leaves of T , then r ℓ = 0 for every ℓ ∈ G . 4.
The semantics of reachability is consistent : if a node u is reachable, and its labeled with feature i , then if f i = 0 , meaning that feature i is undefined in y , both children of u should be reachable too.
In case f i = 1 , only the child along the edge corresponding to x
[ i ] should be reachable.
Let us analyze the size of this encoding.
Condition 1 requires a single clause to be enforced.
Condition 2 can be enforced with O ( nk ) variables and clauses using the linear encoding of Sinz (2005).
Condition 3 requires at most one clause per leaf of T and thus at most O ( | T | ) clauses.
Condition 4 can be implemented with a constant number of clauses per node.
We thus incur in a total of O ( nk + | T | ) variables and clauses, which is pretty much optimal considering Ω( n + | T | ) is a lower bound on the representation of the input.
Note as well that from a satisfying assignment we can trivially recover the desired explanation y as
[Equation]
An efficient encoding supporting values of δ different than 1 is significantly more challenging and involved, and thus we only provide an outline here.
An exhaustive description, together with the implementation, is provided in the supplementary material.
6.2 Probabilistic Encoding
In order to encode that Pr z [ T ( z ) =
T ( x ) | z ∈ C OMP ( y )] ≥ δ , we will directly encode that |{ z ∈ C OMP ( y ) | T ( z )
=
T ( x ) }| ≥ (cid:6) δ 2 | y | ⊥ (cid:7) , where we assume for simplicity that the ceiling can be take safely, in order to have a value we can represent by an integer.
This assumption is not crucial.
As before, we will have f i variables representing
whether y [ i ] ̸ = ⊥ or not, and enforce that (cid:80) ni =
f i ≤ k .
Now define variables c j for j ∈ { 0 , . . . , n } , such that c j is true exactly when (cid:80) ni
=1 f i = j .
This can again be done efficiently via a linear encoding.
Let t i for i ∈ { 0 , . . . , n } a series of variables that represent the bits of an integer t .
The integer t will correspond to the value of (cid:6) δ 2 | y | ⊥ (cid:7) .
Note that as | y | ⊥ can only take n + 1 different values, there are only n + 1 different values that t can take.
Moreover, the value of the c j variables completely determines the value of t , and thus we can manually encode how the c j variables determine the bits t i .
We can now assume that we have access to t through its bits t i .
Our goal now is to build a binary representation of
[Equation]
so that we can then implement the condition α ≥ t with a Boolean circuit on their bits.
In order to represent α , we will decompose the number of instances z according to the leaves of T as follows.
If L is the set of leaves of T whose label matches T ( x ) , then
[Equation]
where notation T ( z ) ⇝ ℓ means that the evaluation of z under T ends in the leaf ℓ .
For a given leaf ℓ , we can compute its weight w ℓ := |{ z ∈ C OMP ( y ) | T ( z ) ⇝ ℓ ) }| as described next.
Let F ℓ be the set of labels appearing in the unique path from the root of T down to ℓ .
Now let u ℓ be the number of undefined features of y along said unique path, and thus u ℓ can be defined as follows: u ℓ := | F ℓ \ { i | f i = 1 }| .
The sets F ℓ depend only on T and thus can be precomputed.
Therefore we can use a linear encoding again to define the values u ℓ .
It is simple to observe now that w ℓ = 2 u ℓ .
which means that by representing the values u ℓ we can trivially represent the values w ℓ in binary (they will simply consist of a 1 in their ( u ℓ + 1) -th position right-to-left), and then implement a
Boolean addition circuit to compute α = (cid:80) ℓ w ℓ .
This concludes the outline of the encoding.
Its number of variables clauses can be shown to be at most O ( n 2 | T | + nk ) .
Conclusions and Future Work
The results proven in this paper suggest that minimal (or minimum) explanations might be hard to obtain in practice even for decision trees, especially in problems where the feature space has large dimension.
A way to circumvent the limitations proven in our work is to relax the guarantee of minimality, or introduce some probability of error, as done in the work of Blanc et al.
A promising direction of future research is to better understand the kind of guarantees and settings in which is still possible to obtain tractability.
Our work leaves open some interesting technical questions: (1) What is the parameterized complexity of computing minimum δ -SRs over decision trees, assuming that the parameter is the size of the explanation one is looking for?
It is not hard to see that W[2] hardness follows from our proofs (i.e., they are parameterized reductions all the way to Set Cover), but membership in any class is fully open.
(2) Does Theorem 2 continue to hold for monotone decision trees?
That is, is it the case that computing minimum δ -SRs over monotone decision trees is hard for every fixed δ ∈ (0 , 1] ?
(3) Is it the case that the hardness of computation for minimal sufficient reasons holds for a fixed δ ∈ (0 , 1] ?
If so, does it hold for every fixed such a δ , or only for some?
(4) Is it possible to extend the positive behavior of decision trees with bounded split number to free BDDs?
Acknowledgments
Barceló is funded by Fondecyt grant 1200967.
Arenas and Barceló have been funded by ANIDMillennium Science Initiative Program - Code ICN17002.
Barceló has also been funded by National
Center for Artificial Intelligence CENIA FB210017, Basal ANID.
M. Romero was funded by
Fondecyt grant Nº11200956.
Subercaseaux is supported by NSF awards CCF-2015445, CCF1955785, and CCF2006953.
Appendix
Organization.
The supplementary material is organized as follows.
In section A, we provide a proof that there is no polynomial-time algorithm for the problem of computing minimum δ -sufficient reasons (unless PTIME = NP), even when δ is a fixed value.
In section B, we provide a proof that there is no polynomial-time algorithm for the problem of computing minimal δ -sufficient reasons (unless PTIME = NP).
In particular, we define in this section a decision problem that we prove to be
NP-hard in Section B.1, and then we show in Section B.2 that this decision problem can be solved in polynomial-time if there exists a polynomial-time algorithm for the problem of computing minimal δ -sufficient reasons.
In Section C, we provide a proof that minimum and minimal δ -sufficient reasons can be computed in polynomial-time when the split number (defined in Section 5.1) is bounded.
Finally, we provide in Section D a proof of Lemma 1, which completes the proof of tractability of the problem of computing minimal δ -sufficient reasons for each class of monotone Boolean models for which the problem of counting positive completions can be solved in polynomial time.
Finally, we describe in Section E our experimental evaluation of the encodings given in Section 6.
A Proof of Theorem
Theorem 2.
Fix δ ∈ (0 , 1] .
Then assuming that PTIME ̸ = NP , there is no polynomial-time algorithm for δ - Compute-Minimum-SR .
Before we can prove this theorem, we will require some auxiliary lemmas.
Given rational numbers a, b with a ≤ b , recall that notation [ a, b ] refers to the set of rational numbers x such that a ≤ x ≤ b (and likewise for [ a, b ) ).
Lemma 2.
Fix δ ∈ (0 , 1) .
Given as input an integer n one can build in n O (1) time a decision tree T δ of dimension n , such that
[Equation]
and moreover, there exists an instance x † for T δ such that every partial instance y ⊆ x † holds
[Equation]
Proof.
Let c =
⌊ δ 2 n ⌋ , and note that δ − 12 n ≤ c 2 n ≤ δ , and thus | δ − c 2 n | ≤ 12 n .
This implies that we can prove the first part of the lemma by building in polynomial time a tree T c over n variables, that has exactly c different positive instances, as then its probability of accepting a random completion of ⊥ n will be exactly c 2 n .
Note as well that c < 2 n as δ < 1 .
As a first step, let us write c in binary, obtaining
[Equation]
with α i ∈ { 0 , 1 } for each i .
Then to build T c start by creating n vertices, labeled 0 through n − 1 .
These n labels are the variables of T c .
For each i ∈ { 1 , . . . , n − 1 } , connect vertex labeled i to vertex labeled i − 1 with a 0 -edge, making vertex labeled n − 1 the root of T c .
Then, for each vertex with label i ∈ { 0 , . . .
, n − 1 } , set its 1 -edge towards a leaf with label true if α i = 1 , and towards a leaf with label false if α i = 0 .
The 0 -edge of vertex labeled 0 goes towards a leaf with label false .
Now let us count how many different positive instances does T c have.
We can do this by summing over all true leaves of T c .
Each true leaf comes from a 1 -edge from a vertex labeled i ∈ { 0 , . . .
, n − 1 } .
For every i ∈ { 0 , . . . , n − 1 } , if the vertex labeled i has a true leaf when following its 1 -edge, then the number of instances reaching that true leaf is exactly 2 i , as the variables whose value is not determined by the path to that leaf are those with labels less than i , which are exactly i variables.
Therefore, the number of different positive instances of T c along a 1 -edge is the sum of 2 i for every i such that α i = 1 , which is exactly c .
An example is given in Figure 3.
This concludes the proof of the first part of the lemma as the construction is clearly polynomial in n .
For the second part, let us build x † by setting x † [ i ] = 1 − α
i for every i ∈ { 0 , . .
. , n − 1 } .
In the example presented in Figure 3, we would build x † = (1 , 1 , 0 , 0 , 1) .
We will now prove that for any y ⊆ x † , it holds that
[Equation]
We do this via a finite induction argument by strengthening our induction hypothesis; for i ∈ { 0 , . . .
, n − 1 } , let T ic be the sub-tree of T c rooted at the vertex labeled i , and let us claim that for every i ∈ { 0 , . .
. , n − 1 } we have that
[Equation]
which implies what we want to show when taking i = n − 1 .
The base case of the induction is when i = 0 , in which case the claim trivially holds as if y [0] = ⊥
we have equality, and if y [0] ̸ = ⊥ then by construction
[Equation]
For the inductive case, let i > 0 , and proceed by cases; if y [ i ] = ⊥ , then by letting t i ∈ { 0 , 1 } be an indicator variable for whether the leaf across the 1 -edge from vertex i is labeled true we have that
[Equation]
where the inequality has used the inductive hypothesis.
On the other hand, if y [ i ] = 1 , that implies x † [ i ] = 1 and thus α i = 0 , which means the leaf across the 1 -edge from vertex i is labeled with false , and thus
[Equation]
which trivially satisfies the claim.
For the last case, if y [ i ] = 0 , then x † [ i ] = 0 and thus α i = 1 , which means the leaf across the 1 -edge from vertex i is labeled with true .
Therefore we have
[Equation]
This completes the induction argument, and thus we conclude the proof of the lemma.
We are now ready to prove Proposition 2.
We will use notation log( x ) to refer to the logarithm in base 2 of x .
Proof of Theorem 2.
We will prove that deciding whether a δ -SR of size k exists is NP-hard.
We will reduce from the case δ = 1 , proved NP-hard by Barceló et al.
We assume of course
that δ < 1 , as otherwise the result is already known.
Let ( T, x , k ) be an input of the Minimum Sufficient Reason problem (i.e., δ = 1 ), and let n be the dimension of T and x .
Assume without loss of generality that T ( x ) = 1 .
If the given input of
Minimum Sufficient Reason is positive, then there is a partial instance
y ⊆ x with | y |
⊥ ≥ n − k such that Pr z [ T ( z ) = 1 | z ∈ C OMP ( y )]
= 1 , and otherwise for every partial instance
y ⊆ x with | y |
⊥ ≥ n − k it holds that
[Equation]
Let us build a tree F δ with 3 n + 3 + ⌈ log(1 /δ )
⌉ variables as follows.
First build T δ of dimension 2 n + 3 + ⌈ log(1 /δ )
⌉ by using Lemma 2, and then replace every true leaf of T δ by a copy of T .
false false false true true false
Assume the 2 n + 3 + ⌈ log(1 /δ )
⌉ variables of T δ are disjoint from the n variables that appear in T , and thus F δ has the proposed number of variables.
An example of the construction of F δ is illustrated in Figure 4.
Define
[Equation]
, and recall that | δ ′ − δ | ≤ 1 2 2 n +
[Equation]
+ ⌈ log(1 /δ )
Now, let us build a final decision tree T ⋆δ with 4 n + k + 4 + ⌈ log(1 /δ ′ )
⌉ + ⌈ log(1 /δ )
⌉ variables as follows.
Create ℓ := n + k + 1 + ⌈ log(1 /δ ′ )
⌉ vertices, labeled r i for i ∈ { 1 , . . . , ℓ } , and assume these labels are disjoint from the ones used in F δ .
Let rbe the root of T ⋆δ , and for each i ∈ { 1 , . . .
, ℓ − 1 } , connect vertex labeled with r i to vertex labeled with r i +1 using a 0 -edge.
The 0 -edge from vertex labeled r ℓ goes towards a leaf labeled with true .
The 1 -edge from every vertex r i goes towards the root of a different copy of F δ .
Note that this construction, illustrated in Figure 5, takes polynomial time.
Now, consider the instance x
⋆ that is defined (i)
exactly as x for the variables of T , (ii) exactly as in the instance x † coming from Lemmafor the variables of T δ in F δ , and (iii) with all variables r i set to 0 .
Note that T ⋆δ ( x ⋆ ) = 1 .
Now we prove both directions of the reduction separately.
Assume fir that the instance ( T, x , k ) is a positive instance for Minimum Sufficient Reason .
Then we claim that there is a δ -SR for T ⋆δ of size at most k .
Indeed, let y ⊆
x be a sufficient reason for x under T with at most k defined components.
Then consider the partial instance y ⋆ ⊆
x ⋆ , that is only defined in the components where y is defined.
Now let us study Pr z [ T ⋆δ ( z ′ )
= 1 | z ∈ C OMP ( y ⋆ )] .
The probability that z ends up in the true leaf on the 0 -edge from vertex r ℓ is 12 ℓ .
In any other case, z takes a path that goes into a copy of F δ , where its probability of acceptance is δ ′ ≥ δ −
[Equation]
⌈ log
[Equation] [Equation]
δ ) ⌉ because of Lemma 2 and using that y ⋆ is undefined for all the variables of T c .
These two facts imply that
[Equation]
Now consider that
[Equation]
from where
[Equation]
and thus
[Equation]
using 2 2 n +
[Equation]
From this we obtain that
[Equation]
which allows us to conclude that
[Equation]
On the other hand, if ( T, x , k ) is a negative instance for Minimum Sufficient Reason , consider any partial y ⋆ with at most k defined components, and note that by hypothesis we have that
Pr z [ T ( z ) =
| z ∈
[Equation]
( y ⋆ )] ≤ 1 − 12 n .
This implies, together with the second part of Lemma 2, that
[Equation]
and thus subsequently
[Equation]
by using that with at most k defined components in T ⋆δ , the probability of reaching the true leaf across the 0 -edge from r ℓ is at most
[Equation]
ℓ − k .
To conclude, note that
[Equation]
We have thus concluded that y ⋆ is a δ -SR for x ⋆ over T ⋆δ if and only if ( T, x , k ) is a positive instance of Minimum Sufficient Reason , which completes our reduction.
T false T false
T false
T false false                rr...
r ℓ −r ℓ true
F δ
F δ . ..
F δ F δ
B Proof of Theorem
Theorem 3.
Assuming that PTIME ̸ = NP , there is no polynomial-time algorithm for
Compute-Minimal-SR .
We start by explaining the high-level idea of the proof.
First, we will show that the following decision problem, called Check-Sub-SR , is NP-hard.
PROBLEM :
Check
[Equation]
-SR
INPUT : ( T, y ) , for a decision tree T of dimension n , and partial instance y ∈ { 0 , 1 , ⊥} n
OUTPUT :
Yes , if there is a partial instance y ′
⊊ y such that
[Equation]
and No otherwise
We then show that if Compute-Minimal-SR admits a polynomial time algorithm, then
Check-Sub-SR is in PTIME, which contradicts the assumption that PTIME ̸ = NP.
The latter reduction requires an involved construction exploiting certain properties of the hard instances for
Check-Sub-SR .
To show that Check-Sub-SR is NP-hard, we use a polynomial time reduction from a decision problem over formulas in CNF, called Minimal-Expected-Clauses , and which we also show to be
NP-hard.
Both the NP-hardness of Minimal-Expected-Clauses and the reduction from MinimalExpected-Clauses to Check-Sub-SR may be of independent interest.
We now define the problem Minimal-Expected-Clauses .
Let φ be a CNF formula over variables
X = { x 1 , . . .
, x n } .
Assignments and partial assignments of the variables in X , as well as the notions of subsumption and completions over them, are defined in exactly the same way as for partial instances over features.
For a partial assignment µ over X , we denote by E ( φ, µ ) the expected number of clauses of φ satisfied by a random completion of µ .
We then consider the following problem for fixed k ≥ 2 (recall that a k -CNF formula is a CNF formula where each clause has at most k literals):
PROBLEM : k -Minimal-Expected-Clauses
INPUT : ( φ, σ ) , for φ a k -CNF formula and σ a partial assignment
OUTPUT :
Yes , if there is a partial assignment µ ⊊ σ such that E ( φ, µ ) ≥ E ( φ, σ ) and No otherwise
We show that k -Minimal-Expected-Clauses is NP-hard even for k = 2 , via a reduction from the well-known clique problem.
Finally, the reduction from k -Minimal-Expected-Clauses to
Check-Sub-SR builds an instance ( T, y ) from ( φ, σ ) in a way that there is a direct correspondence between partial assignments µ ⊆ σ and partial instances y ′ ⊆
y , satisfying that
[Equation]
where m is the number of clauses of φ .
This implies that ( φ, σ ) is a Yes -instance for k -MinimalExpected-Clauses if and only if ( T, y ) is a Yes -instance for Check-Sub-SR .
Below in Section B.1, we show the NP-hardness of k -Minimal-Expected-Clauses and the reduction from k -Minimal-Expected-Clauses to Check-Sub-SR , obtaining the NP-hardness of Check-Sub-SR .
We conclude in Section B.2 with the reduction from Check-Sub-SR to
Compute-Minimal-SR , obtaining Theorem 3.
B.1 Hardness of the decision problem
We start with some simple observations regarding the number E ( φ, µ ) for a CNF formula φ and a partial assignment µ .
By linearity of expectation, we can write E ( φ, µ ) as the sum
[Equation]
where Prob C,µ is the probability that a random completion of µ satisfies the clause C .
In turn, the probabilities Prob C,µ can be easily computed as:
• Prob C,µ = 1 , if there is a positive literal x in C with µ ( x ) = 1 ; or there is a negative literal ¬ x in C with µ ( x ) = 0 .
• Prob C,µ = 1 − 12 η , where η is the number of literals in C of the form x or ¬ x with µ ( x ) = ⊥ .
Finally, note that for an assignment σ , E ( φ, σ ) is simply the number of clauses of φ satisfied by σ .
Now we are ready to show our first hardness result:
Proposition 1.
k -Minimal-Expected-Clauses is NP-hard even for k = 2 .
Proof.
We reduce from the clique problem.
Recall this problem asks, given a graph G and an integer k ≥ 3 , whether there is a clique of size k , that is, a set K of k vertices such that there is an edge between any pair of distinct vertices from K .
Let G be a graph and k ≥ 3 .
We can assume without loss of generality that k is odd and the degree of every vertex x of G , denoted by deg( x ) , is at least k − 1 ; if k is even we can consider the equivalent instance given by the graph G ′
that extends G with a fresh node connected via an edge with all the other nodes and k ′ =
k
+ 1 .
On the other hand, we can iteratively remove vertices of degree less than k − 1 as those cannot be part of any clique of size k .
We define an instance ( φ, σ ) for 2 -Minimal-Expected-Clauses as follows.
The variables of φ are the nodes of G .
For each variable x we have the following clauses in φ :
• A clause
A x = ( ¬ x ) .
This clause A x is repeated k − 12 + deg( x ) − ( k − 1) times in φ .
Note this quantity is always a positive integer.
• A set of clauses B x
= { ( x ∨ ¬ y 1 )
, ( x ∨ ¬ y deg( x ) ) } , where y 1 , . .
, y deg(
x ) are the neighbors of x in G .
Each clause in B x appears only once in φ .
Additionally, for each set { x, y } where x ̸ = y and { x, y } is not an edge in G , we have a clause
Z x,y =
( x ∨ y ) repeated 4 e times in φ , where e is the number of edges in G .
We define the assignment σ such that σ ( x ) = 1 , for all variables x of φ .
For an arbitrary partial assignment µ to the variables of φ , with µ ⊆ σ , we define
[Equation]
In particular, the instance ( φ, σ ) is a Yes -instance for 2 -Minimal-Expected-Clauses if and only if there is µ ⊊ σ with utility φ,σ ( µ ) ≥ 0 .
By equation (1), we can write
[Equation]
where utility φ,σ ( µ, C ) is defined as:
[Equation]
We have that:
[Equation]
variable x
[Equation]
C =
Z x
[Equation]
y
[Equation]
set
[Equation]
x, y }
On the other hand, for the probability Prob C,µ we have the following:
Assume C
=
A x = ( ¬ x ) for some variable x .
Then Prob C,µ is (a) 1 2 , if µ ( x ) = ⊥
(and hence utility φ,σ ( µ, C ) = 1 2 ), and (b) 0 otherwise (then utility φ,σ ( µ, C ) = 0 ).
Suppose C
=
( x ∨ ¬ y
) ∈
B x for some variable x .
Then Prob C,µ is (a) 34 if µ ( x ) = ⊥ and µ ( y ) =
⊥ (and hence utility φ,σ ( µ, C ) = − 14 ),
(b) 12 if µ ( x ) = ⊥ and µ ( y )
= 1 (and then utility φ,σ ( µ, C ) =
− 12 ), and (c) 1 otherwise (then utility φ,σ ( µ, C ) = 0 ).
Suppose C =
Z x,y =
( x ∨ y ) for some set { x, y } .
Then Prob C,µ is (a) 34 if µ ( x ) = ⊥ and µ ( y ) =
⊥ (and hence utility φ,σ ( µ, C ) = − 14 ), and (b) 1 otherwise (then utility φ,σ ( µ, C ) = 0 ).
We now show the correctness of our construction.
Suppose G has a clique K of size k ≥ 3 .
Let µ be the partial assignment that sets µ ( x ) = ⊥ if x ∈ K and µ ( x ) =
if x / ∈ K .
Note that µ ⊊ σ .
We claim that utility φ,σ ( µ ) = 0 and hence ( φ, σ ) is a
Yes -instance.
Let C be a clause in φ .
If C is of the form Z x,y , then utility φ,σ ( µ, C ) = 0 .
Indeed, by construction, { x, y } is not an edge, and since
K is a clique, then µ ( x ) = 1 or µ ( y )
= 1 .
This means we are always in case 3(b) above.
If x / ∈ K and C is of the form A x or belongs to B x , then utility φ,σ ( µ, C ) = 0 , since µ ( x ) = 1 and hence we fall either in case 1(b) or 2(c) above.
It follows that utility φ,σ ( µ ) is the sum of the utilities of all the clauses involved with variables x ∈ K .
That is:
[Equation]
Take x ∈ K .
Then utility φ,σ ( µ, A x ) = 12 as µ ( x ) = ⊥ , and then case 1(a) applies.
On the other hand, for a clause C ∈ B x we have two cases:
• C =
( x ∨ ¬ y ) for y ∈ K .
In this case, utility φ,σ ( µ, C ) = − 14 as we are in case 2(a) above.
• C
=
( x ∨ ¬ y ) for y / ∈ K .
In this case, utility φ,σ ( µ, C ) = − 12 as we are in case 2(b) above.
Moreover, note that the first case occurs exactly for k − 1 clauses in B x , as x has precisely k −neighbors in the clique K .
The second case occurs exactly for deg( x ) − ( k − 1) ≥ 0 clauses in B x .
Replacing in equation (2), we obtain:
[Equation]
We conclude that ( φ, σ ) is a
Yes -instance.
Suppose now that there is a partial assignment µ , with µ ⊊ σ and utility φ,σ ( µ ) ≥ 0 .
Let K be the set of variables x such that µ ( x ) = ⊥ .
For x / ∈ K and C =
A x or C ∈ B x , we have utility φ,σ ( µ, C ) = 0 , as we are in cases 1(b) or 2(c) above.
Then we can write:
[Equation]
y } non-edge
[Equation]
φ
[Equation]
We claim that | K | ≥ k .
Towards a contradiction, suppose | K | =
ℓ < k .
As utility φ,σ ( µ, Z x,y ) ≤for every pair { x, y } , the last term in equation (3) is ≤ 0 , and then:
[Equation]
Take x ∈ K .
Following the same argument as before, we have that utility φ,σ ( µ, A x ) = 12 and for a clause C ∈ B x we have the two cases:
• C =
( x ∨ ¬ y ) for y ∈ K , and utility φ,σ ( µ, C ) = − 14 .
• C =
( x ∨ ¬ y ) for y / ∈ K , and utility φ,σ ( µ, C ) = − 12 .
Let say the first case occurs precisely for r clauses from B x .
Then:
[Equation]
Note that r ≤ ℓ − 1 and from equation (5) we obtain (recall ℓ < k ):
[Equation]
Replacing in equation (4), we obtain:
[Equation]
We conclude that utility φ,σ ( µ ) < 0 which is a contradiction.
Hence | K | ≥ k .
Finally, we show that K is a clique.
By contradiction, assume there is a pair { ˜ x, ˜ y } such that ˜ x ̸ =
˜
y , ˜ x, ˜ y ∈ K and { ˜ x, ˜ y } is not an edge in G .
Then there is a clause Z ˜ x, ˜ y which is repeated M times in φ .
Since µ (˜ x ) = ⊥ and µ (˜ y )
= ⊥ , we have utility φ,σ ( µ, Z ˜ x, ˜ y )
=
− 14 , as we are in case 3(a) above.
As utility φ,σ ( µ, Z x,y ) ≤ 0 for all pairs { x, y } , we obtain:
[Equation]
For x ∈ K , since utility φ,σ ( µ, C ) ≤ 0 , for all C ∈ B x , we have (cid:80) C ∈B x utility φ,σ ( µ, C ) ≤ 0 and hence:
[Equation]
On the other hand, for x ∈ K , we have utility φ,σ ( µ, A x ) = 12 .
Combining all this with equation (3) we obtain:
[Equation]
[Equation]
We conclude that utility φ,σ ( µ ) < 0 , and thus obtain a contradiction.
Hence G contains a clique of size k .
We now provide the reduction from 2 -Minimal-Expected-Clauses to Check-Sub-SR , showing the hardness of the latter problem.
Proposition 2.
Check-Sub-SR is NP -hard.
Proof.
We reduce from 2 -Minimal-Expected-Clauses .
Let ( φ, σ ) be an instance of 2 -MinimalExpected-Clauses .
Let m be the number of clauses of φ and assume that φ has n variables x 1 , . . .
, x n .
Without loss of generality we assume that m is a power of 2 .
Define a decision tree
T of dimension n + m − 1 as follows.
Start with a perfect binary tree S of depth log 2 m , that is, each internal node has two children, and each leaf is at depth log 2 m .
In particular, S has m leaves and m − 1 internal nodes.
All the internal nodes of S are labeled with a different fresh feature from { n + 1 , . . . , n + m − 1 } .
For each clause C in φ , pick a different leaf ℓ C of S .
It is easy to see that for each clause
C we can define a decision tree S C over the features { 1 , . . . , n } such that for every assignment µ : { x 1 , . . .
, x n } → { 0 , 1 } to the variables of φ , the corresponding instance x ∈ { 0 , 1 } n where x [ i ] = µ ( x i ) satisfies that S C ( x )
= 1 if and only if µ satisfies C .
The decision tree T is obtained from S by identifying for each clause C , the leaf ℓ C with the root of the decision tree S C .
For any partial assignment µ : { x 1 , . . .
, x n } → { 0 , 1 , ⊥} for φ , we denote by y µ the partial instance of dimension n + m − 1 such that y µ [ i ]
= µ ( x i ) for every i ∈ { 1 , . .
. , n } and y µ [ i ] = ⊥ for every i ∈ { n + 1 , . .
. , n + m − 1 } .
The output of the reduction is ( T, y σ ) .
Observe that the transformation from µ to y µ is a bijection between the sets { µ | µ ⊆ σ } and { y µ | y µ ⊆
y σ } .
By construction, for any partial assignment µ ⊆ σ , we have:
[Equation]
Hence ( φ, σ ) is a Yes -instance of 2 -Minimal-Expected-Clauses if and only if ( T, y σ ) is a Yesinstance of Check-Sub-SR .
Remark 1.
We can assume that the instance ( T, y σ ) constructed in the proof of Proposition 2, satisfies that
[Equation]
Indeed, the above probability is simply E ( φ,σ ) m , where m is the number of clauses of φ .
On the other hand, from the proof of Proposition 1, we can choose σ such that σ ( x i ) =
1 for every variable x i ∈ { x 1 , . . .
, x n } of φ .
It follows that E ( φ, σ ) is simply the number of clauses satisfied by σ , which are all the clauses in B x for some variable x , and all the clauses of the form Z x,y .
Note that the total number of clauses from the sets B x is greater that the total number clauses of the form A x , and hence E ( φ,σ ) m > 12 .
Indeed, there are deg( x ) clauses in B x , and summing over all the variables x , we obtain 2 e , where e are the number of edges in the graph G .
On the other hand, each clause A x is repeated k − 12 + deg( x ) − ( k − 1) =
deg( x ) − k − 12 times.
Taking the sum over all the variables x , we obtain 2 e − n (cid:0) k − 12 (cid:1) < 2 e .
This property will be useful in the Section B.2.
B.2 From hardness of decision to hardness of computation
We will show a Turing-reduction from a variant of Check-Sub-SR to Compute-Minimal-SR , thus establishing that the latter cannot be solved in polynomial time unless P = NP .
For the sake of readability, given a partial instance y , in this proof we use notation z ∼ U ( y ) to indicate that z is generated uniformly at random from the set C OMP ( y ) .
For instance, we obtain the following simplification by using this terminology:
[Equation]
We will require a particular kind of hard instances for the Check-Sub-SR in order to make our reduction work.
In particular, we now define the notion of strongly-balanced inputs, which intuitively captures the idea that defined features in a partial instance y appear at the same depth in different branches of a the decision tree T .
In order to make this definition precise, consider that every path π from the root to a leaf in a decision tree can be identified with a sequence of labels s π corresponding to the labels of the nodes of π , where the last label of π is either true or false .
We use notation s π
[ i ] for the i -th label in the sequence s π .
With this notation, we can introduce the following definition.
Definition 2.
Given a decision tree T of dimension d and y ∈ { 0 , 1 , ⊥} n a partial instance, we say that the pair ( T, y ) is strongly-balanced if
[Equation]
and there exists k ∈ N such that for every root-to-leaf path π in T , the sequence s π satisfies
[Equation]
If ( T, y ) is strongly-balanced, then there exists a unique value k ∈ N that satisfies the second condition of the definition.
We denote this value by u ( T, y ) .
In particular, if y ∈ { 0 , 1 } n , then ( T, y ) is strongly-balanced and u ( T, y ) = 0 .
Now let us define the following problem.
PROBLEM :
SB-Check-SUB-SR
INPUT : ( T, y ) , for T a decision tree of dimension n and y ∈ { 0 , 1 , ⊥} n a partial instance, where ( T, y ) is strongly-balanced.
OUTPUT :
Yes , if there is a partial instance y ′
⊊ y such that
[Equation]
] , and No otherwise.
One can now check that the proof of Proposition 2 directly proves NP-hardness for this problem, and thus we can reduce from it to prove hardness for the computation variant.
Indeed, the first part of the definition of strongly-balanced follows from Remark 1.
The second part follows from the fact that the construction in the proof of Proposition 2 starts with a perfect binary tree S .
Lemma 3.
If there is a polynomial time algorithm for Compute-Minimal-SR , then there is a polynomial time algorithm for SB-Check-SUB-SR .
Proof.
Let us enumerate the features in T as 1 , . . . , n .
Also, let S be the set of features defined in y , that is, y
[ i ] ̸ = ⊥ ⇐⇒ i ∈ S .
We will first build a decision tree T ′ of dimension 2 n − | S | , with the following features:
Create a feature i for i ∈ S . 2.
For every i ∈ { 1 , . . . , n } \ S create features i
and i ′ .
Note that this amounts to the promised number of features.
We will build T ′ through a recursive process R defined next.
First, note that any decision tree can be described inductively as either a true / false leaf, or a tuple ( r, L, R ) , where r is the root node, L is a decision tree whose root is the left child of r , and R is a decision tree whose root is the right child of r .
We can now define R as a recursive procedure that when called with argument τ proceed as follows:
If τ is a leaf then simply return τ . 2.
If τ = ( r, L, R ) , and node r is labeled with feature i ∈ S , then simply return ( r, R ( L ) , R ( R )) .
If τ = ( r, L, R ) , and node r is labeled with feature i ∈ { 1 , . . . , n } \ S , then return the following decision tree:
[Equation]
where nodes u and
v
are new nodes, both
labeled
with feature i ′ .
As anticipated, T ′ =
R ( T ) .
An example illustrating the process is depicted in Figure 6.
Now we will create a tree T ′′ of dimension 2 n − | S | + m that on top of the previous features incorporates features b j for each j ∈ { 1 , . . .
, m } , where m is an integer we will specify later on.
In order to construct T ′′ , we start by defining y
as the partial instance of dimension 2 n − | S | + m such that y
[ i ] =
y [ i ] for every i ∈ S and
[Equation]
with the remaining components of y 0 being left undefined.
Let T y 0 be a tree of dimension 2 n −| S | + m that accepts exactly the completions of y 0 ; this can be trivially done by creating a tree that accepts exactly the features that are defined in y 0 , and then observing that when running an instance whose feature space is a superset of this, then the instance will be accepted if and only if it is a completion of y 0 .
Now let T 1 be a tree of dimension 2 n + | S | + m that implements the following Boolean formula:
[Equation]
truefalse falsetrue truefalse falsetrue              (
[Figure]
Original decision tree T .
2 ′ 2 ′ false true 3 ′ 3 ′ 3 ′ 3 ′ false true 1false true true false false true false true false true    1
[Figure]
Claim 1.
Decision tree T 1 , implementing the function ϕ , can be constructed in polynomial time.
Proof of Claim 1.
This proof can be easily done by a direct construction.
Indeed, consider the following Boolean formulas:
[Equation]
We then note that
[Equation]
and thus we can build a decision tree for f recursively as illustrated in Figure 7.
Note that g ( x 1 , . . .
, x k ) can be trivially implemented by a decision tree of size O ( k ) .
Thus the recursive equation characterizing the size α ( n ) of a decision tree for f ( x 1 , . . .
, x n ) , is simply
[Equation]
+ O ( n ) , from where we get α ( n ) ∈
O ( n 2 ) , thus concluding the proof of the claim.
Now, let us build an instance x of dimension 2 n − | S | + m as follows.
For each i ∈ S let x
i ] =
y [ i ] , thus ensuring x will be a completion of y .
Then for each j ∈ { 1 , . .
. , m } let x [ b j ] = 0 , and finally for each i ∈ { 1 , . .
. , n } \ S , let x [ i ] = 0 and x [ i ′ ]
= 1 .
f ( x 1 , . . .
, x n ) x n f
[Equation]
g
[Equation]
For example, if y = (0 , ⊥ , ⊥ , 1) , and m = 3 then
[Equation]
where the features b j have been placed at the end of the vector.
Let y ⋆ be the partial instance of dimension 2 n − | S | + m such that y ⋆
[ i ] =
y [ i ] for every i ∈ S , and undefined otherwise.
Let us abuse notation and assume now that T ′ has dimension 2 n − | S | + m , even though it only explicitly uses the first 2 n − | S | features, as this would make it compatible with other decision trees and instance we have constructed.
Finally, let T ⋆ be the decision tree defined as
[Equation]
and note that the union and intersection of decision trees can be computed in polynomial time through a standard algorithm (see e.g., Wegener (2000)).
Let us now define
[Equation]
We now claim that the result of Compute-Minimal-SR ( T ⋆ , x , δ ) is different from y ⋆ if and only if ( T, y ) is a positive instance of SB-Check-SUB-SR .
But before we can prove this, we will need some intermediary tools and claims that we develop next.
Let us start by distinguishing two kinds of leaves of T ′ .
Let us say that the leaves of T ′ introduced in step 1 of the recursive procedure R are natural , while those introduced in step 3 are artificial .
We denote by N the set of natural leaves of T ′ and by A the set of artificial leaves of T ′ .
Moreover, let
N t , N f represent the true and false natural leaves, and define A t , A f analogously.
We will also use T ′↓ z to denote the leaf where instance z ends when evaluated over tree T ′ .
With this notation,
T ′ ( z ) = 1 is equivalent to T ′↓ z ∈
A t ∪ N t .
We now make the following claims.
Claim 2.
For every partial instance y ′ ⋆ ⊆
y ⋆ , it holds that
[Equation]
Proof of Claim 2.
Observe that every leaf ℓ ∈ A has a parent node v in T ′ labeled with some feature i ′ whose parent node u in T ′ is labeled with feature i .
Let G ( ℓ ) =
u be said the grandparent of ℓ , and assume that G − 1 ( u ) = { ℓ ′ | G ( ℓ ′ ) =
u } .
With this notation, we can split the set A as follows:
[Equation]
where the union is actually disjoint.
Thus
[Equation]
we have that for every partial instance y ′
⋆ ⊆
y ⋆ :
[Equation]
but we have the following equation for the last term
[Equation]
as the event is equivalent to z
[ i ] = 1 , z
[ i ′ ] =
[Equation]
and this is equally likely to the complement event z
[ i ] = 0 , z
[ i ′ ] = 1 , given that y ′
⋆
[ i ] =
y ′ ⋆
[ i ′ ] = ⊥ .
Therefore
[Equation]
Claim 3.
Given a partial instance y ′
⊆
y , we can naturally define y ′
⋆ as the partial instance of dimension 2 n − | S | + m that matches y ′ on its defined features, and holds
y ′
⋆
[ i ] =
y ′ ⋆
[ i ′ ]
= ⊥ for every feature i such that y ′
[ i ] = ⊥ .
Then it holds that
[Equation]
Proof of Claim 3.
Given that the resulting leaf is natural, for every node u of T ′ such that u is labeled with feature i ̸∈ S , the tuple ( u, L, R ) was considered when constructing T ′ and the path of w in T ′ goes through u , it must be the case that z
[ i ] =
z [ i ′ ]
= 0 or z
[ i ] =
z [ i ′ ]
= 1 , as otherwise T ′↓ z ∈ A .
But these two alternatives are equally likely by definition of T ′ .
Thus, by using a simple induction argument, for every leaf ℓ of T with a corresponding natural leaf ℓ ′ of T ′ , it holds that
[Equation]
from where the claim immediately follows.
Claim 4.
By choosing m ≥ max { 2 u ( T, y ) + 2 n, 9 } , we have that
[Equation]
Proof of Claim 4.
First, consider that for T 1 , we have that
[Equation]
while on the other hand
[Equation]
where the last equality uses Claim 2.
Let us now show that
[Equation]
By Claim 3 this is the same as showing that
[Equation]
which is guaranteed by the definition of the SB-Check-SUB-SR problem, as we know that
[Equation]
and also that Pr z ∼ U
( y )
[ T ( z ) = 1] must be of the form (cid:0) k 2 n (cid:1) with k ∈ N , given that n is the dimension of T .
Now, consider that
[Equation]
Notice that this holds because T is strongly-balanced, so falling into a natural leaf in T ′ requires going through u ( T, y ) layers without choosing an artificial leaf, which happens with probability 12 at each layer.
Thus, we have that
[Equation]
Moreover
[Equation]
given that T ′ and T 1 impose restrictions over disjoint sets of features
[Equation]
we have that
[Equation]
( z ) = 1] .
Putting together all the previous results, we obtain that
Pr z ∼ U
( y ⋆ )
[( T ′ ∩ T 1 )( z )
= 1] =
Pr z ∼ U
( y ⋆ )
[ T ′ ( z ) =
| T 1 ( z ) = 1] ·
Pr z ∼ U
( y ⋆ )
[ T 1 ( z ) = 1] =
Pr z ∼ U
( y ⋆ )
[ T ′ ( z ) = 1] ·
Pr z ∼ U
( y ⋆ )
[ T 1 ( z ) = 1] ≥ (cid:32)2 + (cid:18) (cid:19) n + u ( T, y ) (cid:33)(cid:18) 1 − ( m + 1) (cid:18) (cid:19) m
(cid:19)
=2 − ( m + 1) (cid:18) (cid:19)
m
+ + (cid:18) (cid:19) n + u ( T, y ) − ( m + 1) (cid:18) (cid:19) m
+ n + u ( T, y )
≥2 − ( m + 1) (cid:18) (cid:19) m
+ (cid:18) (cid:19) n + u ( T, y )
≥2 − (cid:18) (cid:19) m −⌈ log( m +1) ⌉ + (cid:18) (cid:19) n + u ( T, y ) .
But we are assuming m ≥ max { 2 n + 2 u ( T, y ) , 9 } , which implies that m ≥ 2 n + 2 u ( T, y ) .
Hence, we have that m − ⌈ log( m + 1) ⌉ > n + u ( T, y ) , as m − ⌈ log( m + 1) ⌉ > m 2 since m ≥ 9 .
We conclude that
[Equation]
from which the claim follows.
Claim 5.
For every partial instance y ′ ⋆ ⊆
y ⋆ , it holds that
[Equation]
Proof of Claim 5.
We only need to prove that Pr z ∼ U ( y ′ ⋆ )
[ T ′↓ z ∈ A ] =
Pr z ∼ U
( y ⋆ )
[ T ′↓ z ∈ A ] .
As shown in the proof of Claim 4, this follows from the strongly-balanced property of T .
With these claims we can finally prove the reduction is correct.
That is, we will show that
Compute-Minimal-SR ( T ⋆ , x , δ ) is different from y ⋆ if and only if ( T, y ) is a positive instance of SB-Check-SUB-SR .
Forward direction.
Assume the result of Compute-Minimal-SR ( T ⋆ , x , δ ) is some partial instance y ′
⋆ different from y ⋆ .
Note immediately that it is not possible that y ⋆ ⊊ y ′ ⋆ as by definition of δ , we have that
[Equation]
which would contradict the minimality of y
⋆ .
Let us first prove that y ′
⋆ ⊆
y ⋆ .
As a first step, we show that y ′
⋆
[ i ] =
y ′ ⋆
[ i ′ ]
= ⊥ for every
i ̸∈ S .
We do this by way of contradiction, assuming first that y ′
⋆ [ i ] = 0 or y ′
⋆ [ i ′ ]
= 1 for some i ̸∈ S , and exposing how either case generates a contradiction.1.
If there is some feature i ̸∈ S such that y ′
⋆ [ i ] = 0 , let us define y † to be equal to y ′
⋆ except that y † [ i ] = ⊥ .
This means that y † ⊊ y ′ ⋆ .
Moreover, let y † 1 be equal to y ′
⋆ except that y † 1 [ i ] = 1 .
We will now show that y † is also a valid output of the computation problem, which will contradict the minimality of y ′ ⋆ .
Indeed, given that ( T y 0 ∩ T 1 )( z ) = 0 for every instance z , it holds that
[Equation]
and we can then observe that the events T ′ ( z ) = 1 and T 1 ( z ) = 1 are independent, thus implying that
[Equation]
By construction of y † , we also have that
[Equation]
Thus, it now suffices to show that
[Equation]
as this implies by definition of y
⋆ , y † and y † 1 that
[Equation]
which in turn implies by the previous discussion
that
[Equation]
and leads to a contradiction.
In order to prove that Pr z ∼ U ( y †
[Equation]
[Equation] [Equation]
=
[Equation]
] ≥ Pr z
[Equation]
( y ′ ⋆ )
[ T ′ ( z ) = 1] , we will consider two cases, either y ′
⋆ [ i ′ ]
= 1 or y ′ ⋆ [ i ′ ]
= ⊥
(a) If y ′ ⋆
[ i ′ ]
= 1 , then we have that
[Equation]
as for every node
u
in T labeled
with
i , any completion z of y ′ ⋆
that
goes
through
u will be rejected
by
construction (landing in an artificial false leaf), and for paths of T ′ that do not go through a node labeled u
there is no difference between completions of
y ′
⋆ and those for y † 1 .
(b) If y ′
⋆
[ i ′ ]
= ⊥ , then we have that for every node u in T ′ which corresponds to ( u, L, R )
according to the recursive definition of a decision tree, and is labeled with i , the probability of acceptance of a random completion z conditioned on its path going through u , which is denoted by z ⇝ u , is as follows:
[Equation]
while on the other hand we have
[Equation]
By considering that
[Equation]
we conclude that
[Equation]
from which we conclude that
[Equation]
Therefore, by considering that z ⇝ u 1 and z ⇝ u 2 are disjoint events of u 1 , u 2 are distinct nodes of T ′ with labeled i , we have that
[Equation]
This concludes the proof of this case.
It remains to analyze the case when y ′
⋆
[ i ] = ⊥ and y ′
⋆ [ i ′ ]
= 1 , which can be proved in the same way as the previous case y ′
⋆ [ i ] = 0 and y ′
⋆ [ i ′ ]
= ⊥ .
After this case analysis, we can safely assume that y ′
⋆
[ i ] =
y ′ ⋆
[ i ′ ]
= ⊥ for every
i ̸∈ S .
We will now show that y ′
⋆ [ b j ] = ⊥ for every j ∈ { 1 , . .
, m } .
To see this, consider that in general it could be that y ′
⋆ forces a certain number k of features b j to get value 0 , meaning that there is a set K ⊆ { 1 , . . .
, m } with | K | =
k such that y ′
⋆
[ b j ] =
for j ∈ K .
We will argue that k = 0 .
Let us start by arguing that k ≤ m − 2 .
Indeed, assume expecting a contradiction that k > m − 2 , then by definition
[Equation]
and thus
[Equation]
but
[Equation]
as y ′ ⋆ cannot be a superset of y ⋆ , and thus at least one feature i of y ⋆ is undefined in y ′ ⋆ , and the event z
[ i ] =
y ⋆
[ i ] , which happens with probability 12 , is required for T y
( z ) = 1 .
But by definition of δ , if y ′
⋆ is the output of the computational problem, then its probability of acceptance is at least
[Equation]
and this probability is greater than 12 (Claim 4), and thus we have a contradiction.
We now safely assume k ≤ m − 2 and thus m − k ≥ 2 .
Observe that as at least one component of y ⋆ is undefined in y ′ ⋆ , we have
[Equation]
and thus
[Equation]
which, considering that
[Equation]
implies that
[Equation]
as T ′ ( z ) = 1 and T 1 ( z ) = 1 are independent events.
We now show that the RHS of the previous equation is greater than δ .
Indeed, for ease of notation set r :=
( m − k + 1) and note how the RHS can be rewritten as
[Equation]
Now consider that as m − k ≥ 2 we have that r ≥ 3 and thus 2 r − 1 > r , which implies r (cid:0) 12 (cid:1) r − 1 < 1 , and thus the denominator of the previous equation is positive, implying that what we want to show is equivalent to
[Equation]
which is in turn equivalent to
[Equation]
but as by Claim 4 we have δ > 12 , and r ≥ 3 , the previous equation is trivially true.
We have therefore showed that
[Equation]
Now let y ⊖ be the partial instance such that y ⊖ [ i ] =
y ′ ⋆
[ i ] for every i ∈ S , and is undefined in all other features.
Note that y ⊖ ⊆
y ′ ⋆ and also y ⊖ ⊆
y ⋆ .
If y ⊖ = y ′ ⋆ , then y ′
⋆ ⊆
y ⋆ which is what we are hoping to prove.
So we now assume y ⊖ ⊊ y ′
⋆ expecting a contradiction.
Note that T ′ does not use the b j features at all, and therefore we have that
[Equation]
We will use this to prove that y ⊖ would have been a valid outcome of the computing problem, thus contradicting the minimality of y ′ ⋆ .
Indeed,
[Equation]
and note that as
[Equation]
it must be the case that
[Equation]
as only 2 n − | S | features appear as labels in T ′ and, thus, the completion probability of any partial instance over T ′ must be an integer multiple of (cid:0) 12 (cid:1) 2 n −| S | .
Now let us abbreviate 2 n − | S | as ℓ and choose m ≥ 2 ℓ .
We thus have that
[Equation]
≥
[Equation]
1 −
[Equation]
(cid:18)
[Equation]
(cid:19)
[Equation]
(cid:33) =
[Equation] [Equation]
+ 1) (cid:18) (cid:19) 2 ℓ + (cid:18) (cid:19) ℓ − (2 ℓ + 1) (cid:18)
[Equation]
where the last parenthesis is positive for ℓ ≥ 5 , which can be assumed without loss of generality as otherwise the original instance of the decision problem would have constant size.
We have thus concluded that
[Equation]
thus showing that y ⊖ is a valid outcome for the computing problem, which contradicts the minimality of y ′ ⋆ .
This in turn implies that y ′
⋆ =
y ⊖ , and thus subsequently that
y ′ ⋆ ⊆
y ⋆ .
Let us now show how by combining Claims 2, 3 and 5, we can conclude the forward direction entirely.
Indeed, note that the trivial equality
[Equation]
implies that
[Equation]
as we already have proved that Pr z ∼ U ( y ′ ⋆ )
[( T ′ ∩ T 1 )( z ) = 1] ≥ δ by equation 6 and the fact that y ⊖ =
y ′ ⋆ , and we have that δ =
Pr z ∼ U
( y ⋆ )
[( T ′ ∩ T 1 )( z )
= 1] .
We can use Claims 2, 3 and 5 to conclude that
[Equation]
where y ′ is the partial instance of dimension n such that
y ′
[ i ] =
y ′ ⋆
[ i ] for every i such that
y ′
⋆ [ i ] ̸ = ⊥ , and y ′ is undefined in all other features.
By this definition, y ′ ⊊ y as we had y ′ ⋆
⊊ y ⋆ (because by assumption y ′
⋆ ̸ = y ⋆ ), and thus we have effectively proved that the instance ( T, z ) is a positive instance of SB-Check-SUB-SR .
This concludes the proof of the forward direction.
Backward direction.
Assume the instance ( T, y ) is a positive instance of SB-Check-SUB-SR and, thus, there exists some y ′
⊊ y such that
[Equation]
Define z ′ ⋆ of the dimension of T ⋆ based on y ′ by setting y ′
⋆
[ i ] =
y ′
[ i ] for every i such that y ′
[ i ] ̸ = ⊥ , and leave the rest of y ′
⋆ undefined.
Note that this definition immediately implies y ′ ⋆ ⊊ y ⋆ .
By
Claim 3 the previous equation implies that
[Equation]
which implies in turn that
[Equation]
By Claim 5 the denominators of the previous inequality are equal and, thus,
[Equation]
∼ U
[Equation]
y
[Equation]
from where
[Equation]
But combining Claims 2 and 5 we have that
[Equation]
which when combined with the previous equation gives us
[Equation]
and using again that
[Equation]
we obtain that
[Equation]
Finally, by observing that
[Equation]
we have that y ′
⋆ is a valid output for the computational problem
[Equation]
and give it is a strict subset of y ⋆ , the result of Compute-Minimal-SR ( T ⋆ , x , δ ) cannot be equal to y ⋆ .
This concludes the backward direction, and with it the entire proof is complete.
C Proof of Theorem
Theorem 4.
Let c ≥ 1 be a fixed integer.
Both Compute-Minimum-SR and Compute-Minimal-SR can be solved in polynomial time for decision trees with split number at most c .
Proof.
It suffices to provide a polynomial time algorithm for Compute-Minimum-SR .
(The same algorithm works for Compute-Minimal-SR as a minimum δ -SR is in particular minimal.)
In turn, using standard arguments, it is enough to provide a polynomial time algorithm for the following decision problem Check-Minimum-SR : Given a tuple ( T, y , δ, k ) , where T is a decision tree of dimension n , y ∈ { 0 , 1 , ⊥} n is a partial instance, δ ∈ (0 , 1] , and k ≥ 0 is an integer, decide whether there is a partial instance
y ′ ⊆
y such that n − | y ′
| ⊥ ≤ k (i.e., y has at most k defined components) and Pr z [ T ( z ) =
| z ∈ C OMP ( y ′ )] ≥ δ .
In order to solve Check-Minimum-SR over an instance ( T, y , δ, k ) , where T has split number at most c , we apply dynamic programming over T in a bottom-up manner.
Let Z ⊆ { 1 , . . .
, n } be the set of features defined in y , that is, features i with y
[ i ] ̸ = ⊥ .
Those are the features we could eventually remove when looking for y ′ .
For each node u in T , we solve a polynomial number of subproblems over the subtree T u .
We define
[Equation]
In other words, Int ( u ) are the features appearing both inside and outside T u , while New ( u ) are the features only inside T u , that is, the new features introduced below u .
Both sets are restricted to Z as features not in Z play no role in the process.
Each particular subproblem is indexed by a possible size s ∈ { 0 , . .
. , k } and a possible set J ⊆
Int ( u ) with | J | ≤ s and the goal is to compute the quantity:
[Equation]
where C u,s,J is the space of partial instances y ′ ⊆
y with n − | y ′
| ⊥ ≤ s and such that y ′
[ i ] =
y [ i ] for i ∈ J and y ′
[ i ] = ⊥ for i
∈ Int ( u ) \ J .
In other words, the set J fixes the behavior on Int ( u ) (keep features in J , remove features in Int ( u ) \ J ) and hence the maximization occurs over choices on the set New ( u ) (which features are kept and which features are removed).
The key idea is that p u,s,J can be computed inductively using the information already computed for the children u 1 and u 2 of u .
Intuitively, this holds since the common features between T u 1 and T u 2 are at most c , which is a fixed constant, and hence we can efficiently synchronize the information stored for u 1 and u 2 .
Finally, to solve the instance ( T, y , δ, k ) we simply check whether p r,k, ∅ ≥ δ , for the root r of T .
Formally, let us define for a set H ⊆
Z , the partial instance y H ∈ { 0 , 1 , ⊥} n such that y H
[ i ] =
y [ i ] for every i ∈ H , and y H [ i ] = ⊥ for every i ̸∈ H .
In particular, y H ⊆
y .
Then we can write p u,s,J as
[Equation]
Let u 1 and u 2 be the children of u .
We have that New ( u ) is the disjoint union of:
[Equation]
where Sync ( u ) :=
New ( u ) ∩ (cid:0) F (cid:0) N ↓ u 1 (cid:1) ∩ F (cid:0) N ↓ u 2 (cid:1)(cid:1) .
In other words, the features in Sync ( u ) are the features that are in both T u 1 and T u 2 but not outside T u .
We conclude by explaining the computation of p u,s,J .
We consider the following cases:
The feature i labeling u is in J .
This means we have to keep feature i .
If y [ i ] = 0 , then to compute p u,s,J we can simply look at u 1 (the left child).
Note that Int ( u 1 ) is the disjoint union of Int ( u 1 )
∩ Int ( u ) and Sync ( u ) .
Then
[Equation]
s
[Equation]
This computation can be done in polynomial time as Sync ( u ) ≤ c and then there are a constant number of possible J ′ ⊆
Sync ( u ) .
The case when y [ i ] = 1 is analogous, taking uinstead of u 1 . 2.
The feature i labeling u is either outside Z or belongs to Int ( u ) \ J .
This means feature i is undefined.
Again, we have that Int ( u 1 ) is the disjoint union of Int ( u 1 )
∩ Int ( u ) and Sync ( u ) .
Similarly, Int ( u 2 ) is the disjoint union of Int ( u 2 )
∩ Int ( u ) and Sync ( u ) .
Then
[Equation]
Again, this can be done in polynomial time as Sync ( u ) ≤ c . 3.
Finally, the remaining case is that the feature i labeling u is in New ( u ) .
In that case we have the two possibilities: either we keep feature i or we remove it.
If s − | J | = 0 , then the only possible choice is to remove the feature i , and hence p u,s,J is computed exactly as in
case (2).
If s − | J | > 0 .
Then we take the maximum between the cases when we keep feature i and the case when we remove feature i .
For the latter, p u,s,J is computed exactly as in case (2).
For the former, we compute p u,s,J in a similar way as in case (1).
More precisely, if y
[ i ] = 0 , then:
[Equation]
The case y
[ i ] = 1 is analogous.
D Proof of Lemma
Lemma 1.
Let C be a class of monotone models, M ∈ C a model of dimension n , and x ∈ { 0 , 1 } n an instance.
Consider any δ ∈ (0 , 1] .
Then if y ⊆ x is a δ -SR for x under M which is not minimal, then there is a partial instance
y ′
=
y \ { i } , for some i ∈ { 1 , . .
. , n } , such that y ′ is a δ -SR for x under M .
Proof.
Note that, if M ( x ) =
then we can safely assume that for every i where y
[ i ] ̸ = ⊥ it holds that y
[ i ] = 1 , as otherwise if y [ i ⋆ ] = 0 for some i ⋆ , then the lemma trivially holds by setting y ′ =
y \ { i ⋆ } because of monotonicity.
Similarly, if M ( x ) = 0 then we can safely assume that for every i where y
[ i ] ̸ = ⊥ it holds that y
[ i ] = 0 .
As by hypothesis y is not minimal, there exists a δ -SR y ⋆ ⊊ y that minimizes | y ⋆ | ⊥ .
We will prove that | y ⋆ | ⊥ =
| y | ⊥ + 1 , from where the lemma immediately follows.
Assume for the sake of a contradiction that | y ⋆ | ⊥ > | y | ⊥ + 1 .
Then, there must exist a feature i ⋆ that y ⋆ [ i ⋆ ] =
⊥ ̸
= y
[ i ⋆ ] , and such that y ⋆ ∪ { i ⋆ } ̸
= y , where y ⋆ ∪ { i ⋆ } is defined as
[Equation]
Similarly we denote y ⋆ ∪ ( i ⋆ → α ) , with α ∈ { 0 , 1 } , the partial instance defined as
[Equation]
if
[Equation]
y
[Equation]
[ i ⋆ ] otherwise.
We now claim that y ⋆ ∪ { i ⋆ } is also a δ -SR for x under M , which will contradict the minimality of y ⋆ , as | y ⋆ ∪ { i ⋆ }| ⊥ <
| y ⋆ | .
Let us denote by C ( M , y ) the number of completions z ∈ C OMP ( y ) such that M ( z )
= 1 .
Now there are two cases, if M ( x ) = 1 then
[Equation]
(Because of monotonicty) from where
[Equation]
which implies that y ⋆ ∪ ( i ⋆ → 1) is also a δ -SR (note that y ⋆ ∪ ( i ⋆ → 1)
=
y ⋆ ∪ { i ⋆ } because of the initial observation), contradicting the minimality of y ⋆ .
Similarly, if M ( x ) = 0 , then
[Equation]
Because of monotonicty) from where
[Equation]
thus implying that y ⋆ ∪ ( i ⋆ → 0) is also a δ -SR for x under M , which again contradicts the minimality of y ⋆ .
E Experiments
This section presents some experimental results both for the deterministic encoding ( δ = 1) and for the general probabilistic encoding (
δ < 1) .
Datasets For testing the deterministic encoding we use the classical MNIST dataset (Deng, 2012), binarizing features by simply setting to black all pixels of value less than 128.
For testing the general probabilistic encoding we build a dataset of 5x5 images that are either tall or wide , and the task is to predict the kind of a given rectangle.
This idea is based on the dataset built by Choi et al.
(2017) for illustrating sufficient reasons.
Training decision trees We use scikit-learn (Pedregosa et al., 2011) to train decision trees.
In order to accelerate the training, the splitter parameter is set to random .
Also, due to the natural class unbalance on the MNIST dataset, we set the parameter class_weight to balanced .
Hardware All our experiments have been run on a personal computer with the following specifications:
MacBook Pro (13-inch, M1, 2020), Apple M1 processor, 16 GB of RAM.
Solver We use CaDiCaL (Biere et al., 2020), a standard CDCL based solver.
In order to find k ⋆ , the minimum k for which an explanation of size k exists one can either proceed by using a MaxSAT solver, directly to minimize the number of features used in the explanation, or use a standard SAT solver and do a search over k to find the minimum size for which an explanation exists.
After testing both approaches we use the latter as it showed to be more efficient in most cases.
Instead of using binary search to find the k ⋆ , we use doubling search.
This is because a single instance with k = n 2 at the start of a binary search can dominate the complexity, and
often k ⋆ ≪ n .
Deterministic results Given the compactness of the deterministic encoding, with O ( nk + | T | ) clauses, it is feasible to use it for MNIST instances, for which n = 28 × 28 = 784 .
Tables 2 and 3 exhibit results obtained for this dataset when recognizing digit 1 .
Figures 11 andexhibit minimum sufficient reasons for positive and negative instance (respectively) on a decision tree for recognizing the digit 1 .
Figures 13 and 14 show examples when recognizing the digit 3 , and finally Figures 15 and 16 exhibit examples when recognizing the digit 9 .
Figure 10 shows empirically how time scales linearly with k ⋆ , the size of the minimum sufficient reason found.
Probabilistic results Because of the complexity of the encoding, we test over the synthetic dataset described above in which the dimension is only 5 × 5 = 25 .
The positive class corresponds to wide rectangles.
Table 1 summarizes the results obtained for this dataset, while Figure 17 shows examples.
We emphasize the following observations:
Computing probabilistic sufficient reasons through the general probabilistic encoding (i.e., δ < 1 ) is less efficient than computing deterministic ones, even by several orders of magnitude.
As the value of δ approaches one, the size of the minimum δ -SR approaches k ⋆ , the size of the minimum sufficient reason for the given instance.
On the other hand, as δ decreases the size of the minimum δ -SR goes to 0.
This trade-off implies that δ can be used to control the size of the obtained explanation.
The time per explanation increases significantly as δ approaches 1 , even though the encoding itself does not get any larger, implying that the resulting CNF is more challenging.
Interestingly enough, for δ = 1 the deterministic encoding is very efficient, thus suggesting a discontinuity.
It remains a challenging problem to compute δ -SRs for δ < 1 in a way that at least matches the efficiency of the case δ = 1 .
[Table]
[Table] [Table]
[Figure]
[Table]
[Figure]
[Table]
[Figure]
[Table]
[Figure]
[Table]
[Figure]
[Table]
[Figure]
[Table]
[Figure]
[Table]
[Figure]
[Table]
[Figure] [Figure]
[Figure] [Figure]
[Figure] [Figure]
[Figure] [Figure]
[Figure] [Figure]