arXiv:2610.12851stat.MLOct 2026

Manuscript Offprint

arXiv:2610.12851

Universal Bounds for Self-Normalized Kullback-Leibler Estimation

Buu Phan, Lester Mackey, David Alvarez-Melis

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Abstract

This work studies an entropy-based estimator of Kullback–Leibler (KL) divergence constructed from normalized importance weights. We prove a universal finite-sample bound showing that its expectation can exceed the target–proposal KL divergence by at most log⁡2\log 2 for any sample size. We then characterize the KL divergence between the distribution induced by importance-weighted resampling and the proposal, showing that it is upper bounded by both the expectation of the entropy-based estimator and the target–proposal KL divergence. Importantly, these bounds require neither bounded importance weights nor finite higher moments. We apply these results to test-time alignment of generative models via Soft Best-of-NN sampling, an importance-sampling-based scaling technique proposed by Verdun et al. (2025), and to relative entropy coding, obtaining finite-sample policy-divergence certificates and moment-free bounds on coding cost.

1 INTRODUCTION

Importance sampling is a classical Monte Carlo technique for estimating expectations under a target distribution pp using samples from a more accessible proposal distribution qq (Robert and Casella, 1999). Throughout, pp and qq denote probability densities or mass functions, as appropriate. Suppose that pp and qq have the same support, and define the positive likelihood ratio w(x):=p(x)/q(x)w(x) := p(x)/q(x). Given X1,…,XN∼i.i.d.qX_1, \ldots, X_N \stackrel{\mathrm{i.i.d.}}{\sim} q, importance sampling estimates the expected value of a function f(X)f(X) under the target distribution pp by reweighting samples from the proposal distribution qq.

In particular, we have:

Ep[f(X)]=Eq[w(X)f(X)]≈1N∑i=1Nw(Xi)f(Xi).\mathbb{E}_{p}[f(X)]=\mathbb{E}_{q}[w(X)f(X)]\approx\frac{1}{N}\sum_{i=1}^{N}w(X_{i})f(X_{i}).

When pp is known only up to a normalizing constant, self-normalized importance sampling (SNIS) instead approximates the target expectation as

Ep[f(X)]≈∑i=1Nλif(Xi),(1)\mathbb{E}_{p}[f(X)]\approx\sum_{i=1}^{N}\lambda_{i}f(X_{i}), \tag{1}

where λi:=w(Xi)/∑j=1Nw(Xj)>0\lambda_i := w(X_i) / \sum_{j=1}^N w(X_j) > 0. Because common multiplicative factors cancel, SNIS is computable without the target normalizing constant, and its normalized weights naturally define a categorical distribution for importance-weighted resampling. Under standard regularity conditions, the SNIS estimator converges to the target expectation as N→∞N \to \infty, see Owen (2013). At finite NN, however, the random normalization couples the samples, making nonasymptotic guarantees substantially more challenging (Agapiou et al., 2017). In this work, we study the following normalized-weight estimator of the target–proposal Kullback-Leibler (KL) divergence DKL(p∥q):=Ep[log⁡(p(X)/q(X))]D_{\mathrm{KL}}(p\|q) := \mathbb{E}_p[\log(p(X)/q(X))]:

D^N:=∑i=1Nλilog⁡(Nλi)=DKL(λ∥UN)=log⁡N−H(λ),\widehat{D}_{N}:=\sum_{i=1}^{N}\lambda_{i}\log(N\lambda_{i})=D_{\mathrm{K L}}(\boldsymbol{\lambda}\|U_{N})=\log N-H(\boldsymbol{\lambda}),

where λ:=(λ1,…,λN)\boldsymbol{\lambda} := (\lambda_1, \ldots, \lambda_N), UNU_N is uniform on {1,…,N}\{1, \ldots, N\}, and H(⋅)H(\cdot) denotes entropy. We use natural logarithms throughout unless stated otherwise. This estimator has previously appeared as an entropy or perplexity criterion in adaptive importance sampling and sequential Monte Carlo (Cappé et al., 2008) and satisfies

D^N→a.s.DKL(p∥q)andE[D^N]→DKL(p∥q)\widehat{D}_{N}\xrightarrow{a.s.}D_{\mathrm{K L}}(p\|q)\quad\mathrm{a n d}\quad\mathbb{E}[\widehat{D}_{N}]\to D_{\mathrm{K L}}(p\|q)

when DKL(p∥q)<∞D_{\mathrm{KL}}(p\|q) < \infty; see Appendix A. Unlike the direct SNIS estimator obtained by setting f(X)=log⁡w(X)f(X) = \log w(X) in Equation (1), D^N\widehat{D}_N depends only on the normalized weights and is therefore computable even when the target normalizing constant is unknown. Moreover,

0≤D^N≤log⁡N,0\leq\widehat{D}_{N}\leq\log N,

since it is the KL divergence between λ\lambda and the uniform distribution on NN points. Consequently, one immediately obtains E[D^N]≤log⁡N\mathbb{E}[\widehat{D}_N] \leq \log N, where the expectation

†^{\dagger}Work done during an internship at Microsoft Research. Correspondence: truong.phan@mail.utoronto.ca is taken over the proposal samples X1:N∼qNX_{1:N} \sim q^N unless otherwise stated. However, this bound grows with N and does not reflect the discrepancy between p and q. Sharper nonasymptotic guarantees for SNIS quantities typically require additional assumptions, such as bounded importance weights or finite higher moments (Agapiou et al., 2017; Phan et al., 2024). In contrast, we show that E[D^N]\mathbb{E}[\widehat{D}_N] admits a universal finite-sample bound even in the absence of these additional assumptions.

Main Results. As stated above, we assume throughout that pp and qq share the same support and that DKL(p∥q)D_{\mathrm{KL}}(p\|q) is finite, but impose no boundedness or additional moment assumptions. Our first result shows that, for any sample size NN, E[D^N]\mathbb{E}[\widehat{D}_N] cannot exceed DKL(p∥q)D_{\mathrm{KL}}(p\|q) by more than a universal additive constant, while converging to DKL(p∥q)D_{\mathrm{KL}}(p\|q) as N→∞N \to \infty.

Theorem 1 (Universal Upper Bound). For every N≥1N \geq 1,

E[D^N]<DKL(p∥q)+log⁡2.\mathbb{E}[\widehat{D}_{N}]<D_{\mathrm{K L}}(p\|q)+\log2.

Despite its simplicity, to the best of our knowledge, this bound was previously unknown; its proof is given in Appendix C. The additive log⁡2≈0.69\log 2 \approx 0.69 term results from a worst-case analysis that combines several inequalities whose worst cases need not occur simultaneously and is therefore unlikely to be tight; our exhaustive experimental search in Appendix J suggests that the optimal universal slack may instead be near 0.15.

We next consider the distribution induced by SNIS resampling. For each output, draw a fresh proposal set X1:NX_{1:N} and sample

I∣X1:N∼Cat(λ).I\mid X_{1:N}\sim\mathrm{Cat}(\pmb{\lambda}).

Let pNp_N denote the distribution of XIX_I (which depends on the randomness of both the proposal set and the resampling step). We show that DKL(pN∥q)D_{\text{KL}}(p_N \| q) is upper bounded by both E[D^N]\mathbb{E}[\widehat{D}_N] and DKL(p∥q)D_{\text{KL}}(p \| q).

Theorem 2 (KL Contraction under SNIS). Suppose DKL(p∥q)<∞D_{\mathrm{KL}}(p\|q) < \infty. Then, for every N≥1N \geq 1,

DKL(pN∥q)≤min⁡{E[D^N],DKL(p∥q)}.D_{\mathrm{K L}}(p_{N}\|q)\leq\min\big\{\mathbb{E}[\widehat{D}_{N}],D_{\mathrm{K L}}(p\|q)\big\}.

The proof of Theorem 2 is given in Appendix D. The bound DKL(pN∥q)≤DKL(p∥q)D_{\mathrm{KL}}(p_N \| q) \leq D_{\mathrm{KL}}(p \| q) is intuitively plausible since the candidates are drawn from qq, but establishing it requires constructing a nontrivial contraction lemma. Meanwhile, E[D^N]\mathbb{E}[\widehat{D}_N] provides a straightforwardly estimated upper bound on DKL(pN∥q)D_{\mathrm{KL}}(p_N \| q) using only the normalized importance weights, without requiring explicit evaluation of pNp_N. This is particularly useful in applications such as model alignment, where the divergence of the finite-sample resampled policy from the proposal is of direct interest. Importantly, Theorem 1 further guarantees that E[D^N]\mathbb{E}[\widehat{D}_N] cannot substantially exceed the population-level divergence. This property is especially valuable when N≫exp⁡(DKL(p∥q))N \gg \exp(D_{\mathrm{KL}}(p \| q)) as the crude log NN upper bound then becomes unboundedly larger than DKL(p∥q)D_{\mathrm{KL}}(p \| q).

We complement this upper bound with a straightforwardly estimated lower bound, providing a practical way to approximate DKL(pN∥q)D_{\mathrm{KL}}(p_N \| q) without explicitly evaluating pNp_N. For Y∼pNY \sim p_N and M≥1M \geq 1, define

θ^M(Y):=NM∑m=1Mw(Y)w(Y)+∑j=2Nw(Xj(m)),\widehat{\theta}_{M}(Y):=\frac{N}{M}\sum_{m=1}^{M}\frac{w(Y)}{w(Y)+\sum_{j=2}^{N}w(X_{j}^{(m)})},

where Xj(m)∼i.i.d.qX_j^{(m)} \stackrel{\text{i.i.d.}}{\sim} q are auxiliary samples independent of YY. Here, θ^M(Y)\widehat{\theta}_M(Y) is a Monte Carlo estimator of the density ratio pN(Y)/q(Y)p_N(Y)/q(Y), obtained by averaging the SNIS selection probability of YY over fresh auxiliary proposal sets.

Theorem 3 (KL Lower Bound). For all N,M≥1N, M \geq 1,

EY∼pN[EX2:N(1:M)∼q[log⁡θ^M(Y)]]≤DKL(pN∥q),\mathbb{E}_{Y\sim p_{N}}\left[\mathbb{E}_{X_{2:N}^{(1:M)}\sim q}\left[\log\widehat{\theta}_{M}(Y)\right]\right]\leq D_{\mathrm{K L}}(p_{N}\|q),

where the inner expectation is over the MM independent auxiliary proposal sets used to construct θ^M(Y)\widehat{\theta}_{M}(Y). Moreover, for independent Y1,…,YB∼pNY_{1},\ldots,Y_{B}\sim p_{N}, with independent auxiliary proposal sets for each YbY_{b}, define

L^B,M:=max⁡(0,1B∑b=1Blog⁡θ^M(Yb)).(2)\widehat{L}_{B,M}:=\max(0,\frac{1}{B}\sum_{b=1}^{B}\log\widehat{\theta}_{M}(Y_{b})). \tag{2}

Then, almost surely,

lim⁡B→∞lim⁡M→∞L^B,M=DKL(pN∥q).\lim_{B\to\infty}\lim_{M\to\infty}\widehat{L}_{B,M}=D_{\mathrm{K L}}(p_{N}\|q).

The proof is shown in Appendix E. Together with Theorem 2, this result provides a practical way to bracket and approximate DKL(pN∥q)D_{\mathrm{KL}}(p_N \| q) without explicitly evaluating pNp_N. As M→∞M \to \infty followed by B→∞B \to \infty, the lower-bound estimator converges almost surely to the true divergence. Clipping at zero ensures that the estimator, like the DKLD_{\mathrm{KL}} quantity being estimated, is always nonnegative. Related auxiliary-sampling estimators have previously been used to evaluate implicit importance-weighted distributions in variational autoencoder literature (Cremer et al., 2017).

We empirically evaluate our bounds in Appendix J and illustrate their implications in two modern applications of importance sampling: test-time alignment via Soft Best-of-N sampling and approximate relative entropy coding. In both settings, our results require neither bounded importance weights nor higher-order moment conditions, while yielding tighter bounds across relevant regimes.

References (59)