Subquadratic Counting via Perfect Marginal Sampling

Xiaoyu Chen, Zongchen Chen, Kuikui Liu, Xinyuan ZhangarXiv 2026

Here is a concise and engaging blog-style summary of the paper.

Subquadratic Counting via Perfect Marginal Sampling

TL;DR

This paper breaks the long-standing quadratic-time barrier ($\tilde{O}(n^2)$) for approximately computing the partition function of spin systems (such as the hardcore and Ising models). By cleverly leveraging perfect marginal samplers (Las Vegas algorithms that sample exactly from a distribution), the authors introduce two novel techniques that achieve subquadratic running times ($\tilde{O}(n^{2-\delta})$) across a wide range of settings.

What Problem Does This Paper Address?

In statistical physics and computer science, counting problems—like calculating the total number of proper graph colorings or independent sets—are notoriously difficult. Instead of exact counting (which is usually #P-hard), researchers focus on approximate counting by computing the "partition function" ($Z$) within a small error margin ($1 \pm \epsilon$).

For decades, the standard approach has been a "counting-to-sampling" reduction. To estimate the total weight of a system, algorithms sequentially estimate $n$ conditional marginal probabilities (where $n$ is the number of vertices). Because each estimate requires drawing $\tilde{O}(n)$ samples to ensure accuracy, the total time complexity naturally hits a quadratic bottleneck: $\tilde{O}(n^2)$. This paper tackles a fundamental question: Can we bypass this quadratic-time barrier for approximate counting?

Methods

The authors bridge the gap between subquadratic counting and perfect marginal sampling using two distinct methodologies:

  1. Faster Variance Decay via "SAW Trees with Flowers": For two-spin systems (like the hardcore model), the authors build on Weitz’s self-avoiding walk (SAW) tree approach. Instead of truncating the tree deterministically, they use a perfect marginal sampler to generate a random boundary condition. They prove a much sharper variance decay bound in the uniqueness regime, allowing them to truncate the tree much earlier (sublinearly). To make this work as a purely black-box reduction, they introduce a novel data structure called a "SAW tree with flower" to handle topological queries efficiently.
  2. Aggregate Perfect Marginal Samplers: For general spin systems, the authors realize that running $N$ independent samplers one-by-one is redundant. Instead of flipping $N$ individual coins to see how many land on heads, you can sample directly from a Binomial distribution $\text{Bin}(N, p)$ in $\tilde{O}(1)$ time. They generalize this "batching" concept using a probabilistic automaton framework, showing that any perfect sampler with a geometric tail can be aggregated to run in sublinear time $\tilde{O}(N^{1-\delta})$.

Datasets

None used. This is a purely theoretical paper focused on algorithmic complexity and mathematical proofs.

Key Insights and Ideas

  • The Las Vegas Advantage: It is highly surprising that switching the sampling guarantee from Monte Carlo (approximate) to Las Vegas (perfect/exact) yields a massive computational speedup for approximate counting.
  • Batching the Indecision: In many perfect samplers (like Anand and Jerrum’s), the algorithm splits the problem into a "zone of obliviousness" and a "zone of indecision." By tracking the total number of samples entering these zones collectively rather than tracking individual paths, the authors achieve sublinear execution per batch.
  • Sharper Variance Bounds: The authors proved that variance decays at a rate of $\lesssim \left(\frac{1-\delta}{\Delta-1}\right)^\ell$ rather than the standard spatial mixing rate of $(1-\delta)^{2\ell}$. This tighter bound is what mathematically permits sublinear tree truncation.

Key Results

The paper successfully delivers subquadratic approximate counting algorithms ($\tilde{O}(n^{2-\delta})$ time for a constant $\delta > 0$) for several classic models on graphs with maximum degree $\Delta$:

  • Hardcore Model: Achieves subquadratic time when the fugacity $\lambda < \frac{1}{\Delta-1}$, significantly expanding upon the prior state-of-the-art regime of $\lambda = o(\Delta^{-3/2})$.
  • Ising Model: Breaks the quadratic barrier when the interaction parameter satisfies $|\beta - 1| \le \frac{1}{2\Delta}$.
  • Proper $q$-Colorings: Provides subquadratic counting when the number of colors $q > 65\Delta$.
  • Hypergraph Independent Sets: Works on $k$-uniform hypergraphs when $2^{k/2} \ge \sqrt{8ek^2\Delta}$.

Limitations and Future Work

  • Reaching Criticality: For the hardcore model, a gap still remains between the threshold achieved in this paper ($\lambda < \frac{1}{\Delta-1}$) and the true algorithmic criticality threshold ($\lambda_c(\Delta) \approx \frac{e}{\Delta-1}$). Whether subquadratic algorithms can operate all the way up to criticality remains an open question.
  • Exploiting Instance Reduction: In their black-box reduction, the sub-instances passed to the perfect marginal sampler are small ($m = o(n)$). The authors note that if a perfect marginal sampler could explicitly exploit these smaller instance sizes to run faster, it could unlock even better subquadratic runtimes.

Summary updated

BibTeX
@misc{chen2026subquadratic,
  author = {Xiaoyu Chen and Zongchen Chen and Kuikui Liu and Xinyuan Zhang},
  title = {{Subquadratic Counting via Perfect Marginal Sampling}},
  year = {2026},
  eprint = {2604.02235},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2604.02235},
}
Figure