Abstract
Verifying the correctness of samplers in high-dimensional spaces is a fundamental challenge in randomized algorithms. Traditional black-box testing requires a sample complexity that scales exponentially with the number of dimensions. This paper presents CubeProbeEst, the first efficient algorithm designed to estimate the statistical distance of "self-reducible" samplers from a target distribution. By exploiting the self-reducible property and employing sub-cube conditioning, the algorithm achieves a quadratic sample complexity ($O(n^2)$), making the verification of complex combinatorial samplers—such as those for linear extensions in partially ordered sets (posets)—computationally feasible.
Introduction
Randomized algorithms are ubiquitous in modern computing, serving as the backbone for machine learning, privacy-preserving data analysis, and complex simulations. These algorithms rely on samplers to draw representative points from vast, high-dimensional spaces. However, if a sampler is biased, the integrity of the entire downstream analysis is compromised. Testing the fairness of a sampler in an $n$-dimensional space is notoriously difficult because the number of possible outcomes ($2^n$) grows exponentially, precluding simple frequency counting.
While existing tools like Barbarik have addressed specific sampler types, they often rely on specialized gadgets that lack generality. Specifically, they fail for critical combinatorial problems like sampling perfect matchings in graphs or linear extensions in posets. This work introduces a "grey-box" testing framework that leverages the internal structure of self-reducible samplers to break the exponential curse.
Methodology: The CubeProbeEst Algorithm
The core contribution of this work is CubeProbeEst, an algorithm designed for self-reducible samplers. A sampler is considered self-reducible if it generates samples bit-by-bit, where each step involves solving a smaller instance of the same problem.
The algorithm utilizes three primary techniques:
- Sub-cube Conditioning: Instead of observing raw output, the tester queries the sampler to provide samples conditioned on specific bit prefixes (e.g., "provide a sample where the first three bits are 1, 0, 1").
- Probability Estimation (GBAS): The Gamma Bernoulli Approximation Scheme is used to estimate the marginal probability of each bit. A key technical insight is that the estimation error follows a Sub-Gaussian distribution, allowing errors to remain bounded when aggregated.
- The Chain Rule: By estimating conditional probabilities for each bit, the algorithm reconstructs the total probability mass of a specific sample $x$ without requiring the massive sample sizes needed for direct observation.
CubeProbeEst calculates the Total Variation Distance ($d_{TV}$) between the sampler under test and a "gold standard" distribution. Additionally, the authors provide CubeProbeTester, a tolerant identity tester that distinguishes between samplers that are approximately correct and those that are significantly biased.
Experimental Evaluation
The framework was evaluated on three classes of Poset instances:
- avgdeg_k: Derived from directed acyclic graphs with average indegrees of 3 and 5.
- bipartite_p: Generated from bipartite sets with random order constraints.
- bayesiannetwork: Derived from real-world Bayesian network subgraphs.
The researchers tested three state-of-the-art linear extension samplers: LxtQuicksampler, LxtSTS, and LxtCMSGen.
Key Results
The experiments demonstrated that LxtSTS is the most robust sampler, maintaining a low $d_{TV}$ across various poset types. In contrast, LxtQuicksampler showed significant bias as the number of dimensions increased, a trend that would be invisible to traditional testing methods.
Crucially, the algorithm successfully processed 90 different instances, often requiring millions of samples but completing within a 12-hour window. This performance confirms the efficiency of the $O(n^2)$ complexity compared to the impossible $2^n$ requirement of naive testers.
Conclusion and Future Work
CubeProbeEst represents a significant leap in sampler verification, moving from binary "Pass/Fail" results to quantitative distance estimation. This allows engineers to make informed decisions about which sampler to deploy for specific high-stakes tasks.
However, the requirement for self-reducibility remains a limitation, as purely "black-box" samplers cannot be tested with this method. Future research may focus on further optimizing the sample complexity toward the theoretical lower bound of $\Omega(n/\log n)$ and reducing the constant factors that currently necessitate large sample sizes for high-precision testing.
Summary updated