INC: A Scalable Incremental Weighted Sampler

Suwei Yang, Victor Liang, Kuldeep S. MeelFMCAD 2022

TL;DR

This paper introduces INC, a novel weighted sampler designed for incremental updates to sampling distributions. By leveraging a compact knowledge compilation structure called PROB and performing computations in log-space, INC significantly outperforms existing methods in scenarios requiring repeated sampling with changing weights.

What Problem Does This Paper Address?

Weighted sampling is crucial in many applications, particularly in areas like hardware and software verification, where it's used to generate test cases or explore complex systems. The core task is to sample assignments of Boolean formulas according to a specified probability distribution defined by weights. A key challenge arises when these weights need to be updated incrementally over multiple sampling rounds. Existing samplers often struggle with this, either by being inefficient or by not being designed for this incremental nature. This paper addresses the need for a scalable and efficient weighted sampler that can handle these dynamic weight updates effectively.

Methods

The authors propose INC (Incremental Weighted Sampler), built upon a knowledge compilation (KC) paradigm. The core innovation lies in its use of PROB (Probabilistic OBDD), a compact representation of Boolean formulas that is shown to be significantly smaller than previous KC structures like d-DNNF.

Key methodological contributions include:

  • PROB Structure: A variant of OBDD enhanced with conjunction nodes, designed for succinct representation of satisfying assignments.
  • Log-Space Computations: INC performs annotation (calculating joint probabilities) in log-space. This avoids the need for arbitrary-precision arithmetic, which can be slow and prone to numerical underflow, especially with many multiplications. The authors use the LogSumExp trick for stable calculations.
  • Bottom-Up Unified Pass: Unlike prior methods that might use separate passes for annotation and sampling, INC integrates both into a single bottom-up pass over the PROB structure. This dynamic annotation while sampling is a key to its efficiency.
  • Smoothing Property: A preprocessing step ensures that PROBs are "smooth," meaning that for any decision node, the sets of variables in its left and right subtrees are identical. This guarantees that the sampled assignments are complete.

Datasets

Not discussed in the paper. The experiments use benchmarks from various real-world applications, including DQMR networks, SMT-LIB benchmarks, ISCAS89 circuits, and configurable systems.

Key Insights and Ideas

  • PROB's Succinctness is Key: The choice of PROB as the underlying knowledge compilation structure is a major factor in INC's performance. Its smaller size compared to d-DNNF directly translates to faster processing, especially in incremental settings where the compilation cost is amortized.
  • Log-Space for Speed and Stability: Performing probability calculations in log-space is not just about avoiding slow arbitrary-precision math; it's also crucial for numerical stability, preventing underflow issues that can arise from multiplying many small probabilities.
  • Incremental Design Pays Off: While INC might be slightly slower in the initial compilation and sampling round (due to the overhead of building the PROB), its efficiency in subsequent incremental rounds dramatically outperforms existing methods. This highlights the importance of designing samplers with incremental updates in mind from the start.
  • Unified Pass Efficiency: Combining annotation and sampling into a single pass is a clever way to reduce overhead and improve overall speed.

Key Results

  • Median Runtime Improvement: INC achieved a median speedup of 1.69× over the state-of-the-art weighted sampler WAPS across multiple incremental sampling rounds.
  • PROB Size Advantage: PROB diagrams were, on median, 4.64× smaller than the d-DNNF diagrams used by competing approaches.
  • Log-Space Speedup: Using log-space computations provided a median speedup of 1.12× compared to an arbitrary-precision math implementation (INCAP).
  • Incremental Round Efficiency: Incremental sampling rounds for INC took only 5.9% of the time of the initial round, compared to 67.6% for WAPS.
  • Scalability with Rounds: In a 20-round setting, INC's advantage grew, with WAPS taking 2.17× longer than INC.

Limitations and Future Work

  • Initial Compilation Overhead: INC can be slower than WAPS in the initial sampling round due to the time taken to compile the formula into a PROB.
  • Future Work:
    • Investigate further improvements for PROB compilation to reduce initial round overhead.
  • Develop a partial annotation algorithm to efficiently handle scenarios where only a small subset of weights are updated.
  • Explore storing partial sampled assignments as succinct sketches to reduce memory footprint.

Summary updated

BibTeX
@misc{yang2022inc,
  author = {Suwei Yang and Victor Liang and Kuldeep S. Meel},
  title = {{INC: A Scalable Incremental Weighted Sampler}},
  year = {2022},
  eprint = {2306.10824},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2306.10824},
}
Figure