Structural Learning of Probabilistic Sentential Decision Diagrams under Partial Closed-World Assumption
Abstract
Probabilistic sentential decision diagrams are a class of structured-decomposable probabilistic circuits especially designed to embed logical constraints.
To adapt the classical L EARN SPN scheme to learn the structure of these models, we propose a new scheme based on a partial closed-world assumption: data implicitly provide the logical base of the circuit.
Sum nodes are thus learned by recursively clustering batches in the initial data base, while the partitioning of the variables obeys a given input vtree.
Preliminary experiments show that the proposed approach might properly ﬁt training data, and generalize well to test data, provided that these remain consistent with the underlying logical base, that is a relaxation of the training data base.
INTRODUCTION
Probabilistic Circuits (PCs) have been recently introduced as a general computational framework unifying the different existing formalisms for tractable probabilistic modeling [Choi et al., 2020].
Learning the structure of a PC from data is emerging as a crucial challenge for a widespread application of PCs in the area of machine learning.
Different algorithms have been (e g., Lowd and Domingos [2012]) and still are (e.g., Peharz et al.
[2020]) designed to improve the state of the art in this ﬁeld.
Most of these algorithms are somehow inspired by the L EARN SPN scheme of Gens and Domingos [2013], the ﬁrst algorithm for the structural learning of general PCs, originally designed for sum-product networks [Poon and
Domingos, 2011], the most popoular class of PCs.
In this position paper we focus on the problem of learning from data, without other prior domain knowledge, the structure of a particular class of PCs, called Probabilistic Sentential Decision Diagrams (PSDDs, Kisa et al.
Roughly speaking, a PSDD is a weighted logical circuit inducing a probability distribution assigning non-zero probability only to states consistent with the Boolean formula encoded by the circuit.
As a matter of fact there are only two main algorithms to learn the structure of a PSDD:
L EARN PSDD
[Liang et al., 2017] and S TRUDEL [Dang et al., 2020].
Despite their differences, both these algorithms start from a circuit subject to local transformations.
These local actions are designed to preserve the underlying logical base of the circuit, which should therefore be speciﬁed when the initial circuit is given, meaning that both algorithms may assume some prior domain knowledge modelled by the input circuit.
The L EARN SPN architecture is different: the algorithm learns a circuit from an input database by growing it from the root, rather than performing local operations on an initial circuit.
L EARN SPN takes as input a database and recursively divides it into sub-databases by ﬁnding almost independent subsets of variables and clustering similar instances.
Two structural properties of PSDDs prevent a straightforward application of L EARN SPN.
First, PSDDs are structured-decomposable, this roughly meaning that the splitting of the variables into independent sets must agree to some constraint.
Second, a PSDD encodes a Boolean formula representing a knowledge base (KB); thus it is desirable to steer the operations of L EARN SPN so that the obtained KB represents the input database.
Here we address such situation by making L EARN SPN able to learn a PSDD encoding a KB describing the data.
Of course there is no unique way to agree on what “describing the data” means.
In database theory, a traditional assumption, called closed-world assumption (CWA), states that a database reﬂects with ﬁdelity the concerned state of affairs, that it is complete [Reiter, 1981].
Stated otherwise, a fact that is true in the world is stored in the database, whereas a fact that is missing in the database just does not hold in the world.
This assumption is usually followed in ILP (Inductive
Logic Programming), a branch of Machine Learning whose objective is to induce a set hypothesis represented as logic programs (rules).
The opposite of the closed-world assumption is the open-world assumption [Reiter, 1981, Imieli´nski and Lipski Jr, 1989].
Commonly employed in the area of description logic [Baader et al., 2003], this simply states that some facts holding in the real world may be missing, and thus does not presume that the knowledge of a domain is complete.
However, in many cases, it may be desirable to have an intermediate perspective: some parts of the observed data may be complete, and some others may be incomplete.
First treated by Motro [1989], this view has later been instantiated in various forms under various names (local closedworld assumption, partial closed-world assumption, partial completeness, and others; see, e.g., Galárraga et al.
Darari et al.
[2013], Dong et al.
In this work we follow a similar intermediate perspective.
More precisely, we extract a KB from a database D by recursively applying an instance of a partial closed-world assumption (PCWA).
That is, each step of the procedure extracts a sub-database D (cid:48) and a subset X (cid:48) of variables for which D (cid:48) is assumed to reﬂect completely the concerned possible states of affairs (given the constraints provided by the previous step).
This idea is made precise in Section 3.
The paper is organised as follows.
In Section 2 we provide the necessary background about PSDDs.
Our contribution is in Section 3, where we present a PCWA based structural learning algorithm for PSDDs inspired by the L EARN SPN schema.
In Section 4 we run preliminary experiments.
Conclusions and outlooks are in Section 5.
BACKGROUND 2.1 BASICS
We focus on a set of Boolean variables X :=
( X 1 , . . . , X n ) .
Let D denote a database of joint states of X , to be also called records and denoted as x = ( x 1 , . . .
, x n ) .
The database obtained by taking only the columns of D relative to variables in X (cid:48) ⊆
X is denoted as D X (cid:48) .
When coping with a single variable X ∈ X , with a small abuse of notation, we intend as D X
=1 the (sub)set of true instances of D X , and we analogously intend D X =0 .
Notation |D| is used instead to denote the number of records in D .
If the records are indexed by the integers { 1 , . .
, m } , with m := |D| , we denote as D J the database obtained by taking only the records indexed by the elements of J , with J ⊆ { 1 , . . . , m } .
Let x j = x j 1 , . . . , x jn denote the j -th record of D .
According to CWA, we assume the database D
= { x 1 , . . . , x m } complete, this meaning that it completely describes the possible state of (the concerned aspects of) the world.
Hence, D induces a Disjunctive Normal Form (DNF)
[Equation]
L
[Equation]
[Equation]
whose conjunctive clauses are the ones describing the records belonging to D .
That is, for each record x j :=
( x j 1 , . . . , x jn ) ∈ D , the corresponding conjunctive clause under the CWA coincides with L j 1 ∧ · · · ∧ L jn where, for i ≤ n
L ji = (cid:40) X i when x ji = 1 , ¬
X i otherwise.
2.2 PSDDS
Inspired by Choi et al.
[2020], in this section we introduce PSDDs as a class of PCs that, in addition to speciﬁc structural properties (e.g., determinism and structureddecomposability), encode Boolean formulae.
2.2.1 Probabilistic Circuits
A PC C over X is a rooted DAG G annotated by parameters θ in order to represent a joint probability mass function P ( X ) .
Formally, each leaf (terminal node) g of G is called an input unit and it is associated with a variable X g ∈ X and a (possibly degenerate) probability mass function d g ( X g ) .
Non-leaves nodes can be sum units and product units .
Parameters are associated with both input units and sum units.
In case of a sum unit, these can be seen as the probabilities of a mass function weighting its outgoing arcs, while for input units a mass function π is directly provided.
In practice, if ch ( g ) are the children of a node g (also called its inputs ) and X g the set of variables associated to the input units reachable from g , and called its scope , the corresponding probability mass function P g ( X g ) is deﬁned as follows:
[Equation]
an
[Equation]
g is a product unit
[Equation]
As we focus here on Boolean variables, we can identify input units with literals or logical constants, sum units with disjunctions, and product units with conjunctions.
Graph G can be consequently seen as a logical circuit encoding a
Boolean formula.
Both logical and probabilistic elements are considered by the PSDD deﬁnition provided in the next section.
2.2.2 Deﬁning PSDDs
PSDDs have been originally presented as a probabilistic extension of a class of logical circuits called sentential decision diagrams [Darwiche, 2011].
The extension is obtained by respecting the formula in the underlying circuit.
Thus, unlike
PCs, the position of the variables in a PSDD is constrained by a meta-structure called vtree .
A vtree over X is just a full binary tree whose leaves are in one-to-one correspondence with the variables in X (see, e.g., Figure 1).
We intend vtrees as recursive objects and denote them with their root node.
In practice, each node u of vtree v is a(sub-)vtree.
Notation v is used for the variables of v .
Moreover, we denote as v l and v r the sub-vtrees of v rooted at its left and right children.
[Figure]
Using PCs terminology, we can deﬁne a PSDD associated to a vtree v by the properties of its structure and its parameters.
PSDD Structure.
PSDD graph G is deﬁned as follows.
• Input units are associated with the leaves of vtree v , i.e., have scope { X } for some X ∈ v .
They can be literals ( X or ¬ X ) or the logical constant (cid:62) ( true ).
• A product unit n has two inputs.
Notation n = ( p, s ) is used, p is called its prime and s its sub .
• A sum unit n is associated with an internal node u of v , its inputs are product units and are called its elements .
The notation n := { ( p i , s i ) } ki =1 is used.
Its primes and subs are either sum or input units.
The scope of n and of its elements is u .
The scope of the primes is u l and the scope of the subs is u r .
• The root is a sum unit.
PSDD Parameters.
Parameters θ are deﬁned as follows.
• Each input unit (cid:62) associated with variable X is annotated with a weight θ ∈ ]0 ,
[ . • Each sum unit { ( p i , s i ) } ki =1 is annotated with nonnegative weights θ 1 , . . , θ k such that Σ ki [-= 
-]{+=
+}
θ i = 1 .
PSDD Logical Base
Each PSDD node n encodes a
Boolean formula (cid:104) n (cid:105) called its (logical) base and deﬁned recursively as follows
• For input units: (cid:104) X (cid:105) :
= X , (cid:104)¬ X (cid:105) :
= ¬ X , and (cid:104)(cid:62)(cid:105) :
= (cid:62)
¬ X 1 ¬ X
X 3 X¬ X 3 ¬ X
X 1 ¬ X¬ X 1 X¬ X 3 X
X 3 X 4 :
X 1 X
X 3 ¬ X¬ X 3 X         {+
+}
• If n = ( p, s ) is a product unit, (cid:104) n (cid:105) :
= (cid:104) p (cid:105) ∧ (cid:104) s (cid:105) • If n is a sum unit, n = { n i } ki =1 , (cid:104) n (cid:105) := (cid:87) ki =1 (cid:104) n i (cid:105) .
In fact, product units represent AND gates and sum units represent OR gates.
The primes of a sum unit are deﬁned as exclusive, i.e., (cid:104) p
i (cid:105) ∧ (cid:104) p j (cid:105) ≡ ⊥ for i (cid:54) =
j .
Induced Probability Mass Function.
Each unit n induces a probability mass function P n over the variables of its scope.
• If n is an input unit with scope { X } , P n is a univariate mass function: P (cid:62) ( X ) :
= ( θ, 1 − θ ) ; P X ( X ) :=
(1 , 0) ; and P ¬ X ( X ) :
= (0 , 1) .
• Otherwise, let ( X , Y ) be the scope of n , where X are its left variables and Y its right ones.
– If n = ( p, s ) is a product unit,
[Equation]
– If n = { n i } ki =1 is a sum unit
[Equation]
for the unique 1 ≤ i ≤ k such that x | = (cid:104) p
i (cid:105) .
Moreover, each input of a sum unit assigns nonzero probability to at least one world.
Let us note that the exclusivity of the primes makes PSDDs a special class of deterministic PCs.
Indeed, for each decision node n = { ( p i , s i ) } ki =1 and for each world ( xy ) , there is at most one prime p
i such that P p
i ( x ) > 0 .
Moreover, the induced probability mass function of a PSDD factorizes through its variables by following its vtree.
This makes
PSDDs structured-decomposable PCs.
As a demonstrative example, Figure 2 depicts a PSDD over four variables consistent with the vtree in Figure 1.a and whose parameters have been trained from the database in
Table 1 as done in [Kisa et al., 2014].
Labels on the decision nodes denote the vtree nodes for which the sub-PSDD is associated.
[Table]
2. LEARNSPN
To conclude the review of the background material, let us consider the pseudo-code in Algorithm 1 where an adaptation of the classical L EARN SPN scheme for the learning of PCs from a database is depicted [Gens and Domingos, 2013].
This is a recursive procedure, where the database subject to horizontal (line 4) and vertical (line 6) splits.
By horizontal split we intend a partition in clusters of similar records based on a clustering algorithm generically denoted as C LUSTER and returning the index sets of the different clusters.
A vertical split is intended instead a partition of the variables in the database achieved by some independence test and denoted as P ARTITION .
When single columns are found (line 1), univariate mass functions are directly obtained from the data.
The recursion is achieved by expressing the output mass function as a weighted sum of the mass functions associated to the different clusters (sums in line 8) and expressing them as a product of the mass functions associated with the different groups of variables (products in line 8).
Algorithm 1 L EARN SPN ( D , X ) (adaptated from Gens and
Domingos [2013])
Return a PC given database D over X 1: if | X | = 1 then 2: return π ( X ) ← D 3: else 4: { J i } ki =1 ← C LUSTER ( D X ) 5: for i ← 1 , . . . , k do 6: { X ji } m i j =1 ← P ARTITION ( X , D J i ) 7: end for 8: return (cid:80) ki {+=
 |D+} Ji | |D| (cid:81) m i j =1 L EARN SPN ( D X ij J i , X ij ) 9: end if
LEARNING PSDDS UNDER PCWA
The goal of this section is to show how the L EARN SPN scheme as sketched in Section 2.3 can be modiﬁed in order to force the output of Algorithm 1 to be a valid PSDD.
Remarkably, this will be shown to correspond to a PCWA approach.
Similarly to L EARN SPN, we might obtain a PSDD by recursively perform horizontal and vertical splits of D .
Yet, unlike L EARN SPN, the horizontal splits should be driven by the vtree, which we assume here available as an input. Algorithm
Return a PSDD given database D and vtree v and over X 1: if | v | = 1 then 2:
X ← unique variable in v 3: if |D X =1 | = |D| then 4: return X 5: else if |D X [-= 
-]=0 | = |D| then 6: return ¬ X 7: else 8: return ( (cid:62) , |D X =1 | |D| ) 9: end if 10: else 11: { J i } ki =1 ← C LUSTER ( D v l ) 12: for i = 1 , . .
, k do 13: p i ← SL O PP ( D v l J i , v l ) 14: s i ← SL O PP ( D v r J i , v r ) 15: end for 16: return { ( p i , s i , |D Ji | |D| ) } ki = 17: end if
We call our procedure SL O PP (structural learning of PSDDs under PCWA).
Algorithm 2 depicts the SL O PP workﬂow.
This is a recursive procedure, that starts growing the circuit from the top.
A clustering algorithm (line 11) is executed on the columns of the database corresponding to the left variables of the vtree.
The clusters obtained in this way are used to generate the primes (line 13), while the subs are made of the records for the right variables induced by the same clusters (line 14).
The probabilities assigned to these product units are proportional to the cardinality of the corresponding clusters (line 16).
When we ﬁnally obtain databases over single variables (lines 2-8) univariate mass functions or simple literals are speciﬁed depending on the frequencies of the two Boolean states in the column.
The only parameters of the algorithm are the number of clusters to be returned (or the criteria to select this number) and the minimum amount of records required to run the clustering algorithm.
If the number of records is smaller than this threshold, a single cluster with all the records is returned.
As discussed in Section 2, given a database D , CWA allows to describe the possible states of the affairs induced by the database as a DNF φ ( D ) .
The PSDD we learn represents a relaxation of φ ( D ) , i.e, φ ( D ) logically implies the formula encoded by the learned PSDD.
This is formalised by the following result, whose derivation is detailed in the appendix.
Proposition 1 Algorithm 2 returns a valid PSDD representing a relaxation of the formula induced by the input database, i.e., φ ( D ) logically implies (cid:104) SL O PP ( D , v ) (cid:105) .
The aforementioned relaxation happens because SL O PP applies a PCWA at each recursive call, as we shall explain with a simple example.
Consider Table 1 and vtree v in
Figure 1a whose left variables are v l = { X 1 , X 2 } and whose right variables are v r
= { X 3 , X 4 } .
The horizontal lines in that table separate the output of a clustering of the records in D v l , these inducing the primes of the root node, whose corresponding partition D v r induces its subs.
For instance, the second element is induced by the records corresponding to the third, fourth and ﬁfth line in Table 1.
In particular prime p 2 is induced by the sub-table described by the third, fourth and ﬁfth lines restricted to the ﬁrst two columns (associated to X 1 and X 2 ), whereas the restriction of those three lines to the last two columns (associated to Xand X 4 ) induces the corresponding sub s 2 .
By combining the records of these two sub-tables, we see that three new virtual records , [1 , 0 , 1 , 1] , [1 , 0 , 1 , 0] and [0 , 1 , 0 , 1] arise.
Those three virtual records have zero counts, as showed at the bottom of Table 1.
This notwithstanding, they are considered to be possible by the PSDD returned by SL O PP.
Indeed, this PSDD, depicted in Figure 2, induces a mass function that assigns non-zero probability exactly to all the instances appearing in D , included the virtual records.
Stated otherwise, these records coincide with the joint states satisfying the Boolean formula encoded by the PSDD that is returned by SL O PP when applied to Table 1.
PRELIMINARY EXPERIMENTS
A ﬁrst implementation of Algorithm 2 has been achieved within the Juice 2 (Julia) library for PCs [Dang et al., 2021].
The code, freely available as a simple Julia notebook, 3 is highly experimental and not optimized for fast performance.
For this reason, in this position paper, we discuss the results of a very preliminary validation based only on two small databases as available in Juice and whose features are detailed in Table 2.
A deeper analysis based on a larger benchmark is a necessary future work.
[Table]
Given a complete database of Boolean variables, SL O PP needs a vtree over those variables.
Here we adopt the stateof-the-art techniques proposed by Dang et al.
[2021] and based on Chow-Liu trees as included in the (Juice implementation of the) S TRUDEL algorithm.
The PSDD returned by this algorithm is used to evaluate the performance of our method, together with a fully-factorised model intended to provide a trivial baseline level.
To cluster records we use the k-means algorithm.
Here we set the number of clusters k constant (and equal to two and three), while a threshold on the database size d to create multiple clusters is also speciﬁed (and if this is not the case a single cluster with all the data is used).
As a consequence of Proposition 1, the PSDD returned by
SL O PP might be consistent even with records not present in the training set.
Yet, it might be possible that testing records not available in the training set would be inconsistent with the PSDD.
We discard those records from the test database and we denote as γ their number.
This clearly gives an unfair advantage to SL O PP if compared with S TRUDEL or with the fully-factorised model, as both these PSDDs encode the tautology (i.e., no KB).
Yet, for such a preliminary study, we are interested in evaluating the strength of such advantage in terms of performance or its relevance as shown by γ .
Tables 3 and 4 depict the test log-likelihood on the consistent records for different values of the parameters.
As a positive remark we notice comparable performance levels between SL O PP and S TRUDEL and a relatively low number of inconsistent test records.
The most critical point seems to be the huge size of the PSDDs returned by SL O PP: for Plants there are more than an order of magnitude larger than the ones produced by S TRUDEL . This is probably related to the fact that the current implementation of our
C k d γ
LL C |C|
[Table]
ULLY F ACT
[Table]
[Table]
algorithm is only coping with singly-connected topologies, thus creating unnecessarily large circuits.
Forcing the creation of multiple connections in the circuit could lead to smaller circuits.
CONCLUSIONS
A new structural learning algorithm for PSDDs has been presented.
The algorithm uses the input data as a knowledge base to be relaxed by a PCWA approach.
A very preliminary validation suggests that the algorithm might lead to reliable models to be used in frameworks where (some form of) PCWA is a tenable hypothesis.
Besides an extensive experimental analysis, as a future work we intend to embed the learning of the vtree within the SL O PP architecture in order to better exploit the statistical information in the data set.
In order to keep under control the size of the circuit returned by the algorithm, the dynamic generation of multiple connections when more elements involving the same sub-circuit are present should be also considered.
A relaxed version of this idea might be used to obtain even smaller models.
An integration between SL O PP and L EARN PSDD (e.g., achieved by using the output of the ﬁrst algorithm as an input for the second) might also be considered to train better models. Finally, belief revision techniques could be considered to solve the training-testing-set inconsistency issue discussed in the experimental section.
PROOFS
Proof of Proposition 1 It is an easy exercise to verify that the output of SL O PP is a valid PSDD.
To see that the formula encoded by SL O PP ( D , v ) is a relaxation of φ ( D ) , we proceed by induction on the number n of variables in D .
If n = 1 , v is a leaf and SL O PP ( D , v ) is a trivial PSDD consisting in a single unit X , ¬ X or ( (cid:62) , |D X =1 | |D| ) .
In each case the encoded formula is by deﬁnition φ ( D ) .
Assume that the statement holds for a number of variables strictly smaller than a ﬁxed n > 1 .
Then, for a database D over n variables and associated vtree v , consider SL O PP ( D , v ) =
{ ( p i , s i , θ i ) } ki
=1 .
For 1 ≤ i ≤ k , p i = SL O PP ( D v l J i , v l ) and s i
= SL O PP
( D v r J i , v r ) , where J 1 , . . , J k are the clusters obtained from D v l .
Moreover, (cid:104) SL O PP ( D , v ) (cid:105) = (cid:87) ki =1 (cid:104) p i (cid:105) ∧ (cid:104) s i (cid:105) , and by induction hypothesis (cid:104) p
i (cid:105) and (cid:104) s i (cid:105) are relaxations of φ ( D v l J i ) and φ ( D v r J i ) , respectively.
This means that (cid:104) p i (cid:105) implies φ ( D v l J i ) and (cid:104)
s i (cid:105) implies φ ( D v r J i ) , and thus we get that (cid:104) p
i (cid:105) ∧ (cid:104) s i (cid:105) implies their conjunction.
We can immediately conclude that (cid:104) SLoPP ( D , v ) (cid:105) implies
[Equation]
Now, for 1 ≤ i ≤ k , both φ ( D v l J i ) and φ ( D v r J i ) are DNFs whose conjunctive clauses are induced by the rows of D v l J i and of D v r J i , respectively.
By taking their conjunction we combine their clauses and clearly get, among others, φ ( x i ) , the conjunctive clause induced by the i th record of D .
This yields the desired conclusion.