Introduction
Weighted model counting (WMC) and weighted sampling are fundamental tasks in fields ranging from machine learning to hardware verification. These problems involve determining the total weight of solutions to a set of constraints or sampling solutions proportional to their weights. Because these tasks are #P-hard, exact solutions are often computationally infeasible for large-scale problems. This paper introduces WeightMC and WeightGen, the first scalable algorithms for approximate weighted model counting and sampling that provide strong theoretical guarantees without relying on expensive "Most Probable Explanation" (MPE) queries.
Methodology: Hashing and the Tilt Parameter
The authors adapt recent breakthroughs in unweighted counting by utilizing XOR-based hashing. This technique uses 3-wise independent hash functions to partition the space of satisfying assignments into "cells." By tuning the number of constraints so that a single cell contains a manageable total weight, the total weight of the entire space can be estimated by scaling the weight found in that cell.
A central contribution of this work is the formalization of the tilt parameter ($\rho$), defined as the ratio of the maximum weight of a satisfying assignment to the minimum weight ($\rho = w_{max} / w_{min}$). The authors demonstrate that the difficulty of weighted counting is intrinsically linked to this parameter:
- Small Tilt: The weight distribution is relatively flat, allowing a standard SAT solver (NP-oracle) to solve counting and sampling efficiently.
- Large Tilt: For known weight functions, the authors propose PartitionedWeightMC, which decomposes the problem into regions of small tilt.
Experimental Results and Scalability
The algorithms were evaluated against a diverse suite of benchmarks, including grid networks, medical diagnosis models (DQMR), and circuit verification tasks. A primary point of comparison was the Sentential Decision Diagram (SDD) package, a state-of-the-art exact counter.
The results highlight a significant leap in scalability. While SDD performed well on smaller instances, it frequently encountered memory limits as the number of variables grew beyond 1,000. In contrast, WeightMC successfully processed formulas with up to 63,797 variables (e.g., the LLReverse benchmark), representing an order-of-magnitude improvement over previous methods.
Beyond scalability, the algorithms demonstrated high precision. The $L_2$ norm of the relative error across benchmarks was only 0.014, and WeightGen produced sampling distributions nearly indistinguishable from an ideal sampler.
Conclusion
By moving away from MPE-based optimization and leveraging the tilt parameter, WeightMC and WeightGen provide a robust framework for large-scale probabilistic reasoning. The work identifies the development of parity-aware pseudo-Boolean solvers as a key future direction to further enhance performance on high-tilt problems.
Summary updated