BayesSum: Bayesian Quadrature in Discrete Spaces

Sophia Seulkee Kang, François-Xavier Briol, Toni Karvonen, Zonghao Chen

TL;DR

The paper introduces BayesSum, a novel framework that extends Bayesian quadrature to discrete domains to estimate intractable sums and expectations. By leveraging prior structural information about the integrand through a Gaussian process, BayesSum achieves significantly higher sample efficiency and faster convergence rates than traditional Monte Carlo methods.

What Problem Does This Paper Address?

Computing expectations over discrete domains is a fundamental challenge in statistics and machine learning. It frequently arises when dealing with unnormalized likelihood models—such as the Ising/Potts models in statistical physics and protein sequencing, or spatial point processes in ecology.

In these settings, calculating the expectation requires evaluating a sum that is either countably infinite or combinatorially explosive (e.g., all possible configurations on a lattice). Standard approaches like Monte Carlo (MC) sampling or Importance Sampling are consistent, but they converge slowly ($O(N^{-1/2})$) because they treat the integrand as a black box, completely ignoring structural properties like smoothness or sparsity. While advanced quadrature methods exist to exploit these properties in continuous spaces, analogous tools for discrete domains have been severely limited.

Methods

The authors propose BayesSum, which models the discrete integrand $f$ using a Gaussian Process (GP) prior. By conditioning this GP on a finite set of evaluated points, they obtain a posterior distribution over the total sum. The final estimate is a weighted linear combination of function evaluations, where the weights are optimally determined by the choice of a discrete kernel function and the probability mass function.

To make the method widely applicable, the authors introduce three key variants:

  1. BayesSum + Bayesian Quadrature (BQ): A formulation designed for mixed domains containing both continuous and discrete variables.
  2. Active BayesSum: An active learning strategy that sequentially selects the next query points by maximizing the expected information gain, minimizing posterior uncertainty.
  3. Stein BayesSum: For cases where the target probability distribution is only known up to a normalization constant, this variant utilizes discrete Stein kernels to bypass the need for explicit kernel mean embeddings.

The authors also provide a comprehensive dictionary of closed-form kernel mean embeddings for common discrete distributions (e.g., Poisson, Negative Binomial, and Uniform over discrete cubes).

Datasets

The method was evaluated on both synthetic benchmarks and realistic statistical modeling tasks:

  • Synthetic Data: Four toy settings including a Poisson distribution with a smooth integrand, a uniform distribution over a combinatorially large lattice, an unnormalized Potts model, and a mixed continuous-discrete domain.
  • Sales Dataset: A real-world dataset from Shmueli et al. (2005) used to evaluate parameter estimation for a Conway-Maxwell-Poisson (CMP) count data model.
  • Protein Sequence Data: A simulated dataset of 2,000 protein sequences of length 15, used to train a large, computationally demanding Potts model.

Key Insights and Ideas

  • Discrete Smoothness Exists: Smoothness isn't exclusive to continuous spaces. By carefully selecting discrete kernels (like the Hamming distance kernel for sequences or the Brownian motion kernel for counts), GPs can effectively exploit structural similarities in discrete spaces.
  • The "No-Replacement" Imperative: In continuous Bayesian quadrature, the probability of sampling the exact same point twice is zero. In discrete spaces, duplicate samples occur frequently. The authors demonstrate that sampling with replacement degrades performance because duplicate points yield singular Gram matrices and provide zero new information. Sampling without replacement is essential.
  • Bypassing Normalization with Stein Kernels: Stein BayesSum elegantly handles unnormalized distributions by utilizing partial difference operators, allowing researchers to compute accurate expectations even when the true probability weights are unknown.

Key Results

BayesSum consistently and significantly outperforms standard Monte Carlo, Russian Roulette, importance sampling, and stratified sampling across all tested scenarios.

Comparison of BayesSum against baselines on synthetic settings.

As shown in Figure 1, BayesSum achieves orders-of-magnitude lower absolute error for the same number of sample points. Quantitatively, the empirical convergence rate ($\alpha$, where error scales as $O(N^{-\alpha})$) for BayesSum reached as high as 7.322 in the Poisson setting, compared to the standard ~0.5 rate of Monte Carlo methods.

Furthermore, when integrated into gradient descent loops for parameter estimation in unnormalized models (CMP and Potts models), BayesSum provided much more accurate normalization constant estimates, leading to superior model convergence under identical computational budgets.

Limitations and Future Work

Despite its success, BayesSum carries a few limitations:

  • Computational Complexity: Like most GP-based methods, it scales cubically ($O(N^3)$) with the number of samples due to matrix inversion, though the authors note weights can be precomputed if they don't depend on the integrand.
  • The Curse of Dimensionality: The performance margin over Monte Carlo narrows as the dimensionality of the discrete space increases.
  • Theoretical Gaps: Formally establishing the exact convergence rates by mapping discrete Reproducing Kernel Hilbert Spaces (RKHSs) to discrete Sobolev spaces remains an open mathematical challenge.

Summary updated

BibTeX
@misc{kang2025bayessum,
  author = {Sophia Seulkee Kang and François-Xavier Briol and Toni Karvonen and Zonghao Chen},
  title = {{BayesSum: Bayesian Quadrature in Discrete Spaces}},
  year = {2025},
  eprint = {2512.16105},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2512.16105},
}
Figure