Papers
Topics
Authors
Recent
Search
2000 character limit reached

Subquadratic Counting via Perfect Marginal Sampling

Published 2 Apr 2026 in cs.DS and math.PR | (2604.02235v1)

Abstract: We study the computational complexity of approximately computing the partition function of a spin system. Techniques based on standard counting-to-sampling reductions yield $\tilde{O}(n2)$-time algorithms, where $n$ is the size of the input graph. We present new counting algorithms that break the quadratic-time barrier in a wide range of settings. For example, for the hardcore model of $λ$-weighted independent sets in graphs of maximum degree $Δ$, we obtain a $\tilde{O}(n{2-δ})$-time approximate counting algorithm, for some constant $δ> 0$, when the fugacity $λ< \frac{1}{Δ-1}$, improving over the previous regime of $λ= o(Δ{-3/2})$ by Anand, Feng, Freifeld, Guo, and Wang (2025). Our results apply broadly to many other spin systems, such as the Ising model, hypergraph independent sets, and vertex colorings. Interestingly, our work reveals a deep connection between $\textit{subquadratic}$ counting and $\textit{perfect}$ marginal sampling. For two-spin systems such as the hardcore and Ising models, we show that the existence of perfect marginal samplers directly yields subquadratic counting algorithms in a $\textit{black-box}$ fashion. For general spin systems, we show that almost all existing perfect marginal samplers can be adapted to produce a sufficiently low-variance marginal estimator in sublinear time, leading to subquadratic counting algorithms.

Summary

  • The paper demonstrates that constant-time perfect marginal samplers enable subquadratic approximate counting for various spin systems.
  • It details the use of the self-avoiding walk tree framework and aggregate samplers to reduce variance and circumvent the traditional quadratic time barrier.
  • The innovative methodology applies to models like the hardcore, proper colorings, and polymer models, promising more efficient partition function estimation.

Subquadratic Counting via Perfect Marginal Sampling (2604.02235)

Overview

The paper investigates the fine-grained computational complexity of approximately counting the partition function in discrete spin systems, focusing on settings where standard counting-to-sampling reductions induce a quadratic time barrier. It introduces innovative algorithmic techniques that leverage perfect marginal samplers to achieve subquadratic approximate counting in a wide class of models, notably including the hardcore model, Ising model, proper colorings, hypergraph independent sets, and polymer models. The theoretical contribution is a rigorous equivalence: efficient perfect marginal sampling directly enables subquadratic counting.

Model Classes and Problem Formulation

The central objects of study are spin systems, parameterized by interaction matrices on graphs/hypergraphs. The counting problem entails computing partition functions Z=∑σ∈Ωw(σ)Z = \sum_{\sigma \in \Omega} w(\sigma), while the sampling problem is to generate samples from the associated Gibbs distribution μ(σ)=w(σ)/Z\mu(\sigma) = w(\sigma)/Z. These primitives are fundamental in combinatorics, statistical physics, and machine learning.

Standard reductions from counting to sampling, leveraging marginal samplers, yield—at best—O~(n2)\tilde{O}(n^2) time complexity, where nn is the number of vertices, due to a chain rule decomposition requiring nn marginal queries each estimated via O(n)O(n) samples.

Main Algorithmic Results

Hardcore Model

For the hardcore model with fugacity parameter λ\lambda on graphs of degree Δ\Delta, the authors provide an approximate counting algorithm running in O~(n2−δ)\tilde{O}(n^{2-\delta}) time for λ<1Δ−1\lambda < \frac{1}{\Delta-1}, which is within a constant factor of the uniqueness threshold μ(σ)=w(σ)/Z\mu(\sigma) = w(\sigma)/Z0. This regime strictly improves upon previous results that required μ(σ)=w(σ)/Z\mu(\sigma) = w(\sigma)/Z1 [AFFGW25].

General Spin Systems

The techniques generalize to:

  • Proper μ(σ)=w(σ)/Z\mu(\sigma) = w(\sigma)/Z2-colorings with μ(σ)=w(σ)/Z\mu(\sigma) = w(\sigma)/Z3
  • Ising model with μ(σ)=w(σ)/Z\mu(\sigma) = w(\sigma)/Z4 satisfying μ(σ)=w(σ)/Z\mu(\sigma) = w(\sigma)/Z5
  • Hypergraph independent sets for μ(σ)=w(σ)/Z\mu(\sigma) = w(\sigma)/Z6 (μ(σ)=w(σ)/Z\mu(\sigma) = w(\sigma)/Z7-uniform, degree μ(σ)=w(σ)/Z\mu(\sigma) = w(\sigma)/Z8)
  • Polymer models satisfying strong sampling decay

In all cases, the runtime is μ(σ)=w(σ)/Z\mu(\sigma) = w(\sigma)/Z9 for some constant O~(n2)\tilde{O}(n^2)0, dependent on model parameters but independent of O~(n2)\tilde{O}(n^2)1.

Perfect Marginal Sampling and Black-Box Reductions

A central innovation is the black-box reduction: given a constant-time expected perfect marginal sampler (Las Vegas-style, outputting samples with no variation error), one may construct a subquadratic counting algorithm. The reduction is generic within the uniqueness regime of anti-ferromagnetic two-spin systems.

The reduction relies on the interplay between correlation decay and variance reduction in marginal estimation. Instead of naive repeated sampling, the algorithm leverages spatial mixing properties to propagate uncertainty through tree-like structures (e.g., self-avoiding walk trees) and achieves fast variance decay, enabling accurate estimates with O~(n2)\tilde{O}(n^2)2 samples per marginal.

The theoretical machinery is based on the self-avoiding walk (SAW) tree framework, and variance bounds are established via total-squared-influence measures and potential function analyses. Crucially, these bounds scale favorably across levels of the SAW tree, allowing truncations at sublinear depth while preserving estimator concentration.

Aggregate Perfect Marginal Samplers

The paper further develops an aggregate (batch) version of perfect marginal samplers: instead of independently simulating O~(n2)\tilde{O}(n^2)3 marginal samples, the algorithm tracks aggregate statistics and directly samples from corresponding multinomial distributions, dramatically reducing computational overhead.

This framework is formalized via probabilistic automata with bounded width and geometric decay in stopping time, enabling joint simulation of O~(n2)\tilde{O}(n^2)4 runs in O~(n2)\tilde{O}(n^2)5 time. This is applied to models outside the branching process paradigm, such as colorings and hypergraph independent sets.

For explicit models (e.g., the hardcore model), the underlying sampler's subcritical branching process is exploited to achieve optimal exponents in the aggregate setting. Extensions to polymer models and spin systems with weak interactions are provided, with detailed runtime exponents dependent on model parameters.

Implications and Theoretical Perspective

The strong numerical claim is that for substantial swaths of parameter space previously constrained by quadratic-time algorithms, subquadratic approximate counting is attainable. The reduction is so robust that for any setting admitting constant-time perfect marginal sampling (typically, those with strong spatial mixing), subquadratic counting follows.

This fundamentally shifts the fine-grained complexity landscape for approximate counting in spin systems, establishing a new frontier where sampling and counting regimes can be sharply separated by their dependency on marginal sampling guarantees. It circumvents the limitations of standard reductions and demonstrates that Las Vegas-style sampling can generically accelerate classical inference tasks.

On the practical side, these techniques promise faster algorithms for combinatorial enumeration in statistical mechanics, graphical models in machine learning, and algorithmic combinatorics. They may be directly applicable to high-dimensional parameter estimation and inference where partition function estimation is the bottleneck.

Technical Contributions

  • Tight variance analysis for marginal estimators leveraged from correlation decay
  • Design and analysis of aggregate perfect marginal samplers for arbitrary automata with geometric tail
  • Generic implementation of self-avoiding walk tree recursion with "flower" structures to simulate marginal queries
  • Quantitative runtime exponents for various models (hardcore, coloring, Ising, hypergraph independent sets, polymer)
  • Black-box reduction from perfect marginal sampling to subquadratic counting across uniqueness regimes

Open Questions and Future Directions

The paper leaves open whether subquadratic-time counting extends to the critical point (uniqueness threshold) in the hardcore model and other systems. Establishing perfect marginal samplers throughout the entire uniqueness regime remains a tantalizing challenge. Another direction is further tightening runtime exponents and extending the framework to broader classes of graphical models, including those with constraints on global structure.

Future developments in AI might harness these results to scale inference primitives in large probabilistic models and combinatorial enumeration tasks, especially as such models become ubiquitous in both theoretical and applied contexts.

Conclusion

This research establishes a new methodology for subquadratic approximate counting in spin systems and related probabilistic models, grounded in perfect marginal sampling and robust variance reduction strategies. The implications are significant both in fine-grained complexity theory and practical algorithm design, and the techniques are widely extensible within graphical model inference and combinatorial optimization.

Paper to Video (Beta)

No one has generated a video about this paper yet.

Whiteboard

No one has generated a whiteboard explanation for this paper yet.

Collections

Sign up for free to add this paper to one or more collections.