This paper presents a novel algorithm called PAWS (PArity-based Weighted Sampler) that bridges the gap between powerful combinatorial search tools and the notoriously difficult problem of probabilistic sampling.
The Problem: Local Search in Complex Spaces
Sampling from a probability distribution is a cornerstone of machine learning and physics. It is heavily used to estimate expectations and marginals when exact calculation is impossible—a task known to be #P-complete.
The standard tool for this is Markov Chain Monte Carlo (MCMC). However, MCMC relies on "local search," moving iteratively from one state to a neighboring state. In complex combinatorial spaces (like software code or Ising models with strong interactions), the distribution often features "modes" (high-probability islands) separated by vast "oceans" of near-zero probability. MCMC frequently gets stuck on one island, failing to "mix" and provide a representative sample of the entire space.
The authors ask a compelling question: Can we instead use complete search methods (like SAT solvers or Branch and Bound), which are incredibly efficient at finding needles in haystacks, to perform weighted sampling?
Methods: Embed, Project, and Search
The authors propose a four-step strategy to transform sampling into a series of search problems:
- Weight Discretization: They first approximate the continuous weights of the distribution by grouping them into geometric "buckets" (log-scale). This turns a complex weighted problem into a slightly simpler discrete one.
- Embedding: They map the discrete weighted distribution into a higher-dimensional space where the distribution is uniform. Essentially, they add auxiliary binary variables such that the number of valid configurations in the new space corresponds to the weight of the configuration in the original space.
- Projection and Search: To sample from this uniform space, they use Universal Hashing. By adding random "parity constraints" (XOR equations) to the problem, they roughly cut the search space in half with each constraint. By adding just the right number of constraints, they prune the space down until only a few "surviving" configurations remain.
- The Oracle: Finally, they use a combinatorial solver (like a SAT solver or the optimization tool
ToulBar2) as a "black box" to find these survivors. One is then chosen via rejection sampling.
Unlike MCMC, which provides no easy way to tell if it has converged, PAWS provides a probabilistic certificate: if the solver finds a solution, the sample is guaranteed to be within a known constant factor of the true distribution.
Key Results
The authors evaluated PAWS on two distinct types of problems: synthetic Ising grids (classic physics models) and Software Verification (SW) benchmarks (real-world industrial traces from Microsoft’s SAGE system).
Accuracy in Hard Regimes (Ising Grids)
On Ising grids with strong interactions, MCMC (Gibbs sampling) and Variational methods (Belief Propagation) failed significantly, producing highly inaccurate marginals. PAWS, however, remained highly accurate.
As seen in the correlation plots above, PAWS stays tightly clustered along the "ground truth" 45-degree line for both mixed and attractive configurations, easily outperforming traditional methods that struggle with energy barriers.
Scaling to Software Verification
Software verification instances are notoriously difficult because they contain large regions of zero probability (invalid execution traces) that break the assumptions of many MCMC samplers. PAWS successfully scaled to instances with hundreds of variables.
In these tests, PAWS produced samples that closely matched the theoretical distribution, whereas MCMC often failed to even find a single valid state.
Key Insights and Limitations
The core "aha" moment of PAWS is that sampling doesn't have to be a local walk. By randomly slicing the space using hash functions, a global sampling problem becomes a series of global search queries. Because PAWS uses global search, it isn't bothered by the "energy barriers" that trap MCMC; it can jump between distant modes of the distribution effortlessly. Furthermore, as SAT solvers get faster, PAWS gets faster.
However, there are limitations:
- Computational Cost: While more accurate in hard cases, PAWS is computationally heavier than MCMC. It requires solving multiple NP-hard problems per sample.
- Hyperparameter Sensitivity: Performance depends on choosing the right number of buckets and pivot values. While the paper provides a method to estimate these, it adds overhead.
Ultimately, PAWS represents a powerful new paradigm for discrete sampling, offering provable bounds and robust performance in spaces where traditional MCMC fails.
Summary updated