Noise-Driven Bandwidth Selection in Stein Samplers with Mini-Batch Scores

Stein variational gradient descent (SVGD) approximates a hard-to-sample distribution with a cloud of particles. It moves the particles using only the score, meaning the gradient of the log-density, so the unknown normalizing constant never has to be computed. How well it works depends heavily on one number: the bandwidth of the kernel that decides how strongly particles attract and repel each other. A recent fix chooses that bandwidth online by maximizing the kernel Stein discrepancy (KSD), a score-based measure of how far the particles are from the target. On large-data Bayesian problems, though, the score itself is estimated from a mini-batch of data. We argue that this combination has a hidden flaw. The KSD contains products of scores at pairs of particles. When both factors come from the same noisy mini-batch, the mini-batch noise does not average out. It adds a positive term to the estimated discrepancy, and that term grows as the bandwidth grows. The bandwidth selector therefore climbs toward wide kernels because of gradient noise, not because the particles fit the target poorly. A wide kernel weakens the repulsion between particles, which is exactly the regime where SVGD collapses and becomes overconfident.

The proposal is to measure this bias, to show that it drives bandwidth choice and posterior collapse on standard Bayesian benchmarks, and to remove it cheaply. The fix is a split-batch KSD estimator: each score factor in a pairwise product is computed from a different half of the same mini-batch. Because the two halves are independent, the product is unbiased, and the method uses no extra data gradients. If the diagnosis is right, the split-batch selector should keep Ad-SVGD's well-calibrated behavior when scores are noisy. The naive selector should drift toward large bandwidths and narrow posteriors, and the drift should get worse as the dataset grows relative to the batch.

Core Claim

Write the Stein kernel for a base kernel $k_\sigma$ with bandwidth $\sigma$ as $h_\sigma(x,x') = s(x)^\top s(x')\,k_\sigma(x,x') + s(x)^\top \nabla_{x'} k_\sigma + \nabla_x k_\sigma^\top s(x') + \mathrm{tr}(\nabla_x \nabla_{x'} k_\sigma)$, where $s = \nabla_x \log p$ is the target score. Suppose $s$ is replaced by a mini-batch estimate $\hat s = s + \xi$, with zero-mean noise $\xi$ drawn from one shared data batch for all particles. The terms that are linear in the score stay unbiased. The quadratic term does not. Averaged over particles $x_1,\dots,x_n$, the estimated squared KSD is inflated in expectation by

$$ B(\sigma) = \frac{1}{n^2}\sum_{i,j} k_\sigma(x_i,x_j)\, C(x_i,x_j), \qquad C(x,x') = \mathbb{E}\big[\xi(x)^\top \xi(x')\big]. $$

In Bayesian regression with $N$ data points and batch size $b$, the cross-covariance $C$ scales roughly like $N^2/b$ times the per-datum gradient covariance. For nearby particles it is positive. Since $k_\sigma \to 1$ as $\sigma$ grows, $B(\sigma)$ increases with bandwidth. The gradient of the naive KSD with respect to $\sigma$ therefore carries a systematic push toward wider kernels.

Averaging over iterations cannot remove this push, because it is a bias in expectation rather than variance. The split-batch estimator removes it. It computes $\hat s_A(x_i)^\top \hat s_B(x_j)$ from disjoint halves $A$ and $B$ and then symmetrizes, which gives $\mathbb{E}[\hat s_A^\top \hat s_B] = s^\top s'$ exactly. This is the same double-sampling logic that nested Monte Carlo analysis shows to be necessary for non-linear functions of expectations (On Nesting Monte Carlo Estimators). Here it is applied to the bilinear structure of the Stein kernel, where it happens to be exact and free.

Relation to Prior Work

The method we build on is Ad-SVGD (Adaptive Kernel Selection for Stein Variational Gradient Descent). It adapts per-dimension bandwidths by gradient ascent on the empirical KSD and reuses score evaluations already computed for the particle update. It fixes median-heuristic variance collapse on Gaussian targets and on a 16-dimensional ODE inverse problem. Its analysis assumes the kernel step is a valid ascent step on the true KSD, and it does not study mini-batch scores. That missing setting is precisely where our bias appears.

Two papers motivate the mechanism. Understanding the Variance Collapse of SVGD in High Dimensions shows that collapse comes from particles estimating their own driving force, and that the variance scales like $n/d$. It does not study how bandwidth choice feeds this. Our claim is that noise-inflated bandwidths are a second, independent route into the same collapse. On the Convergence of Stochastic Multi-Objective Gradient Manipulation and Beyond shows that computing weights and gradients from the same mini-batch biases the update, and it fixes this with an exponential moving average. We borrow the diagnosis, but we argue their remedy fails here. Our bias is present in the expectation of each step, so smoothing across steps preserves it.

Two further papers constrain the design. $\lambda$-PSD shows that maximizing a Stein discrepancy's magnitude can destroy its signal-to-noise ratio. That warns us that removing bias alone may not be enough when variance is large, so we test an SNR-normalized variant as a secondary arm. Kernel Stein Discrepancy Descent shows that KSD landscapes flatten under bad bandwidths. This is consistent with our prediction that inflated bandwidths degrade particle dynamics. Minimum Stein Discrepancy Estimators supplies the general Stein-operator view and uses stochastic Riemannian gradients, but it assumes exact scores. KSD Aggregated Goodness-of-fit Test avoids selecting a single kernel by aggregating over many. That approach is designed for testing on a fixed sample, not for particles that evolve during inference.

Research Program

The first part of the work is analysis. We will derive $B(\sigma)$ and its gradient with respect to $\sigma$ for RBF and product kernels under shared-batch score noise. For a Gaussian target with additive score noise of known covariance, we will compute in closed form the bandwidth the naive selector converges to. We will then predict the resulting particle variance by combining this with the $n/d$ analysis of Ba et al. The goal is a formula of the form "selected bandwidth versus noise level $N/b$", which the experiments can check directly.

The second part is the estimator. The split-batch KSD uses half-batches $A$ and $B$ inside the quadratic term and the full batch inside the linear terms, and it drops diagonal pairs $i=j$ in U-statistic form. It needs the same number of data-gradient evaluations as the naive estimator. Only how those gradients are combined changes.

We will build two further variants. One adds cross-fitting over particles: the bandwidth gradient is computed on one half of the particles while the other half is moved. This separates batch-noise bias from the particle self-reuse bias highlighted by Ba et al. The other replaces the magnitude objective with a ratio of the debiased KSD to its estimated standard deviation, following the Rayleigh-quotient logic of λ-PSD.

The third part is empirical and is described below. The main outputs are the bandwidth trajectory, the calibration of the posterior, and how both change as the noise level $N/b$ is swept.

Baselines

The naive reference point is SVGD with the median-heuristic bandwidth recomputed each iteration and mini-batch scores. The file documents its variance collapse in Melcher et al.. Every method gets the same particles, initialization, step-size schedule, iteration count, and total number of per-datum gradient evaluations.

The strongest existing method is Ad-SVGD run as published, with product-kernel bandwidths, but with its KSD computed from the same shared mini-batch scores used for the particle update. This is how a practitioner would deploy it on Covertype-scale data. On the 16-dimensional ODE inverse problem with exact scores, Ad-SVGD is reported to maintain the nominal 90% posterior interval coverage while median-heuristic SVGD is overconfident (Melcher et al.). The file gives no numeric width or coverage for the median baseline. For Covertype, no reported result was found on Lacuna for test log-likelihood or accuracy of Ad-SVGD; that paper shows only curves. We will therefore rerun Ad-SVGD with exact scores as a reference ceiling. Beating it means that, under mini-batch scores, the split-batch selector recovers coverage and marginal variance within noise of this exact-score Ad-SVGD, while naive mini-batch Ad-SVGD does not. The gap should widen as $N/b$ grows.

We also include Damped SVGD (Ba et al.), with its damping parameter tuned on a held-out grid of the same size as our tuning budget. It is the strongest non-kernel remedy for collapse. For sampling quality, we include MMD-descent, reported to hold variance at about 1.0 on isotropic Gaussians where SVGD's variance decays like $n/d$ (Ba et al.). It requires target samples, so it serves only as an oracle on the synthetic tasks.

Two ablations isolate the key ingredient. The first applies an EMA-smoothed Ad-SVGD bandwidth with shared batches, testing whether smoothing alone suffices. The second applies particle cross-fitting without batch splitting, testing whether the effect comes from data noise or from particle reuse.

Why not just…?

Why not just use a larger mini-batch for the kernel step? This is the real threat. The bias shrinks roughly as $1/b$, so a batch several times larger could make it negligible. We will answer it at equal compute: the split-batch estimator will be compared against naive Ad-SVGD given two, four, and eight times the gradient budget for the kernel step. If a modestly larger batch matches split-batch calibration on Covertype, the contribution shrinks to a diagnostic of how large $b$ must be, and we will report it that way. The theory predicts the required $b$ scales with $N$, which would make batch inflation unattractive on large datasets. We will state this only if the sweep confirms it.

Why not just smooth the bandwidth with a moving average, as CR-MOGM does for task weights? The moving average in Zhou et al. removes coupling that behaves like noise. Our term $B(\sigma)$ is a bias that points the same way in every step, so averaging steps should converge to the same wrong bandwidth. The EMA ablation tests exactly this. If EMA alone matches split-batch performance, our mechanism is wrong.

Why not just fix the bandwidth once, using the median heuristic or a grid search on a pilot run? The median heuristic is the collapsing baseline reported in Melcher et al.. A static grid search cannot follow particles whose spread changes by orders of magnitude during inference, and data splitting of the kind criticized in Schrab et al. has no natural analogue for evolving particles. We will still include the best fixed bandwidth, chosen with oracle access to the final posterior, as an upper reference for any static choice.

Proposed Experiments

The decisive synthetic check uses the isotropic Gaussian collapse benchmark of Ba et al., with $d$ from 10 to 1000. We add score noise of controlled, known covariance, shared across particles, to mimic mini-batching. Three quantities are measured: the bandwidth each selector converges to, the particle trace variance, and agreement with the closed-form predicted bandwidth. The mechanism is supported if three things hold together. Naive Ad-SVGD's bandwidth must rise with the noise level as predicted. Its variance must fall below the exact-score Ad-SVGD value. The split-batch selector must track the exact-score bandwidth.

The second setting is the 16-dimensional ODE linear inverse problem from Melcher et al. We add a synthetic stochastic-score variant by subsampling observation terms, and we measure empirical coverage of 90% intervals against the nominal level.

The main real-data setting is Bayesian logistic regression on Covertype, with 581,012 points and 54 features, where mini-batch scores are unavoidable. We sweep $N/b$ by varying the batch size. Metrics are test log-likelihood, test accuracy, and the ratio of particle marginal variances to those of a long-run reference sampler. To check that the effect is not specific to one dataset, we repeat the analysis on the 13 logistic-regression datasets used in Kernel Stein Discrepancy Descent.

The single result that would falsify the proposal is this: naive mini-batch Ad-SVGD's selected bandwidth does not increase with $N/b$, or it increases without any loss of calibration. In either case, noise-driven bandwidth inflation would be real but harmless, and the split-batch estimator would be unnecessary.