The permanent of a matrix is a sum of the same products the determinant uses, but with every sign positive. Without signs to cancel, computing it exactly is #P-hard, so practical estimators sample. The best estimators with provable accuracy, rejection samplers and importance samplers built on "nesting" upper bounds, work by splitting the problem recursively. They assign the first few rows to columns, bound each resulting submatrix from above, and sample in proportion to those bounds. Splitting deeper tightens the bound and wastes fewer samples, but the upfront work grows exponentially with depth. Today that depth is a hand-set constant: DeepAR is tuned to around 20 and DEEPNIS is fixed at 16. This is a granularity tradeoff of the same kind studied for step-by-step reasoning, where splitting too coarsely forces large errors and splitting too finely piles up overhead. The optimum sits at an interior point that depends on the instance.
We propose to pick that depth, and ultimately a non-uniform splitting tree, automatically for each matrix. The decision is driven by a cost model whose one unknown quantity, the true permanent, is estimated with the Bethe approximation, a cheap convex relaxation from statistical physics. Its error against the true permanent is now provably at most a factor of $\sqrt{2^n}$ on non-negative matrices. The claim is that a certified relaxation makes granularity selection a principled, nearly free, instance-adaptive computation. We further claim it should match or beat the best hand-tuned fixed depth, including the cost of tuning, across real network matrices and adversarial synthetic ones.
Core Claim
Let $U_d$ be the depth-$d$ nesting upper bound at the root, $\mathrm{per}(A)$ the permanent, and $c_0$ the per-sample cost. The total expected cost of a rejection-style estimator is approximately
$$T(d) \approx C_{\text{pre}}(d) + c_0 \, k(\epsilon,\delta)\, \frac{U_d}{\mathrm{per}(A)},$$
where $C_{\text{pre}}(d)$ is the bound-construction cost and $k(\epsilon,\delta)$ is the number of accepted samples the stopping rule needs. For DeepAR, $C_{\text{pre}}(d) = O(2^d d n)$ (Approximating the Permanent with Deep Rejection Sampling). The ratio $U_d/\mathrm{per}$ is the expected number of draws per acceptance. For importance sampling it controls the variance (Estimating the Permanent by Nesting Importance Sampling).
The observation that makes adaptive depth feasible is that $U_d$ is computed exactly as $d$ increases, so the only unknown is $\mathrm{per}(A)$. That unknown is shared across all depths, so it sets the scale of the tradeoff but not its shape. The Bethe permanent supplies this scale with a guarantee. A Tight Analysis of Bethe Approximation for Permanent proves $\mathrm{bethe}(A) \le \mathrm{per}(A) \le \sqrt{2^n}\,\mathrm{bethe}(A)$. Plugging in $\mathrm{bethe}(A)$ therefore overestimates sampling cost, which errs toward deeper splitting and never toward running a sampler with an unaffordable rejection rate.
The resulting rule is simple: deepen while the predicted saving in sampling time exceeds the added construction time. We then refine the permanent estimate online from the first samples, so the rule tightens as evidence arrives.
The second, more ambitious claim concerns shape. A uniform depth is itself too coarse a granularity choice. Some branches of the partition tree are nearly tight after two levels, while others stay loose after twenty. We will grow a non-uniform frontier, expanding the node with the largest estimated slack $U(S)/\mathrm{bethe}(S)$, weighted by its share of the root bound, until the cost model says to stop.
Relation to Prior Work
Three sampler papers motivate the gap directly.
- DeepAR (Approximating the Permanent with Deep Rejection Sampling) introduces depth-$d$ pre-tightened bounds and exposes the depth tradeoff. It leaves $d$ manual and analyzes runtime only at $d=0$.
- DEEPNIS (Estimating the Permanent by Nesting Importance Sampling) turns nesting bounds into importance sampling with rigorous stopping and $\epsilon^{-1}$ efficiency in tight regimes. It hardcodes depth 16.
- ADAPART (Approximating the Permanent by Sampling from Adaptive Partitions) is the closest precedent for adaptivity. It chooses which column to split greedily, one step at a time, to reduce the slack of the Soules bound.
We differ from ADAPART in two ways. We choose how far to split under an explicit cost model, rather than which column to split next. And our slack estimate uses a relaxation with a certified two-sided error, which ADAPART does not use.
Two papers constrain the design.
- Degree-M Bethe and Sinkhorn Permanent Based Bounds on the Permanent of a Non-Negative Matrix shows that finer "cover" granularity tightens Bethe-type bounds but is intractable for finite $M>1$. We therefore use only the plain Bethe and Sinkhorn quantities, never higher covers.
- DeepAR's finding that the Brouwer–Schrijver bound fails to nest warns that correctness must be preserved. Bethe itself is a lower bound and is not a sampling proposal. We use it only to decide granularity, so the sampler's guarantee is untouched.
The method comes from two sources. The relaxation theory is A Tight Analysis of Bethe Approximation for Permanent, with the unified max-entropy view of On Convex Programming Relaxations for the Permanent, which places Sinkhorn/capacity ($e^n$) and Bethe ($2^n$) in one family and so offers a cheaper fallback proxy. The lens is the granularity literature. How does Chain of Thought decompose complex tasks? derives an interior optimal branching degree by balancing per-step error against accumulated error. Designing Algorithms Empowered by Language Models: An Analytical Framework, Case Studies, and Insights shows that costs in recursive decompositions compound multiplicatively with depth.
We borrow the analysis pattern from these papers, not their formulas. Their $m^* = e^{d/2}$ result assumes a classification error law that has no counterpart here. We test whether the permanent's depth tradeoff shows the same interior optimum, and whether that optimum can be predicted from cheap per-instance quantities.
Research Program
The work has three parts.
Uniform adaptive depth. We instrument the DeepAR dynamic program so it emits $U_d$ for every $d$ up to a ceiling as a byproduct, and compute $\mathrm{bethe}(A)$ by belief propagation. We then apply the stopping rule. The key analytical question is how much regret the rule incurs, since the Bethe error can be as large as $2^{n/2}$. We will bound the regret in terms of the realized ratio $\mathrm{per}/\mathrm{bethe}$ and show the online refinement removes most of it after a small number of samples.
Non-uniform frontiers. A frontier of a partition tree, with nesting leaf bounds, yields a root bound equal to the sum of the leaf bounds. We must prove this frontier bound still nests when the sampler descends through nodes whose subtrees were expanded to different depths, and establish when it does. The practical risk is that DeepAR's $O(2^d d n)$ dynamic program exploits uniform depth. A non-uniform frontier may need memoization over column subsets, and we will measure whether that overhead erases the gain.
Explaining two open anomalies. The same slack diagnostics may explain two open puzzles. The first is why Sinkhorn preprocessing helps on network graphs but hurts on Bernoulli matrices in DeepAR. The second is why the naive row-sum bound converges fast in DEEPNIS. Both can be read as statements about how $U_d/\mathrm{per}$ decays with $d$ under different preprocessing, and our logs measure that decay directly.
Baselines
Default fixed depth. The naive reference is each sampler at its published default: DeepAR at its recommended depth and DEEPNIS at depth 16 with extended Huber bounds and Sinkhorn balancing. All methods use the same implementation, hardware, error tolerance, and failure probability. Beating it means lower total wall-clock time, including our Bethe computation, at identical $(\epsilon,\delta)$ guarantees.
DEEPNIS at its default configuration. This is the strongest existing method. Estimating the Permanent by Nesting Importance Sampling reports DEEPNIS up to 115 times faster than DeepAR on cage5 at $\epsilon = 0.005$. No absolute per-instance DEEPNIS runtimes were found in the file, so we will rerun it ourselves. Our method wraps DEEPNIS with adaptive depth. Beating it means a median speedup above 1 across the benchmark suite, and no instance more than 1.5 times slower.
ADAPART. This is the adaptive competitor. Approximating the Permanent by Sampling from Adaptive Partitions reports a log upper bound of 20.1 versus Sinkhorn's 40.3 on bcspwr01, and 12x to 32x speedups over earlier samplers on network matrices. We compare on runtime and on the root bound achieved at equal construction time.
Pilot-tuned fixed depth. This ablation isolates the Bethe ingredient. It spends a small fixed budget of pilot samples at a few depths to estimate acceptance rates, then commits to the best. It is charged for its pilot time.
Oracle depth. The best fixed depth found by exhaustive search, not charged for the search, is the ceiling. It measures how much of the achievable gain we capture.
Proxy swap. The same controller runs with the Sinkhorn/capacity proxy instead of Bethe. This tests whether Bethe's tighter guarantee matters in practice.
Why not just…?
Why not just tune the depth once per matrix family? On homogeneous synthetic ensembles this may work nearly as well. We will report that honestly, and the family-tuned depth is included as a baseline. But DeepAR's own observation that one preprocessing choice helps on graphs and hurts on Bernoulli matrices suggests that the optimal granularity shifts with structure in ways a family label does not capture. The per-instance variance of the oracle depth across the Network Data Repository instances will show whether per-matrix adaptivity matters.
Why not just run short pilot samplers at several depths? This is the real threat. Pilot acceptance rates measure $U_d/\mathrm{per}$ directly. On hard instances like staircase matrices, however, acceptance at shallow depths is so low that pilots return almost no information without costing as much as the run itself. Bethe gives a scale estimate in polynomial time regardless of how bad the rejection rate is. The pilot baseline is charged for its pilot time. If it matches us everywhere, the contribution reduces to the non-uniform frontier, and we will say so.
Why not just use ADAPART's greedy splitting with a better bound? Greedy one-step slack reduction does not account for exponentially growing construction cost, so it cannot decide when to stop splitting. It also ignores whether a split that looks locally good leaves an expensive subtree. Comparing root bounds at equal construction time against ADAPART will show whether the cost-aware horizon matters.
Proposed Experiments
The benchmarks follow the three sampler papers. We use Network Data Repository matrices (The Network Data Repository with Interactive Graph Analytics and Visualization), including cage5, bcspwr01 and ENZYMES. The synthetic ensembles are staircase matrices, Bernoulli $\mathcal{B}(n,p)$ across densities, uniform $[0,1]$ matrices, and the block-diagonal family on which Bethe is off by exactly $\sqrt{2^n}$. The block-diagonal family is the adversarial case for our proxy and must be reported separately. Where exact permanents are feasible, at small $n$, we also verify coverage of the $(\epsilon,\delta)$ intervals.
The metrics are:
- total wall-clock time to the guarantee;
- the ratio of our time to oracle-depth time;
- the chosen depth versus the oracle depth;
- the fraction of runtime spent computing the proxy.
Three checks are decisive. First, measuring $T(d)$ across a sweep of depths on each instance must show an interior minimum, the U-shape the granularity literature predicts; if cost is monotone in depth, the problem dissolves. Second, the Bethe-guided rule must land within a small factor of oracle time on network matrices, and beat pilot tuning on staircase matrices. Third, on the block-diagonal worst case, online refinement must recover from the proxy's maximal error within a bounded number of samples.
A secondary analysis regresses the per-depth slack decay against Sinkhorn preprocessing and matrix density to test whether our measurements explain the Bernoulli-versus-graph anomaly.
References
- Approximating the Permanent with Deep Rejection Sampling
- Estimating the Permanent by Nesting Importance Sampling
- A Tight Analysis of Bethe Approximation for Permanent
- Approximating the Permanent by Sampling from Adaptive Partitions
- Degree-M Bethe and Sinkhorn Permanent Based Bounds on the Permanent of a Non-Negative Matrix
- On Convex Programming Relaxations for the Permanent
- How does Chain of Thought decompose complex tasks?
- Designing Algorithms Empowered by Language Models: An Analytical Framework, Case Studies, and Insights
- The Network Data Repository with Interactive Graph Analytics and Visualization