[Paper Review] Sparse Hashing for Scalable Approximate Model Counting: Theory and Practice
This paper introduces sparse hashing via a novel class of concentrated hash functions to accelerate approximate model counting in SAT-based algorithms. By reducing XOR constraint size through low-probability variable selection ($p = \mathcal{O}(\log_2 m / m)$), the method achieves significant speedups—up to 10x—while maintaining strong theoretical guarantees comparable to 2-universal hashing, as validated on 1893 benchmarks with $\varepsilon_{\text{obs}}$ mean of 0.05.
Given a CNF formula F on n variables, the problem of model counting or #SAT is to compute the number of satisfying assignments of F . Model counting is a fundamental but hard problem in computer science with varied applications. Recent years have witnessed a surge of effort towards developing efficient algorithmic techniques that combine the classical 2-universal hashing with the remarkable progress in SAT solving over the past decade. These techniques augment the CNF formula F with random XOR constraints and invoke an NP oracle repeatedly on the resultant CNF-XOR formulas. In practice, calls to the NP oracle calls are replaced a SAT solver whose runtime performance is adversely affected by size of XOR constraints. The standard construction of 2-universal hash functions chooses every variable with probability p = 1/2 leading to XOR constraints of size n/2 in expectation. Consequently, the challenge is to design sparse hash functions where variables can be chosen with smaller probability and lead to smaller sized XOR constraints. In this paper, we address this challenge from theoretical and practical perspectives. First, we formalize a relaxation of universal hashing, called concentrated hashing and establish a novel and beautiful connection between concentration measures of these hash functions and isoperimetric inequalities on boolean hypercubes. This allows us to obtain (log m) tight bounds on variance and dispersion index and show that p = O( log(m)/m ) suffices for design of sparse hash functions from {0, 1}^n to {0, 1}^m. We then use sparse hash functions belonging to this concentrated hash family to develop new approximate counting algorithms. A comprehensive experimental evaluation of our algorithm on 1893 benchmarks demonstrates that usage of sparse hash functions can lead to significant speedups.
Motivation & Objective
- To address the performance bottleneck in approximate model counting caused by large XOR constraints in CNF-XOR formulas.
- To design sparse hash functions that maintain strong concentration properties, enabling efficient SAT solving on CNF-XOR formulas.
- To establish a theoretical foundation linking hash function concentration to isoperimetric inequalities on the Boolean hypercube.
- To implement and empirically evaluate a new approximate model counter, ApproxMC5, using sparse hash functions.
- To demonstrate that sparse hashing can yield significant practical speedups without sacrificing approximation quality.
Proposed method
- Introduce $(\rho, \mathsf{qs}, k)$-concentrated hash functions as a relaxation of 2-universal hashing, ensuring bounded dispersion index $\rho$.
- Formalize a connection between concentration measures of hash functions and isoperimetric inequalities on the Boolean hypercube to derive tight variance bounds.
- Construct sparse hash functions $\mathcal{H}^k_{\text{Rennes}}$ where each variable is selected with probability $p_i = \mathcal{O}(\log_2 i / i)$.
- Implement a variant $\mathcal{H}^{\text{lsa}}_{\text{Rennes}}$ with analytically optimized parameters for practical use in ApproxMC5.
- Replace dense 2-universal hashing in ApproxMC4 with sparse concentrated hashing in ApproxMC5 to reduce XOR constraint size and improve SAT solver performance.
- Use a threshold-based sampling strategy where the number of XORs scales with $\log_2 |\text{sol}(F)|$, balancing sparsity and accuracy.
Experimental results
Research questions
- RQ1Can sparse hash functions with low variable selection probability maintain sufficient concentration for accurate approximate model counting?
- RQ2What is the theoretical relationship between hash function concentration and isoperimetric properties of the Boolean hypercube?
- RQ3How does the use of sparse XOR constraints affect the runtime of SAT solvers in approximate model counting pipelines?
- RQ4Can sparse hashing achieve both theoretical guarantees and practical speedups compared to dense 2-universal hashing?
- RQ5What is the trade-off between sparsity of XORs and the number of required SAT queries in the approximation process?
Key findings
- ApproxMC5, using sparse concentrated hashing, achieves a median speedup of 3.2x and up to 10x over ApproxMC4 on 1893 benchmarks.
- ApproxMC5 successfully computes estimates for 23% of benchmarks where ApproxMC4 timed out, demonstrating improved scalability.
- The observed error tolerance $\varepsilon_{\text{obs}}$ averaged 0.05 across all benchmarks, far below the theoretical guarantee of 0.8.
- Performance improvement correlates strongly with the logarithm of the number of solutions: higher solution counts lead to greater speedups due to increased sparsity.
- The method maintains strong theoretical guarantees, with the dispersion index of the counting variable bounded by a constant $\rho$, ensuring variance control.
- Theoretical analysis confirms that $p = \mathcal{O}(\log_2 m / m)$ suffices for constructing valid concentrated hash functions from $\{0,1\}^n$ to $\{0,1\}^m$.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.