Manuscript Offprint
arXiv:2611.06657Approximating #BIS in Time
Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.
Abstract
We give randomized algorithms for approximately counting and nearly uniformly sampling independent sets in arbitrary bipartite graphs (#BIS). At fixed accuracy, both algorithms run in time on -vertex graphs.
More generally, the same running-time dependence on the number of variables holds for approximate counting and sampling with efficiently evaluable positive log-supermodular weights on Boolean variables. A weighted Sinclair–Jerrum walk on the self-reduction tree reduces these tasks to coarse lower estimates of residual log-partition functions. We obtain these estimates by optimizing a concave relaxation of an exact variational principle on the tree; threshold smoothing certifies that the low-degree search suffices.
Contents
| 1 | Introduction | 1 |
|---|---|---|
| 2 | Counting and sampling from coarse estimates | 8 |
| 3 | A variational principle on the self-reduction tree | 12 |
| 4 | Constructing the coarse estimator | 19 |
| 5 | Low-degree approximation and threshold smoothing | 24 |
| 6 | Closing remarks | 30 |
| A | Algorithmic and bit implementation details | 38 |
*School of Computer Science, Nanjing University, Nanjing, China. Email: liu@nju.edu.cn.
†School of Computer Science, Nanjing University, Nanjing, China. Email: yinyt@nju.edu.cn.
By the trichotomy of Dyer, Goldberg, and Jerrum [DGJ10], every counting constraint satisfaction problem with a fixed finite set of Boolean relations is polynomial-time computable, #BIS-equivalent, or equivalent to counting satisfying assignments of Boolean formulas (#SAT). Yet the approximation complexity of the #BIS-equivalent case remains unresolved: algorithmic techniques have not yielded a fully polynomial randomized approximation scheme (FPRAS), and hardness reductions have not established NP-hardness of approximation [DGGJ04]. The problems in this equivalence class are conjectured to have intermediate approximation complexity: they have no FPRAS, yet they are strictly easier to approximate than #SAT [DGGJ04, GJ12a, CGG16]. Determining the approximation complexity of #BIS, and hence of this entire equivalence class, is a central open problem in the area of approximate counting.
#BIS also fits into the broader framework of log-supermodular weights on Boolean variables: positive weights whose logarithms are supermodular set functions. This is the FKG lattice condition [FKG71], also called multivariate total positivity of order two (MTP) [KR80]. The framework includes ferromagnetic Ising models with arbitrary local fields, whose partition functions are #BIS-equivalent [GJ07]; when all fields favor the same spin, they admit an FPRAS [JS93]. It also allows terms coupling more than two variables. For #BIS, summing out one side gives such a weight on the other, with no more variables than vertices. Log-supermodularity also marks a complexity boundary for Boolean weighted counting CSPs with nonnegative constraints and all unary weights available: apart from a tractable class generated by unary weights and disequality, a non-log-supermodular constraint gives #SAT-equivalence [BDG13, Theorem 10.2]. Whether general log-supermodular counting reduces to #BIS remains open [CDG15, Theorem 6].
Substantial algorithmic progress has been made on restricted graph classes and in favorable parameter regimes. High-temperature algorithms exploit weak long-range dependence through correlation decay or rapid mixing. The hard-core model weights an independent set by for a fugacity . On graphs of maximum degree at most a fixed , Weitz's correlation-decay algorithm [Wei06] gives a deterministic fully polynomial-time approximation scheme (FPTAS) whenever , the uniqueness threshold of the infinite -regular tree. At this means maximum degree at most five, and Liu and Lu [LL15] need this bound on one side only. With the same fugacity on both sides, Chen, Liu, and Yin [CLY23] show that remains the uniqueness threshold when the degree bound holds on one side only, and they sample rapidly below it. Low-temperature algorithms exploit concentration around structured phases. Algorithmic Pirogov–Sinai theory gives high-fugacity algorithms on lattice regions with suitable boundary conditions [HPR20] and beyond lattices [CHP26]. Polymer methods yield approximation algorithms on bounded-degree bipartite expanders [JKP20] and on bipartite graphs with sufficiently unbalanced degrees or fugacities [CP20], the latter including . On almost every random regular bipartite graph of sufficiently large fixed degree, recent work of Kocurek, Oveis Gharan, and Tjowasi [KOGT26], together with [JKP20], covers all fugacities. Graph containers give an FPTAS for #BIS on weakly expanding regular bipartite graphs of large fixed degree, and inverse-polynomial relative approximation in subexponential time on regular bipartite graphs of growing degree [JPP23]; spectral methods give an FPRAS in the dense regular case [CDKP24]. These guarantees rely on assumptions that need not hold on arbitrary bipartite graphs.
Recent announcements of subexponential-time algorithms for exactly counting satisfying assignments of fixed-width CNF formulas [Ope26, Cla26] would, if confirmed, yield -time exact counting algorithms for #BIS on arbitrary -vertex bipartite graphs. Before these announcements, the best known approximation algorithm for #BIS was the deterministic approximation algorithm of Goldberg, Lapinskas, and Richerby [GLR21], running in time poly() for relative error . The conjectured intermediate approximation complexity of the #BIS-equivalent class motivates the search for algorithms substantially faster than those available for SAT. Against the traditional exponential-time benchmark for SAT, obtaining a subexponential-time approximation algorithm for #BIS has been a prominent open direction in approximate counting (see, e.g., [Per20, Liu23]). The question was explicitly posed by Jenssen, Perkins, and Potukuchi [JPP23, Question 1] and reiterated by Carlson, Davies, Kolla, and Potukuchi [CDKP24]. If confirmed, the announced algorithms would answer the question as stated, while also changing the SAT benchmark. The underlying algorithmic goal remains to exploit the special structure of #BIS to obtain algorithms substantially faster than those available for SAT. Against the announced SAT bounds, a natural quantitative target is a fixed-power saving in the exponent: does #BIS admit a -time approximation algorithm at fixed accuracy for some fixed ?
1.1 Results
We resolve this question by giving randomized algorithms for approximately counting and nearly uniformly sampling independent sets in arbitrary bipartite graphs. At fixed accuracy, both algorithms run in time on -vertex graphs. We state the precise bounds in the exact real-arithmetic model of Section 2; implementations using bit operations and fair random bits have the same exponential factors (Theorem A.1).
Write for the independent sets of , , and for the uniform law on .
Theorem 1.1 (Bipartite independent sets). There are randomized algorithms with the following guarantees for every bipartite graph with vertices.
(i) For every real , the sampling algorithm returns an independent set of whose law is within total variation distance of . Its running time is at most
(ii) For all reals , the counting algorithm returns an estimate satisfying
Its running time is at most
Both bounds hold on every execution in the exact real-arithmetic model.
The constants are absolute. For rational accuracy and failure-probability parameters, Theorem A.1 gives a bit implementation with polynomial overhead in their encoding lengths.
Log-supermodular weights. The algorithms follow from a general result for log-supermodular weights on Boolean variables. A positive weight is log-supermodular if
where and are the coordinatewise minimum and maximum.
The algorithms receive the dimension and use the following representation of W.
-
(Exact evaluation) The weight is given by an exact evaluator using at most operations per value; in the bit implementation, denotes the bit cost of returning an exact rational value.
-
(Value length) The algorithms receive a bound on the bit length of every value of W, where the bit length of a rational is the larger of those of its numerator and denominator.
Write for the partition function and for the target law.
Theorem 1.2 (Log-supermodular weights). For every log-supermodular weight W given in this representation, there are randomized algorithms with the following guarantees.
(i) For every real , the sampling algorithm returns a configuration whose law is within total variation distance of . Its running time is at most
(ii) For all reals , the counting algorithm returns an estimate satisfying
Its running time is at most
Both bounds hold on every execution in the exact real-arithmetic model.
When and are polynomial in , both algorithms run in time at fixed accuracy. The algorithms access only through its evaluator; no factorization into local interactions or correlation-decay assumption is required.
To apply Theorem 1.2 to #BIS, let be a bipartite graph and write for the neighborhood of a vertex set and . Summing out gives the positive weight
since can be completed to an independent set by adjoining any subset of .
Proof of Theorem 1.1 from Theorem 1.2. If , the at most two choices of , together with (1.2), give exact counting and sampling algorithms in polynomial time. Otherwise set . For , we have and , so
Thus the coverage function is submodular, so is supermodular and satisfies (1.1). The values are integers at most , so we may take and . Since , the counter of Theorem 1.2 counts independent sets.
For sampling, complete the sampler's output by adjoining a uniform subset of , using at most additional uniform draws. This maps to without increasing total variation distance. The running-time bounds follow from Theorem 1.2 with and .
When , choosing the smaller side as gives the exponent
Both algorithms also apply under every feasible pinning, that is, one whose occupied vertices form an independent set. Deleting the occupied vertices, their neighbors, and the pinned vacant vertices leaves a bipartite induced subgraph. If this subgraph has fewer than two vertices, count and sample by exact enumeration. Restoring the occupied vertices gives a bijection between its independent sets and those consistent with the pinning.
The bipartite hard-core model. With positive rational vertex fugacities , the hard-core model assigns each independent set weight . Summing out gives
Its partition function is the hard-core partition function of . Up to an additive constant, is a modular function minus the weighted coverage function , so is log-supermodular. Complete the sampler's output by occupying each independently with probability . This completion does not increase total variation distance.
The weight is exactly evaluable in time polynomial in and the total bit length of the fugacities, with at most plus that length. Thus, with exact enumeration of when , Theorem 1.2 covers the hard-core model on arbitrary bipartite graphs with arbitrary positive rational vertex fugacities. When the fugacities' total bit length is polynomial in , the algorithms preserve time at fixed accuracy.
Bipartiteness makes this marginalization produce a positive log-supermodular weight, although the original hard-core edge constraint fails (1.1). For every fixed and fixed rational , approximating the partition function at uniform fugacity is on bipartite graphs of maximum degree [CGG 16, Corollary 3]. On general -regular graphs at the same fugacity, there is a constant such that approximation within a factor is NP-hard under randomized reductions [SS14, p. 2387].
The random-cluster and ferromagnetic Potts models. Let be a graph, not necessarily bipartite, with vertices and edges, and for let be the number of connected components of , isolated vertices included. With a rational and positive rational edge weights , the random-cluster model gives the weight
and its partition function is the multivariate Tutte polynomial [Sok05, (1.1)]. The rank of in the cycle matroid of is submodular, so is supermodular when ; this is the FKG lattice condition for the random-cluster measure [Gri06]. Computing by graph search evaluates the weight exactly in time polynomial in , and the bit lengths of and the . Since , we may take to be times the bit length of plus the total bit length of the . If , enumerating the at most two edge sets counts and samples exactly; otherwise Theorem 1.2 applies with . When the bit lengths are polynomial in , the algorithms run in time at fixed accuracy: on graphs of bounded degree, and on all graphs.
Multigraphs reduce to simple graphs: a loop contributes , while a parallel bundle becomes one edge of activity . Lift samples by including loops independently with probabilities and replacing each present bundle by a nonempty according to weights . The latter is the law of independent Bernoulli choices with probabilities conditioned on being nonempty. Sequential conditioning, using suffix products of the exclusion probabilities, samples this law in arithmetic operations and uniform draws. For a matroid on with a polynomial-time rank oracle, the weight is log-supermodular because is submodular, and sums to the multivariate Tutte polynomial [Sok05, (1.3)]. Use , replace by in the bound on , and enumerate directly when .
For an integer and rational , the ferromagnetic -state Potts model assigns a coloring the weight over the edges whose endpoints receive the same color. Writing each factor as and expanding gives the Fortuin–Kasteleyn representation: the Potts partition function equals with [Sok05, Theorem 2.3], so the counter estimates it. Coloring each component of the sampler's output independently and uniformly from maps the random-cluster law to the Potts law, by the Edwards–Sokal coupling [ES88], and does not increase total variation distance. For every integer , approximating the ferromagnetic Potts partition function is #BIS-hard [GJ12a], whereas the ferromagnetic Ising model, the case , has an FPRAS [JS93].
1.2 Overview of the proof
Self-reduction and coarse estimates (Section 2). Sampling and counting reduce to the conditional marginal probabilities along the self-reduction tree. Fix an order of the coordinates; the nodes are the prefixes , , with children and , and the mass of a node is the partition function of the residual weight left by pinning its prefix. The next coordinate is 1 with conditional marginal probability . The classical self-reduction as in [JVV86] multiplies estimated probabilities, so their errors accumulate along a path and it needs relative accuracy at every node. A different self-reduction by Sinclair and Jerrum [SJ89, Section 4] uses a reversible tree walk and needs much less. Because the leaves carry exact weights, its stationary law conditioned on the leaves is exactly the target law. Mass estimates with approximation ratio , which we call the distortion, cost only a factor in running time (Proposition 2.1). Our task is therefore to estimate the logarithm of every residual mass from below within an additive error as in equation (2.3); since pinning preserves log-supermodularity, the same estimator applies to every node along the self-reduction tree.
A variational principle on the self-reduction tree (Section 3.1). Lower estimates come from Gibbs' variational principle [WJ08], which we write on the tree. Express a strictly positive law as , with potential and . A branching rule assigns a probability to moving from each internal node to ; write for the probability of reaching , and for the law of the leaf reached, which can be any law. Write for the entropy of a finite law and for the binary entropy of , with . By the chain rule for entropy, , where the sum runs over internal nodes. Gibbs' principle therefore becomes
with the conditional marginal probabilities as its unique maximizer (Proposition 3.1). Every branching rule thus gives a lower bound, and the best one is exactly what self-reduction needs. The objective, however, is not concave in , even for log-supermodular laws. It is concave in the leaf probabilities, but evaluating its entropy requires those probabilities.
Relaxing to guides (Sections 3.2 and 3.3). The above variational formulation is not friendly to optimization algorithms. Both parts inside its objective stand in the way of concavity: the non-linear entropy terms, and the expected potential that depends on the branching probabilities through products along paths. There is a standard way to linearize an entropy (see equation (3.6) and Remark 3.7), and for the potential term we apply the Lovász extension in equation (3.12). The identity (3.6) linearizes a binary entropy as for uniform on and the logit . Driving the descent by independent uniform inputs , one per depth, with the binary decision rule at the node reached at depth , turns the entropy terms at depth into . The binary decision rules do not form a convex domain (for optimization), so we have to further relax to an appropriate set of real-valued decision functions of that we call guides (see Definition 3.5). This relaxation also means that the potential term needs to be evaluated at fractional decisions, which is provided by its Lovász extension [Lov83] after normalizing by . This gives the variational objective in equation (3.13)
a linear score term plus a potential term. Every guide satisfies , with equality only for the exact guide , the guide defined by the true conditional marginal probabilities. Furthermore, is concave exactly when is log-supermodular (Proposition 3.8). It is an expectation over independent inputs of quantities computed from the guide and from values of the potential, so it can be estimated and optimized without evaluating the probabilities of the law induced by the guide. What remains is the size of the search space: a guide is a -valued function of continuous inputs.
Low-degree approximation and coarse estimation (Section 4). Such a function can depend on exponentially many interactions among its inputs. We restrict the search to functions whose coordinates have interaction degree at most : every nonzero component of their Hoeffding decompositions [O'D14, §8.3] involves at most inputs (Section 4.1). Once each input is discretized to poly bins, such a function has coefficients. For related uses of low-degree approximation, see [LMN93, MY26]. To show that this restricted search contains a good candidate, the argument follows : Section 5 turns the exact guide into a witness , a guide with a small objective gap and small degree- tails (4.2), and Section 4 discretizes and truncates into a candidate that is nearly as good. Crucially, the algorithm never evaluates or explicitly; their existence merely certifies that the low-degree search space contains a near-optimal candidate . Instead, the algorithm optimizes the low-degree Walsh coefficients of directly via projected stochastic supergradient ascent [NJLS09]. A penalty for values outside keeps the objective at most for every candidate. We estimate this value on fresh samples and subtract an error margin, giving a lower estimate with high probability. The additive error is at cost up to polynomial factors (Theorem 4.1). It remains to construct witnesses.
Ordinary resampling and the square-root baseline (Section 5.1). The exact guide has objective gap zero, but its moving thresholds can create interactions of every order, so it need not be a witness. Ordinary resampling replaces each input independently with probability , which multiplies a component involving inputs by [O'D14, §8.3] and costs at most
of objective value (Lemma 5.1). Taking gives exponential cost , where , and balancing the terms gives the square-root baseline of Corollary 5.2: time for #BIS at fixed accuracy, which already answers the question of [JPP23]. The loss is linear in because a resampled input contributes nothing to the linear score.
Threshold smoothing and the cube-root bound (Section 5.2). Threshold smoothing keeps every input and shifts its threshold instead. For a smoothing parameter , each threshold encountered by the exact guide becomes with a fresh fair sign. The perturbed decisions determine the next threshold. Averaging the signs at fixed inputs, with one sign sequence shared by all output coordinates, gives the guide of (5.2). The two shifted thresholds have mean , which preserves each branching probability and hence the joint law . Concavity therefore protects the potential term. Symmetry cancels the first-order score change, while the factor compensates for the entropy curvature . The linear-score loss is at most per comparison and in total (Proposition 5.5). For a fixed threshold , the averaged indicator has variance (Lemma 5.7), a factor smaller than the original indicator's variance. An exact energy identity for threshold trees (5.5) turns this into geometric decay of the high-degree tails at a rate linear in . This is an aggregate statement rather than a componentwise contraction. Thus suffices, the distortion costs the walk , and each estimate costs . Choosing of order when this is at most , and using exact enumeration otherwise, gives the exponent of Theorem 1.2.
1.3 Related work
Algorithms for independent sets. Ge and Štefanković [GŠ12] proposed a Markov chain for #BIS on edge subsets, with weights determined by adjacency-matrix ranks over . Goldberg and Jerrum [GJ12b] later proved exponential mixing time on an infinite family of bipartite graphs.
For fixed and fixed , a degree bound on one side suffices for nearly linear field-dynamics sampling and nearly cubic Glauber mixing [CLY23]. Faster Glauber mixing from a fully occupied side is known with degree balance [CF25] or with no degree bound on the other side [FY26]. At criticality, results require a bound on the maximum degree of the whole graph [CCYZ25, CJ25] and draw on spectral independence and field dynamics [ALOG20, CFYZ21].
Low-temperature methods include polymer and clique dynamics [CGG21, FGKP23], perfect sampling in an unbalanced regime [BCP24], and improved fugacity bounds on regular bipartite expanders [JMP26]. For sufficiently large fixed , algorithms cover fugacities down to , including , on almost every -regular bipartite graph [JKP20, LLLM22, CGŠV22].
For every fixed , the randomized container algorithm of [JPP23, Theorem 3] achieves relative error with probability at least in time on -regular bipartite graphs. Its guarantee does not cover arbitrary accuracy [CDKP24]. Pinning can also destroy regularity, obstructing the usual sampling self-reduction [JPP23]. Our estimator handles every pinned residual, yielding counting and sampling at arbitrary accuracy (Proposition 2.1).
Cardinality-constrained independent sets. Counting bipartite independent sets of a given total size or occupation of one side is NP-hard to approximate within any polynomial factor when the prescription is part of the input [CDF19]. Further hardness results hold at certain fixed occupation densities on bounded-degree bipartite graphs [NPWW26]. Such constraints generally destroy log-supermodularity, even after complementing one side.
Self-reduction and marginal estimation. Bounded self-reductions [CGMW26] and rejection sampling on self-reduction trees [HL08, HMJ13] require upper bounds on residual masses that remain consistent under recursion. Moitra [Moi19] estimates conditional marginals by a coupling-based linear program for bounded-degree CNFs in the local-lemma regime. We use the Sinclair–Jerrum tree walk [SJ89, Section 4] with coarse variational lower estimates of log-partition functions, without requiring consistency between parent and child estimates. Samples yield relative counts by self-reduction [JVV86]. Our estimates apply even when bipartite hard-core models have coexisting phases and exponentially slow local dynamics [DFJ02, MWW09].
Variational bounds on partition functions. Bethe bounds are lower bounds for Boolean models with log-supermodular factors [Ruo12]; other approaches use convex hierarchies, mean-field approximation, and correlation rounding [Ris16, JKM18, JKR19]. For an Ising interaction matrix , with Frobenius norm , the additive guarantees of [JKM18, Theorem 12 and Remark 13] have leading scale . Jain, Koehler, and Risteski [JKR19] bound the mean-field error by and give subexponential algorithms with additive error when . Our estimator gives error for arbitrary positive log-supermodular weights, with weight sizes entering its running time through (Corollary 2.3).
L-FIELD [DK14, DK15] produces factorized laws from sub- and supergradient bounds; its log-supermodular upper bound has a concave Lovász-extension formulation [DK14, Lemma 3 and Section 4.1]. The logistic perturb-and-MAP upper bound is at least as tight as the L-FIELD upper bound [SB16, Proposition 1].
Sequential variational representations. For binary variables, Lemma 3.6 is equivalent to Hazan and Jaakkola's random-perturbation identity [HJ12, Theorem 1] (Remark 3.7). Sequential perturbation samplers use upper bounds [HMJ13]; lower bounds from perturbing a fixed variable subset generally fall below [HMJ13, Corollary 1], while using all variables gives equality but requires one Gumbel perturbation per configuration. Variational autoregressive networks [WWZ19] optimize the objective of Proposition 3.1 using network branching rules. It need not be concave even for log-supermodular laws, and its evaluation uses the candidate law's conditional probabilities. Our fractional relaxation is concave for log-supermodular laws and evaluable under a fixed product law using only guide and weight evaluations, without evaluating the induced law's probabilities.
Organization. Section 2 reduces sampling and counting to coarse mass estimation; Section 3 develops the variational principle and concave relaxation. Section 4 builds the estimator from guides constructed in Section 5 using resampling and threshold smoothing. Section 6 discusses scope and open questions; Appendix A gives quantitative conversion and bit implementation details.
2 Counting and sampling from coarse estimates
We first explain how coarse lower estimates of residual log-partition functions suffice for sampling and counting. We then derive Theorem 1.2 assuming an estimator with the accuracy and running-time guarantees stated below. To construct such an estimator, Section 3 develops a concave variational formulation, which Section 4 turns into a finite-dimensional optimization problem. Section 5 uses threshold smoothing to establish the approximation bounds needed for the stated guarantees.
Notation and computational model. All logarithms are natural unless a base is specified. Write , let be the th unit vector, and identify subsets with their indicator vectors.
We use and for prefixes, and and for indicators. For finite laws, . Graphs are finite, simple, and labeled.
We work in an exact real-arithmetic model. Arithmetic operations, comparisons, and evaluations of log and exp on real numbers have unit cost, as does an independent uniform draw from (0,1). We also charge one operation for each accessed coefficient or graph entry, and operations for each evaluation of a weight . The model has no oracle for partition functions, conditional probabilities or expectations: the algorithm estimates expectations from independent samples and computes every function it queries. Running-time bounds count operations and random draws on every execution. Appendix A implements the algorithm with bit operations and fair random bits at the claimed cost.
2.1 The self-reduction tree
Let satisfy the evaluator and value-length assumptions of Theorem 1.2, and fix an order of its coordinates. The estimator bounds use this original dimension , including for residuals with fewer than two free coordinates.
The self-reduction tree is the complete binary tree of depth whose nodes at depth are the prefixes ; it is a special case of the self-reducibility tree of Sinclair and Jerrum [SJ89, p. 100]. We write depth. The root is the empty prefix, the leaves are the configurations denotes the parent of a node , and and denote the children of a node with depth.
Pinning the prefix at a node of depth leaves the residual weight on the free coordinates . Its partition function is the mass of , and its residual law is the conditional law of the free coordinates given the prefix . Thus , the residual law of the root is , and at a leaf . Pinning the next coordinate to 0 or 1 gives the two child residuals, so at every internal node. If is log-supermodular, so is every residual, since (1.1) remains valid when the prefix coordinates are fixed. Let have law . The conditional marginal probability at a node with depth is
and we write when . Every prefix has positive probability, so these probabilities are defined at every internal node. If they were available, we could sample by descending the tree, choosing child with probability . They also determine the partition function: telescoping the masses along any root-to-leaf path gives the chain rule
For the coarse estimates in the next subsection, we normalize each residual by its value at 0. The resulting normalized potential is , with partition function . This rescaling leaves the residual law unchanged. We have , the normalization used for the Lovász extension in Section 3.3, and , because the configuration contributes 1 to . At a leaf, and hence .
2.2 From coarse estimates to counting and sampling
We first specify the estimates needed for the counting and sampling conversion. At a node , the estimator approximates the normalized residual log-partition function .
Since can be evaluated exactly, adding to such an estimate gives an estimate of with the same additive error.
Suppose that, given any node and any failure parameter , a randomized estimator returns a real with
where is a known one-sided additive error bound common to all nodes. Thus, with the stated probability, is a lower bound on and underestimates it by at most . The bound may depend on the original input parameters and the chosen estimator construction; in particular, it may grow with . At a leaf, , so we require the estimator to return exactly.
We also assume a cost bound that is uniform over the nodes. Every execution, including one on which the accuracy guarantee fails, uses at most operations and uniform draws, including evaluations of . The factor absorbs the dependence on the estimator's other construction parameters, which are fixed in advance. It may depend on the original input parameters and need not be polynomial in , but it is independent of the node and the requested failure probability. The condition also pays for evaluating the exact leaf weights and the normalizing value , as needed by the conversion.
Proposition 2.1 (Counting and sampling from coarse estimates). Suppose every residual admits the estimator in (2.3), with additive error bound and cost . For , every residual law can be sampled within total variation distance at cost
and can be estimated within relative error , with failure probability at most , at cost
These bounds hold on every execution. No log-supermodularity is needed for this conversion.
Why coarse estimates suffice. Direct self-reduction by descent [JVV86] would use ratios of mass estimates in place of the conditional probabilities in (2.1). If for both children of , then . These errors multiply along the path, up to a factor , so obtaining relative error from this product bound calls for . The walk of Sinclair and Jerrum [SJ89, Section 4] pays for the error once, in its running time. The sampling half of Proposition 2.1 is a quantitative form of their theorem [SJ89, Theorems 4.4 and 4.5]: for self-reducible relations, counts within a polynomial ratio suffice for almost uniform generation. They weight each edge of the tree by the estimated number of solutions below it, and run the lazy walk that, when it moves, chooses an incident edge in proportion to its weight. Its stationary probabilities are proportional to the sums of incident edge weights. Single solutions are counted exactly, so the stationary law conditioned on the leaves is uniform. To obtain samples efficiently, it remains to control both the time to approach stationarity and the probability that the endpoint is a leaf. On a tree of depth , the leaves carry stationary probability at least [SJ89, Lemma 4.1], which controls the number of runs needed to obtain a leaf endpoint. Each subtree hangs from a single edge whose weight is within the ratio of the number of leaves below it, so the conductance is at least [SJ89, Lemma 4.2]. Their bound on mixing in terms of conductance then controls the length of each run [SJ89, Theorem 3.4 and Lemma 4.3].
What changes here. We need this conversion for weighted leaves and for approximation ratios that may be superpolynomial in . To turn our logarithmic estimates into edge weights, we use the mass estimates , which satisfy at leaves and when all estimates are good. The arguments for the stationary law, leaf mass and conductance bound above use only these two properties, so they carry over with leaf weights and . In particular, the stationary law conditioned on the leaves is . For the running time, however, their bound through the minimum stationary probability could depend on very small leaf weights. We avoid this dependence by bounding convergence from the root using its stationary probability, which is at least . This gives mixing time polynomial in , , and . Together with the leaf-mass bound, it gives an sampling overhead up to polynomial factors in and , even when grows with . Randomized estimates are computed once and cached, as in [SJ89, Remark after Theorem 4.5], so that the analysis can condition on fixed edge weights. Since the same construction applies to every residual, the resulting samples give a relative counter by self-reduction [JVV86]. Appendix A.1 gives the full construction and failure-probability analysis.
The log-supermodular estimator. The following estimator supplies the estimates required by Proposition 2.1; its proof is completed in Section 5.2.
Theorem 2.2 (Estimator from threshold smoothing). Assume is log-supermodular and let . For every node and every real , a randomized algorithm returns a real such that
Every execution uses at most
operations and uniform draws. At leaves it returns .
The estimator subtracts an error margin from an estimated objective value; the objective itself never exceeds .
The cube-root balance. The parameter trades accuracy against cost. In the additive error bound , the term bounds how far the value of the guide constructed in Section 5 falls below , and bounds the further loss of discretization, truncation, optimization and validation in Section 4. The error bound contributes to the walk, whereas each estimate costs up to polynomial factors, with . Balancing and yields .
Proof of Theorem 1.2. Put and . Suppose first that , and let be the largest number , , with ; it is found by comparing with for . Then , and maximality gives , whence
By Theorem 2.2, the estimator with this parameter satisfies (2.3) with and poly . Proposition 2.1 then gives the required sampler and relative counter, with exponential factor .
If instead , then , and we evaluate all weights, sum them, and sample by comparing one uniform draw with their cumulative sums. This exact enumeration costs . In both cases the exponent is . Since and , this gives the bound of Theorem 1.2.
At the root, the same estimator gives additive estimates directly.
Corollary 2.3 (Additive estimates). Let be log-supermodular. For all reals and , a randomized algorithm returns a real with . Every execution uses at most poly operations and uniform draws.
Proof. Apply Theorem 2.2 at the root with , so that , and add , since .
Such an additive estimate at the root is not a relative approximation of . By Proposition 2.1, lower estimates within additive error polylogarithmic in at every node, at quasi-polynomial cost, would already give a randomized quasi-polynomial approximation scheme.
The next three sections prove Theorem 2.2. Section 3 writes as the maximum of an objective that is concave for log-supermodular weights, Section 4 maximizes a finite-dimensional version of it from samples, and Section 5 shows that this version loses little.
3 A variational principle on the self-reduction tree
We develop a variational formulation for constructing the coarse lower estimates of the residual log-partition functions required by (2.3). Starting from Gibbs' variational principle on the self-reduction tree (Section 3.1), we linearize the entropy terms (Section 3.2) and use the Lovász extension for the potential term (Section 3.3). The resulting objective has maximum , so every feasible choice gives a lower bound; it is concave when the weight is log-supermodular.
We state the formulation for a general potential normalized by . Write and . Every strictly positive law on the cube has this form for a unique normalized potential, namely . The tree masses and conditional marginal probabilities in this section are those of the weight .
3.1 Branching rules
Sampling by self-reduction descends the tree from the root, moving from each internal node to with probability and to otherwise. To obtain as the solution of an optimization problem, we let these probabilities vary. A branching rule assigns a probability to every internal node of the self-reduction tree, that is, to every node with depth. We write for the branching probability at the node with prefix , so that is the branching probability at the root .
The descent with rule starts at the root and moves from each internal node to with probability and to otherwise (Figure 1). It reaches the node with prefix with probability
the product of the branching probabilities along the path. We write for the probability of reaching node v and for the induced law on leaves. Every law on is for some : at each node that reaches, let be the conditional probability under that the next coordinate is 1, and choose arbitrary values elsewhere. In particular by (2.2).
To apply Gibbs' variational principle, we express the entropy of in terms of the branching probabilities. The entropy of a law on a finite set is , and the binary entropy of is , where [CT06, Chapter 2]. Let have law . Given , the coordinate is a Bernoulli variable with mean , so the chain rule for entropy [CT06, Theorem 2.5.1] gives
the last sum over internal nodes. At each depth, the probabilities sum to one, so that depth contributes the expected binary entropy of the next branch.

Figure 1: A branching rule on the self-reduction tree for . Nodes other than the root are labeled by their prefixes, and edges by the probabilities with which the descent takes them. The probability of reaching each leaf, shown below it, is the product along its path, and by (3.2) the entropy of the leaf law is .
For every law on the cube, Gibbs' variational principle, in the form of [WJ08, Theorem 3.4 and §5.2.2], gives
with equality exactly when ; here is the relative entropy of with respect to , and terms with are zero. Substituting (3.2) for the entropy of writes the principle on the tree.
Proposition 3.1 (Variational principle on the self-reduction tree). For every strictly positive law on ,
the maximum over branching rules , and the unique maximizer is the vector of conditional marginal probabilities of .
Proof. By (3.2) and (3.3), the bracket equals , which is maximal exactly when . Since is strictly positive, every internal node is reached with positive probability, so for .
The maximizer is the vector of conditional marginal probabilities that self-reduction needs, and by (3.3) every branching rule gives a lower bound. This formulation does not yet yield the desired algorithm. It has variables, and the probabilities in (3.1) are products along paths. The objective is not concave in , even for log-supermodular laws: for and , its Hessian in the two branching probabilities on the path to has determinant at .
Using the probabilities , or equivalently the leaf law , as variables restores concavity, but leaves an evaluation problem. Direct Monte Carlo evaluation of requires sampling from the candidate law and evaluating its probabilities. Rewriting this expectation under the uniform law on leaves introduces the weights , and the resulting integrand can have exponentially large second moment. We next drive every descent by the same independent uniform inputs. Thresholding a fresh input at each step expresses the entropy as an expectation under this fixed law. The expectation is linear in the map computing the descent and requires no evaluation of the induced leaf probabilities.
3.2 Linearizing the entropy
The linearization rests on an identity for a single bit. Let be uniform on , and let be the logit function. It is integrable, strictly increasing and antisymmetric, , so . Since on ,
We call the linear score of a bounded measurable function on . The threshold indicator , where , equals 1 at with probability , and by (3.5) its linear score is the entropy of that bit:
The left side is linear in the indicator, whereas is concave in p. No other [0,1]-valued function with the same mean scores as much; this is the bathtub principle [LL01, Theorem 1.14] with its equality case.
Lemma 3.2 (Bathtub principle). If is measurable and , then , with equality only if almost everywhere.
Proof. For , equals the constant almost everywhere, and . Otherwise put and , so that , on and on . Since is increasing,
The last integrand is nonnegative, and since is strictly increasing it vanishes only where or ; so equality forces almost everywhere.
The identity (3.6) is also the one-bit case of Hazan and Jaakkola's random-perturbation identity (Remark 3.7).
Encoding a descent. To apply (3.6) at every step of a descent, let be independent uniform inputs on , one for each depth, and write . The threshold descent of a branching rule compares each fresh input with at the current node . Let be the threshold descent using the conditional marginal probabilities of :
Because is uniform on and independent of , the conditional probability that given is the branching probability of the node , so has law ; in particular has law . The map performs sequential inverse-transform sampling, the discrete analogue of the inverse Rosenblatt transformation [Ros52].
Lemma 3.3 (Entropy identity for threshold descents). For every branching rule , the threshold descent takes values in , its th coordinate depends only on , and for every . Hence , and adding gives the bracket in (3.4). In particular , and
Proof. The first two claims are immediate from (3.7). The identity is (3.6) with , which is a function of . Since has law , summing over gives by (3.2), and . For , Proposition 3.1 gives the value .
Example 3.4 (Threshold descent on a path). Let be the path with , in this order, and . Summing out gives , , and , so . The conditional marginal probabilities are , , and . Thus is given by
By Lemma 3.3, with , . The second coordinate illustrates an interaction: its threshold for moves with the decision on , a dependence measured in Section 4.1 and reduced by averaging in Section 5.
From threshold descents to guides. By Lemma 3.3, the bracket in (3.4) is a score that is linear in the descent , plus an expected potential. This represents the objective under a fixed product law without evaluating the induced leaf probabilities. We now optimize over the map computing the descent instead of the branching probabilities. Threshold descents do not form a convex set: the average of and equals on . To obtain a convex feasible set we allow maps with values in .
Definition 3.5 (Guides). A guide is a measurable map whose th coordinate depends only on . Its coordinates are its rows, and its linear score is . A guide is Boolean if its values lie in .
We write for a general guide and call the exact guide of . Every threshold descent is a Boolean guide, and by Lemma 3.3 its linear score is the entropy of its law. A general Boolean guide may depend on the full earlier input history and may use an arbitrary measurable set of values of the fresh input to decide its next bit.
We first prove that the variational bound remains valid for all Boolean guides. This is the form needed in Section 3.3, where general guides are expressed as averages of Boolean guides that need not be threshold descents. The restriction to earlier and current inputs is essential: choosing after all inputs are revealed attains , which can exceed (Remark 3.7).
Lemma 3.6 (Variational principle for Boolean guides). Let be a strictly positive law on . Every Boolean guide satisfies
with equality if and only if almost everywhere. Thus is the maximum of the left-hand side over Boolean guides, and the unique maximizer is the exact guide.
Proof. We express the deficit as a sum of two nonnegative losses at each step. By Section 2.1, applied to the weight , the masses satisfy at internal nodes and at a leaf , and . Write for the Bernoulli law of mean . Since and , expanding relative entropy gives the one-step identity
The endpoint cases use .
Now write and . Given , the reached node is fixed. As a function of the fresh input , the next bit is the indicator of a measurable set, with mean . Its rearrangement loss is nonnegative by Lemma 3.2:
By (3.9) at with , and by (3.10),
Taking expectations and summing over telescopes the masses from to , giving
Both losses are nonnegative. They vanish for the exact guide, since its conditional mean is and each step is the maximizing threshold in Lemma 3.2. Conversely, equality forces and almost surely for every . The equality case of Lemma 3.2 then gives almost surely. Induction using (3.7) yields almost everywhere.
Two Boolean guides with the same law can have different linear scores. The guide with samples like the exact guide, but in (3.11) its Bernoulli relative entropies vanish and its rearrangement losses total , so its linear score is : the left side of (3.8) depends on the guide, not only on its law.
Remark 3.7 (Relation to random perturbations). The identity (3.6) is the one-bit case of the random-perturbation identity for log-partition functions. The logit has the logistic law [BS07, Section 2], that of a difference of two independent Gumbel variables with mean zero and scale one. For and the log-odds , the threshold indicator is the maximizer of over , so by (3.6)
For each variable , take independent copies of these Gumbel variables, as in [HJ12]. Write for . The additive term vanishes in expectation, leaving the logistic coefficient . If each variable is chosen after its own coefficient and the earlier ones are revealed, expectations and maxima nest. Thus the maximization identity in Lemma 3.6, for binary variables, is equivalent to Hazan and Jaakkola's random-perturbation identity [HJ12, Theorem 1]. The lemma also identifies the unique maximizer, as needed in Proposition 3.8.
If all coefficients are revealed before choosing , the maximum becomes , the corresponding upper bound [HJ12, Section 4.1, equation (5)]. It can be strict: for and it is about 3.187, whereas is about 3.139.
3.3 The concave relaxation
Guides form the convex feasible set announced in Section 3.2. The linear score is already defined on this set; it remains to extend the potential to fractional points while preserving the variational bound. By the layer cake representation [LL01, Theorem 1.13], a guide is the average of its layers , which are Boolean guides. Equivalently, take uniform on , independently of , and set . Then for every . We extend the objective in (3.8) by averaging over these layers. For a constant guide , whose linear score is zero, this gives the potential value at . This is the Lovázs extension (L2) below, which is computed from values of and is concave exactly when is log-supermodular (L3).
We define the extension on all of , because the search of Section 4.2 evaluates it at points outside . For , order its coordinates as , put , with , and define the Lovázs extension [Lov83]
ties may be broken arbitrarily.
A marginal difference of is a value , and is supermodular if for all , that is, if is log-supermodular. We use five standard facts from [Lov83] and [Bac13, Definition 3.1 and Propositions 3.1, 3.2 and 3.6], stated here for supermodular functions. (L1), (L2) and (L4) hold for every potential with .
(L1) for every set , by telescoping.
(L2) For , , where : this layer equals for ( , with and ), and summation by parts gives (3.12).
(L3) If is supermodular, then is concave on all of , and at every the vector of chain increments in (3.12), for any ordering of , is a supergradient. Conversely, concavity of forces supermodularity.
(L4) If every marginal difference of has absolute value at most , then so does every chain increment in (3.12); since is continuous and linear wherever the order of the coordinates is fixed, .
(L5) If is supermodular and is a random Boolean vector, then , by (L1), (L3) and Jensen's inequality.
By (L5) and (L2), for supermodular and , is the largest over random Boolean vectors with mean . The maximum is attained by . Thus is the concave closure of on [Bac13, Section 5.1]. For independent sets with the right side summed out, and , an empty maximum being zero.
The variational objective. Using this extension, define the objective of a guide by
The last term is the potential term. We call the variational objective and the objective value of . Both terms are finite because is integrable and is bounded. We call the objective gap of .
Proposition 3.8 (Exactness and concavity of the relaxation). Every guide satisfies , with equality if and only if almost everywhere. The objective is concave on the convex set of these guides if and only if is supermodular, that is, if and only if is log-supermodular.
Proof. Write as above; for each the layer is a Boolean guide. The score is linear in , by (L2), and by (L1) the objective agrees on Boolean guides with the left side of (3.8). Since is integrable and is bounded, Fubini's theorem and Lemma 3.6 give
and by Lemma 3.3. If , then for almost every the layer attains equality, so almost everywhere by Lemma 3.6. By Fubini's theorem, for almost every and every we have for almost every ; since , this forces .
If is supermodular, then is concave by (L3), and so are the potential term and . Conversely, following [Bac13, Proposition 3.6], a constant guide has linear score zero, because , so . For sets and , the layers of are for and for , so by (L1) and (L2), concavity of on constant guides gives
which is supermodularity.
Averaging Boolean guides. When is supermodular, averaging Boolean guides cannot increase their average objective gap. The guides constructed in Section 5 use this property. Let be independent of , and let be a random Boolean vector with each a function of . The average is a guide, and averaging preserves the linear score. Applying (L5) conditionally on , then taking expectations, gives . Thus
By (3.11) for each fixed , the objective gap of is therefore at most the average over of the rearrangement losses and Bernoulli relative entropies of the Boolean guide . In ordinary resampling and in threshold smoothing (Section 5), each is the threshold descent of a branching rule, so its rearrangement losses vanish. When under the joint law of , as in both constructions, the potential inequality above and give
Sampling from a guide. Every guide also defines a sampler, for every potential: has a law with , by (3.11) for each layer, (3.14), the chain rule and the convexity of relative entropy.
For the coarse objective gaps used here, this bound does not guarantee small total variation distance. We therefore use Section 2 to turn lower estimates into samples through the tree walk. Section 4 optimizes a finite-dimensional version of from samples and turns the value it finds into a lower estimate of .
4 Constructing the coarse estimator
We turn the variational formulation developed in the previous section (Proposition 3.8) into an algorithm for the coarse lower estimates (2.3) required by our counting and sampling algorithms. We first use the Hoeffding decomposition to measure interactions among the independent inputs (Section 4.1). We then discretize the inputs and restrict to low interaction degree to obtain a finite-dimensional concave optimization problem (Section 4.2). The accuracy guarantee assumes the existence of a nearly optimal guide with small high-degree tails. Such a guide is used only to show that the search space contains a good candidate; the algorithm optimizes and validates candidates using independent uniform inputs and evaluations of the weight . Section 5 constructs guides satisfying the required bounds.
Throughout this section, is log-supermodular and satisfies the evaluator and value-length assumptions of Theorem 1.2. Its normalized potential is supermodular, with and . The value-length bound gives , so every marginal difference of has absolute value at most . Every residual likewise has a supermodular normalized potential . Its marginal differences are those of with the prefix fixed, so the same bound applies.
4.1 Interaction degree
Let be a function of independent uniform inputs. For let integrate out coordinate , and for put
where is the identity. These are the components of the Hoeffding decomposition [Hoe48, ES81], also called the Efron-Stein or functional ANOVA decomposition, and presented as the orthogonal decomposition in [O'D14, §8.3]. The component depends only on the coordinates in and has mean zero in each of them, and distinct components are orthogonal.
We call the interaction energy on . For an integer , the function has interaction degree at most if whenever . Write for its degree- tail, and . By orthogonality, is the best approximation of interaction degree at most , with squared error . These degrees and squared norms correspond to Fourier degree, weight and high-degree weight on the Boolean cube and finite product spaces [O'D14, Definitions 1.17, 8.32 and 8.38 and Proposition 8.33]. Interaction degree counts the input coordinates in a component, not powers of their values or their binary digits. In Example 3.4, the second row has a nonzero component on .
To represent low-degree functions with finitely many coefficients, we partition each input interval into finitely many bins. Averaging a function over each product of bins gives a function of the bin indices alone. This averaging does not increase high-degree tail norms. Indeed, any linear operator that commutes with every satisfies for every . If is also an contraction, then . Bin averaging has both properties (Section 4.2). We will also use this observation for the noise operator, which averages a function over independent choices to keep or resample each input (Section 5.1).
4.2 From guides to coarse estimates
Fix , and an integer , put , and let be a node of the self-reduction tree of whose residual has free coordinates, identified with positions in the inherited order. Write . The guide and its interaction decomposition use these inputs. We allocate the additive slack as for binning and truncation, for optimization, and for validation. The following parameters depend only on the original dimension and the bound , uniformly over all residuals:
(4.1)
Both minima are over nonnegative integers. Thus and . Here is the number of bins per input, bounds the bin scores (Lemma 4.2), bounds the absolute slope of the objective in each row (Lemma 4.3), and . The auxiliary parameter will be used in Section 5 to choose so that the required tail bound holds.
Suppose that there is a guide g on k inputs for which
Here is a known bound. The guide may depend on the residual, while and are common to all residuals. The first inequality controls the achievable additive error; the second ensures that low-degree truncation loses at most of objective value (Lemma 4.4). We call such a guide a witness: it is used only to prove that a good coefficient vector exists, and the algorithm does not evaluate it.
Theorem 4.1 (Estimator from a guide). If (4.2) holds for every residual, then for every node v and a randomized algorithm returns such that
At leaves it returns 0. Every execution costs at most
operations and uniform draws.
To prove Theorem 4.1, we construct a concave objective bounded above by , show that its low-degree search space contains a good candidate, and optimize and validate candidate values using independent samples. Throughout the proof, and are as above.
A sound concave objective. Divide each input interval into equal bins and put for . The variables are independent and uniform. Low-degree truncation need not preserve the range . For optimization, a candidate is therefore a vector whose th row is a real-valued function . Clipping its rows to produces a guide.
For a function of the bins, replacing by its conditional mean preserves the linear score. The score of bin j is
since on . The following bounds control the size of these scores and the score error when a guide is averaged over bins.
Lemma 4.2 (Bin scores). The bin scores satisfy and .
Proof. Since , we have . The interior bins lie in , where . For the first bin, and , so . This proves the first bound.
An increasing function with mean on an interval of length satisfies , and likewise with ; hence is at most times the oscillation of . The oscillations of over the interior bins sum to . For the boundary bins, we use the one-sided bound. On the first bin , and the last bin is symmetric. Summing, .
Substituting the clipped candidate into gives a lower bound, but need not preserve concavity. We therefore extend the bin scores concavely and subtract a penalty that controls the change in the potential under clipping. For let if and if . This function is concave and -Lipschitz, equals on , and satisfies , where ; we write for the distance to the interval. For a candidate define the penalized objective
The objective is an expectation under the fixed product law of the bins; its integrand uses only candidate values and evaluations of W.
Lemma 4.3 (Soundness for every candidate). The objective is concave. Every candidate satisfies , and any two candidates satisfy .
Proof. Concavity holds termwise: , and minus the distance to an interval are concave, and is linear. Let , coordinatewise; it is a guide. Then for every , and (L4) gives : the penalty pays for the change of the potential term under clipping. Hence
The equality holds because is a function of the bins and ; the last inequality is Proposition 3.8.
For the Lipschitz bound, the term of row is -Lipschitz by Lemma 4.2, and the potential term and the penalty are -Lipschitz in each row.
A good low-degree candidate exists. We now represent low-degree candidates by finitely many bounded coefficients and show that one preserves nearly the witness's objective value. We use Walsh characters because their orthogonality controls truncation error, while their values in ensure that -valued functions of the bins have coefficients in . Since , identify each bin index with its vector of 2s binary digits. For put , where is the inner product of the digit vectors, and for put . These Walsh characters [O'D14] are an orthonormal basis for the functions of . The support of is . For a function of the bins write . Viewed as a function of , the Hoeffding component of on is over the with support [O'D14, Proposition 8.36].
Lemma 4.4 (Low-degree candidate). There is a candidate such that each row is a linear combination, with coefficients in , of the Walsh characters whose supports lie in and have at most elements, and
Proof. Let be the guide assumed in (4.2), and put . Conditioning on averages the guide over each product of input bins. Thus takes values in , and depends only on . Its penalty vanishes, and since is concave, . Since , Lemma 4.2 and the choice of give
For the last step use (4.2) and : with and the left-hand side is at most .
Now truncate to interaction degree , setting . Conditioning on the bins acts on each coordinate separately, commutes with every and does not increase norms, so by Section 4.1 , and (4.2) gives . By Cauchy-Schwarz, . Summing over the rows, Lemma 4.3 turns this into an objective loss of at most 1/128. Together with the preceding bound, this gives the claimed objective value. In the Walsh basis keeps exactly the characters of whose supports have at most elements. Their coefficients lie in because , and they vanish unless the support lies in , since does not depend on later bins.
Stochastic optimization. For row let be the set of whose support lies in and has at most elements. Put
A coefficient vector (unrelated to the branching rules of Section 3.1) defines the candidate , and we write . By Lemma 4.4, some has . Since and ,
A fresh sample of the bins allows us to evaluate a sample objective and a stochastic supergradient. Generating the sample uses uniform draws and comparisons. At a sample every character is a sign, so . Dropping the expectations in (4.4) gives the sample objective , which is concave and piecewise linear in . For every fixed , . The potential term of is evaluated by sorting the values and applying (3.12) to values of . Choose a supergradient from the chain increments of that sorting (L3), with slope zero at every kink of and of the penalty. The slope of each row then has magnitude at most . The coordinate of is the chosen row- slope multiplied by . Put . Since , the sample objective satisfies , and
Averaging the supergradient inequality gives a supergradient of J at fixed .
We use projected stochastic supergradient ascent [NJLS09, §2.2] with target expected optimization gap . Set and . Initialize and iterate
with a fresh sample each time; the projection clips each coordinate to . Return
If maximizes on , then projection does not increase the distance to , and the conditional supergradient inequality gives
Summing over , using and concavity of at ,
By Markov's inequality, with probability at least 3/4. The finite-precision implementation and its rounding analysis are given in Appendix A.3.
Validation. For a requested failure probability , run the ascent independently times to amplify the probability of finding a good candidate. We estimate each returned candidate's objective value using fresh samples, since the candidate depends on the samples used during ascent. Subtracting the validation error margin then gives a lower estimate of whenever validation is accurate. For each candidate, average over
fresh samples. Conditional on the candidate, Hoeffding's inequality [Hoe63] shows that this average differs from its objective value by more than with probability at most .
Proof of Theorem 4.1. At a leaf return 0. Otherwise compute the parameters (4.1) by comparisons, and the bin scores from the values . Run ascent and validation attempts as above, writing and for the averaged iterate and validation average in attempt . Return
By a union bound, with probability at least every validation is accurate within , and with probability at least some attempt has . On both events every is at most by Lemma 4.3, and the best one is at least
The clamps keep in , since . They are harmless because : the configuration 0 contributes , and by telescoping from 0.
For the cost, the characters with are listed by choosing a support of at most positions and nonzero digit patterns on it, and a character is evaluated in operations. One ascent step or one validation sample costs poly operations and evaluations of . There are steps and validation samples, all fixed in advance, and . By (4.6) and , the total is (4.3) on every execution.
5 Low-degree approximation and threshold smoothing
We construct nearly optimal guides with small high-degree tails, providing the witnesses required by the estimator of Theorem 4.1. These guides are obtained by averaging random perturbations of the exact guide and serve only to certify that the search space contains a good candidate. We first analyze ordinary resampling, which gives the square-root baseline (Section 5.1). We then introduce threshold smoothing, which improves the objective-loss bound from linear to quadratic in the perturbation parameter while preserving comparable high-degree decay (Section 5.2). This improved tradeoff completes the proof of Theorem 2.2 and yields the cube-root running-time exponent.
Throughout this section, is a supermodular potential on , normalized by , and . We use the exact guide of (3.7), the variational objective , and the Hoeffding decomposition of Section 4.1. The constructions work in any fixed coordinate order and apply, in particular, to every pinned residual from Section 2.
5.1 Ordinary resampling and the square-root baseline
The simplest way to shrink the high-degree components of the exact guide (3.7) is to resample its inputs: for , let , where is the noise operator. O'Donnell [O'D14, Definitions 8.26–8.27, Proposition 8.28 and §8.3] treats it on finite product spaces, with the correlation as its parameter.
Lemma 5.1 (Ordinary resampling). For every , is a guide, and
for every row i and integer .
Proof. The operator is positive, fixes constants, and preserves the uniform product measure. Because depends only on the first inputs, so does . Sample a noisy copy of by independently keeping each coordinate with probability and otherwise drawing a fresh uniform value. Then , while is uniform. As in (3.15), (L5) applied given gives . Consider the linear score of row . If is resampled, the row contributes zero, since . If is kept, the noisy prefix has the uniform product law and is independent of ; hence
By Lemma 3.3, the sum of the latter expectations is . This proves the objective-gap bound using Proposition 3.8. Finally multiplies the Hoeffding component on by . Orthogonality and give .
Corollary 5.2 (Square-root baseline). Ordinary resampling and the estimator of Theorem 4.1 give the counting and sampling guarantees of Theorem 1.2 within the bound
times the same polynomial factors. For bipartite independent sets this gives times the polynomial factors in Theorem 1.1.
Proof. For , take , with the parameters of (4.1). Apply Lemma 5.1 to any residual with free coordinates. Its objective gap is at most . If , the degree- tail of each row has norm at most ; if the tail vanishes. Thus Theorem 4.1 supplies, at every node, a one-sided estimate with additive error bound and cost
The conversion of Proposition 2.1 therefore has exponential cost , with and as in the proof of Theorem 1.2.
If , choose the largest with integer for which . Then both and are . If , exact enumeration instead costs poly, and . Taking the cheaper of the resulting algorithm and enumeration gives the stated minimum. Finally, ; for use , , and .
5.2 Threshold smoothing and the two guarantees
Resampling loses linearly in , because a resampled input contributes nothing to the linear score. Threshold smoothing keeps every input and shifts its threshold instead, which loses only quadratically while reducing the variance of the averaged indicator at each threshold by a fraction linear in .
Theorem 5.3 (Near-optimal guides with small high-degree tails). Let be a normalized supermodular potential on coordinates. For every there is a guide such that
(i) Near-optimal objective value: , and
(ii) Low-degree approximation: for every row and every integer .
We construct , in any coordinate order, by smoothing the thresholds of the exact guide. Item (i) controls the additive error in the estimate of ; item (ii) controls the degree needed for an accurate truncation of , and hence the size of the search space.
The construction. Fix a smoothing parameter .
Definition 5.4 (Ordered threshold tree). A function is an ordered threshold tree if it can be computed as follows. For in turn, compare with a threshold that depends only on the outcomes of the previous comparisons, and record . Finally output a real number that depends only on . Equivalently, is computed by a decision tree that queries in this order, each query a threshold comparison.
Each row of the exact guide is an ordered threshold tree: for the threshold is , the later comparisons are ignored, and the output is . Earlier inputs influence a later threshold only through the earlier binary decisions.
For put . To smooth an ordered threshold tree, draw independent fair signs , independent of the uniform inputs, and in the th comparison replace by . Here is the threshold at the node reached by the perturbed comparisons. Write for the resulting output, and define its smoothing by averaging the signs at fixed inputs:
We call this perturbation and averaging operation threshold smoothing, and the smoothing of ; it need not be continuous. Both shifted thresholds lie in . Conditional on the preceding inputs and signs, the probability of taking branch 1 is
By induction on , the perturbed outcomes , with inputs and signs random, have the same law as the unperturbed ones. In particular, under the joint law of , has the law of , and .
For the exact guide, use one perturbed sequential run for all rows: with independent uniform inputs and independent fair signs , set
Thus . Averaging each row with its own independent sign sequence would give the same . By the calculation above, when inputs and signs are both random; for fixed signs the law is in general different. The shared run gives one random Boolean vector with conditional mean and law , which the potential bound of Proposition 5.5 needs.
The two guarantees. Proposition 5.5 bounds the objective gap of the smoothed guide, and Theorem 5.6 bounds the high-degree tails of the smoothing of any ordered threshold tree. Together they prove Theorem 5.3.
Proposition 5.5 (Near-optimal objective value for the smoothed guide). The guide g of (5.2) has the following properties.
(1) g is a guide.
(2) With , and ,
(3) For every , .
(4) . Consequently
Theorem 5.6 (Energy identity). Let be an ordered threshold tree on coordinates and its smoothing. Then
Consequently , and for every integer ,
Proof of Theorem 5.3. Take as in (5.2). By Proposition 5.5 it is a guide satisfying the near-optimal objective value guarantee (i). For the low-degree approximation guarantee (ii), apply (5.6) to the ordered threshold tree , whose variance is at most .
Theorem 5.3 supplies the witness required by Theorem 4.1, which completes the main line.
Proof of Theorem 2.2. Apply the generic estimator of Theorem 4.1 with and . Apply Theorem 5.3 to the normalized potential of each residual, which is supermodular with free coordinates; its objective gap is at most . If , item (ii) of Theorem 5.3 and give ; if the tail vanishes. The generic cost is (4.3), and .
Quadratic objective gap. It remains to prove Proposition 5.5 and Theorem 5.6. The objective gap uses the one-bit identity (3.5) for the linear score and the averaging argument of (3.15) for the potential term.
Proof of Proposition 5.5. (1) Each is Boolean and depends only on , so its average lies in and depends only on .
(2) Conditional on is fixed and is fresh. By (3.5),
Since , has the law of . Also , and by Lemma 3.3. Subtracting proves (5.3).
(3) At the loss is zero. For , put . The two shifted thresholds have mean , so expanding Bernoulli relative entropy gives
The inequality yields
by applying it to the two probability ratios. Hence .
(4) Given , the Boolean vector has mean , so (L5) gives , as in (3.15). Averaging and using proves the potential inequality. Together with items (2) and (3) this gives . Now , the lower bound in (5.4) is Proposition 3.8, and .
Geometric decay of high-degree tails. We prove Theorem 5.6 by induction on , using only the mean and variance of a single smoothed indicator.
Let be the threshold indicator of Section 3.2. The smoothing of a single comparison is
Lemma 5.7 (Moments of a smoothed indicator). For every , with p = 1 - c,
Proof. Write . The two indicators in (5.8) are nested, with means and , so and . Subtracting gives . This also holds at , where .
Proof of Theorem 5.6. Put . On any product of input coordinates, use the squared norm , with Hoeffding components as in Section 4.1. We prove by induction on ; for the tree and its smoothing are the same constant.
For , let be the first threshold, put , and let and be the two remaining ordered threshold trees, with smoothings and . Writing , independence of the signs gives
where and . The first summand has no interaction involving coordinate 1. In the second, the factor is centered, so a component of on produces a component on . Orthogonality and Lemma 5.7 therefore give
The last equality is the usual quadratic identity in an inner-product norm. By the induction hypothesis, the last line equals , which is because follows when and otherwise. This proves (5.5).
The constant component is . Subtracting its square gives the variance identity; for the tail, use when .
The factor for the added coordinate 1 exactly offsets the variance that the smoothing removes from the indicator, so the weighted energy passes down the tree without loss. This is an aggregate identity: an individual component's squared norm need not shrink by , as Example 5.8 shows.
Example 5.8 (The path, smoothed). In Example 3.4 with , the smoothed guide loses approximately 0.0449 of linear score and gains 0.0018 in the potential term. Its objective value is approximately , against the loss bound in (5.4). The exact interaction energies of row 2 are
| S | ||||
|---|---|---|---|---|
| 9/169 | 8/2535 | 2/13 | 4/195 | |
| 9/169 | 2/845 | 619/5070 | 11/1690 |
With , the table gives
The interaction energy on is multiplied by 619/780, which exceeds .
More generally, fix a common at every node. If each threshold is replaced by a function of its input with mean and variance , the recursion (5.10) gives the same identity with this . If every variance is at most , it gives the corresponding inequality. For example, resampling the queried input replaces by and turns into . Its variance factor is , and the identity holds component by component: . With , that is, , resampling removes the same fraction of variance as threshold smoothing, but on a fair bit it lowers the score by , whereas threshold smoothing lowers it only from to .
The cost of variance reduction. The energy identity shows how variance contraction at each comparison controls the decay of high-degree tails. We now bound the linear-score loss required for a given variance reduction.
Proposition 5.9 (The cost of smoothing one threshold). For , put and recall . Write for the variance of . Every measurable with satisfies
Proof. The map exchanges and and, since is antisymmetric with , preserves both sides of (5.11); so assume . Put and . Then , , and has the same sign as . The variance deficit is
because pointwise. Since , each of and carries mass of , and . Since ,
where for and for . On each side, increases with the distance from . For this fixed , the bathtub principle minimizes the integral subject to these sign and mass constraints by placing on . Hence
Threshold smoothing removes variance (Lemma 5.7) and loses at most of linear score (Proposition 5.5). For the variance contraction , its linear-score loss is therefore within a factor 128/3 of the minimum over all replacements with the same mean and variance, uniformly for 0 < c < 1.
6 Closing remarks
6.1 Discussion
Log-supermodularity. Our algorithm treats #BIS through the more general problem of counting with efficiently evaluable positive log-supermodular weights. Log-supermodularity also plays a central role in classifications of approximate counting problems [BDG 13, CDG 15]. The general log-supermodular counting problem is #BIS-hard, but is not known to be #BIS-equivalent. Our algorithm may therefore be solving a strictly harder problem than #BIS. Can one establish #BIS-equivalence, or identify a separation that can be exploited to obtain faster algorithms for #BIS?
Bipartite and general hard-core models. Extending our counting or sampling bound to general hard-core models, including fugacities approaching the uniqueness threshold, would also speed up SAT algorithms. Our companion paper [JLY26, Theorems 1.6 and 2.8] shows that an hard-core sampling algorithm for general graphs at fixed accuracy in this setting would give a randomized SAT algorithm running in time on inputs of binary length s.
6.2 Open questions
Improving the running time. For arbitrary bipartite graphs, can the exponent 1/3 be reduced, and is a quasi-polynomial-time approximation scheme or an FPRAS possible? Within our approach, Proposition 2.1 reduces this question to the accuracy and cost of lower estimates on every pinned residual. Additive error at quasi-polynomial cost would suffice for a quasi-polynomial scheme; error at polynomial cost would suffice for an FPRAS and polynomial-time sampling.
Improving the estimator. Write . For fixed , an objective gap and estimation cost up to polynomial factors, uniformly over residuals and , give a total exponent by Proposition 2.1. Balancing at , with enumeration if this exceeds , gives
Resampling has with , and threshold smoothing has . Changing only the constants in these bounds leaves these powers unchanged.
Proposition 5.9 shows that threshold smoothing is optimal up to an absolute constant in linear-score loss at its given variance reduction. Potential gains can offset score losses (Example 5.8), so the proposition gives no corresponding lower bound on the full objective gap. Can a sharper analysis of the full objective, a different guide construction, or better control of interaction tails improve this balance and reduce the exponent ?
Quantitative reductions. Approximation-preserving reductions may enlarge instances and alter accuracy requirements, so their quantitative costs must be composed with our running-time bound. Which problems in the #BIS-equivalence class admit reductions, or direct log-supermodular representations, that preserve a comparable saving in their natural size parameters?
Acknowledgements
We thank Weiming Feng and Heng Guo for constructive feedback during early stages of the project.
AI methodology
The coarse estimator idea first emerged during interactions with GPT 5.5 Pro. The first such construction was suggested by GPT 6 Pro on 7 October 2026, when the authors asked specifically for ideas that make use of convex optimization (with pointers to OpenAI's math GitHub repo) and “the difference between bipartite -coloring and #BIS” (with a note on bipartite -coloring from Heng Guo through private communication). The initial proof completed by AI claimed an algorithm running in time . We subsequently identified the Sinclair–Jerrum walk on the self-reduction tree, the variational principle on that tree, and the use of the Lovász extension as implicit ingredients hidden in the proofs. We also abstracted the log-supermodular structure underlying the algorithm, leading to the current organization and presentation of the paper. OpenAI Codex assisted with mathematical development, finite-algorithm accounting, source drafting, literature checks, and bibliography preparation. We also used Codex and Claude to help polish and check proofs.
References
[ALOG20] Nima Anari, Kuikui Liu, and Shayan Oveis Gharan. Spectral independence in high-dimensional expanders and applications to the hardcore model. In FOCS, pages 1319–1330, 2020. doi:10.1109/FOCS46700.2020.00125.
[Bac13] Francis Bach. Learning with submodular functions: A convex optimization perspective. Foundations and Trends in Machine Learning, 6(2-3):145–373, 2013. Numbering follows arXiv:1111.6453v2. URL: https://arxiv.org/abs/1111.6453.
[BCP24] Antonio Blanca, Sarah Cannon, and Will Perkins. Fast and perfect sampling of subgraphs and polymer systems. ACM Transactions on Algorithms, 20(1), 2024. Article 5. doi:10.1145/3632294.
[BDG 13] Andrei A. Bulatov, Martin Dyer, Leslie Ann Goldberg, Mark Jerrum, and Colin McQuillan. The expressibility of functions on the Boolean domain, with applications to counting CSPs. Journal of the ACM, 60(5):32:1–32:36, 2013. doi:10.1145/2528401.
[BS07] Alexander Barvinok and Alex Samorodnitsky. Random weighting, asymptotic counting, and inverse isoperimetry. Israel Journal of Mathematics, 158:159–191, 2007. arXiv:math/0302177. URL: https://arxiv.org/abs/math/0302177.
[BZ10] Richard P. Brent and Paul Zimmermann. Modern Computer Arithmetic, volume 18 of Cambridge Monographs on Applied and Computational Mathematics. Cambridge University Press, Cambridge, 2010. doi:10.1017/CB09780511921698.
[CCYZ25] Xiaoyu Chen, Zongchen Chen, Yitong Yin, and Xinyuan Zhang. Rapid mixing at the uniqueness threshold. In STOC, pages 879–890, 2025. Current full version: arXiv:2411.03413. URL: https://arxiv.org/abs/2411.03413, doi:10.1145/3717823.3718260.
[CDF 19] Radu Curticapean, Holger Dell, Fedor Fomin, Leslie Ann Goldberg, and John Lapinskas. A fixed-parameter perspective on #BIS. Algorithmica, 81:3844–3864, 2019. Preliminary version in IPEC 2017. doi:10.1007/s00453-019-00606-4.
[CDG 15] Xi Chen, Martin Dyer, Leslie Ann Goldberg, Mark Jerrum, Pinyan Lu, Colin McQuillan, and David Richerby. The complexity of approximating conservative counting CSPs. Journal of Computer and System Sciences, 81(1):311–329, 2015. doi:10.1016/j.jcss.2014.06.006.
[CDKP24] Charlie Carlson, Ewan Davies, Alexandra Kolla, and Aditya Potukuchi. A spectral approach to approximately counting independent sets in dense bipartite graphs. In 51st International Colloquium on Automata, Languages, and Programming (ICALP 2024), volume 297 of LIPIcs, pages 35:1–35:18, 2024. doi:10.4230/LIPIcs.ICALP.2024.35.
[CF25] Xiaoyu Chen and Weiming Feng. Rapid mixing via coupling independence for spin systems with unbounded degree. In APPROX/RANDOM, volume 353 of LIPIcs, pages 68:1–68:17, 2025. doi:10.4230/LIPIcs.APPROX/RANDOM.2025.68.
[CFYZ21] Xiaoyu Chen, Weiming Feng, Yitong Yin, and Xinyuan Zhang. Rapid mixing of Glauber dynamics via spectral independence for all degrees. In FOCS, pages 137–148, 2021. doi:10.1109/FOCS52979.2021.00022.
[CGG 16] Jin-Yi Cai, Andreas Galanis, Leslie Ann Goldberg, Heng Guo, Mark Jerrum, Daniel Štefanković, and Eric Vigoda. #BIS-hardness for 2-spin systems on bipartite bounded degree graphs in the tree non-uniqueness region. Journal of Computer and System Sciences, 82(5):690–711, 2016. doi:10.1016/j.jcss.2015.11.009.
[CGG 21] Zongchen Chen, Andreas Galanis, Leslie A. Goldberg, Will Perkins, James Stewart, and Eric Vigoda. Fast algorithms at low temperatures via Markov chains. Random Structures & Algorithms, 58(2):294–321, 2021. doi:10.1002/rsa.20968.
[CGM12] Prasad Chebolu, Leslie Ann Goldberg, and Russell Martin. The complexity of approximately counting stable matchings. Theoretical Computer Science, 437:35–68, 2012. URL: https://arxiv.org/abs/1004.1836, doi:10.1016/j.tcs.2012.02.029.
[CGMW26] Katie Clinch, Serge Gaspers, Simon Mackenzie, and Qi Wang. Faster exponential-time approximate counting via bounded self-reductions. In 34th Annual European Symposium on Algorithms (ESA 2026), volume 388 of LIPIcs, pages 104:1–104:14, 2026. doi:10.4230/LIPIcs.ESA.2026.104.
[CGŠV22] Zongchen Chen, Andreas Galanis, Daniel Štefanković, and Eric Vigoda. Sampling colorings and independent sets of random regular bipartite graphs in the non-uniqueness region. In SODA 2022, pages 2198–2207, 2022. doi:10.1137/1.9781611977073.87.
[CHP26] Sarah Cannon, Tyler Helmuth, and Will Perkins. Pirogov–Sinai theory for the hard-core model beyond lattices. Communications in Mathematical Physics, 407:129, 2026. arXiv:2411.07809. URL: https://arxiv.org/abs/2411.07809.
[CJ25] Zongchen Chen and Tianhui Jiang. Improved mixing of critical hardcore model. In APPROX/RANDOM, volume 353 of LIPIcs, pages 51:1–51:22, 2025. doi:10.4230/LIPIcs.APPROX/RANDOM.2025.51.
[Cla26] Claude (Anthropic). A time algorithm for 3-SAT, 2026. Research manuscript. URL: https://github.com/anthropics/formal-math/blob/main/eth/README.md.
[CLY23] Xiaoyu Chen, Jingcheng Liu, and Yitong Yin. Uniqueness and rapid mixing in the bipartite hardcore model (extended abstract). In FOCS, pages 1991–2005, 2023. Full version: arXiv:2305.00186. URL: https://arxiv.org/abs/2305.00186, doi:10.1109/FOCS57990.2023.00121.
[CP20] Sarah Cannon and Will Perkins. Counting independent sets in unbalanced bipartite graphs. In SODA 2020, pages 1456–1466, 2020. doi:10.1137/1.9781611975994.88.
[CT06] Thomas M. Cover and Joy A. Thomas. Elements of Information Theory. Wiley-Interscience, Hoboken, NJ, second edition, 2006. doi:10.1002/047174882X.
[DFJ02] Martin Dyer, Alan Frieze, and Mark Jerrum. On counting independent sets in sparse graphs. SIAM Journal on Computing, 31(5):1527–1541, 2002. doi:10.1137/S0097539701383844.
[DGGJ04] Martin Dyer, Leslie Ann Goldberg, Catherine Greenhill, and Mark Jerrum. The relative complexity of approximate counting problems. Algorithmica, 38(3):471–500, 2004. doi:10.1007/s00453-003-1073-y.
[DGJ10] Martin Dyer, Leslie Ann Goldberg, and Mark Jerrum. An approximation trichotomy for Boolean #CSP. Journal of Computer and System Sciences, 76(3-4):267–277, 2010. doi:10.1016/j.jcss.2009.08.003.
[DK14] Josip Djolonga and Andreas Krause. From MAP to marginals: Variational inference in Bayesian submodular models. In Advances in Neural Information Processing Systems, volume 27, 2014. URL: https://proceedings.neurips.cc/paper_files/paper/2014/file/efe0df3ea4a53a04614ad79e7a8a57de-Paper.pdf.
[DK15] Josip Djolonga and Andreas Krause. Scalable variational inference in log-supermodular models. In ICML, volume 37 of PMLR, pages 1804–1813, 2015. URL: https://proceedings.mlr.press/v37/djolonga15.html.
[ES81] B. Efron and C. Stein. The jackknife estimate of variance. The Annals of Statistics, 9(3):586–596, 1981. doi:10.1214/aos/1176345462.
[ES88] Robert G. Edwards and Alan D. Sokal. Generalization of the Fortuin–Kasteleyn–Swendsen–Wang representation and Monte Carlo algorithm. Physical Review D, 38(6):2009–2012, 1988. doi:10.1103/PhysRevD.38.2009.
[FGKP23] Tobias Friedrich, Andreas Göbel, Martin S. Krejca, and Marcus Pappik. Polymer dynamics via cliques: New conditions for approximations. Theoretical Computer Science, 942:230–252, 2023. URL: https://arxiv.org/abs/2007.08293.
[FKG71] C. M. Fortuin, P. W. Kasteleyn, and J. Ginibre. Correlation inequalities on some partially ordered sets. Communications in Mathematical Physics, 22:89–103, 1971. doi:10.1007/BF01651330.
[FY26] Weiming Feng and Minji Yang. Rapid mixing of Glauber dynamics for monotone systems via entropic independence. In SODA, pages 4894–4929, 2026. doi:10.1137/1.9781611978971.177.
[GGJ17] Andreas Galanis, Leslie Ann Goldberg, and Mark Jerrum. A complexity trichotomy for approximately counting list H-colorings. ACM Transactions on Computation Theory, 9(2):9:1–9:22, 2017. doi:10.1145/3037381.
[GJ07] Leslie Ann Goldberg and Mark Jerrum. The complexity of ferromagnetic Ising with local fields. Combinatorics, Probability and Computing, 16(1):43–61, 2007. doi:10.1017/S096354830600767X.
[GJ12a] Leslie Ann Goldberg and Mark Jerrum. Approximating the partition function of the ferromagnetic Potts model. Journal of the ACM, 59(5):25:1–25:31, 2012. doi:10.1145/2371656.2371660.
[GJ12b] Leslie Ann Goldberg and Mark Jerrum. A counterexample to rapid mixing of the Ge-Štefanković process. Electronic Communications in Probability, 17(5):1–6, 2012. doi:10.1214/ECP.v17-1712.
[GJ15] Leslie Ann Goldberg and Mark Jerrum. A complexity classification of spin systems with an external field. Proceedings of the National Academy of Sciences, 112(43):13161–13166, 2015. doi:10.1073/pnas.1505664112.
[GLR21] Leslie Ann Goldberg, John Lapinskas, and David Richerby. Faster exponential-time algorithms for approximately counting independent sets. Theoretical Computer Science, 892:48–84, 2021. doi:10.1016/j.tcs.2021.09.009.
[Gri06] Geoffrey R. Grimmett. The Random-Cluster Model, volume 333 of Grundlehren der mathematischen Wissenschaften. Springer, Berlin, Heidelberg, 2006. doi:10.1007/978-3-540-32891-9.
[GŠ12] Qi Ge and Daniel Štefankovič. A graph polynomial for independent sets of bipartite graphs. Combinatorics, Probability and Computing, 21(5):695–714, 2012. Preliminary version in FSTTCS 2010. doi:10.1017/S0963548312000296.
[HJ12] Tamir Hazan and Tommi Jaakkola. On the partition function and random maximum a-posteriori perturbations. In Proceedings of the 29th International Conference on Machine Learning (ICML), Edinburgh, 2012. arXiv:1206.6410. URL: https://arxiv.org/abs/1206.6410.
[HL08] Mark Huber and Jenny Law. Fast approximation of the permanent for very dense problems. In Proceedings of the 19th Annual ACM-SIAM Symposium on Discrete Algorithms (SODA), 2008.
[HMJ13] Tamir Hazan, Subhransu Maji, and Tommi Jaakkola. On sampling from the Gibbs distribution with random maximum a-posteriori perturbations. In Advances in Neural Information Processing Systems 26 (NIPS), 2013. arXiv:1309.7598. URL: https://arxiv.org/abs/1309.7598.
[Hoe48] Wassily Hoeffding. A class of statistics with asymptotically normal distribution. The Annals of Mathematical Statistics, 19(3):293–325, 1948. doi:10.1214/aoms/1177730196.
[Hoe63] Wassily Hoeffding. Probability inequalities for sums of bounded random variables. Journal of the American Statistical Association, 58(301):13–30, 1963. doi:10.1080/01621459.1963.10500830.
[HPR20] Tyler Helmuth, Will Perkins, and Guus Regts. Algorithmic Pirogov–Sinai theory. Probability Theory and Related Fields, 176:851–895, 2020. doi:10.1007/s00440-019-00928-y.
[IL86] Robert W. Irving and Paul Leather. The complexity of counting stable marriages. SIAM Journal on Computing, 15(3):655–667, 1986. doi:10.1137/0215048.
[JKM18] Vishesh Jain, Frederic Koehler, and Elchanan Mossel. The mean-field approximation: Information inequalities, algorithms, and complexity. In COLT, volume 75 of PMLR, pages 1326–1347, 2018. URL: https://proceedings.mlr.press/v75/jain18b.html.
[JKP20] Matthew Jenssen, Peter Keevash, and Will Perkins. Algorithms for #BIS-hard problems on expander graphs. SIAM Journal on Computing, 49(4):681–710, 2020. doi:10.1137/19M1286669.
[JKR19] Vishesh Jain, Frederic Koehler, and Andrej Risteski. Mean-field approximation, convex hierarchies, and the optimality of correlation rounding: A unified perspective. In STOC, pages 1226–1236, 2019. doi:10.1145/3313276.3316299.
[JLY26] Zhe Ju, Jingcheng Liu, and Yitong Yin. Fine-grained complexity across the computational phase transition, 2026. Manuscript.
[JMP26] Matthew Jenssen, Alexandru Malekshahian, and Jinyoung Park. A refined graph container lemma and applications to the hard-core model on bipartite expanders. Random Structures & Algorithms, 68(1):e70041, 2026. doi:10.1002/rsa.70041.
[JPP23] Matthew Jenssen, Will Perkins, and Aditya Potukuchi. Approximately counting independent sets in bipartite graphs via graph containers. Random Structures & Algorithms, 63(1):215–241, 2023. doi:10.1002/rsa.21145.
[JS93] Mark Jerrum and Alistair Sinclair. Polynomial-time approximation algorithms for the Ising model. SIAM Journal on Computing, 22(5):1087–1116, 1993. doi:10.1137/0222066.
[JVV86] Mark R. Jerrum, Leslie G. Valiant, and Vijay V. Vazirani. Random generation of combinatorial structures from a uniform distribution. Theoretical Computer Science, 43:169–188, 1986. doi:10.1016/0304-3975(86)90174-X.
[KOGT26] Nicholas Kocurek, Shayan Oveis Gharan, and Dante Tjowasi. Sampling from the hardcore model on random regular bipartite graphs above the uniqueness threshold, 2026. Preprint, arXiv:2604.21847. URL: https://arxiv.org/abs/2604.21847.
[KR80] Samuel Karlin and Yosef Rinott. Classes of orderings of measures and related correlation inequalities. I. Multivariate totally positive distributions. Journal of Multivariate Analysis, 10(4):467–498, 1980. doi:10.1016/0047-259X(80)90065-2.
[KY76] Donald E. Knuth and Andrew C. Yao. The complexity of nonuniform random number generation. In Joseph F. Traub, editor, Algorithms and Complexity: New Directions and Recent Results, pages 357–428. Academic Press, New York, 1976.
[Liu23] Kuikui Liu. 6.S891 lecture 11: The polymer method and the cluster expansion, October 2023. Lecture notes, October 17, 2023; see Question 2, page 9. URL: https://kuikuiliu.github.io/files/au2023/6S891-lec11.pdf.
[LL01] Elliott H. Lieb and Michael Loss. Analysis, volume 14 of Graduate Studies in Mathematics. American Mathematical Society, Providence, RI, second edition, 2001. doi:10.1090/gsm/014.
[LL15] Jingcheng Liu and Pinyan Lu. FPTAS for #BIS with degree bounds on one side. In Proceedings of the 47th Annual ACM Symposium on Theory of Computing (STOC 2015), pages 549–556, 2015. doi:10.1145/2746539.2746598.
[LLLM22] Chao Liao, Jiabao Lin, Pinyan Lu, and Zhenyu Mao. An FPTAS for the hardcore model on random regular bipartite graphs. Theoretical Computer Science, 929:174–190, 2022. doi:10.1016/j.tcs.2022.07.001.
[LMN93] Nathan Linial, Yishay Mansour, and Noam Nisan. Constant depth circuits, Fourier transform, and learnability. Journal of the ACM, 40(3):607–620, 1993. doi:10.1145/174130.174138.
[Lov83] László Lovász. Submodular functions and convexity. In Achim Bachem, Martin Grötschel, and Bernhard Korte, editors, Mathematical Programming: The State of the Art (Bonn, 1982), pages 235–257. Springer, Berlin, 1983. doi:10.1007/978-3-642-68874-4_10.
[Moi19] Ankur Moitra. Approximate counting, the Lovász local lemma, and inference in graphical models. Journal of the ACM, 66(2):1–25, 2019. Preliminary version in Proceedings of the 49th Annual ACM SIGACT Symposium on Theory of Computing (STOC), 2017, pages 356–369. doi:10.1145/3268930.
[MWW09] Elchanan Mossel, Dror Weitz, and Nicholas Wormald. On the hardness of sampling independent sets beyond the tree threshold. Probability Theory and Related Fields, 143(3-4):401–439, 2009. doi:10.1007/s00440-007-0131-9.
[MY26] Tianshun Miao and Yitong Yin. Sampling matchings in near-linear time, 2026. URL: https://arxiv.org/abs/2609.21936, arXiv:2609.21936, doi:10.48550/arXiv.2609.21936.
[NJLS09] Arkadi Nemirovski, Anatoli Juditsky, Guanghui Lan, and Alexander Shapiro. Robust stochastic approximation approach to stochastic programming. SIAM Journal on Optimization, 19(4):1574–1609, 2009. doi:10.1137/070704277.
[NPWW26] Ijay Narang, Will Perkins, Yuzhou Wang, and Timothy L. H. Wee. Computational thresholds for balanced and fixed-slice independent sets in bipartite graphs, 2026. Preprint, arXiv:2608.02503. URL: https://arxiv.org/abs/2608.02503.
[O'D14] Ryan O'Donnell. Analysis of Boolean Functions. Cambridge University Press, New York, 2014. Numbering follows arXiv:2105.10386. doi:10.1017/CB09781139814782.
[Ope26] OpenAI. The Exponential Time Hypothesis is false, 2026. Research manuscript, revised October 25, 2026. URL: https://github.com/openai/math/blob/main/preprints/The-Exponential-Time-Hypothesis-is-False-October-25-2026/build/main_full_version.tex.
[PB83] J. Scott Provan and Michael O. Ball. The complexity of counting cuts and of computing the probability that a graph is connected. SIAM Journal on Computing, 12(4):777–788, 1983. doi:10.1137/0212053.
[Per20] Will Perkins. Counting and sampling algorithms at low temperature. Talk at the STOC workshop “New Frontiers in Approximate Counting”, 2020. Slides; see slide 29, “Open Questions”. URL: https://homepages.inf.ed.ac.uk/hguo/slides/STOCworkshop-Will.pdf.
[Ris16] Andrej Risteski. How to calculate partition functions using convex programming hierarchies: Provable bounds for variational methods. In COLT, volume 49 of PMLR, pages 1402–1416, 2016. URL: https://proceedings.mlr.press/v49/risteski16.html.
[Ros52] Murray Rosenblatt. Remarks on a multivariate transformation. The Annals of Mathematical Statistics, 23(3):470–472, 1952. doi:10.1214/aoms/1177729394.
[Ruo12] Nicholas Ruozzi. The Bethe partition function of log-supermodular graphical models. In Advances in Neural Information Processing Systems, volume 25, 2012. URL: https://proceedings.neurips.cc/paper_files/paper/2012/file/03afdbd66e7929b125f8597834fa83a4-Paper.pdf.
[SB16] Tatiana Shpakova and Francis Bach. Parameter learning for log-supermodular distributions. In Advances in Neural Information Processing Systems 29 (NIPS), 2016. arXiv:1608.05258. URL: https://arxiv.org/abs/1608.05258.
[SJ89] Alistair Sinclair and Mark Jerrum. Approximate counting, uniform generation and rapidly mixing Markov chains. Information and Computation, 82(1):93–133, 1989. doi:10.1016/0890-5401(89)90067-9.
[Sok05] Alan D. Sokal. The multivariate Tutte polynomial (alias Potts model) for graphs and matroids. In Bridget S. Webb, editor, Surveys in Combinatorics 2005, volume 327 of London Mathematical Society Lecture Note Series, pages 173–226. Cambridge University Press, 2005. arXiv:math/0503607. doi:10.1017/CB09780511734885.009.
[SS14] Allan Sly and Nike Sun. Counting in two-spin models on d-regular graphs. The Annals of Probability, 42(6):2383–2416, 2014. doi:10.1214/13-AOP888.
[Wei06] Dror Weitz. Counting independent sets up to the tree threshold. In Proceedings of the 38th Annual ACM Symposium on Theory of Computing (STOC 2006), pages 140–149, 2006. doi:10.1145/1132516.1132538.
[WJ08] Martin J. Wainwright and Michael I. Jordan. Graphical models, exponential families, and variational inference. Foundations and Trends in Machine Learning, 1(1-2):1–305, 2008. doi:10.1561/2200000001.
[WWZ19] Dian Wu, Lei Wang, and Pan Zhang. Solving statistical mechanics using variational autoregressive networks. Physical Review Letters, 122:080602, 2019. URL: https://arxiv.org/abs/1809.10606, doi:10.1103/PhysRevLett.122.080602.
A Algorithmic and bit implementation details
We first give the quantitative conversion promised in Proposition 2.1, then implement the algorithm with bit operations and independent fair random bits.
Conventions. In the exact-arithmetic algorithm, a fixed rule resolves bin and transition boundaries. Integer indices are obtained by comparisons and binary search, with the logarithm of their range charged to the operation count. The bit implementation uses the following conventions. Integers are encoded in binary, and a rational by its numerator and denominator. Arithmetic, comparisons and memory access are charged by bit complexity. Every loop, transition and evaluation has a predetermined cap, so all bounds hold on every execution. There is no transcendental primitive: logarithms of rationals and the constant log 2 are computed to absolute error , with certified error bounds, in time polynomial in and the input length [BZ10]. The evaluator returns for every configuration x as a rational whose numerator and denominator have at most B bits, in at most bit operations. Accuracy and failure-probability parameters are rationals, and denotes the total length of their encodings. Each is first rounded down to a power of two, within a factor two, at cost poly( ).
Theorem A.1 (Bit model). When the cost counts bit operations and fair random bits, Theorems 1.1 and 1.2 and Corollary 2.3 hold for rational accuracy and failure-probability parameters with the same exponential factors and with the polynomial factors multiplied by poly( ). On every execution the sampler of Theorem 1.2 returns a configuration, that of Theorem 1.1 an independent set, and the counters and additive estimator return rationals.
A.1 Quantitative conversion from coarse estimates
Keep the tree and residual notation of Section 2.1. We give the tree walk and the failure-probability and time bounds used in Proposition 2.1. The conversion is classical [JVV86, SJ89]; we track the constants because the ratio between estimates and masses, the distortion of (A.1) below, is superpolynomial and its exponent enters the main bound, and because Appendix A.3 needs explicit caps. The walk is that of Sinclair and Jerrum [SJ89, Section 4], and Lemma A.3 states the weighted form of their bounds that we use.
Counting from residual samples
Proposition A.2 (Counting from the sampler). Suppose that the residual law of every node can be sampled within total variation distance at cost . Then relative counting of with error and failure probability costs on every execution.
Proof. Put . For , with the prefix already chosen, draw samples from the residual law of within total variation distance , each with fresh randomness. Let be the more frequent value of coordinate among them, with ties broken toward zero, and let be its frequency. Return .
With , the chain rule (2.2) gives exactly. Conditional on the earlier choices, each value of coordinate has a sampled frequency whose mean is within of its conditional probability. By Hoeffding's inequality [Hoe63], a further deviation larger than has probability at most . The two frequencies are complementary, so with probability at least every level has , and then . The logarithm is 3-Lipschitz on , so
and for . On every execution , so is finite. The algorithm makes exactly sampler calls, each of cost , and one evaluation of .
The Sinclair–Jerrum walk. As explained in Section 2.2, Sinclair and Jerrum [SJ89, Section 4] replace the one-way descent by a reversible walk on the tree. Suppose that every node carries a mass estimate and that, for a distortion ,
No estimate is required to equal the sum of the estimates of its children. For depth(v) < d the estimates determine the conditional marginal probabilities only within the factor , , so a descent driven by them loses a factor at every level. The walk avoids this loss.
As in [SJ89, (8)–(10)], give the edge between a node and its parent the weight , the estimate at its lower endpoint, and give every node v the weighted degree
(A.2) the total weight of its edges, which Sinclair and Jerrum write . Let . The walk holds with probability and otherwise moves along an edge at the current node, chosen with probability proportional to its weight:
Exact leaf weights make its stationary law, conditioned on the leaves, equal to ; the distortion affects only the mixing time and the stationary probability of the leaves.
Lemma A.3 (Sinclair–Jerrum walk). Consider any rooted tree whose leaves all have depth , with the chain and the notation above defined on it. Give each leaf a weight , let be the sum of the weights of the leaves below , and suppose that at every node and at every leaf. Put and , and let be the set of leaves. Then is reversible with stationary law ; moreover , , at each leaf , and, for ,
Proof. Every estimate is within the ratio of its mass, and every leaf carries its exact weight. The proofs of [SJ89, (11), Lemma 4.1 and Lemma 4.2] use only these two facts and the disjointness of the subtrees at each depth, so they hold verbatim with the number of leaves below a node replaced by its mass and with their depth equal to our . They give the stationary law, , and conductance at least , half of whose square is . The conditional leaf law follows from . By [SJ89, (12)] with leaf weights, , while , the sum over the children of the root; hence . Finally, the chain holds with probability , and it is ergodic because every is positive, so [SJ89, Theorem 3.4], applied with the set in the role of their , gives . By reversibility, , so by the Cauchy–Schwarz inequality , which proves (A.3).
Additive estimates and a cached table. Assume the estimator guarantee (2.3) of Section 2.2, with the same additive error bound b for all nodes.
Proposition A.4 (Sampling from additive estimates). Given (2.3), for every there is a sampler within total variation distance of , and one within of the residual law of every node . Every execution uses at most operations and uniform draws.
Each sampler invocation, including each call in Proposition A.2, uses fresh randomness and an initially empty cache. Within an invocation, cache the first answer of the estimator for each node v and set
At a leaf the estimate is the exact weight . On the success event in (2.3) these estimates satisfy (A.1), and on every execution, including a failure of the estimator, they are positive.
For the analysis, assign an independent seed of the estimator to each of the fewer than nodes, with ; then with probability at least all estimates satisfy (A.1). The algorithm builds this table lazily: it generates a seed and stores the resulting estimate on the first request for a node, as in the implementation that remembers earlier answers [SJ89, Remark after
Theorem 4.5, pp. 118–119]. The seed for each new node is independent of all previous randomness, even when requests are adaptive, so deferred generation has the same law as the complete table. Since , each request costs .
Proof of Proposition A.4. Use the cached mass estimates (A.4) and the chain of Lemma A.3 with leaf weights , and choose integer caps
Run independent chains from the root for steps each, sharing the same cache and using fresh transition randomness. Return the configuration of the first endpoint that is a leaf, and the all-zero configuration if none is a leaf.
Condition on a table for which (A.1) holds. By Lemma A.3 the endpoint law of every chain is within of . Each chain ends at a leaf with probability at least , and
The first leaf endpoint has the conditional law . The probability of no leaf endpoint is at most , and a bad table adds at most , so the total variation error is smaller than . Each transition is implemented exactly: one uniform draw selects the hold event and, if needed, an edge by cumulative comparison of the positive edge weights. For the residual law of a node of depth less than , run the same construction on the subtree below . Lemma A.3 applies to it with leaves at depth . Its constants and are no larger than those of the whole tree, so the same caps suffice. At a leaf the residual law is a point mass, returned exactly.
There are poly transitions and at most new requests, each costing . Mass estimates are stored in a binary trie keyed by the prefixes, and the current path is kept on a stack, so lookups and updates take poly(d) operations. The integer caps are found by doubling and binary search in operations. These bounds hold on every execution, regardless of failures of the estimator.
Together, Propositions A.2 and A.4 prove Proposition 2.1.
A.2 Finite-precision arithmetic and bounded random choices
Two standard lemmas replace exact uniform draws.
Lemma A.5 (Accumulated simulation error). Consider a randomized procedure with at most sequential steps. If, conditional on every common past, the ideal and the implemented step have output laws at total variation distance at most , then the final outputs are at total variation distance at most .
Proof. Couple each pair of steps maximally while the histories agree. By a union bound, the histories disagree with probability at most , and otherwise the outputs coincide.
Lemma A.6 (Finite choices from fair bits). Let be positive rationals whose numerators and denominators have at most bits, and let . Using fair bits and bit operations one can draw an index whose law is within total variation distance of .
Proof. Read the bits as a grid point and return the least with , by exact integer cross multiplication. For uniform on , this agrees with the inverse transform of unless the cell contains one of the interior cumulative boundaries.
Without truncation, fair bits generate such choices exactly with a random number of bits [KY76]; the truncation makes the cost bounded on every execution.
A.3 Finite-precision optimization and simulation
The estimator. At a node whose residual has free coordinates, run the generic estimator of Theorem 4.1 with in place of 1/64. Choose a known bound on the objective gap, and choose a degree after the rounded parameter of item (b) below has been computed. For threshold smoothing use and ; for ordinary resampling use the rational bound and . These choices satisfy the required tail bound with the rounded of item (b); if , the tail vanishes. Make the following further changes.
(a) Each bin is read from 2s fair bits, since .
(b) Each bin score is replaced by a dyadic rational with , computed from certified values of . In the definitions of and in (4.1), is replaced by the integer , so that ; in (4.10), is replaced by the larger integer . All parameters are then integers or rationals computed exactly.
(c) The residual weight is formed exactly, a rational whose numerator and denominator have at most 2B bits. Each value , entering the potential term is computed to absolute error on a common dyadic grid, and is exact.
(d) Let be the power of two with , take steps, and return , clamped as before, where averages the computed sample values.
Soundness is unchanged: for the clipped guide of the proof of Lemma 4.3, because , so the objective with scores is at most for every candidate. In the proof of Lemma 4.4, the rounded scores lower the objective at , which takes values in , by at most . The truncation step is unchanged, because is defined from the new , which bounds . The losses are from score rounding, from the bins, and from truncation, totaling . Thus .
In the analysis below, denotes the objective with the dyadic scores and the exact potential . Write the potential term as , where and . The first differences are nonnegative, and
Thus errors of at most in the values change the computed sample objective at by at most , and each chain increment by at most .
Rounded values need not define a supermodular potential. For a fixed sorted chain, let be the supergradient obtained from the exact potential increments and let be the computed vector. A computed row slope has magnitude at most
so the bounds (4.7) remain valid, and
Since , the additional term in the distance recursion contributes at most to (4.9). Consequently
and Markov's inequality gives with probability at least 3/4.
Validate as in (4.10). Let be the validation average using the exact potential values in attempt . The computed average satisfies
With probability at least , every differs from by at most . On this event every corrected value is at most .
With probability at least , some ascent attempt satisfies . On the intersection of the two events, the largest corrected validation value is at least
The logarithms need bits of precision beyond the input length, the iterates stay on a common dyadic grid in , and the cost is (4.3), now in bit operations and fair bits.
Additive estimation. To implement Corollary 2.3, let be the rounded dyadic accuracy, with , and choose the largest power of two with . Integer comparisons find it, and . Run the preceding estimator at the root with and the rounded failure probability, and compute a rational satisfying by certified logarithm evaluation. Return the sum of and the estimate at the root. With probability at least ,
Since , the exponential factor is unchanged; the additional logarithm uses poly bit operations.
The walk. Let , so that , compute a rational with , and use the mass estimates
and at leaves. Then , so on the success event , and on every execution the estimates are positive rationals of polynomial length. Lemma A.3 applies with the power of two . With , take the integer caps , and , and the estimator failure probability . Each transition draws the hold event with one fair bit and an edge among at most three by Lemma A.6 with bits. Each step then has error at most , so by Lemma A.5 the bit model adds at most to the error budget in the proof of Proposition A.4, and the total stays below .
Counting. Proposition A.2 calls this sampler at accuracy , rounded down to a power of two, and computes with integer logarithms. The frequencies are rationals with denominator and are at least , so is a rational of polynomial length on every execution.
Proof of Theorem A.1. The additive-estimation construction above proves Corollary 2.3 in the bit model. For Theorem 1.2, the balance is unchanged, with and as in its proof: is a power of two found by integer comparisons, and the degree makes each estimator call cost
bit operations and fair bits. The ordinary-resampling choice likewise gives the square-root bound of Corollary 5.2 in the bit model: take the power of two of that proof, give the walk the rational additive error bound , and use the corresponding degree . In the enumeration case the weights are summed exactly, with bits, and a configuration is drawn by Lemma A.6 with and , within . For Theorem 1.1, the weights (1.2) are integers with at most bits, and the completion by a uniform subset of uses at most fair bits.