Context-Specific Likelihood Weighting

Nitesh Kumar, Ondrej Kuzelka

Abstract

Sampling is a popular method for approximate inference when exact inference is impractical. Generally, sampling algorithms do not exploit context-specific independence (CSI) properties of probability distributions. We introduce context-specific likelihood weighting (CS-LW), a new sampling methodology, which besides exploiting the classical conditional independence properties, also exploits CSI properties. Unlike the standard likelihood weighting, CS-LW is based on partial assignments of random variables and requires fewer samples for convergence due to the sampling variance reduction. Furthermore, the speed of generating samples increases. Our novel notion of contextual assignments theoretically justifies CS-LW. We empirically show that CS-LW is competitive with state-of-the-art algorithms for approximate inference in the presence of a significant amount of CSIs.

Introduction

Probabilistic graphical models, such as Bayesian networks (BNs), are indispensable tools for reasoning under uncertainty. However, as these models grow in size and complexity, calculating exact answers becomes computationally explosive. Researchers often turn to approximate inference methods like Likelihood Weighting (LW), a sampling technique that estimates probabilities by generating numerous samples and weighting them according to the evidence. While effective, standard LW often fails to exploit the internal logical structures of a distribution, leading to inefficiencies in both speed and accuracy.

The Challenge: Context-Blindness in Standard Sampling

Standard Likelihood Weighting is "context-blind." It relies on the rigid graph structure of a Bayesian network, assuming that every parent variable of a node is always relevant to its state. In reality, many systems exhibit Context-Specific Independence (CSI). CSI occurs when a variable becomes independent of its parents given a specific value (context) of another parent.

Figure 1: Representation of Context-Specific Independence (CSI). A tabular CPD (center) for node E in a Bayesian network (left) can be simplified into a Tree-CPD (right) by exploiting redundancies. For instance, if A=1, the value of E is determined regardless of B or C.

Consider a medical diagnostic system: if a patient is diagnosed with a specific rare condition, that condition might dictate their symptoms regardless of other minor health factors. A standard algorithm would still waste computational resources sampling those irrelevant factors. This paper introduces CS-LW to bridge the gap between simple sampling and the rich, logical structure found in real-world data.

Methods: Exploiting Context-Specific Independence

The authors propose Context-Specific Likelihood Weighting (CS-LW), which moves beyond tabular representations by using rule-based structures, specifically a restricted fragment of Distributional Clauses. The algorithm is built on several key technical components:

  • Contextual Assignments: Instead of assigning values to every variable in the network, CS-LW uses "partial assignments." It only samples the ancestors of a variable that are strictly required to determine its distribution in the current context.
  • Modified Bayes-Ball Algorithm: The authors adapted the classic "Bayes-ball" graph traversal algorithm to be context-sensitive. This modified version dynamically decides which parts of the network to visit based on the values already sampled. If a rule indicates that a variable is irrelevant in the current context, the "ball" simply does not roll toward it.
Figure 2: The modified Bayes-ball algorithm dynamically determines which variables are 'requisite' for a query based on the values already sampled in the current context.
  • Theoretical Justification: The authors provide a mathematical proof (Theorem 3) showing that query probabilities can be correctly computed by summing over these "safe" contextual assignments, ensuring that ignoring irrelevant variables does not bias the results.

Key Insights and Ideas

CS-LW offers a rare "win-win" in approximate inference. By only sampling requisite variables, it effectively operates in a lower-dimensional space. According to the Rao-Blackwell theorem, this dimensionality reduction naturally reduces the variance of the estimate, leading to faster convergence. Furthermore, because fewer variables are sampled per iteration, the algorithm is significantly faster per sample than standard methods.

Experimental Evaluation

The authors evaluated CS-LW on four well-known Bayesian networks: Alarm, Andes, Win95pts, and Munin1. Since these datasets are typically stored in flat tables, decision tree learning was used to automatically extract the hidden CSI structures.

  • Efficiency Gains: On the Andes network (223 variables), CS-LW was approximately 5 times faster than standard LW and achieved significantly lower error rates.
  • Accuracy: For the Alarm network, CS-LW achieved a Mean Absolute Error (MAE) of 0.0034 at 100,000 samples, compared to 0.0086 for standard LW.
  • Scalability: When compared to Collapsed Compilation (CC), a state-of-the-art hybrid method, CS-LW proved more robust. While CC ran out of memory on the large Munin1 dataset due to large variable domains, CS-LW handled the network easily, providing a competitive approximation.

Conclusion

Context-Specific Likelihood Weighting represents a significant advancement in approximate inference. By treating conditional probabilities as rules rather than just tables, CS-LW exploits the logical structure of data to improve both speed and accuracy. While its benefits are most pronounced in networks with high CSI, its ability to scale to large, complex models makes it a powerful tool for modern probabilistic reasoning. Future work may extend this context-specific logic to other sampling frameworks, such as Markov Chain Monte Carlo (MCMC) methods.

Summary updated

BibTeX
@inproceedings{kumar2021context,
  author = {Nitesh Kumar and Ondrej Kuzelka},
  title = {{Context-Specific Likelihood Weighting}},
  booktitle = {International Conference on Artificial Intelligence and Statistics},
  year = {2021},
  url = {https://openreview.net/forum?id=3O9dglgWbO},
}
Figure