Perfect Sampling for (Atomic) Lovász Local Lemma

Kun He, Xiaoming Sun, Kewen WuarXiv 2021

Abstract

Sampling solutions to Constraint Satisfaction Problems (CSPs) within the Lovász Local Lemma (LLL) regime is a fundamental challenge in theoretical computer science. While approximate sampling has seen significant progress, perfect sampling—guaranteeing an exact uniform distribution—has remained elusive for general cases. This paper presents a novel Markov chain-based algorithm that achieves perfect sampling for atomic CSPs in expected quasilinear time. By combining "state tensorization" with bounding chains and systematic scans, the proposed method not only provides exact samples but also operates under milder conditions than previous state-of-the-art approximate samplers.

What Problem Does This Paper Address?

Constraint Satisfaction Problems (CSPs)—like Boolean satisfiability ($k$-CNF) or hypergraph coloring—are foundational to computer science. The famous Lovász Local Lemma (LLL) provides a mathematical guarantee that if the dependencies between constraints are sparse enough, a solution exists.

While we have efficient algorithms to find a solution in this regime (the Moser-Tardos algorithm), sampling a solution uniformly at random is much harder. Most recent breakthroughs have focused on approximate sampling, where the output distribution is statistically close to uniform. However, approximate samplers can completely ignore certain valid solutions, which is problematic if you need strict fairness or exact probabilistic inference.

Perfect sampling guarantees the output is drawn from the exact target distribution. Prior to this paper, perfect samplers for CSPs in the LLL regime only existed for highly restrictive, "extremal" cases. This paper tackles the challenge of building a fast, perfect sampler for general atomic CSPs under mild LLL conditions.

Methods

The authors build a Markov chain-based algorithm utilizing three core techniques:

  1. Bounding Chains & Coupling from the Past: Instead of running a standard Glauber dynamics Markov chain and guessing when it has "mixed" (which only yields approximate samples), the authors use a bounding chain. The algorithm tracks uncertainty using a wildcard symbol ($\star$). It updates variables backward in time until all $\star$ symbols collapse into concrete values, guaranteeing the final state is a perfect sample from the stationary distribution.
  2. State Tensorization: Bounding chains are notoriously inefficient when variables can take on many possible values (large domains). To fix this, the authors introduce "state tensorization." They mathematically transform variables with large domains into a hierarchical tree (similar to a Huffman tree) of binary variables. This brilliantly reduces the problem to binary domains without altering the violation probabilities or dependency structures of the original CSP.
  3. Systematic Scan: Instead of updating variables at random, the algorithm updates them in a deterministic, round-robin order. This makes the history of updates highly structured, drastically simplifying the mathematical proof of how fast the algorithm finishes.

Key Insights and Ideas

  • Perfect is possible (and fast): You don't have to settle for approximate sampling. The authors prove that perfect sampling can be done in expected $\tilde{O}(n \log n)$ time (where $n$ is the number of variables).
  • Beating approximate bounds: Surprisingly, the mathematical conditions required for this perfect sampler to work are actually milder than the conditions required by the previous state-of-the-art approximate samplers.
  • State Tensorization is a powerful reduction: By breaking large domains into a hierarchy of binary choices, you can bypass the algorithmic inefficiencies of large domains. Because this transformation preserves the LLL conditions, it acts as a clean, black-box bridge between simple binary algorithms and complex, large-domain problems.
  • Deterministic ordering simplifies "time travel" proofs: To prove the bounding chain finishes quickly, researchers use "information percolation" to track how constraints interact backward in time. By using a systematic scan instead of random updates, the authors made these temporal dependency graphs much easier to bound.

Key Results

The algorithm achieves significant improvements over previous approximate samplers across various problem types. For general atomic CSPs, it achieves perfect sampling in expected $\tilde{O}(n \log n)$ time if $p^{0.175} \Delta \lesssim 1$ (where $p$ is the maximum violation probability of a constraint and $\Delta$ is the constraint degree). This breaks the previous best approximate sampling record of $p^{0.142} \Delta \lesssim 1/N$.

Comparison of sampling methods for various CSPs under LLL conditions.

As shown in the table above, the proposed method (JPV21) matches or exceeds the performance of prior approximate samplers while providing the added guarantee of perfect sampling. For $k$-uniform hypergraphs with $Q$ colors, the algorithm perfectly samples a proper coloring if the edge degree $\Delta \lesssim Q^{k/3}$, matching the current best-known bounds for approximate samplers.

Limitations and Future Work

  • Atomic Restriction: The algorithm natively handles "atomic" CSPs—meaning each constraint has exactly one forbidden configuration (like in $k$-CNF). To handle non-atomic CSPs, the constraints must be decomposed into atomic ones. This increases the constraint degree $\Delta$ by a factor of $N$ (the number of forbidden configurations), making the algorithm less efficient if $N$ is large.
  • Constant Factors in Running Time: The expected running time is quasilinear with respect to the number of variables $n$. However, the polynomial dependencies on $k, \Delta,$ and $Q$ are treated as constants. The authors note that these dependencies could likely be tightened by analyzing higher moments of the running time, but they leave this optimization for future work.

Summary updated

BibTeX
@misc{he2021perfect,
  author = {Kun He and Xiaoming Sun and Kewen Wu},
  title = {{Perfect Sampling for (Atomic) Lovász Local Lemma}},
  year = {2021},
  eprint = {2107.03932},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2107.03932},
}
Figure