Approximate Weighted First-Order Model Counting: Exploiting Fast Approximate Model Counters and Symmetry

Timothy van Bremen, Ondrej Kuzelka

Abstract

Weighted First-Order Model Counting (WFOMC) is a fundamental task in probabilistic logic inference, yet it faces significant scalability hurdles. Standard exact solvers often fail due to the exponential explosion of variables during grounding, while existing approximate counters struggle with the "tilt"—the extreme disparity between maximum and minimum weights. We present ApproxWFOMC, an anytime algorithm that decomposes complex weighted problems into a series of unweighted counts constrained by cardinality. By leveraging state-of-the-art approximate counters and heuristic search, ApproxWFOMC provides tight, PAC-guaranteed bounds on problems that are computationally intractable for exact methods.

The Challenge of Tilt and Grounding

In probabilistic logic, we often need to calculate the total weight of possible worlds satisfying a set of rules, a process known as WFOMC. The traditional approach involves "grounding" first-order logic into propositional logic. However, as domain sizes increase, the number of variables grows rapidly, causing exact solvers like SDD or d4 to exceed memory limits.

Furthermore, approximate weighted counters like WeightMC are often hindered by "tilt." In grounded formulas, the ratio between weights can grow exponentially with domain size, requiring an astronomical number of SAT solver queries to achieve accuracy. ApproxWFOMC is designed to bypass this trap by transforming the weighted problem into multiple unweighted ones.

The ApproxWFOMC Approach

ApproxWFOMC introduces a two-step innovation:

  1. Exact Decomposition: The algorithm proves that a WFOMC problem can be mathematically decomposed into a weighted sum of unweighted model counts, each restricted by cardinality constraints (e.g., "count models where exactly $n$ people are smokers"). This exploits symmetry, grouping models by the number of true groundings rather than their specific identities.
  2. Anytime Bounding: The decomposition is treated as a search problem. Using a priority queue, the algorithm focuses on regions of the model space that contribute most to uncertainty. It uses ApproxMC3, a hashing-based approximate model counter, to perform the actual counting.

The algorithm provides PAC (Probably Approximately Correct) guarantees, allowing users to specify tolerable error ($\epsilon$) and uncertainty ($\delta$) levels.

Empirical Evaluation

The researchers evaluated ApproxWFOMC on challenging, non-domain-liftable Markov Logic Network (MLN) benchmarks, including transitive-smokers-mln and transitive-smokers-drinkers-mln.

Scalability and Runtime

ApproxWFOMC demonstrates significantly better scalability than exact compilers. As shown in the runtime analysis, exact solvers like SDD and d4 fail as domain sizes increase, whereas ApproxWFOMC continues to provide results.

Runtime comparison for transitive-smokers (a) and transitive-smokers-drinkers (b) MLNs across domain sizes.

Rapid Convergence

A key advantage of the anytime nature of the algorithm is its rapid convergence. The upper and lower bounds on the model count narrow toward the true value very quickly, often requiring only a few dozen calls to the underlying SAT oracle to achieve high precision.

Convergence of upper and lower bounds toward the true value as the number of ApproxMC3 calls increases.

Conclusion

ApproxWFOMC represents a significant step forward for large-scale probabilistic inference. By avoiding the "tilt" problem and exploiting symmetry through cardinality constraints, it scales to domain sizes previously unreachable. Future work will focus on reducing grounding dependencies and tighter integration between cardinality constraints and hashing-based counters to further enhance performance.

Summary updated

BibTeX
@inproceedings{bremen2020approximate,
  author = {Timothy van Bremen and Ondrej Kuzelka},
  title = {{Approximate Weighted First-Order Model Counting: Exploiting Fast Approximate Model Counters and Symmetry}},
  booktitle = {International Joint Conference on Artificial Intelligence},
  year = {2020},
  doi = {10.24963/ijcai.2020/587},
}
Figure