Perfect Sampling from Pairwise Comparisons

Dimitris Fotakis, Alkis Kalavasis, Christos Tzamos

This NeurIPS 2022 paper, "Perfect Sampling from Pairwise Comparisons," by Dimitris Fotakis, Alkis Kalavasis, and Christos Tzamos, tackles a fundamental challenge in probabilistic modeling: how to generate an exact, unbiased sample from a distribution when you can only observe how elements compare to one another.

TL;DR

The authors present the first efficient algorithm for "perfect sampling" from a discrete distribution using only pairwise comparison data (e.g., "item A is preferred over item B"). By combining a preliminary learning phase with a re-weighted Markov chain and the "Coupling from the Past" technique, they achieve polynomial sample complexity that depends on the connectivity of the comparison graph rather than the potentially "peaky" structure of the underlying distribution.

What Problem Does This Paper Address?

In many real-world scenarios—from consumer preferences to sports rankings—we don't have direct samples from a distribution $D$. Instead, we have access to a Local Sampling Scheme (LSS): we pick two items, $u$ and $v$, and see which one "wins." Under the standard Bradley-Terry-Luce (BTL) model, the probability that $u$ beats $v$ is proportional to their relative weights in the underlying distribution.

While researchers have extensively studied how to learn (estimate) the distribution from these comparisons, sampling from it is equally vital for applications like simulations and randomized algorithms. Most existing methods rely on "approximate sampling" via Markov Chain Monte Carlo (MCMC). However, MCMC has two major flaws:

  1. No clear stopping rule: It’s hard to know exactly when the chain has "mixed" enough to be close to the true distribution.
  2. The "Landscape" Problem: If the distribution is multimodal (has multiple peaks) or contains very low-probability regions, a standard Markov chain can take an exponential amount of time to move between states.
A synthetic "bad instance" featuring a bimodal distribution where standard Markov chains struggle to mix efficiently.

The authors aim for perfect sampling, which provides a definitive stopping criterion and guarantees the output is drawn exactly from the target distribution.

Methods

The paper builds on Coupling from the Past (CFTP), a classic algorithm that uses a Markov chain to produce exact samples. The authors' contribution lies in making CFTP efficient for pairwise comparisons through a three-step process:

  1. The Learning Phase: They first use an existing efficient algorithm to get a "good enough" approximation $\tilde{D}$ of the true distribution $D$. This approximation doesn't need to be perfect; it just needs to capture the general shape of the distribution.
  2. The Re-weighting (Bernoulli Factory): This is the "secret sauce." They design a new, parametric Markov chain. Using the estimate $\tilde{D}$, they use a "Bernoulli downscaling" technique to adjust the transition probabilities. This effectively "flattens" the distribution's landscape, making the stationary distribution of this modified chain almost uniform.
  3. CFTP + Rejection Sampling: Because the flattened chain mixes much faster (its speed depends on the comparison graph's connectivity, not the distribution's peaks), they can run CFTP to get an exact sample from this modified distribution. Finally, they use rejection sampling to "correct" the sample back to the original distribution $D$.

Key Insights and Ideas

  • Approximation for Perfection: A counter-intuitive insight is that you can use an approximate estimate of a distribution to build a perfect sampler. Usually, approximations lead to approximate results, but here the approximation is used only to optimize the speed of the Markov chain, while the rejection sampling step ensures the accuracy remains absolute.
  • Spectral Gap vs. Distribution Shape: The authors show that by re-weighting the chain, the bottleneck for sampling shifts from the "shape" of the distribution (which could be pathological) to the "connectivity" of the comparison graph (the Fiedler eigenvalue $\lambda(Q)$). If you compare a diverse enough set of items, sampling becomes efficient regardless of how skewed the preferences are.
  • Simulated Tempering Connection: The re-weighting technique draws inspiration from "simulated tempering," a method used in physics and statistics to help Markov chains escape local optima by effectively "heating up" the distribution to make it flatter.

Key Results

As a purely theoretical paper, the authors provide rigorous mathematical proofs of their algorithm's complexity rather than empirical benchmarks.

Table summarizing the sample complexity for exact sampling compared to approximate learning.
  • Efficiency: The proposed algorithm generates a perfect sample using an expected $\tilde{O}(n^2 / \lambda(Q))$ samples from the comparison oracle.
  • Polynomial vs. Exponential: For "bad" distributions where standard CFTP would take $O(\alpha^{-n})$ time (exponential in the number of items $n$), this new approach remains polynomial, provided the comparison graph is well-connected.
  • Generality: The technique for speeding up a Markov chain when the stationary distribution is approximately known is general and could potentially be applied to sampling problems outside of pairwise comparisons.

Limitations and Future Work

  • Tightness of Bounds: The authors note it is unclear if the $O(n^2 / \lambda(Q))$ bound is tight. There might be even faster algorithms (perhaps $O(n)$) that don't rely on random walks.
  • Comparison Graph Assumptions: The algorithm requires the comparison graph to be a spanning tree (identifiable). If some items are never compared to the rest of the set, the distribution cannot be recovered or sampled.
  • Empirical Validation: The paper lacks "wall-clock" performance metrics on real-world ranking data, which the authors suggest as a direction for future experimental work.

Summary updated

BibTeX
@inproceedings{fotakis2022perfect,
  author = {Dimitris Fotakis and Alkis Kalavasis and Christos Tzamos},
  title = {{Perfect Sampling from Pairwise Comparisons}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2022},
  url = {https://openreview.net/forum?id=RTz8HtoSxL},
}
Figure