Original: NeuroBE: Escalating NN Approximations of Bucket Elimination
Revised: NeuroBE: Escalating Neural Network Approximations of Bucket Elimination

Original: Abstract
Revised: Abstract

Original: A major limiting factor in graphical model inference is the complexity of computing the partition function.
Revised: A major limiting factor in graphical model inference is the complexity of computing the partition function.

Original: Exact message-passing algorithms such as Bucket Elimination (BE) require exponentially high levels of memory to compute the partition function, therefore approximations are necessary.
Revised: Exact message-passing algorithms such as Bucket Elimination (BE) require exponential memory to compute the partition function; therefore, approximations are necessary.

Original: In this paper, we build upon a recently introduced methodology called Deep Bucket Elimination (DBE) that uses classical Neural Networks(NNs) to approximate messages generated by BE when buckets have large memory requirements.
Revised: In this paper, we build upon a recently introduced methodology called Deep Bucket Elimination (DBE) that uses classical Neural Networks to approximate messages generated by BE for large buckets.

Original: The main feature of our new scheme called NeuroBE  is that it customizes the architectureand learning of the NNs to the message size and its distribution. We also explore a new loss function for training taking into account the estimated message cost distribution.
Revised: The main feature of our new scheme, renamed NeuroBE , is that it customizes the architecture of the neural networks, their learning process and in particular, adapts the loss function to the internal form or distribution of messages.

Original: Our experiments demonstrate significant improvements in accuracy and time compared with  DBE .
Revised: Our experiments demonstrate significant improvements in accuracy and time compared with the earlier DBE scheme.

Original:  INTRODUCTION
Revised:  INTRODUCTION

Original: Two of the critical goals of probabilistic modeling are the compact representation of probability distributions and the efficient computation of their marginals and modes.
Revised: Two of the critical goals of probabilistic modeling are the compact representation of probability distributions and the efficient computation of their marginals and modes.

Original: Probabilistic graphical models, such as Markov networks (Pearl, 1988; Darwiche, 2009; Dechter, 2013) provide a framework to represent distributions compactly as normalized products or factors : P ( X ) = 1 Z (cid:81)
Revised: Probabilistic graphical models, such as Markov networks [Pearl, 1988, Darwiche, 2009, Dechter, 2013] provide a framework to represent distributions compactly as normalized products or factors : P ( X ) = 1 Z (cid:81)

Original: α f α ( X α ) , where X is a set of variables, each potential f
Revised: α f α ( X α ) , where X is a set of variables, each potential f

Original: α is a function over a subset X α of the variables (its scope) and Z = (cid:80) X (cid:81) α f α
Revised: α is a function over a subset X α of the variables (its scope) and Z = (cid:80) X (cid:81) α f α

Original: ( X α ) is the partition function .
Revised: ( X α ) is the partition function .

Original: Computing the partition function isstill exponential in the induced width of the model’s graph even for distributions that admit a compact representation.
Revised: Computing the partition function is exponential in the induced width of the model’s graph even for distributions that admit a compact representation.

Original: The partition function Z is defined by two types of operations: sums and products.
Revised: The partition function Z is defined by two types of operations: sums and products.

Original: It can be evaluated efficiently if (cid:80) X (cid:81)
Revised: It can be evaluated efficiently if (cid:80) X (cid:81)

Original: α f α ( X α ) can be reorganized using the distributive law along a variable ordering (Dechter, 2003).
Revised: α f α ( X α ) can be reorganized using the distributive law along a variable ordering [Dechter, 2003].

Original: This organization can be described using buckets as data structures, one for each variable in the ordering.
Revised: This organization can be described using buckets as data structures, one for each variable in the ordering.

Original: When a bucket is processed, its associated variable is removed by creating a bucket output function, also called a message , that is passed to a subsequent bucket.
Revised: When a bucket is processed, its associated variable is removed, creating a bucket output function, also called a message , that is passed to a subsequent bucket.

Original: The  complexity of computing this function is exponential in its number of arguments, called scope or the bucket’s width.
Revised: The time and space complexity of computing this function is exponential in its number of arguments, called scope or the bucket’s width.

Original: Overall, Bucket Elimination (BE) (Dechter, 1999b) is time and memory exponential in the induced-width of the model’s graph along the ordering.
Revised: Overall, Bucket Elimination ( BE ) [Dechter, 1999b] is time and memory exponential in the induced-width of the model’s graph along the ordering.

Original: Providing good approximations to BE is important not only because it generates an answer to a query, but primarily because it compiles a structure and a set of messages that can be used to answer multiple queries (e.g., the probability of evidence for various evidence variables Darwiche (2009)).
Revised: Providing good approximations to BE is important not only because it generates an answer to a query, but primarily because it compiles a structure and a set of messages that can be used to answer multiple queries (e.g., the probability of evidence for various evidence variables Darwiche [2009]).

Original: Also because, the messages can be used as building blocks for generating heuristics for search to further improve performance.
Revised: Also, the messages can be used as building blocks for generating heuristics for search to further improve performance.

Original: Wewill therefore consider and evaluate NeuroBE within the class of approximate BE schemes.
Revised: We therefore consider and evaluate NeuroBE in the context of approximate BE , generating approximation to its messages.

Original: Schemes that approximate BE includethe (weighted) minibucket scheme (Dechter and Rish, 2003; Liu and Ihler, 2012) and generalized belief propagation schemes (Yedidia et al., 2000; Mateescu et al., 2010).
Revised: Schemes that approximate BE include (weighted) minibucket ( WMB ) [Dechter and Rish, 2003, Liu and Ihler, 2012] and generalized belief propagation schemes [Yedidia et al., 2000, Mateescu et al., 2010].

Original: Recently introduced, Deep
Revised: A recently introduced scheme,

Original:  Bucket Elimination (DBE) (Razeghi et al., 2021) approximates each bucket function with a neural network (NN).
Revised: Deep Bucket Elimination (DBE) [Razeghi et al., 2021] approximates each bucket function with a neural network (NN).

Original: While this approach is inherently time consuming requiring the independent training of many NNs to compute the partition function of a single problem, it has yielded more accurate approximations on several benchmarks.
Revised: While this approach is inherently time consuming, requiring the independent training of many NNs to solve the partition function of a single problem, it has yielded more accurate approximations on several benchmarks when compared against competing schemes.

Original: It is important to note that unlike weighted bucket-elimination andbelief propagation schemes, DBE can improve with time even with bounded memory, yielding an anytime framework for reasoning. Still, DBE ’s original design can be improved significantly which is the focus of this paper.
Revised: Both WMB and DBE are restricted by memory. Yet the memory demanded by WMB (notwithstanding recent work [Forouzan and Ihler, 2015]) increases exponentially with its i -bound not accommodating refined steps of memory increase. In contrast, NN architectures can grow more gradually and may facilitate a more flexible memory-accuracy balance.

Original: Contributions.
Revised: Contributions.

Original: We present NeuroBE , a re-design of DBE , that addresses  its one size fits all policy by customizing the NN construction and training sample size to each bucket separately, in proportion to its message size.
Revised: We present NeuroBE , a re-design of DBE , that addresses the shortcomings of its one size fits all policy by customizing the NN construction and training sample size to each bucket separately, in proportion to its message size.

Original: In particular, we introduce a new loss function that is sensitive to  bucket’s message distribution.
Revised: We also introduce a new loss function that is sensitive to a bucket’s message distribution, also called local structure .

Original: We also provide an analysis relating the local errors to a bound on the global error.
Revised: We also provide an analysis relating the local errors to an upper bound on the global error.

Original: In an extensive empirical evaluation we show that NeuroBE outperforms DBE across all benchmarks using far less  training samples, yielding higher accuracy with less time.
Revised: In an extensive empirical evaluation we show that NeuroBE outperforms DBE across all benchmarks using far less resources, such as training samples and NN size, while yielding higher accuracy with less time.

Revised: We provided the source code to reproduce the results of this paper at https://github.com/dechterlab/NeuroBE.

Original: The paper is organized as follows.
Revised: The paper is organized as follows.

Original: We first provide a background to BE  and DBE ; then we present NeuroBE ; followed by error analysis; lastly, we demonstrate the efficiency of NeuroBE empirically.
Revised: We first provide a background to BE , WMB and DBE ; then we present NeuroBE ; followed by error analysis; lastly, we demonstrate the efficiency of NeuroBE empirically.

Original: Related work.
Revised: Related work.

Original: As noted, approximating and bounding
Revised: As noted, approximating and bounding

Original: Bucket Elimination has been carried out extensively over the years for all probabilistic queries.
Revised: Bucket Elimination has been carried out extensively over the years for all probabilistic queries.

Original: Well known is the
Revised: Well known is the

Original: Mini-Bucket Elimination scheme (Dechter and Rish, 2003) and its variants, such as Weighted Mini-Bucket Elimination (WMBE) , augmented with message-passing cost-shifting (Liu and Ihler, 2011).
Revised: Mini-Bucket Elimination scheme [Dechter and Rish, 2003] and its variants, such as Weighted Mini-Bucket Elimination (WMB) , augmented with message-passing cost-shifting [Liu and Ihler, 2011b].

Original: Neural network approximation to BE was introduced in
Revised: Neural network approximation to BE was introduced in

Original: Razeghi et al.
Revised: Razeghi et al.

Original: The idea is closest in spirit to the
Revised: The idea is closest in spirit to the

Original: Neuro-Dynamic Programming scheme as outlined in Bertsekas and Tsitsiklis (1996) where the cost-to-go functions (similar to messages) generated by dynamic programming can be approximated by NNs.
Revised: Neuro-Dynamic Programming scheme as outlined in Bertsekas and Tsitsiklis [1996] where the cost-to-go functions (similar to messages) generated by dynamic programming can be approximated by NNs.

Original: This technique is also highly related to Deep Reinforcement Learning (DRL) (Mnih et al., 2015) where, in the absence of a model, the value function is approximated by neural networks learned from temporal trajectories.
Revised: This technique is also highly related to Deep Reinforcement Learning (DRL) [Mnih et al., 2015] where, in the absence of a model, the value function is approximated by NNs learned from temporal trajectories.

Original: Recently, Graph Neural Networks (GNNs) (Scarselli et al., 2009) are used to learn messages following the messagepassing reasoning methods in graphical models (Abboud et al., 2020; Yoon et al., 2018; Heess et al., 2013).
Revised: Recently, Graph Neural Networks (GNNs) [Scarselli et al., 2009] are used to learn messages following the messagepassing reasoning methods in graphical models [Abboud et al., 2020, Yoon et al., 2018, Heess et al., 2013].

Original: However,
Revised: However,

Original: Yoon et al.
Revised: Yoon et al.

Original: ; Heess et al. (2013) is restricted to small instances (i.e., ∼ 40 variables) and Abboud et al.
Revised: [2018], Heess et al. [2013] is restricted to small instances (i.e., ∼ 40 variables) and Abboud et al.

Original: (2020) tackles problems with a known polynomial-time approximation.
Revised: [2020] tackles problems with a known polynomial-time approximation.

Original: GNN based methods derive a supervised end-to-end learning algorithm which generalize across different problem instances.
Revised: GNN based methods derive a supervised end-to-end learning algorithm, generalizing across different problem instances.

Original: In contrast, we consider a different class of algorithms, where we confine learning to within a problem instance only .
Revised: In contrast, we consider a different class of algorithms, where we confine learning to within a problem instance only .

Original:  BACKGROUND
Revised:  BACKGROUND

Original: A graphical model can be defined by a 3-tuple M =
Revised: A graphical model can be defined by a 3-tuple M =

Original: ( X , D , F ) ,
Revised: ( X , D , F ) ,

Original: where X =
Revised: where X =

Original: X i : i ∈ V, V = { 1 , ..., n }} is a set of n variables indexed by V  and D
Revised: X i : i ∈ V, V = { 1 , ..., n }} is a set of n variables indexed by V , and D

Original: =
Revised: =

Original: { D i : i ∈ V } is the set of finite domains for each X
Revised: { D i : i ∈ V } is the set of finite domains for each X

Original: i (i.e. each X i can onlyassume values in D i , and each D i is finite). Each function f α ∈ F is defined over a subset of the variables called its scope, X α , where α ⊆ V are the indices of variables in its scope and D α denotes the Cartesian product of their domains, so that f α : D α → R ≥ 0 .
Revised: i (i.e. each X i can only

Original: A"
Revised: A"

Original: B"
Revised: B"

Original: C" D"
Revised: C" D"

Original: E"
Revised: E"

Original: F"
Revised: F"

Original: G" (a) A primal Graph
Revised: G" ( [Figure] primal Graph

Original: [Figure]
Revised: [Figure]

Revised: assume values in D i , and each D i is finite).

Revised: Each function f α ∈ F is defined over a subset of the variables called its scope, X α , where α ⊆ V are the indices of variables in its scope, and D α denotes the Cartesian product of their domains so that f α : D α

Revised: → R ≥ 0 .

Original: The primal graph of a graphical model associates each variable with a node.
Revised: The primal graph of a graphical model associates each variable with a node.

Original: An edge between node i and node j is created if and only if there is a function containing 
Revised: An edge between node i and node j is created if and only if there is a function containing X i and

Original: Xi and X j in its scope.
Revised: X j in its scope.

Original: Figure 1a shows a primal graph of a graphical model with variables indexed from A to G with functions over pairs of variablesthat are connected by an edge.
Revised: Figure 1a shows a primal graph of a graphical model with variables indexed from A to G and functions over pairs of variables are connected by an edge.

Original: Graphical models can be used to represent a global function, often a probability distribution, defined by Pr ( X ) ∝ (cid:81)α f α
Revised: Graphical models can be used to represent a global function, often a probability distribution, defined by Pr ( X ) ∝ (cid:81)

Original:  ( X α ) .
Revised: α f α ( X α ) .

Original: An important task is to compute the normalizing constant, also known as the partition function Z = (cid:80) X (cid:81)
Revised: An important task is to compute the normalizing constant, also known as the partition function Z = (cid:80) X (cid:81)

Original: α f α ( X α ) .
Revised: α f α ( X α ) .

Original: 2.1 BUCKET ELIMINATION
Revised: 2.1 BUCKET ELIMINATION

Original: Bucket Elimination (BE) (Dechter, 1999a) is a universal exact algorithm for probabilistic inference.
Revised: Bucket Elimination (BE) [Dechter, 1999a] is a universal exact algorithm for probabilistic inference.

Original: It is a variable elimination algorithm that can answer a wide-range of queries, including the partition function ranging from constraint satisfaction, to pure combinatorial optimization (e.g., Most
Revised: It is a variable elimination algorithm that can answer a wide-range of queries, including the partition function ranging from constraint satisfaction, to pure combinatorial optimization (e.g., Most

Original: Probable Explanation (MPE/MAP)), and weighted counting (Partition Function, Probability of Evidence).
Revised: Probable Explanation (MPE/MAP)), and weighted counting (Partition Function, Probability of Evidence).

Original: Given a variable ordering d , BE (presented in Algorithm 1, omitting steps 9-12) creates a bucket tree where each node is a bucket representing a variable in the ordering d .
Revised: Given a variable ordering d , BE (presented in Algorithm 1, omitting steps 9-12) creates a bucket tree where each node is a bucket representing a variable in the ordering d .

Original: Figure 1b shows a bucket tree for the primal graph in Figure 1a along an ordering.
Revised: Figure 1b shows a bucket tree for the primal graph in Figure 1a along an ordering.

Original: Each bucket in this tree contains a set of the model’s functions depending on the given order of processing.
Revised: Each bucket in this tree contains a set of the model’s functions depending on the given order of processing.

Original: For example, Bucket G in Figure 1b has functions { f ( A, G ) , f ( F, G ) } , an exhaustive set of model’s functions with variable G in its scope.
Revised: For example, Bucket G in Figure 1b has functions { f ( A, G ) , f ( F, G ) } , an exhaustive set of model’s functions with variable G in its scope.

Original: There is an arc from a bucket, say B c , to a parent bucket, B p , if X p is the latest variable in bucket B c ’s message scope along the ordering (constants are placed in B 1 ).
Revised: There is an arc from a bucket, say B c , to a parent bucket, B p , if X p is the latest variable in bucket B c ’s message scope along the ordering (constants are placed in B 1 ).

Original: In the same example, there is an arc from Bucket G to Bucket F.
Revised: In the same example, there is an arc from Bucket G to Bucket F.

Original: BEthen, performs inference along the bucket tree as a 1iteration message-passing algorithm (bottom-up).
Revised: BE performs inference along the bucket tree as a 1-iteration message-passing algorithm (bottom-up).

Original: It processes each bucket from leaves to the root passing messages from child ( c ) to parent ( p ).
Revised: It processes each bucket from leaves to the root passing messages from child ( c ) to parent ( p ).

Original: For a child variable X c , it considers all the functions in bucket B c .
Revised: For a child variable X c , BE encompasses all the functions in bucket B c .

Original: This includes the original functions in the graphical model as well as the messages received by processing previous variables.
Revised: This includes the original functions in the graphical model as well as the messages received by processing previous variables.

Original: It then marginalizes X c out from the product of functions in B c generating a new, so called, bucket function or message, denoted λ c → p , or λ c for short:
Revised: It then marginalizes X c out from the product of functions in B c generating a new, so called, bucket function or message, denoted λ c → p , or λ c for short:

Original: [Equation]
Revised: [Equation]

Original: The λ c function is placed in B p , the bucket of X p .
Revised: The λ c function is placed in B p , the bucket of X p .

Original: Once all the variables are processed, BE outputs all the messages and the exact value of Z by taking the product of all the constant present in the bucket of the first variable.
Revised: Once all the variables are processed, BE outputs all the messages and the exact value of Z by taking the product of all the constants present in the bucket of the first variable.

Original: We illustrate BE message flow on our example problem in Figure 1b.
Revised: We illustrate BE message flow in our example problem in Figure 1b.

Original: Complexity.
Revised: Complexity.

Original: Both the time and space complexity of BE are exponential in the induced width , which is the size of the largest number of variables in the scope of any message over all buckets (Dechter, 2013).
Revised: Both the time and space complexity of BE are exponential in the induced width , which is the size of the largest number of variables in the scope of any message over all buckets [Dechter, 2013].

Original: Clearly, BE becomes impractical if the induced width is large.
Revised: Clearly, BE becomes impractical if the induced width is large.

Original: 2.2 DEEP BUCKET ELIMINATION
Revised: 2.2 WEIGHTED MINI-BUCKET

Revised: Given a variable ordering d , Weighted Mini-Bucket ( WMB ) [Dechter and Rish, 2003, Liu and Ihler, 2011b] approximates BE by partitioning each bucket B c with high width into several disjoint “mini-buckets” B jc to ensure that individual B jc has low ( ≤ i − bound) width.

Revised: The method also assigns a weight p cj to each mini-bucket B jc .

Revised: WMB then eliminates the bucket’s variable X in the j th mini-bucket

Revised: B jc using the power sum following Holder’s inequality [Liu and Ihler, 2011a]:

Revised: [Equation]

Revised: and µ jc is passed to a parent bucket B p .

Revised: For example, using an i -bound = 2 in Figure 1b, WMB approximates the exact message λ D → C (A, B, C), passed from bucket D to bucket

Revised: C , by three messages corresponding to partitioning bucket

Revised: B D into three mini-buckets each with a single function f ( A, D ) , f ( B, D ) , f ( C, D ) .

Revised: Based on Holder’s inequality [Liu and Ihler, 2011a], the exact message is bounded by the product of the mini-bucket messages when the weights p cj ’s are non-negative and sum to one.

Revised: Thus, for any i -bound

Revised: WMB generates an upper bound of the partition function.

Revised: Generally, time and accuracy in WMB increases with the i -bound.

Revised: Yet, due to memory constraints it can run with a maximum i -bound of about 20 and therefore, the generated bounds can be extremely loose when a problem’s inducedwidth is high.

Revised: Interestingly, when it is run, WMB terminates quickly, taking a few seconds and up to a minute.

Original: Given a variable ordering d , Deep Bucket Elimination (DBE)(Razeghi et al., 2021) approximates each message generated in the bucket tree by training a NN when the scopeof any bucket message ( S )  is high ( > i -bound).
Revised: Given a variable ordering d , Deep Bucket Elimination (DBE) approximates each message generated in the bucket tree whenever the scope ( S ) of a message is high ( > i -bound) using a neural network (NN).

Original: For example, in figure 1b, if we use an i -bound = 2 , instead of sending an exact function fromthe bucketof D tothe bucketof C ,λ D → C ( A, B, C ) , DBE sends a NNapproximation µ θ,D → C ( A, B, C ) with parameters θ  , as we describe next.
Revised: Following the previous example of i -bound = 2 in Figure 1b, rather than sending the exact message from bucket D to bucket C , DBE sends a NN µ θ,D → C ( A, B, C ) parameterized by θ that approximates the exact message λ D → C ( A, B, C ) , as we elaborate next.

Revised: We use µ ∗ c → p to denote the local exact message computed using all functions in bucket c , regardless of the local functions being exact or approximate (as defined by the right side of Eq.

Revised: However, if we execute exact BE , in which case the bucket contains exact messages only, we denote the output message as λ c → p and refer to it as the global exact message .

Original: Let B be a bucket with width w > i -bound and output message λ ( S ) with scope S  .
Revised: Let B be a bucket with width w > i -bound and µ ∗ ( S ) be its local exact message having scope S whose size is the bucket’s width, w .

Original: DBEthen, constructs a fullyconnected feed-forward NN having w nodes in the input layer.
Revised: DBE constructs a fully-connected feedforward NN having w nodes in the input layer, followed by

Original: This is followed by L hidden layers with a constant h hidden nodesper layer with ReLU activation function.
Revised: L hidden layers each having h hidden nodes with ReLU activation function.

Original: Finally, the output layer contains one node with a realvalued output.
Revised: The output layer contains one node with a real-valued output.

Original: Subsequently, DBE generates a training set { ( s n , λ ( s n )) } of size N, where s n denotes a configuration over S  sampled uniformly at random and λ ( s n ) is the  message value defined in Eq.
Revised: Subsequently, DBE generates a training set { ( s n , µ ∗ ( s n )) } of size N, where s n is the n th configuration of S , sampled uniformly at random and where µ ∗ ( s n ) is the local exact message value defined in Eq.

Original: The NN parameters, θ , are then trained to minimize the mean square error loss :
Revised: The NN function µ θ ( S ) approximating µ ∗ ( S ) is trained to minimize the mean square error loss :

Original: [Equation]
Revised: [Equation]

Original: where s n is the n th sample in the training set and µ θ ( s n ) is the NN output.

Original: Once training is complete, DBE passes the trained NN, µ θ to its parent bucket.
Revised: Once training is complete, DBE passes the trained NN, µ θ to its parent bucket.

Original: Typically, DBE needs to approximate many buckets in order to compute the partition function Z .

Original: Even though DBE has yielded more accurate approximations when competing with the weighted bucket-elimination scheme on several benchmarks, each  message approximation procedure requires a large training sample size, increasing DBE ’s total time and memory requirements substantially.
Revised: While DBE showed superior quality of solutions compared with WMB , its time performance was quite inferior. In particular, training each bucket message used the same fixed architecture and the same sample size (quite large), needlessly resulting in a high total time.

Original: Therefore, we re-design each message approximation procedure, as elaborated in the following section.
Revised: This paper is devoted to a redesign of the algorithm, aiming to improve both time and accuracy, as we elaborate in the following section.

Original:  NEUROBE
Revised:  NEUROBE

Revised: Algorithm NeuroBE advances DBE , and is described in this section, focused on the partition function task.

Revised: However, extension to other queries is straightforward, and requires altering only the message definition in Eq.

Revised: (1) to fit the corresponding task (e.g., replacing summation by maximization in Eq.

Revised: (1) for the MAP query.)

Original: We rename DBE to NeuroBE since we use mostly shallow neural networks (2 layers).
Revised: We rename DBE to NeuroBE since we use mostly shallow neural networks (up to 2 layers).

Original: Algorithm 1 presents NeuroBE .
Revised: Algorithm 1 describes NeuroBE .

Original: NeuroBE first creates a bucket tree along a given ordering (line 2).
Revised: The algorithm first creates a bucket tree along a given ordering (line 2).

Revised: It then processes buckets one by one along the ordering from last to first.

Original: While processing each bucket, if it’s width  ≤ i − bound, then the message, µ ∗ c → p, is computed exactly (line 7).
Revised: If the current processed bucket has width w ≤ i -bound, then the message, µ ∗ c → p is computed exactly (line 7).

Original: Otherwise, the  message is approximated using a NN (line 10).
Revised: Otherwise, the bucket’s message is approximated by a neural net (line 9).

Original: Note that in either case, if a bucket contains a NN function, then computing µ ∗ in Line 7 or in the NNtrain method inAlgorithm 3 (line 5) requires evaluating the trained NN.
Revised: The message is placed in the appropriate parent bucket in the bucket tree.

Original: Finally, line 14 calculates the partition function using the functions in bucket B 1 .
Revised: Finally, line 13 calculates the partition function using the functions in bucket B 1 .

Original: Note that we denote µ ∗ c → p as the exact message computed in a bucket while we reserve the notation λ c → p to the messages computed by exact BE . We do this to distinguish the exact local computation of a message that may be based on inexact functions in the bucket from the globally exact messages λ computed by BE . In the latter, each bucket function is computed exactly where all the functions are exact. Hence, we refer to λ as the global exact message ; µ ∗ c as the local exact message and by µ θ,c → p the  NN approximation of the local exact message, µ ∗ c → p .
Revised: Note that if a bucket contains a NN function, then computing µ ∗ (line 7 or 9) requires evaluating the trained NN (see Algorithm 3, line 4).

Original: The difference between NeuroBE and DBE is solely in the individual message approximation scheme, NN - train .
Revised: The difference between NeuroBE and DBE is solely in the individual message approximation scheme, NN-train .

Original: In contrast to DBE , NeuroBE dynamically customizes the NN architecture andits training set size to the bucket message complexity (see Vapnik (1999)).
Revised: In contrast to DBE , NeuroBE dynamically customizes the NN architecture and training set size to the bucket’s message complexity, and it modifies the loss function to depend on the message distribution. These modifications are described in the sequel. do 5:

Original: NN Architecture selection Clearly, the NN size should bedependant on the dimensionality of  the message function.
Revised: Let X p be the parent variable of X c in the bucket-tree 6: if width ( B c ) < i then 7: compute µ ∗ c → p ← (cid:80) X c (cid:81) f α ∈ B c f α , 8: else 9: µ θ,c → p ← NN-train (cid:0) { f α | f α ∈ B c } , L , b , η (cid:1) 10: end if 11:

Original: In our case, the function’s scope size is the induced-width, w .
Revised: Put µ ∗ c → p or µ θ,c → p in B p 12: end for 13: ˆ Z = (cid:80) X 0 (cid:81) f α ∈ B 1 f α 14: return ˆ Z and all messages generated NN Architecture selection. Clearly, the NN size should depend on both the approximated function’s complexity and, especially, its dimensionality.

Original: We therefore propose to adjust the NN size by making the number of hidden units, h , a function of w while keeping the number of layers, L , constant.
Revised: Since a bucket message’s scope size is the induced-width, w , we make the number of hidden units, h , a function of w while keeping the number of layers, L , constant.

Original: Specifically, we select h = b · w , where bis a constant satisfying b ≥ 1 .
Revised: Specifically, we use a simple function h = b · w , where b ≥ 1 to fit the NN’s architecture to the message size.

Original: Figure 2 illustrates an example NN model  with an input layer of size w and 2 hidden layers with dimension h, varying linearly with b .
Revised: Figure 2 is an example NN model architecture with an input layer of size w and 2 hidden layers with dimension h .

Original: Through such a rule, NeuroBE fits the NN’s architecture to the message size. We next quantify the capacity of such , and use it to determineits train sample 
Revised: Next, we provide a rule to determine sample sizes to train a NN, depending on a notion of its complexity.

Original: NN complexity.
Revised: NN complexity.

Original:  Pseudo-dimension (Pollard, 1984; Anthony and Bartlett, 2002) is often used to measure the expressive power of a set of functions that can be learned by any statistical regression algorithm.
Revised: The notion of a Pseudo-dimension [Pollard, 1984, Anthony and Bartlett, 2002] is often used to measure the expressive power of a set of functions that can be learned by any statistical regression algorithm.

Original: Bounds to the pseudodimension of NNsused in our work with ReLU activation function is provided by Bartlett et al.
Revised: The work in Bartlett et al. [2019] derived lower bounds to the pseudo-dimension for NNs with ReLU activation function (an architecture used in our work).

Original: We use the  lower boundas a proxy to estimate the pseudo-dimension ( ρ ) of the NN ( µ θ ), with L layers, and b · w hidden units,approximating µ ∗ having width w , yielding (see appendix for derivation):
Revised: We use the derived lower bound to estimate the pseudo-dimension ( ρ ) of a NN ( µ θ ), having an architecture of L layers and b · w hidden units, yielding (see Appendix for derivation):

Original: [Equation]
Revised: [Equation]

Original: The above equation correlates the complexity of the candidate NN with  the width of the message µ ∗ it approximates.
Revised: Since in our experiments, the pair ( L, b ) are fixed for a given problem instance, our ρ estimate only varies with w and is used to determine the sample complexity. Sample Complexity.

Original: Sample Complexity As suggested in Vapnik (1999), we choose a sample size N that is proportional tothe pseudodimension (Eq. 2) of each NN as a function of its # of 
Revised: As suggested in Vapnik [1999], we choose a sample size for training a NN, µ θ , proportional to its pseudo-dimension, Eq. We therefore select a number of samples N satisfying the expression [Equation]

Revised: where η is a constant allowing us to tweak N linearly.

Revised: Since the triplet ( L, b, η ) of a problem is fixed, the number of samples for training, N , is a function of w only.

Original:  Input :  F , a set of functions over scope S ∪ { X } ,where X , a variable to be eliminated. µ ∗ denotes the output message over S , N , an integer,
Revised: Sample Generation Let B be a generic bucket where variable X is eliminated; let F be the set of functions from Input : X , a variable to be eliminated, F , a set of functions over scope S ∪ { X } , N , an integer,

Original: Output : D , a set of N samples{ ( s, µ ∗ n ( s )) } 1: initialize D = {}, 2: for i=1..
Revised: Output : D , a set of N samples 1: initialize D = {}, 2: for i = 1 ..

Original: N do 3: s ← sample uniformly from domain(S) 4: µ ∗ ( s ) ← (cid:80) x
Revised: N do 3: s ← sample uniformly from domain( S ) 4: µ ∗ ( s ) ← (cid:80) x

Original: (cid:81) f ∈ F f ( s, x ) {Eq. 4} 5: µ ∗ nor ( s ) ← Normalize µ ∗ ( s ) {Eq. 5} 6:
Revised: (cid:81) f ∈ F f ( s, x ) {Eq. Add ( s , µ ∗ ( s ) ) to D 6:

Original: Add (s, µ ∗ nor ( s ) ) to D 7: end for 8:  return D arguments w : [Equation] where η is a constant. The sample size N ( w ) often exceeds memory limits for higher width buckets with even the simplest NN architecture ( L = 1 , b = 1 ).
Revised: Update µ ∗ min , µ ∗ max 7: end for 8: Normalize D (Eq 4) 9: return D the graphical model (initialized in line 2, Algorithm 1) as well as messages from the previous buckets (line 11, Algorithm 1) residing in B and S be the scope of the output message function µ ∗ .

Original: So, we use η as a control over the sample size and threshold sample size per bucket to 10 6 . In general, for high induced-width problems, we keep η small and train NNs with small sample sizes. However, for problems with small induced-width, we let η take high values.
Revised: Then, Algorithm 2 generates a dataset

Original: Sample Generation Given a generic bucket B of a variable X and  a local bucket function µ ∗ ( S ) , where S is the scope of the bucket’s output function, we create a training set D T (see Algorithm 2), by generating N (from Eq. 3) number of training examples ( s, µ ∗ nor ( s )) by sampling configurations { S = s }uniformly at random from the domain ofscope S .
Revised: D containing a given number of samples N . The algorithm iteratively and uniformly at random, samples a configuration { S = s } from the domain of S and computes the exact local bucket function value for s using Eq 1 (lines 3,4). The pair < s, µ ∗ ( s ) > is added to the dataset D (line 5).

Original: We compute the message value for each configuration s as
Revised: A normalization step occurs in line 10, where each sample s is shifted and scaled to the range [ − 1 , 1] and µ ∗ ( s ) is shifted and scaled to [0 , 1] , to accelerate training of the NN [Le Cun et al., 1991], by:

Original: [Equation]
Revised: [Equation]

Original: Each generated configuration s then, is paired with its normalized message value µ ∗ nor ( s ) ∈ [0 , 1] as,

Original: [Equation]
Revised: [Equation]

Original:  where µ ∗ min and µ ∗ max  are minimum and maximum µ ∗ values in D T .
Revised: ) where µ ∗ min , µ ∗ max (line 6) are defined relative to the dataset

Original: Note that we also normalize the input sample configurations across benchmarks with domain values >to be in [ − 1 , 1] to accelerate training, as suggested in Cun et al. Some benchmarks in our experiments have very large message values (e.g. e 51 ). In such cases, we use a log transform i.e. logµ ∗ , logµ ∗ min ( D T ) and logµ ∗max ( D T ) instead of their corresponding usual µ ∗ values to compute the target NN values µ ∗ nor in Eq. (For simplicity we will ignore the normalization subscript on the output function µ ∗ and will explicitly denote it when relevant.)
Revised: D by µ ∗ min = min s ∈ D µ ∗ ( s ) and µ ∗ max = max s ∈ D µ ∗ ( s ) .

Original: Loss Function  DBE used the mean square error loss function for training each NN.
Revised: Loss Function Algorithm DBE sampled each message input configuration uniformly and uses the mean square error loss function for training.

Original: However, in the context of thepartition function we want to weigh errors associated with high cost tuples higher than low cost tuples. Namely, squared error on message values that are large seem to be potentially much costlier than smaller message values because oftheir significant contribution to the sum-product operation in Eq. Hence, we propose an importance mean square error (abbreviated as I.m.s.e) as a loss function where the weights are dependent on the message values.
Revised: However, it seems intuitive that generating the samples by taking into account the message distribution could lead to more effective training of the function.

Original: We define the importance weight of a sample as its relative weight in the function distribution in the given dataset D . Namely, given a dataset D , the importance weight W ( s ) is normalized over the µ ∗ values: [Equation]
Revised: Since sampling directly from the message distribution is hard, we instead weight each sample by an importance weight within the loss function, described next.

Original: Definition 1 (Importance mean square error loss (I.m.s.e)) .
Revised: Definition 1 (I.m.s.e loss) .

Original: Let µ θ be thelearned NNfunction for approximating  function µ ∗  . 
Revised: Let µ θ be the NN for approximating the function µ ∗ norm . Let D = D

Revised: Train be the training set.

Original: Then, the I.m.s.e loss function for a given minibatch, D  ∈ DT of size # D  is defined by
Revised: Then, the I.m.s.e loss function for a given mini-batch, D i ∈ D of size # D i is defined by:

Original: [Equation]
Revised: [Equation]

Original:  log transformation.
Revised: where [Equation] Log transformations Usually in our experiments we apply a log transformation to the input functions, for computational reasons.

Original: For problem instances whose functions costs and message costs are very large, we apply log transformation everywhere, replacing µ ∗ by log µ ∗  in  the above equations. Here, the weight function becomes:
Revised: The algorithms presented here remain the same; however the values µ ∗ , µ ∗ min and µ ∗ max in this case refer to the log of the original function values. In cases when we use the log-space computation, the weight function W ( s ) (Eq. 6) is not suitable. We instead use modified importance weights,

Original: [Equation]
Revised: [Equation]

Revised: Note that the importance weight, W ( s ) or W log ( s ) , are computed in the original function space that is not normalized, which is either W ( s ) or W log ( s ) .

Revised: MaskedNet For problems with determinism, i.e., a high proportion of zero probability states, a fully connected feedforward NN was unable to correctly predict deterministic outputs and hence Razeghi et al.

Revised: [2021] used a MaskedNet.

Revised: The input configuration is sent to a fully connected layer with a RELU activation function to obtain a feature vector.

Revised: This feature vector is then sent to two sister layers: the first layer outputs a binary mask responsible for determining whether the final output is zero, and the second layer is responsible for predicting the target value of the Bucket’s function.

Revised: The activation functions of the two final layers are the logistic function and the softplus function, respectively.

Revised: The outputs from the two sister networks are multiplied together to get the final output of the MaskedNet.

Revised: The loss for the MaskedNet in NeuroBE is thus a sum of the binary crossentropy loss (from the first output layer) and the proposed

Revised: I.m.s.e loss (from the second output layer).

Revised: Thus when a sample configuration s has µ ∗ ( s ) = 0 , the loss becomes the binary cross-entropy error, since W ( s ) = 0 , following

Revised: Eq.

Revised: (5) and (6).

Original:  Algorithm 3 describes the procedure, NN - Train .
Revised: NN-Train Algorithm 3 describes the procedure NN-Train .

Original: Its input parameters are L, b, η where L is the number of layers, b is a constant to determine the number of hidden-units, b · w (line 1),  η is another constant to determine the training sample size N (line 2, Eq.3).
Revised: Its input parameters are L, b, η where L is the number of layers, b is a constant to determine the number of hidden units, b · w (line 1), and η is another constant to determine the training sample size N (line 2, Eq.

Original: A major step occurs next where the algorithm generates a Data set of samples (line 3, see also Algorithm 2) and splits it to create the training set  of size N , validation set  of size N/ 4 and testing set  of  size 50 k (line 4).
Revised: A major step occurs next where the algorithm generates a dataset D and splits it into the training set D Train of size N , validation set D V al of size N/ 4 and testing set D Test of fixed size (50k) (lines 3-4; see also Algorithm 2).

Original: If the bucket B contains a trained NN, then this step requires evaluating that NN.

Original: Lines 8-12 then performs batch training for updating the NN parameters( θ) using the I.m.s.e loss function (Eq. 7), and the Adam optimizer (Kingma and Ba, 2014) (line 14) with a learning rate of 0 .
Revised: Lines 8-12 then describe the batch training for updating the NN parameters θ using the I.m.s.e loss function (line 11, Eq. (5)), and the Adam optimizer [Kingma and Ba, 2014] (line 12) with a learning rate of 0 .

Original: 001 and a batchsize ( N B ) of 256 across all benchmarks.
Revised: 001 and a batch-size of 256 across all benchmarks.

Original: At the end of each epoch, the current model is evaluated on a holdout validation set (line 14).
Revised: At the end of each epoch, the current model is evaluated on a holdout validation set (line 14).

Original: We evaluate the early-stopping criteria (line 
Revised: We evaluate the early-stopping criteria (line 15), which is assigned

Original: : D
Revised: True when either the maximum limit # epochs is reached

Original:  D V  D  Initialize  parameters θ  p  6: while p  epochs early stopping do 7:
Revised: 1: # h ← b ∗ w 2: N ← # training samples( w, η, L, b ) {Eq. 3} 3: D ← generate-samples( X, F, N + N/ 4 + 50 k ) 4: D Train , D V al , D Test ← Split( D ) 5: Initialize NN parameters θ , p =1, early-stopping ← False 6: while p ≤ # epochs and ¬ early-stopping do 7:

Original: D  D  divide D Train  minibatch 8:  i k do 9:
Revised: D 1 , .., D k ← divide D Train to minibatch 8: for i .k do 9:

Original: Let D i
Revised: Let D i

Original: = {  s, µ ∗  ) } 10:Compute
Revised: = { ( s, µ ∗ norm ) } 10:

Original:  } 11: loss  ←  ( µ ∗  , µ θ ) {Eq. 7} 12: θ ← update θ by optimize(Adam, loss D i , θ ) 13: end for 14: loss D val ← L D val ( µ ∗  , µ θ ) {For stop condition} 15: early-stopping ← evaluate early-stoping( loss D Val ) 16: p ← p +17: end while 18: Unnormalize { µ θ ( s ) ,µ ∗ ( s ) | s ∈ D Test } {Inverse of Eq.
Revised: Compute { µ θ ( s ) | s ∈ D i } 11: loss D i ← L D i ( µ ∗ norm , µ θ ) {Eq. 5} 12: θ ← update θ by optimize(Adam, loss D i , θ ) 13: end for 14: loss D val ← L D val ( µ ∗ norm , µ θ ) {For stop condition} 15: early-stopping ← evaluate early-stopping( loss D Val ) 16: p ← p +17: end while 18: Unnormalize { µ θ ( s ) , µ ∗ ( s ) | s ∈ D Test } {Inverse of Eq.

Original: 5} 19: ˆ ϵ ← max s ∈ D Test ( logµ ∗ ( s ) − logµ θ ( s )) 20: return µ θ , ˆ ϵ15), which is assigned True when either the maximum limit # epochs is reached or the validation error increases for two consecutive epochs.
Revised: 4} 19: ˆ ϵ ← max s ∈ D Test ( logµ ∗ ( s ) − logµ θ ( s )) 20: return µ θ , ˆ ϵ or the validation error increases for two consecutive epochs.

Original: Once training is complete, we compute the maximum log relative error between the target and NN approximated messages over a test set (lines 18-19).
Revised: Once training is complete, we compute the maximum log relative error between the target and NN approximated messages over a test set (lines 18-19).

Original: In the next section, we use this  to analyse error propagation  in NeuroBE .
Revised: In the next section, we use this maximum error to analyse the propagation of error in NeuroBE .

Original: The NN - train procedure then returns the approximated message µ θ , along with its estimated error.
Revised: The NN-train procedure then returns the approximated message µ θ , along with its estimated error.

Original: Complexity.
Revised: Complexity.

Original: The time and space complexity for learning a single message in NeuroBE is linear in the  sample size.
Revised: The time and space complexity for learning a single message in NeuroBE is a function of the NN and sample size.

Original: In contrast to DBE , here the  sample size varies with the bucket’s width.
Revised: In contrast to DBE , here the NN and sample sizes vary with the bucket’s width.

Original:  ERROR ANALYSIS
Revised:  ERROR ANALYSIS

Original: We next analyse the relationship between the local errors contributed by each approximated message and the global partition function error.
Revised: We now analyse the relationship between the local errors contributed by each approximated message and the global partition function error, focusing on a simple case where the bucket tree is a chain.

Original: Definition 2 (local and global bucket errors) .
Revised: Definition 2 (local and global bucket errors) .

Original: Let λ be the (global) exact message generated in B by the exact BE algorithm, µ ∗ be the (local) exact message in B computed by the functions in it and µ = NN -train( µ ∗ ) be its NN [Figure]
Revised: Given a bucket B , let λ be the (global) exact message generated in B , µ ∗ be the (local) exact message in B at the time of message computation, and µ = NN-train ( µ ∗ ) be its NN approximation.

Original: approximation. Then,  the Local Bucket Error is the function
Revised: Then, we define the local and global log relative errors as:

Original: E = logµ ∗ − logµ
Revised: E = log µ ∗ − log µ, and,

Original: The Global Bucket Error is [Equation] The above error corresponds to a log of the relative errors.
Revised: G = log λ − log µ.

Original: We use log relative error here because bounding the global error as a function of the local errors turned out to be easier.
Revised: We use log relative error since it simplifies the analysis. We now show the following relationship:

Original: Theorem 1.
Revised: Theorem 1.

Original: Assume a bucket-chain along an ordering d  and let B  be a bucket along the chain at index c . Let
Revised: Assume a bucket-chain along an ordering d , and let B c be a bucket along the chain at position c having scope S of its bucket message.

Original:  E  ( s ) = lnµ ∗  ( s ) − lnµ ( s )as defined above and let ϵ  = max s ∈ D ( S ) | E  ( s ) |, where S is the scope of outgoing message from B and D ( S ) is the set of all possible configurations on S .
Revised: Let E c ( s ) = log µ ∗ c ( s ) − log µ c ( s ) and let ϵ c = max s ∈ D ( S ) | E c ( s ) | .

Original: Then,
Revised: Then,

Revised: G c = log λ c − log µ c ≤ n − c (cid:88) k

Original: [Equation]
Revised: = ϵ c + k

Original: In particular, since λ 1 = Z  ,the partition function
Revised: In particular, since λ 1 = Z and µ 1 = ˆ Z ,

Revised: G 1 = log Z − log ˆ Z ≤ n − 1 (cid:88) k

Original: [Equation]
Revised: = ϵ 1+ k (8)

Original: For the proof see the Appendix.
Revised: For the proof see the supplementary material.

Original: In the next section we evaluate NeuroBE .

Original:  EXPERIMENTS 5. EXPERIMENT SETUP
Revised:  EMPIRICAL EVALUATION 5.1 EXPERIMENTAL SETUP

Original: We ran experiments comparing NeuroBE againstthe
Revised: We conducted experiments comparing NeuroBE against

Original: Weighted Mini Bucket Elimination scheme ( WMB ) (Dechter and Rish, 2003; Liu and Ihler, 2012) and DBE (Razeghi et al., 2021).
Revised: WMB [Dechter and Rish, 2003, Liu and Ihler, 2012] and DBE [Razeghi et al., 2021] over several benchmarks.

Revised: We also compare the impact of the two loss functions, m.s.e and I.m.s.e, on the performance of NeuroBE .

Revised: Finally, we illustrate how increasing sample and NN complexity impact performance.

Original: Benchmarks Following the methodology in DBE , we evaluated NeuroBE on instances selected from three wellknown benchmarks from the UAI repository used in Kask et al.
Revised: i-bounds. All three algorithms, WMB , DBE and NeuroBE , use the i-bound parameter ( i ). As noted, in WMB higher i-bounds lead to more accurate bounds with more time and memory, up to their memory limit. Algorithms DBE and

Revised: NeuroBE are also observed to improve accuracy and time with increasing i-bounds because of the reduced number of trained buckets #NB( i ).

Revised: Hence, for a fair comparison we use an i -bound of 10 for some (easy) benchmarks, while primarily using the highest feasible i -bound of 20 dictated by WMB ’s memory bound for other (hard) benchmarks.

Revised: Benchmarks Following the example of DBE , we evaluated NeuroBE on instances selected from three well-known benchmarks from the UAI repository used in Kask et al.

Original: (2020), i.e. grids (vision domain), pedigree (genetic linkage analysis) and DBNs.
Revised: [2020]: grids (vision domain), pedigree (genetic linkage analysis) and DBNs.

Original: We targeted diverse benchmarks (in structure and level of determinism) and aimed for different levels of hardness.
Revised: We targeted diverse benchmarks (in structure and level of determinism) and aimed for different levels of hardness.

Original: Thus, in the grids benchmark, we distinguish between problems that can be solved exactly, which we  call "grid-easy", and those that cannot be solved, called "grid-hard".
Revised: Thus, in the grids benchmark, we distinguish those problems that can be solved exactly, which we [Figure] call “grid-easy”, from those that cannot be solved, called “grid-hard”.

Original: We also distinguish benchmarks that possess determinism , namely have a high proportion of zero probabilities, a feature which can impact training.
Revised: We also distinguish benchmarks that possess determinism , namely have a high proportion of zero probabilities, since it can impact training.

Original: We randomly selected 13 instances from Grids, with easy ones (width 20-30) and hard ones (1600 variables, width 55 or 114), 6 from pedigrees, which posses high level of determinism and 6 from DBNs, totalling 25 instances.
Revised: We randomly selectedinstances from Grids, with easy ones (400 variables, width 20-30) and hard ones (1600 variables, width 55 or 114),from pedigrees ( ≈ 800 variables, width ≈ 34), which posses high level of determinism and 6 from DBNs ( ≈ 40 variables, width ≈ 22), totalling 25 instances.

Revised: As described in section 3, we apply log transformations to Grids and DBNs since they have large message function values.

Original: NN architectures and sample sizes.
Revised: NN architectures and sample sizes.

Original: To trigger bucket message approximations, we used i -bound= 10 for easy problems and i -bound= 20 for hard ones.

Original: For problems with determinism, such as pedigree, the NN architecture hasset of output layers, one indicating whether the input configuration has non-zero probability while the other specifies the message value if so.

Original: The loss is then a sum of the cross-entropy loss (from the first output layer) and the (importance) mean square loss (from the second output layer).

Original: We keep the # layers fixed (=2) across all benchmarks.

Original: Through a process of trial and error applied to a selectedrepresentative instance from each benchmark, we used as static parameters of the architecture and sample sizes as follows.
Revised: Through a process of trial and error on a selected instance from each benchmark, we selected the parameters of the architectures and sample sizes as follows.

Original: We selected  h = 3 w and N avg ∈ [149 k, 350 k ] for pedigrees;  h = 3 w and N avg ∈ [80 k, 180 k ] for DBN;  h = w and N avg ∈ [23 k, 68 k ]  for grid-easy; and  h = w and N avg ∈ [75 k, 150 k ] for grid-hard.
Revised: We selected L = 1 , h = 3 w, and N avg ∈ [149 k, 350 k ] for pedigrees; L = 2 , h = 3 w, and N avg ∈ [80 k, 180 k ] for DBN; L = 2 , h = w, and N avg ∈ [23 k, 68 k ] , for grid-easy; and L = 1 , h = w, and N avg ∈ [75 k, 150 k ] for grid-hard.

Original: Performance measures We evaluate the performance of
Revised: Performance measures We evaluate the performance of

Original: NeuroBE using: error = | log e Z − log e ˆ Z | where ˆ Z is the estimate of the partition function, Z .
Revised: NeuroBE using: error = | log e Z − log e ˆ Z | where ˆ Z estimates Z .

Original: When the exact Z is not available (for hard Grid benchmark),  Z ∗ is a surrogate to Z , which is obtained using an advanced sampling scheme for a duration of 100 ∗ 1 hr (Kask et al., 2020).
Revised: When the exact Z is not available (i.e., for hard Grid benchmark), we use Z ∗ as a surrogate to Z , which is obtained using an advanced sampling scheme for a duration of 100 ∗ 1 hr [Kask et al., 2020].

Original: 5.2 RESULTS
Revised: 5.2 RESULTS

Original: Figure 3 compares NeuroBE against WMB and DBE over the 3 benchmarks.
Revised: Figure 3 compares NeuroBE against WMB and DBE over the four benchmarks.

Original: The first few columns show the problem statistics for instances in the respective benchmarks (pedigree, DBN and grids).
Revised: The first few columns show the problem statistics for instances in the respective benchmarks (pedigree, grid-hard; grid-easy and DBN).

Original: We then show  WMB  error, followed bythe average error, minimum error, standard deviation and average time (in hours) over 5 runs (due to stochasticity) for both DBE  and NeuroBE with m.s.e and
Revised: We then show results on WMB ’s error, followed by DBE ’s and NeuroBE ’s performance information. We omit WMB ’s time performance in

Original: I.m.s.e loss functions.
Revised: Figure 3 since its execution takes only a minute. For DBE , we report the number of buckets trained by NNs, ( # NB ), followed by the average error, minimum error, standard deviation, and average time (in hours) over five runs, which is preferable due to stochasticity.

Original: For NeuroBE , we also report  the average and maximum #training samples,( N avg , N max ) and maximum #hidden units,( h max ) across all buckets of the instance.
Revised: For NeuroBE with both m.s.e and I.m.s.e loss functions, we also report statistics about NN architecture and sample size that varies within problem instances: the average and maximum number of training samples, N avg and N max , and maximum number of hidden units, h max .

Original: Pedigrees We observe immediately that overall NeuroBEhas far superior performance to DBE , especially with the I.m.s.e loss function.
Revised: Pedigrees We observe immediately that, overall, NeuroBE with the I.m.s.e loss function is clearly superior to DBE and NeuroBE with m.s.e loss.

Original: In particular, it is ≥ 5 times more accurate than DBE for almost allthe instances and takes less time, since it uses far less training samples.
Revised: In particular, it is ≥ 5 times more accurate than DBE for almost all instances and takes less time, since it uses far less training samples.

Original: Also,
Revised: NeuroBE with the I.m.s.e loss function also outperforms WMB on most instances.

Original: NeuroBE outperforms WMB on mostof the instances. 
Revised: NeuroBE with the m.s.e loss function is less accurate than both WMB and DBE for most instances. It also fails to approximate the partition function for instance [Figure] 5 (errors and standard deviation denoted by # in Figure 3).

Original: Here, DBE yields either a similar (or even worse) accuracy as WMB .
Revised: Here, DBE has similar or even worse accuracy than WMB .

Original: Grids.
Revised: Grid-hard.

Original: Here too we observe that NeuroBE outperforms DBE in accuracy, particularly with the I.m.s.e loss, as reflected by the average error and standard deviation, even though it uses far less time.
Revised: The results for the grid-hard benchmark is shown in Fig. 4b. We used the highest possible i -bound of 20 , and we observe that NeuroBE can achieve a far lower average error and standard deviation and takes far less time than WMB and DBE , particularly with the I.m.s.e loss.

Original: In most cases, we see a reduction in time by a factor of 2 while still producing a far better estimate.
Revised: In most cases, we see a reduction in time by a factor of two.

Original: NeuroBE and DBE outperform WMB across all problem instances. 
Revised: DBE outperforms WMB across all problem instances. Grid-easy.

Original: [Figure]
Revised: The results for the grid-easy benchmark is shown in Figure 4c. We used a lower i -bound of 10 to facilitate the training of a relatively large number of buckets. As expected, when an instance has a low induced-width and only a small number of buckets are approximated (e.g., ID 2), DBE obtains high accuracy.

Revised: As the induced-width increases and more buckets are trained, NeuroBE has far higher accuracy compared with both WMB and DBE .

Revised: Both the loss functions in NeuroBE show similar performance.

Original: DBN We report results for the DBN benhcmark fori -bounds.
Revised: DBN We report results for the DBN benhcmark for two i -bounds.

Original: For i-bound=20, NeuroBE , mostly with the 
Revised: Overall, the results are mixed. For i -bound = 20,

Original: I.m.s.e loss achieves a higher accuracy than DBE  with far less #training samples (but with more training time).
Revised: NeuroBE achieves a higher accuracy than DBE for half of the instances with far less #training samples (but with more training time).

Original: It is superior to WMB on instances 2,3,5.
Revised: It is superior to WMB on instances 2, 3, and 5.

Revised: When comparing the two loss functions in NeuroBE , I.m.s.e loss has better (or similar) performance for most instances.

Original: However, WMB performs better on instance 1,4 & 6, as the induced-width is closer to the i-bound.
Revised: However, WMB performs better on instance 1, 4, and 6, as the induced-width is closer to the i -bound.

Original: For i-bound=10, NeuroBE shows better accuracy than WMB for all three instances.
Revised: For i -bound = 10, DBE and NeuroBE show better accuracy than WMB for those three instances.

Original: It is comparable to DBE  on most instances taking less time.
Revised: DBE has better accuracy when compared with NeuroBE , using more #training samples (and hence, more time). NeuroBE with I.m.s.e loss is better performing compared with m.s.e loss on most instances. Overall, NeuroBE when trained with I.m.s.e loss takes more time than with m.s.e loss for the same #training samples.

Original: Overall, compared with DBE , NeuroBE using I.m.s.e  is about 50 % faster while also far more accurate on pedigrees, twice as fast and 5 to 10 fold more accurate on hard grids.
Revised: In summary, NeuroBE using I.m.s.e compared against DBE is about 50 % faster while also far more accurate on pedigrees, twice as fast and 5 to 10 fold more accurate on hard grids.

Original: It is also faster and more accurate on easy grids and has a  comparable performance on the DBN benchmark.
Revised: It is also faster and more accurate on easy grids and has a mixed but still comparable performance on DBNs.

Original: The impact of loss functions.
Revised: The impact of loss functions.

Original: We observe that NeuroBE with the I.m.s.e loss shows better performance (lower average error and standard deviation) than NeuroBE with the m.s.e loss for the pedigree instances, andfor the majority of
Revised: We observe that NeuroBE with the I.m.s.e loss shows better performance (lower average error and standard deviation) than NeuroBE with the m.s.e loss for the pedigree instances and the majority of

Original: DBN, grid-easy and grid-hard instances.
Revised: DBN, grid-easy and grid-hard instances.

Original: An F-test  on the two groups of partition function estimates (each consisting of 5 approximations) showed that the means are significantly different for pedigrees, (Fig. 3(a)).
Revised: An F-test with a significance level of 0 . on the two groups of partition function estimates (each consisting of five approximations) showed that the means are significantly different for pedigrees, in Figure 3(a).

Original: For the grids and DBN, there was no statistical difference between the two means.
Revised: For the grids and DBN, there was no statistical difference between the two means.

Original: However, by inspection, we see a reduction in the standard deviation for almost all instances.
Revised: However, by inspection, we see a reduction in the standard deviation for almost all instances.

Original: Impact of architecture size.
Revised: Impact of architecture size.

Original: Figure 4 shows the impact of architecture size on time and accuracy on a few problem instances.
Revised: Figure 4 shows the impact of architecture size on time and accuracy for a few problem instances.

Original: We show the average error of the partition function estimate (what we call global error), and standard deviation (over 5 runs) and the computation time for 2 different NN architecture and their associated sample sizes.
Revised: We show results for two different NN architectures and their associated sample sizes.

Original: As expected we see that increasing theNN and sample  sizes increases the time and accuracy for pedigrees.
Revised: As expected, we see that increasing the sample and NN sizes increases both time and accuracy for pedigrees.

Original: For grid-hard instances, we just increased the sample sizes for the same architecture having h = w , and observe that the average error is reduced, as expected.
Revised: For grid-hard instances, we just increased the sample sizes and kept the same architecture having h = w . We observe that the average error is reduced, as expected.

Original: Instances from grid-easy and DBN (except, instance #2) show a similar improvement in performance with a larger NN and training sample size.
Revised: Instances from grid-easy and DBN (except ID 2) show a similar improvement in performance with a larger NN and training sample size.

Original: This shows that the algorithm has an anytime characteristic, as it can improve its performance by controlling the size of theapproximating NN matched by a suitable  sample size for training.
Revised: This trend illustrates that increasing the size of the NN (matched by a suitable increase in sample size), improves the accuracy of NeuroBE , at the cost of more time and memory. A key question for future work is how to develop a policy that can facilitate gradual control of architecture and sample size increase to improve performance in an anytime way.

Original:  CONCLUSION & FUTURE WORK
Revised:  CONCLUSION & FUTURE WORK

Original: In this work, we advance the earlier theme of using Neural
Revised: In this work, we advance the earlier theme of using Neural

Original: Networks to approximate the class of bucket-elimination algorithms that is at the heart to probabilistic reasoning.
Revised: Networks to approximate the class of bucket-elimination algorithms that is at the heart to probabilistic reasoning.

Original: NeuroBE can be viewed as a realization of Neuro-Dynamic
Revised: NeuroBE can be viewed as a realization of Neuro-Dynamic

Original: Programming schemes Bertsekas and Tsitsiklis (1996), in the context of graphical models.
Revised: Programming schemes [Bertsekas and Tsitsiklis, 1996], in the context of graphical models.

Original: That being said, it requires  training of numerous NN per problem instance and thus the central aim of NeuroBE ’s design (customizing NN architectures, training samples and the loss function to the message) is to enhance efficiency  of such schemes.
Revised: That being said, it requires the training of numerous NNs per problem instance, and thus, the central aim of NeuroBE ’s design (customizing NN architectures, training samples, and the loss function to the message) is to enhance efficiency and scalability of such schemes.

Original: We presented NeuroBE and illustrated, on challenging instances over three benchmarks that it can be far more accurate and requires less time compared with Deep Bucket Elimination ( DBE ) and is also superior to weighted mini-bucket ( WMB ) that cannot improve its accuracy once their memory is exhausted.
Revised: We presented NeuroBE and illustrated on challenging instances over three benchmarks that it can be far more accurate and requires less time compared with Deep Bucket Elimination ( DBE ). It is also superior to weighted mini-bucket ( WMB ) even when provided with the highest memory resources feasible.

Original: We believe that NeuroBE has the potential to become more time efficient and may also extend into learning across a set of instances from the same benchmark domain.

Original: Future Work.
Revised: Future Work.

Original: While NeuroBE adjusts the NN architectures according to  a bucket’s scope, it keeps the # layers fixed, a hyper-parameter we wish to explore varying dynamically.
Revised: We will explore further how to improve NeuroBE ’s efficiency by customizing additional features of a NN and its training per bucket (e.g., varying the number of layers).

Original: We will also explore  training a single function per union of buckets, which yield a cluster in a treedecomposition (Dechter, 2013). This can significantly reduce the number of trained functions at the cost of more time for sample generation, a trade-off we plan to study.
Revised: We will also explore moving from training buckets separately per single variable to training clusters of buckets within a tree-decomposition, thus training a single function per union of buckets [Dechter, 2013], potentially reducing the number of trained functions at the cost of more time for sample generation.

Original: We willalso explorethe task of parameter sharing and training multiple bucket functions simultaneously. 2021. Main Track.
Revised: Finally, we will explore parameter sharing by training multiple bucket functions simultaneously in a single problem instance and across a benchmark of instances.

Original:  ISSN doi: 10.1109/TNN.2008. //doi.org/10.1109/
Revised:  ACKNOWLEDGEMENT

Original: TNN. ISBN A APPENDIX A.1 ESTIMATING THE PSEUDO-DIMENSION OF A NN: In our work, we use NN architectures with ReLU activation functions.
Revised: We thank our reviewers and our lab colleagues Bobak

Original: To construct a NN with L layers and a variable h, #hidden-units per layer to model a specific local bucket message µ ∗ , we pick the rule h

Original: = b ∗ w where w is the width and b is a constant.

Original: By doing this, the # parameters in the NN is :

Original: [Equation]

Original: We make use of the lower bound of pseudo-dimension for NNs with ReLU activation functions from the work in Bartlett et al.

Original: (2019) to get:

Original: [Equation]

Original: By substituting Eq.

Original: 10 in Eq.

Original: and ignoring all linear terms in w we get that ρ ( w ) can be dominated by:

Original: [Equation]

Original: A.2 ESTIMATING ERROR IN PARTITION FUNCTION:

Original: Theorem.

Original: 1 Let B c be a bucket in a bucket chain along an ordering d ; let B c contain the original functions as ϕ c and µ c +1 as the message passed to it from the previous bucket; let λ c be the (global) exact message generated in B c , µ ∗ c be the local exact message in B c and µ c = APP ( µ ∗ c ) its approximation (e.g., by a trained neural network).

Original: Let

Original: E c = lnµ ∗ c − lnµ c and and ϵ c = max B c | E c | . Then, [Equation] k
Revised: Pezeshki and Nick Cohen for their constructive feedback.

Original: [Equation]

Original: ϵ c

Original: [Equation]

Original: In particular, since λ 1 = Z , the partition function

Original: [Equation]

Original: Proof.

Original: We will next derive the recursion, starting at the first processed bucket B n and going down in order.

Original: Remember throughout that ln µ ∗ n − i =

Original: (cid:80)

Original: [Equation]

Original: For B n λ n = µ ∗ n , therefore

Original: [Equation]

Original: For B n − 1 , by definition

Original: [Equation]

Original: Substituting lnλ n from B n = ln (cid:88)

Original: [Equation]

Original: If

Original: [Equation]

Original: , then,

Original: [Equation]

Original: Since ln (cid:80) X n − 1 e lnϕ n − 1 + lnµ n = lnµ ∗ n − 1 we get lnλ

Original: [Equation]

Original: lnµ

Original: [Equation]

Original: (13) or equivalently,

Original: [Equation]

Original: Moving to B n − 2 , by definition:

Original: [Equation] Substituting lnλ n − 1 from Eq. (13) we get lnλ [Equation]
Revised: This work was supported in part by NSF grants IIS-2008516.

Original: Taking max [Equation] yielding, [Equation]
Revised: . Main Track

Original: Moving to bucket B n − 3 , by definition [Equation] Substituting for λ n − 2 from Eq. (16) we get with some algebra
Revised: TNN

Original: [Equation]

Original: yielding

Original: [Equation]

Original: and so on.

Original: Clearly the emerging expression for bucket B c is

Original: [Equation] 17) or, [Equation] The general transition from n − i to n − i − 1 can be easily followed to complete the inductive proof.
Revised: URL https://doi.org/10.1109/TNN.

Original: Assuming that we control the derivation of µ c for each B c to ensure that E c = lnµ ∗ c − lnµ c ≤ ϵ c and substituting in the expression we get from Eq. (18) that [Equation] A.3 MISCALLANEOUS EXPERIMENTS ON ANALYZING ERROR
Revised: ISBN 0387987800.

Original: Calculating ϵ from Theorem 1 is hard because it involves computing the local bucket error E over all configurations in the scope of the bucket.

Original: Therefore, we calculate the maximum over a sampled test set (lines 18-20 of algorithm 3) as ˆ ϵ .Additionally, we calculate the average local bucket error, ˆ ϵ avg over the same test set.

Original: To bound the global error of the approximated partition function from Eq.

Original: 9, we sum over all the estimated bucket error bounds, ˆ ϵ ), Clearly, the bound is very lose.

Original: We therefore use the average local bucket error, ˆ ϵ avg to give us some additional information on the global error empirically:

Original: [Equation]

Original: Relationship between local and global errors empirically.

Original: Figure 5a) depicts the empirical global errors against the local error bound for 4 grid instances over 2 sample configurations={60k,120k}.

Original: Specifically, the local error bound shown is the maximum over the estimated local bucket errors ( ˆ ϵ avg from Eq. 20) across all buckets and the (empirical) global error is the error in the partition function estimate.

Original: As expected, we see a somewhat linear relationship between the global error and the local error bound.

Original: We also see that higher samples drive the local and global errors towards the lower-left of the plot and vice-versa.

Original: Impact of sample size on error bounds.

Original: Figure 5b &c) depicts the impact of sample size on the estimated local and global error bounds (Eq. 20).

Original: Specifically, the local error bound shown is the maximum over the estimated local bucket errors ( ˆ ϵ avg from Eq. 20) across all buckets.

Original: As expected, we see that increasing the training sample size makes the two bounds tighter.

Original: For the 4 grid instances (f10, f5, f2, f15), we also observed that the empirical global error in the partition function estimate for for the two sample configurations {(37.21, 7.94), (18.8, 5.9), (10.28, 3.05), (41.3, 27.5)} is in proportion to the global error bound from Fig.

Original: 5b).