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 log2 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-N 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 p using samples from a more accessible proposal distribution q (Robert and Casella, 1999). Throughout, p and q denote probability densities or mass functions, as appropriate. Suppose that p and q have the same support, and define the positive likelihood ratio w(x):=p(x)/q(x). Given X1,…,XN∼i.i.d.q, importance sampling estimates the expected value of a function f(X) under the target distribution p by reweighting samples from the proposal distribution q.
In particular, we have:
Ep[f(X)]=Eq[w(X)f(X)]≈N1i=1∑Nw(Xi)f(Xi).
When p is known only up to a normalizing constant, self-normalized importance sampling (SNIS) instead approximates the target expectation as
Ep[f(X)]≈i=1∑Nλif(Xi),(1)
where λi:=w(Xi)/∑j=1Nw(Xj)>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→∞, see Owen (2013). At finite N, 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))]:
DN:=i=1∑Nλilog(Nλi)=DKL(λ∥UN)=logN−H(λ),
where λ:=(λ1,…,λN), UN is uniform on {1,…,N}, and H(⋅) 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
DNa.s.DKL(p∥q)andE[DN]→DKL(p∥q)
when DKL(p∥q)<∞; see Appendix A. Unlike the direct SNIS estimator obtained by setting f(X)=logw(X) in Equation (1), DN depends only on the normalized weights and is therefore computable even when the target normalizing constant is unknown. Moreover,
0≤DN≤logN,
since it is the KL divergence between λ and the uniform distribution on N points. Consequently, one immediately obtains E[DN]≤logN, where the expectation
†Work done during an internship at Microsoft Research. Correspondence: truong.phan@mail.utoronto.ca is taken over the proposal samples X1:N∼qN 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[DN] admits a universal finite-sample bound even in the absence of these additional assumptions.
Main Results. As stated above, we assume throughout that p and q share the same support and that DKL(p∥q) is finite, but impose no boundedness or additional moment assumptions. Our first result shows that, for any sample size N, E[DN] cannot exceed DKL(p∥q) by more than a universal additive constant, while converging to DKL(p∥q) as N→∞.
Theorem 1 (Universal Upper Bound). For every N≥1,
E[DN]<DKL(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 log2≈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:N and sample
I∣X1:N∼Cat(λ).
Let pN denote the distribution of XI (which depends on the randomness of both the proposal set and the resampling step). We show that DKL(pN∥q) is upper bounded by both E[DN] and DKL(p∥q).
Theorem 2 (KL Contraction under SNIS). Suppose DKL(p∥q)<∞. Then, for every N≥1,
DKL(pN∥q)≤min{E[DN],DKL(p∥q)}.
The proof of Theorem 2 is given in Appendix D. The bound DKL(pN∥q)≤DKL(p∥q) is intuitively plausible since the candidates are drawn from q, but establishing it requires constructing a nontrivial contraction lemma. Meanwhile, E[DN] provides a straightforwardly estimated upper bound on DKL(pN∥q) using only the normalized importance weights, without requiring explicit evaluation of pN. 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[DN] cannot substantially exceed the population-level divergence. This property is especially valuable when N≫exp(DKL(p∥q)) as the crude log N upper bound then becomes unboundedly larger than DKL(p∥q).
We complement this upper bound with a straightforwardly estimated lower bound, providing a practical way to approximate DKL(pN∥q) without explicitly evaluating pN. For Y∼pN and M≥1, define
θM(Y):=MNm=1∑Mw(Y)+∑j=2Nw(Xj(m))w(Y),
where Xj(m)∼i.i.d.q are auxiliary samples independent of Y. Here, θM(Y) is a Monte Carlo estimator of the density ratio pN(Y)/q(Y), obtained by averaging the SNIS selection probability of Y over fresh auxiliary proposal sets.
Theorem 3 (KL Lower Bound). For all N,M≥1,
EY∼pN[EX2:N(1:M)∼q[logθM(Y)]]≤DKL(pN∥q),
where the inner expectation is over the M independent auxiliary proposal sets used to construct θM(Y). Moreover, for independent Y1,…,YB∼pN, with independent auxiliary proposal sets for each Yb, define
LB,M:=max(0,B1b=1∑BlogθM(Yb)).(2)
Then, almost surely,
B→∞limM→∞limLB,M=DKL(pN∥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) without explicitly evaluating pN. As M→∞ followed by B→∞, the lower-bound estimator converges almost surely to the true divergence. Clipping at zero ensures that the estimator, like the DKL 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.
2 DIVERGENCE GUARANTEES FOR SOFT BEST-OF-N
2.1 Test-Time Alignment with KL Control
A central goal of language-model alignment is to steer a base policy toward high-reward outputs while controlling distributional shift from the original model. Test-time alignment (Stiennon et al., 2020; Huang et al., 2025) provides an attractive alternative to fine-tuning by leaving the base policy fixed and using additional computation at generation time to favor high-reward responses. Since aggressive reward optimization can move the resulting distribution substantially away from the base policy, KL regularization provides a natural mechanism for trading off reward improvement against fidelity to the original model.
Concretely, suppose we have a base policy π0(y∣x) from which we can sample candidate responses and a reward function r(x,y)∈R that measures the desirability of response y for input x. The reward function may encode human preferences, correctness, task performance, or other desired behavior. Our goal is to generate high-reward responses while controlling the distributional shift from the base policy (Csiszár and Matus, 2003; Verdun et al., 2025). For each prompt x, such policy is the solution of the following KL-constrained optimization problem:
where β>0 is the Lagrange parameter associated with the KL constraint and determines a point on the reward–KL trade-off (see Verdun et al., 2025 and Appendix F for a detailed derivation). The normalizing constant in the denominator is generally intractable, so direct sampling from πβ is not available. Thus, the test-time alignment goal is to approximately sample from the reward-tilted policy πβ using only samples from the base policy π0 and evaluations of the reward r(x,y). As a result, for a given choice of β, test-time alignment naturally gives rise to three computational objectives: approximating the population Gibbs policy πβ with a policy πN,β from which we can sample using N draws from π0, evaluating its corresponding expected reward, EY∼πN,β(⋅∣x)[r(x,Y)], and quantifying the population distributional shift of this approximation, DKL(πN,β(⋅∣x)∥π0(⋅∣x)). We construct such a policy using self-normalized importance sampling, a procedure known in this setting as Soft Best-of-N.
2.2 Soft Best-of-N Alignment and KL Guarantees
The Soft Best-of-N (SBoN) algorithm (Verdun et al., 2025) provides a SNIS approximation to πβ. Specifically, SBoN draws
Moreover, provided that the normalizing constant in Equation (3) is finite, the finite-N SBoN policy converges to the population Gibbs policy, i.e. πN,β(⋅∣x)⟶πβ(⋅∣x) as N→∞. Details regarding the expression of πN,β and its convergence are provided in Appendix G.
Since inference is constrained by a finite computational budget N, SBoN implements the finite-sample policy πN,β1 rather than the ideal Gibbs policy πβ. This makes it important to characterize the distributional shift induced by the finite-N procedure, as measured by DKL(πN,β(⋅∣x)∥π0(⋅∣x)). Prior work by Aminian et al. (2026) provides a worst-case guarantee for this finite-N divergence under the bounded-reward assumption 0≤r(x,y)≤Rmax, showing that
Thus, the bound does not capture the asymptotic behavior of SBoN: as N→∞, πN,β converges to πβ,
1In the limit β→∞, SBoN reduces to standard Best-of-N (Beirami et al., 2024), as the resampling distribution concentrates on the highest-reward candidate.
Target Gibbs Policy
Soft Best-of-N
Figure 1: Soft Best-of-N and its KL guarantees. The population KL is the limiting SBoN divergence as N→∞. Our estimator E[DN] is tighter than the guarantee of Aminian et al. (2026) and can overshoot the population KL by at most log2. In contrast, the bound of Aminian et al. (2026) depends only on the reward range and does not account for the geometry of the reward distribution under the base policy. It converges to βRmax, which is 12 in this example, corresponding to the first column and last row of Figure 2a.
whereas the bound converges to βRmax, which can be strictly larger than the population divergence. Moreover, since the bound depends only on the reward range and N, it does not account for how high-reward responses are distributed under the base policy π0, and therefore need not provide a tight characterization of the divergence.
We next apply our general SNIS results to SBoN, obtaining a tighter, alignment-sensitive bound on the finite-N KL divergence. For each realization Y1,…,YN∼i.i.d.π0(⋅∣x), using the KL estimator DN=∑i=1Nλilog(Nλi), we obtain the following guarantees.
Corollary 1 (KL Guarantees for Soft Best-of-N). For every x and N≥1,
Consequently, E[DN] is no larger than the bounded-reward guarantee (4) of Aminian et al. (2026), so the bound in (5) is at least as tight.
The proof is given in Appendix I. The corollary has three main implications for test-time alignment, which we outline below.
KL Contractivity. The finite-N SBoN policy is always closer to the base policy π0 than the population Gibbs policy πβ is to π0. Thus, although πN,β→πβ as N increases, its finite-N distributional shift cannot exceed the population shift induced by the chosen alignment strength β.
Bounded Overshooting. The expected estimator E[DN] provides an easy-to-estimate upper bound on the finite-N policy divergence. In particular, for fixed β and N, we can sample candidate pools from π0 offline and average DN to estimate this quantity. By Theorem 1,
Thus, the estimator-based upper bound cannot overshoot the theoretical limit given by the population divergence DKL(πβ(⋅∣x)∥π0(⋅∣x)) by more than the universal additive constant log2. This contrasts with the bounded-reward guarantee of Aminian et al. (2026), which can substantially exceed the population divergence and therefore become loose as an upper bound on the finite-N policy shift. In particular, their bound approaches βRmax as N grows, whereas our bound never exceeds the population divergence by more than log2, illustrated in Figure 1.
Tightness and Tracking. When 0≤r(x,y)≤Rmax, the corollary further shows that E[DN] is no larger than the existing bounded-reward guarantee in (4). Combined with the universal log2 overshoot guarantee above, this comparison is particularly meaningful. An upper bound could improve only slightly upon the bounded-reward guarantee while still remaining far from the true divergence. In contrast, E[DN] is guaranteed to remain within log2 of the population divergence from above. Thus, the estimator
E[DN] closely tracks the true divergence within its fluctuation range. Moreover, our general result does not require bounded rewards and applies whenever πβ is well-defined and DKL(πβ(⋅∣x)∥π0(⋅∣x))<∞.
Finally, we note that our results for test-time alignment are not restricted to the LLM setting. The same analysis applies more generally to continuous generative models, including diffusion models, whenever test-time alignment is performed through importance-weighted sampling or resampling.
2.3 Experiments
Bound comparison. We consider a discrete output space with eight outcomes and implicitly condition throughout on a fixed input x. The small output space allows us to compute the finite-N SBoN policy πN,β exactly, providing ground-truth finite-N KL values against which to evaluate our bounds. We fix the base policy and construct four reward profiles ranging from aligned to anti-aligned with respect to π0, as shown in the first row of Figure 2a. In the aligned case, high reward is assigned to outputs that already have large probability under the base policy; in the anti-aligned case, high reward is assigned to rare outputs. The two intermediate reward profiles interpolate between these extremes. All rewards take values in [0, 1], so the bounded-reward guarantee is identical across reward geometries for fixed (N,β).
For each reward profile, we evaluate SBoN over several values of the inverse temperature β and computational budget N. Because the output space is small, we can compute the finite-N SBoN policy πN,β exactly by enumerating candidate-count configurations and hence obtain DKL(πN,β∥π0) without Monte Carlo error. We also compute the population divergence DKL(πβ∥π0) exactly. The expectation E[DN] is estimated using 50,000 independent candidate pools, with Monte Carlo uncertainty reported in the figure. This setup isolates the effect of reward-reference alignment: the base policy, reward range, and inference parameters are held fixed across reward geometries, while only the locations receiving high reward are changed.
Figure 2a illustrates how the SBoN policy changes with both the alignment strength β and the reward-reference geometry. As β increases, the Gibbs policy places increasingly more mass on high-reward outputs, resulting in larger population and finite-N divergences from the base policy. The magnitude of this shift depends strongly on the reward geometry: when high-reward outputs are already likely under π0, the population KL remains relatively small, whereas rewarding outputs that are rare under π0 produces a substantially larger population KL. Across all of these regimes, E[DN] closely tracks the exact finite-N divergence DKL(πN,β∥π0), while the population divergence DKL(πβ∥π0) characterizes its limiting value as N→∞. Thus, DKL(πβ∥π0) provides a theoretical limit on the finite-N divergence, while E[DN] provides a directly estimable upper bound. In contrast, the guarantee of Aminian et al. (2026) is insensitive to the reward-reference geometry and remains unchanged across columns for fixed (N,β).
How many Monte Carlo samples are needed? In practice, E[DN] must be estimated from finitely many Monte Carlo repetitions. We denote by K the Monte Carlo batch size, corresponding to K independent realizations of DN, and estimate
E[DN]≈K1k=1∑KDN(k).
How K interacts with N is not immediately clear. For large N, DN converges to DKL(πβ∥π0), suggesting that fewer repetitions may suffice, whereas for small N, the deterministic bound 0≤DN≤logN restricts its range. We therefore study how many repetitions are needed for the empirical average of DN to reliably upper bound DKL(πN,β∥π0) across different values of N and target-proposal divergences.
We consider a discrete state space obtained by discretizing Gaussian distributions over 1000 equally spaced points. We vary the target–proposal mismatch to obtain different values of DKL(πβ∥π0) and evaluate the estimator across several values of N. To estimate the finite- N divergence DKL(πN,β∥π0), we use the limiting result from Theorem 3 with M=2000 and B=50000. To quantify finite- K uncertainty, we repeatedly compute the Monte Carlo average above and report its 2.5th and 97.5th percentiles as error bars. Wider error bars indicate greater variability across independent Monte Carlo estimates of E[DN].
The results are shown in Figure 2b. As expected, increasing K reduces the Monte Carlo uncertainty in estimating E[DN], with the error bars narrowing substantially as K increases. Importantly, even for moderate K, the empirical estimates remain close to the true expectation and typically preserve the upper-bound relationship with DKL(πN,β∥π0). Although the theoretical range of DN grows as logN, the empirical estimates remain well concentrated, with error bars that are substantially narrower than the full range of the estimator. We also observe a non-monotonic dependence on the population KL divergence: the typical range of the error bars increases from DKL(πβ∥π0)=1 to DKL(πβ∥π0)=4, but then decreases as the population KL divergence is further increased to DKL(πβ∥π0)=12. These behaviors can be heuristically explained by the
←DKL(πN,β∣∣π0)←DKL(πβ∣∣π0)←DKL(πN,β∣∣π0)←E[DN]←Aminian et al.
(a) Soft Best-of-N under varying reward–reference alignment. The top row shows the reference policy π0 and four reward profiles, while the lower rows compare the exact finite-N divergence, the expected SNIS estimator E[DN], the population divergence, and the bounded-reward bound of Aminian et al. (2026). In all settings, E[DN] closely tracks the finite-N divergence and provides a substantially tighter computable bound than the bounded-reward guarantee.
N
N
N
N
(b) Monte Carlo estimation of E[DN]. The first row shows the discretized Gaussian target and proposal PMFs. The second row shows the estimates for different batch sizes K, with error bars spanning the 2.5th–97.5th percentiles.
Figure 2: Soft Best-of-N experiments, implicitly conditioning throughout on a fixed input x. The legend at the top is shared by both (a) and (b). The quantity of interest E[DN] closely tracks and upper-bounds the finite-N divergence DKL(πN,β∣∣π0) across the settings considered.
variance of the Monte Carlo estimator. In particular, since
0≤DN≤CN:=log(1+(N−1)e−βRmaxN),
we have
Var(DN)≤E[DN](CN−E[DN]).
Hence, for an average over K independent replicates, the standard deviation is bounded by
K−1/2E[DN](CN−E[DN]).
Thus, the Monte Carlo uncertainty depends not only on the range of DN, but also on the location of its expectation within that range. In particular, for fixed CN, the quantity inside the square root is maximized when E[DN]=CN/2 and decreases as the expectation approaches either endpoint of [0,CN], providing a possible explanation for the observed non-monotonic behavior above.
Finally, regarding the number of Monte Carlo samples K required for reliable estimation, K=16 appears sufficient to provide a reliable empirical upper bound in the scenarios considered, while K=64 tracks the true expectation very closely. Similar values of K exhibit comparable performance across the additional scenarios reported in Appendix J.3.
3 RELATIVE ENTROPY CODING
Relative entropy coding (REC) considers the problem of communicating a sample from a target distribution using shared randomness from a proposal, with coding cost closely related to the KL divergence between the two distributions (Theis and Ahmed, 2022). REC has recently gained interest in machine learning through the idea of sequential coding, where it is used to quantify the information required to transfer knowledge from a teacher model to a student model (Qiu et al., 2026).
Communication-efficient importance sampling-based compression (CE-ISC) (Phan et al., 2024) implements REC using SNIS by generating shared proposal samples and communicating the index of the selected sample. However, their existing finite-sample coding cost guarantee relies on restrictive assumptions and can be highly conservative for small to moderate N. In this section, we show that our general SNIS result yields an immediate finite-N coding guarantee with a universal additive penalty for CE-ISC. Throughout this section, all logarithms have base 2, as the coding costs are measured in bits.
Setup. Let (X,Y)∼pX,Y. For a realization X=x, the encoder and decoder share N i.i.d. proposals
and denote the corresponding SNIS divergence estimator by
DN,x:=DKL(λx∥UN)=i=1∑Nλi,xlog2(Nλi,x).
CE-ISC (Phan et al., 2024) selects one of the proposals according to these normalized weights and communicates a random index J identifying the selected proposal. Conditioned on X = x and the proposal pool, Phan et al. (2024) show that
E[log2J∣X=x,Y1:N]≤DN,x+δ,δ:=1+elog2e.
(7)
Hence,
E[log2J∣X=x]≤E[DN,x∣X=x]+δ.
Their analysis then establishes a finite-sample bound of the form
E[DN,x∣X=x]≤DKL(pY∣X(⋅∣x)∥pY)+NΔx,
where the remainder term Δx/N depends on bounded likelihood ratios and higher-order moments of the importance weights; see Phan et al. (2024, Section 8.2) for the explicit expression for Δx. Averaging over X yields
EX[E[DN,X∣X]]≤I(X;Y)+NΔ,
for Δ:=E[ΔX], which leads to their entropy bound
H(J)≤I(X;Y)+NΔ+log2(I(X;Y)+NΔ+1)+4.
Although the Δ/N term vanishes as N→∞, the finite-sample guarantee relies on strong assumptions. In particular, Δ contains a term 6(ω−1)logω, where
ω=x,ysuppY(y)pY∣X(y∣x),
in addition to terms involving higher-order moments. Consequently, the bound can become uninformative for small to moderate N when the likelihood ratio or the corresponding moments are large. Our moment-free SNIS bound gives the following alternative.
Corollary 2 (Finite-sample coding bound). Under the CE-ISC construction,
H(J)≤I(X;Y)+log2(I(X;Y)+2)+5.
Proof. Applying Theorem 1 conditionally on X=x:
E[DN,x∣X=x]≤DKL(pY∣X(⋅∣x)∥pY)+1.
Averaging over X therefore yields
EX[E[DN,X∣X]]≤I(X;Y)+1.
Replacing the bound E[DN,X]≤I(X;Y)+Δ/N in the coding argument of Phan et al. (2024) above yields
H(J)≤I(X;Y)+log2(I(X;Y)+2)+5,
which concludes the proof.
Thus, our result provides a universal finite-sample coding guarantee without requiring bounded likelihood ratios or higher-order moment assumptions.
4 RELATED WORK
We study the finite-sample behavior and applications of the estimator DN. This estimator has previously appeared in the adaptive importance sampling and sequential Monte Carlo literature. In particular, Cornebise et al. (2008) proposed using this term to estimate the Kullback–Leibler divergence between target and proposal distributions and employed this criterion to adapt proposal distributions in particle filtering. Cappé et al. (2008) use the entropy H(λ) of the normalized importance weights to monitor convergence in adaptive importance sampling with mixture proposals. It also appears in Brekelmans et al. (2023) in the context of importance-weighted variational inference analysis. Our work studies this same finite-sample quantity but focuses on a nonasymptotic characterization of its expectation. Previous works (Agapiou et al., 2017; Deligiannidis et al., 2024) developed a general framework for finite-sample analysis of self-normalized importance sampling, relying on certain moment assumptions. Building on this framework, Phan et al. (2024) derived a finite-sample bound for E[DN], but their result relies on several restrictive boundedness assumptions. Closely related, Chatterjee and Diaconis (2018) show that, under broad conditions, the characteristic sample size required for successful importance sampling scales as N≍exp(DKL(p∥q)), highlighting the forward KL divergence as a fundamental measure of target-proposal mismatch. Sanz-Alonso (2018) further derived nonasymptotic necessary sample-size conditions from an information-theoretic perspective, involving the KL and other f-divergences.
Recent work has also studied importance-weighted resampling in the context of test-time alignment. Verdun et al. (2025) introduced Soft Best-of-N sampling and analyzed the discrepancy between its finite-sample distribution πN,β and the tilted target πβ. They establish nonasymptotic bounds on DKL(πβ(⋅∣x)∥πN,β(⋅∣x)) and show that it decays at rate O(1/N) under their setting. Their analysis primarily characterizes the convergence of the finite-sample SBoN policy to the population target, whereas our focus is on providing finite-sample certificates for the distributional shift from the base policy. In particular, our results complement this analysis by providing distribution-free control of KL-related quantities DKL(πN,β(⋅∣x)∥π0(⋅∣x)) arising from self-normalized importance weights without requiring bounded rewards or higher-moment assumptions. Other works (Beirami et al., 2024; Mroueh, 2024) study and provide theoretical analysis for the related problem of Best-of-N, which arises as a special case of our framework. Finally, Aminian et al. (2026) analyze the same quantity and derive a bounded-reward bound, for which we establish a tighter guarantee.
5 CONCLUSION
This work provides nonasymptotic guarantees for a self-normalized importance sampling estimator of the forward KL divergence. Our results characterize its finite-sample behavior without requiring bounded importance weights or finite higher moments and establish a connection between the normalized importance weights and the discrepancy between the target and proposal distributions. We further demonstrate the applicability of these guarantees to test-time alignment and relative entropy coding.
Several directions remain for future work. On the theoretical side, our results raise the broader question of what other universal, distribution-free finite-sample guarantees can be established for SNIS, including for other functionals of the normalized importance weights, and whether the additive slack in our bounds can be further tightened. On the algorithmic side, these guarantees may inform more efficient sampling strategies for adaptive importance sampling, where the proposal or sample design is chosen to reduce target–proposal mismatch. Given that recent works have also explored new approaches for scaling test-time compute to improve performance and inference efficiency (Lifshitz et al., 2025; Geuter et al., 2026; Di et al., 2026), extending our analysis to these settings could provide principled control of the resulting distributional shift as well as theoretical guidance for efficient test-time computation.
References
Sergios Agapiou, Omiros Papaspiliopoulos, Daniel Sanz-Alonso, and Andrew M Stuart. Importance sampling: Intrinsic dimension and computational cost. Statistical Science, pages 405–431, 2017.
Gholamali Aminian, Idan Shenfeld, Amir Reza Asadi, Ahmad Beirami, and Youssef Mroueh. Best-of-n through the smoothing lens: Kl divergence and regret analysis. In International Conference on Learning Representations, volume 2026, pages 105057–105090, 2026.
Christian Bauckhage. Computing the kullback-leibler divergence between two weibull distributions. arXiv preprint arXiv:1310.3713, 2013.
Ahmad Beirami, Alekh Agarwal, Jonathan Berant, Alexander D'Amour, Jacob Eisenstein, Chirag Nagpal, and Ananda Theertha Suresh. Theoretical guarantees on the best-of-n alignment policy. arXiv preprint arXiv:2401.01879, 2024.
Rob Brekelmans, Sicong Huang, Marzyeh Ghassemi, Greg Ver Steeg, Roger Grosse, and Alireza Makhzani. Improving mutual information estimation with annealed and energy-based bounds. arXiv preprint arXiv:2303.06992, 2023.
Olivier Cappé, Randal Douc, Arnaud Guillin, Jean-Michel Marin, and Christian P Robert. Adaptive importance sampling in general mixture classes. Statistics and Computing, 18(4):447–459, 2008.
Sourav Chatterjee and Persi Diaconis. The sample size required in importance sampling. The Annals of Applied Probability, 28(2):1099–1135, 2018.
Julien Cornebise, Éric Moulines, and Jimmy Olsson. Adaptive methods for sequential importance sampling with application to state space models. Statistics and Computing, 18(4):461–480, 2008.
Chris Cremer, Quaid Morris, and David Duvenaud. Reinterpreting importance-weighted autoencoders. arXiv preprint arXiv:1704.02916, 2017.
Imre Csiszár and Frantisek Matus. Information projections revisited. IEEE Transactions on Information Theory, 49(6):1474–1490, 2003.
George Deligiannidis, Pierre E Jacob, El Mahdi Khribch, and Guanyang Wang. On importance sampling and independent metropolis-hastings with an unbounded weight function. arXiv preprint arXiv:2411.09514, 2024.
Qiwei Di, Kaixuan Ji, Xuheng Li, Heyang Zhao, and Quanquan Gu. Best-of-majority: Minimax-optimal strategy for pass@ k inference scaling. In International Conference on Learning Representations, volume 2026, pages 92146–92171, 2026.
Rick Durrett. Probability: theory and examples, volume 49. Cambridge university press, 2019.
Jonathan Geuter, Youssef Mroueh, and David Alvarez-Melis. Guided speculative inference for efficient test-time alignment of llms. In International Conference on Learning Representations, volume 2026, pages 75016–75056, 2026.
Audrey Huang, Adam Block, Qinghua Liu, Nan Jiang, Akshay Krishnamurthy, and Dylan J Foster. Is best-of-n the best of them? coverage, scaling, and optimality in inference-time alignment. arXiv preprint arXiv:2503.21878, 2025.
Jean-François Le Gall. Measure theory, probability, and stochastic processes. Springer, 2022.
Shalev Lifshitz, Sheila A McIlraith, and Yilun Du. Multi-agent verification: Scaling test-time compute with multiple verifiers. arXiv preprint arXiv:2502.20379, 2025.
Youssef Mroueh. Information theoretic guarantees for policy alignment in large language models. arXiv preprint arXiv:2406.05883, 2024.
Buu Phan, Ashish Khisti, and Christos Louizos. Importance matching lemma for lossy compression with side information. In International Conference on Artificial Intelligence and Statistics, pages 1387–1395. PMLR, 2024.
Yury Polyanskiy and Yihong Wu. Information theory: From coding to learning. Cambridge university press, 2025.
Shikai Qiu, Marc Finzi, Yujia Zheng, Kun Zhang, and Andrew Gordon Wilson. Requential coding: Pushing the limits of model compression with self-generated training data. arXiv preprint arXiv:2607.11883, 2026.
Christian P Robert and George Casella. Monte Carlo statistical methods, volume 2. Springer, 1999.
Daniel Sanz-Alonso. Importance sampling and necessary sample size: An information theory approach. SIAM/ASA Journal on Uncertainty Quantification, 6(2):867–879, 2018.
Nisan Stiennon, Long Ouyang, Jeffrey Wu, Daniel Ziegler, Ryan Lowe, Chelsea Voss, Alec Radford, Dario Amodei, and Paul F Christiano. Learning to summarize with human feedback. Advances in neural information processing systems, 33:3008–3021, 2020.
Lucas Theis and Noureldin Y Ahmed. Algorithms for the communication of samples. In International Conference on Machine Learning, pages 21308–21328. PMLR, 2022.
Claudio Mayrink Verdun, Alex Oesterling, Himabindu Lakkaraju, and Flavio P Calmon. Soft best-of-n sampling for model alignment. In 2025 IEEE International Symposium on Information Theory (ISIT), pages 1–6. IEEE, 2025.
David Williams. Probability with martingales. Cambridge university press, 1991.
Supplementary Materials
A ASYMPTOTIC CONVERGENCE
We first recall the Strong Law of Large Numbers and the Dominated Convergence Theorem, the two main tools we use to establish the convergence results in this section.
Lemma 1 (Strong Law of Large Numbers; Williams (1991, Section 14.5)). Let Z1,Z2,… be i.i.d. random variables such that
E[∣Zi∣]<∞.
Then N1∑i=1NZi converges to E[Zi] both almost surely and in L1 as N→∞.
Lemma 2 (Dominated Convergence Theorem; Durrett (2019, Theorem 1.6.7)). Let Z1,Z2,… be random variables such that ZN→Z almost surely. Suppose there exists a random variable Y such that E[Y]<∞ and
∣ZN∣≤YforallN.
Then
N→∞limE[ZN]=E[Z].
We now establish the asymptotic convergence of DN and E[DN] to DKL(p∥q).
Proposition 1 (Asymptotic consistency). Suppose that p and q have the same support and that DKL(p∥q)<∞. Then
and substituting these limits into the expression above yields
DNa.s.DKL(p∥q),
which completes the proof for the first part.
Second Claim. We now prove the second claim, E[DN]⟶DKL(p∥q). Although we have already shown that DN→DKL(p∥q) almost surely, almost-sure convergence alone does not justify interchanging the limit and expectation. We will therefore prove convergence of the expectations by showing separately that the positive and negative parts of an equivalent representation of DN converge in expectation.
Proof strategy. By exchangeability, we will first rewrite
Similarly, since DKL(p∥q)=E[W1logW1] exists and is finite, W1logW1 is integrable, and therefore
DKL(p∥q)=E[(W1logW1)+]−E[(W1logW1)−].
It therefore suffices to prove
E[(ANlogAN)+]⟶E[(W1logW1)+]
and
E[(ANlogAN)−]⟶E[(W1logW1)−].
Indeed, subtracting the two convergent sequences then yields
E[DN]⟶E[W1logW1]=DKL(p∥q).
For the negative part, we will apply the Dominated Convergence Theorem. Since AN→W1 almost surely and the map x↦(xlogx)− is continuous on [0,∞), with the convention 0log0=0, we have
(ANlogAN)−a.s.(W1logW1)−.
Moreover, the function x↦xlogx is bounded below by −1/e on [0,∞), and hence
0≤(ANlogAN)−≤e1foreveryN.
Thus the sequence is dominated by the integrable constant 1/e. The dominated convergence theorem therefore yields
E[(ANlogAN)−]⟶E[(W1logW1)−].
For the positive part, we now prove that
E[(ANlogAN)+]⟶E[(W1logW1)+].
Unlike the negative part, (ANlogAN)+ is not uniformly bounded. We therefore split its expectation into two events. In particular, define
First Term. On the good event GN, we apply the dominated convergence theorem. By the strong law of large numbers,
N−11i=2∑NWia.s.1,
so 1GN→1 almost surely. Since AN→W1 almost surely, it follows that
(ANlogAN)+1GNa.s.(W1logW1)+.
Moreover, on GN,
AN=W1+∑i=2NWiNW1≤N−12NW1≤4W1,
for N≥2. Hence, on GN,
(ANlogAN)+≤(4W1log(4W1))+.
Moreover,
(4W1log(4W1))+≤4(log4)W1+4(W1logW1)+,
whose expectation is finite since E[W1]=1 and E[(W1logW1)+]<∞, as shown above. Therefore, by the dominated convergence theorem,
E[(ANlogAN)+1GN]⟶E[(W1logW1)+].
Second Term. It remains to prove that
E[(ANlogAN)+1GNc]⟶0.
We will first use the exponential Markov inequality to show that Pr(GNc) decays geometrically in N, and then combine this with a deterministic upper bound on (ANlogAN)+.
Set
TN:=i=2∑NWi.
Then
GNc={TN<2N−1}.
Fix θ>0. Since the map x↦e−θx is decreasing,
{TN<2N−1}={e−θTN>e−θ(N−1)/2}.
Applying Markov's inequality to the nonnegative random variable e−θTN≤1 gives
Since W2,…,WN are independent and identically distributed,
E[e−θTN]=i=2∏NE[e−θWi]=(E[e−θW1])N−1.
Therefore
Pr(GNc)≤(eθ/2E[e−θW1])N−1.
We now show that θ>0 can be chosen so that the quantity in parentheses is strictly smaller than one. By Le Gall (2022, Chapter 8.2.4), for a random variable Z≥0 and E[Z]<∞, its Laplace transform
LZ(θ):=E[e−θZ]
satisfies
LZ′(0+)=−E[Z].
Applying this with Z=W1 and using E[W1]=1, we obtain
θ↓0limθE[e−θW1]−1=−1.
Equivalently, defining
r(θ):=E[e−θW1]−(1−θ),
we have
θr(θ)=θE[e−θW1]−1+1⟶0.
Thus r(θ)=o(θ) as θ↓0; that is, the remainder r(θ) is negligible compared with θ as θ↓0. Hence
We first provide the following result which will be used in the proof of this part.
Lemma 3 (Contraction Lemma). Let T≥0 be an integrable random variable, and let g:(0,∞)→(0,∞). Suppose there exists a>0 such that
min{t,a}≤g(t)≤max{t,a}forallt>0,
and
E[g(T)]=E[T].
Then, for every convex differentiable function f for which the expectations are finite,
E[f(g(T))]≤E[f(T)].
In particular, for f(t)=tlogt,
E[g(T)logg(T)]≤E[TlogT].
Proof. Let
ℓa(t)=f(a)+f′(a)(t−a)
be the tangent line to f at a, and define
Ra(t)=f(t)−ℓa(t).
Since f is convex and ℓa is linear, we have Ra is also convex. Furthermore,
Ra′(t)=f′(t)−f′(a),
thus Ra(t) achieves minimal value at a. For this reason, we have Ra is nonincreasing on (0,a] and nondecreasing on [a,∞). Because g(t) lies between t and a, i.e.:
min{t,a}≤g(t)≤max{t,a}forallt≥0,
(a) For t<a, we have t<g(t)<a, and hence Ra(g(t))≤Ra(t).
(b) For t>a, we have a<g(t)<t, and hence Ra(g(t))≤Ra(t).
Figure 3: Illustration of contraction toward the anchor a, using Ra(s)=(s−a)2.
Therefore we have
Ra(g(t))≤Ra(t)
for every t>0, illustrated in Figure 3. Taking expectations gives
Chain Rule for Relative Entropy. To establish the desired inequality, separate the first coordinate from the remaining coordinates. Define
Y=(X2,…,XN),T=i=2∑NWi,
so that
S=W1+T.
Under the original law
r=qN=q⊗qN−1,
the random variable X1 has distribution q, the vector Y has distribution qN−1, and X1 is independent of Y. In particular, for every fixed value y of Y,
rX1∣Y=y=q.
Under the tilted law r, however, X1 and Y are generally not independent. We denote by
rX1∣Y=y
the conditional distribution of X1 when Y=y, and by rY the marginal distribution of Y.
Claim 2. Divergence decomposition and termwise bounds.
Thus, the chain rule decomposes the joint divergence into the divergence of the marginal law of Y and the average conditional divergence of X1 given Y=y.
C.2 Bounding the Conditional Contribution
In this section, we prove that
EY∼rY[DKL(rX1∣Y∥q∥q)]≤DKL(p∥q).
We establish the stronger pointwise bound
DKL(rX1∣Y=x2:N∥q∥≤DKL(p∥q)
for every x2:N for which the conditional distribution is well defined. Once this pointwise inequality is proved, taking expectation with respect to Y∼rY immediately yields the required quantity since DKL(p∥q) is a constant. Before proving the result, we present Corollary 3, a main tool for proving this result. The proof is presented at the end of this section.
Corollary 3 (Application of Contraction Lemma). Let W>0 and W∼pW satisfy E[W]=1. For fixed t≥0, define
mt=E[W+tW],ht(w)=mtw/(w+t).
Then ht is a probability density relative to the law of W, and
E[ht(W)loght(W)]≤E[WlogW],
where all expectations are taken with respect to W∼pW.
Applying the Corollary. For the remainder of this section, fix a realization
Y=x2:N,t=i=2∑Nw(xi),w(x)=q(x)p(x).
Let X∼q, define
W=w(X),
and denote by pW the probability law of W induced by X∼q. We will show that the likelihood ratio of rX1∣Y=x2:N with respect to q is
q(x)rX1∣Y=x2:N(x)=ht(w(x)),
where
ht(u)=mtu+tu,mt=EW∼pW[W+tW].
Once this identity is established, applying directly Corollary 3 yields the desired pointwise inequality. To see this, we note that the conditional divergence can be written as
Thus, once the conditional likelihood-ratio identity is verified, the desired pointwise inequality follows directly from Corollary 3. It therefore remains to derive the conditional likelihood-ratio identity
q(x)rX1∣Y=x2:N(x)=ht(w(x)).
Deriving the Conditional Likelihood Ratio. Fix a realization
Y=x2:N,t=i=2∑Nw(xi),w(x)=q(x)p(x).
After conditioning on Y=x2:N, the quantity t is fixed. Recall that, under the original law r=qN, X1 is independent of Y. Therefore,
rX1∣Y=x2:N(x)=q(x).
Under the tilted law r, the conditional distribution of X1 given Y=x2:N is obtained by normalizing the joint density:
Consequently, the likelihood ratio of the conditional law with respect to q is
q(x)rX1∣Y=x2:N(x)=ht(w(x)).(14)
C.2.1 Proof of Corollary 3
For convenience, all expectations are taken with respect to W∼pW. By construction,
E[ht(W)]=mt1E[W+tW]=1.
Inverse Function Analysis. Write
c=mt1,a=c−t,ht(w)=w+tcw.
The key step is to show that a>0, that a is a fixed point of ht, and that, for every w>0, the transformed value ht(w) lies between w and a. More precisely, we will prove that
ht(a)=a
and
min{w,a}≤ht(w)≤max{w,a},w>0.(15)
Proof. We first verify that a>0. If t=0, then
m0=E[WW]=1,
so
c=1,a=c−t=1>0.
If t>0, then, using E[W]=1,
1−tmt=E[W]−tE[W+tW]=E[W−W+ttW]=E[W+tW2]>0.
Therefore,
a=c−t=mt1−t=mt1−tmt>0.
Next, since a+t=c,
ht(a)=a+tca=cca=a.
Thus, a is a fixed point of ht. Finally,
ht(w)−w=w+tcw−w=w+tw(c−w−t)=w+tw(a−w).(16)
Because w/(w+t)>0, the sign of ht(w)−w is the same as the sign of a−w. Hence,
w≤a⟹ht(w)≥w,
whereas
w≥a⟹ht(w)≤w.
Moreover, ht is increasing because
ht′(w)=(w+t)2ct≥0.
Since ht(a)=a, monotonicity gives
w≤a⟹ht(w)≤ht(a)=a,
and
w≥a⟹ht(w)≥ht(a)=a.
Combining these facts proves (15). Thus, ht(w) always lies between w and the fixed point a.
To obtain the final result, we apply Lemma 3 with
g(w)≜ht(w),f(w)≜wlogw.
The lemma then gives
E[ht(W)loght(W)]≤E[WlogW],
which concludes the proof.
C.3 Bounding the Marginal Contribution
We now prove that
DKL(rY∥qN−1)≤log2.
The proof proceeds in three steps. First, we identify the likelihood ratio of the marginal law r~Y with respect to qN−1. More precisely, we construct a nonnegative function B such that
Indeed, all N normalized weights have the same expectation and their sum is equal to 1. Similarly, by exchangeability of the N+1 i.i.d. random variables
Consider the joint distribution of the candidate pool and selected index,
p⋆(x1:N,i)=(j=1∏Nq(xj))λi(x1:N),
and the reference joint distribution
q⋆(x1:N,i)=(j=1∏Nq(xj))N1.
Under both distributions, the candidate pool X1:N is drawn i.i.d. from q; the only difference is that under p⋆ the index I is sampled according to the normalized importance weights, whereas under q⋆ it is sampled uniformly. Their KL divergence is
Under p⋆, the output XI has marginal distribution pN. Under q⋆, since I is uniform and independent of the i.i.d. candidate pool, we have XI∼q. Therefore, by the data-processing inequality (Polyanskiy and Wu, 2025),
DKL(pN∥q)≤DKL(p⋆∥q⋆)=E[DN],
which completes the proof.
D.2 Proof of DKL(pN∥q)≤DKL(p∥q)
Let X∼q and write
W:=w(X),Eq[W]=1.
For N=1, we have p1=q, and hence
DKL(p1∥q)=0≤DKL(p∥q).
We therefore assume N≥2 for the remainder of the proof. By exchangeability of X1,…,XN, the density (or probability mass function) of the resampled particle is
respectively. It therefore remains only to prove (8). First, observe that hN is strictly increasing. Indeed, differentiating under the expectation gives
hN′(t)=NE(t+∑j=2NWj)2∑j=2NWj>0,
since Wj>0 almost surely. We next establish the following two claims:
There exists c>0 such that
hN(c)=c.
We have
hN(t)≥tfort≤c,
and
hN(t)≤tfort≥c.
Once these claims are established, the strict monotonicity of hN and hN(c)=c imply
t≤hN(t)≤c,t≤c,
and
c≤hN(t)≤t,t≥c.
This is exactly (8).
Proving the claims. We first note that hN is continuous on (0,∞). Indeed, let tk→t>0. Since
tk+∑j=2NWjtk⟶t+∑j=2NWjt
and the integrand is bounded between 0 and 1, the dominated convergence theorem gives
hN(tk)⟶hN(t).
Consequently, hN(t)/t is also continuous on (0,∞).
Now observe that
thN(t)=NE[t+∑j=2NWj1].
For every realization of W2,…,WN, the function
t↦t+∑j=2NWj1
is strictly decreasing. Taking expectations therefore shows that hN(t)/t is strictly decreasing on (0,∞). Moreover,
hN(t)−t=t(thN(t)−1).
Since t>0, the sign of hN(t)−t is determined by whether hN(t)/t is above or below 1. Thus, hN(t)−t can cross zero at most once, and any crossing must be from positive to negative. On the other hand,
Eq[hN(W)−W]=Eq[hN(W)]−Eq[W]=0.
If hN(W)=W almost surely, then any value in the support of W is a fixed point and the claims follow immediately. Otherwise, hN(W)−W cannot be strictly positive almost surely or strictly negative almost surely, since its expectation is zero. Hence there exist values t1,t2 in the support of W such that
hN(t1)>t1,hN(t2)<t2.
Since hN(t)/t is strictly decreasing, we must have t1<t2. By continuity, there exists c∈(t1,t2) such that
hN(c)=c.
Finally, since hN(t)/t is decreasing and
chN(c)=1,
we have
thN(t)≥1fort≤c,
and
thN(t)≤1fort≥c.
Equivalently,
hN(t)≥tfort≤c,
and
hN(t)≤tfort≥c.
This proves the two claims and completes the proof.
is given by an exponential tilt of the base policy (Verdun et al., 2025). In particular, for an appropriate inverse temperature β>0, the optimal policy takes the form
Proof. The objective is linear, and hence concave, in the policy π. To see this directly, let π1 and π2 be two policies and let θ∈[0,1]. Define the mixture policy
Thus the concavity inequality holds with equality, so the expected reward is linear (and therefore both concave and convex) in π. Moreover, DKL(π∥π0) is convex in π for fixed π0, so the constraint
DKL(π∥π0)≤ε
defines a convex feasible set. Hence maximizing the expected reward over this set is a convex optimization problem. Suppose the KL constraint is active, with multiplier η>0. The Lagrangian is
(b) Slack as function of N for the maximizing pair.
Figure 4: Finite-sample slack in the Bernoulli setting with p(0)=1−ϵ1, and q(0)=ϵ2. (a) Maximum slack over the considered sample sizes N as a function of (ϵ1,ϵ2). The maximum observed slack is indicated by the red star. (b) Exact finite-sample slack and its Monte Carlo approximation as N varies for the parameter pair (ϵ1,ϵ2)=(10−8,8.09×10−2) attaining the largest observed slack.
J EXPERIMENTAL VALIDATION
We first focus on the additive log 2 slack in Theorem 1. Specifically, we investigate how large the finite-sample gap
Δ∗=Nsup{E[DN]−DKL(p∥q)}
can become across a range of distributions and sample sizes. Our experiments confirm that this gap can indeed be positive, while suggesting that the theoretical log2≈0.69 constant is conservative: across all settings considered, we do not observe a gap larger than 0.15. This motivates the possibility that the universal additive constant in Theorem 1 can be potentially improved. We then turn to Theorem 2 and empirically validate its bound across a range of distributions and sample sizes. All Monte Carlo estimates of E[DN] are computed using 50,000 independent replicates.
J.1 Empirical Study of the Additive Slack
Bernoulli distributions. Our first experiment considers a simple Bernoulli setting on {0,1}, with
p(0)=1−ϵ1,p(1)=ϵ1,q(0)=ϵ2,q(1)=1−ϵ2,
where ϵ1,ϵ2∈(0,1/2). The corresponding importance weights are
w(0)=ϵ21−ϵ1,w(1)=1−ϵ2ϵ1.
In this setting, the expectation of the SNIS KL estimator can be evaluated exactly. In particular, if M∼Binomial(N,ϵ2) denotes the number of zeros among the N samples drawn from q, then, conditional on M=m, the total unnormalized importance weight is
(b) Slack as a function of N for selected targets.
Figure 5: Finite-sample behavior of the SNIS KL estimator for Weibull targets pμ,ν=Wei(μ,ν) with fixed proposal Q=Wei(1,1). Left: maximum slack Δ∗(μ,ν) over the shape-scale family. Right: trajectories of the gap E[DN]−DKL(p∥q) as N increases.
We evaluate the maximum finite-sample slack Δ∗(ϵ1,ϵ2):=maxN{E[DN]−DKL(p∥q)} over a logarithmically spaced grid of (ϵ1,ϵ2), where the maximum is taken over the considered sample sizes N. Figure 4a shows that positive slack occurs when p is highly concentrated on state 0, while that state remains relatively unlikely under q. Across this Bernoulli family, the largest observed slack is approximately 0.0844, substantially below the universal log 2 bound. The maximum occurs at the boundary of the considered range of ϵ1; further decreasing ϵ1 increases the slack, but the observed values appear to converge to a finite limit.
Smooth long-tail Weibull. We next consider whether differences in tail behavior between the target and proposal distributions contribute to positive finite-sample slack. To investigate this, we consider a two-parameter family of Weibull target densities. pμ,ν=Wei(μ,ν), with
pμ,ν(x)=νμ(νx)μ−1exp{−(νx)μ},x≥0,
and fix the proposal density to be q=Wei(1,1)=Exp(1). We vary the shape parameter μ and scale parameter ν over a two-dimensional grid. In particular, μ<1 corresponds to targets with heavier tails than the exponential proposal. The population KL divergence is available in closed form (Bauckhage, 2013):
DKL(p∥q)=logμ−logν+γE(μ1−1)+νΓ(1+μ1)−1,
where Γ(⋅) denotes the Gamma function and γE is the Euler–Mascheroni constant. This allows us to directly measure the finite-sample gap Δ∗(μ,ν). The results in Figure 5a show that the maximum slack remains close to zero across the considered parameter range, with sample sizes up to N=215. Moreover, the maximizing N consistently occurs at the largest sample size considered, suggesting that the slack approaches zero from below as N increases. This behavior is further illustrated in Figure 5b, where the slack remains negative across the considered sample sizes and increases toward zero. These results empirically suggest that heavier-tailed behavior of the target distribution alone does not lead to a positive overshoot in the finite-sample slack.
Rare-bump setting. Let
p=N(0,τ2),q=βN(0,τ2)+21−βN(−a,σ2)+21−βN(a,σ2).
Figure 6: Profiled SNIS slack in the rare-bump setting. For each (A,S) and fixed β, we plot Δ∗(A,S;β):=maxN{E[DN]−DKL(p∥q)}. The red star marks the maximizing geometry for each value of β. Further decreasing β below 0.01 does not substantially increase the observed slack, suggesting that the maximum slack approaches a limiting value as β→0.
The proposal places a small mass β on a component matching the target, with the remaining mass split between two symmetric side modes. Since the problem is invariant to a common rescaling of p and q, we set τ=1 without loss of generality and parameterize the geometry by
A=τa,S=τσ.
Thus the setting is completely specified by (A,S,β), together with the number of importance samples N. As shown in Figure 6, the rare-bump setting produces substantially larger positive slack than the Bernoulli and Weibull examples. The largest observed slack increases as β decreases, reaching approximately 0.142 for β=0.01, attained at N=320. The maximizing geometry also lies near the boundary of the considered (A,S) range: increasing A and S further continues to increase the slack, although the observed values appear to approach a limiting value. Similarly, further decreasing β below 0.01 does not substantially increase the observed slack, suggesting convergence to a limiting value as β→0. Nevertheless, the observed slack remains well below the universal log 2 bound.
Finally, a search over one million randomly generated discrete target–proposal pairs on a state space of size 256 does not yield substantially larger slack. This further supports our theoretical guarantee, suggesting that the optimal universal constant may be considerably smaller than log2.
J.2 Validating the Lower and Upper Bounds on DKL(pN∥q)
Figure 7 compares DKL(pN∥q), E[DN], DKL(p∥q), and the lower bound LN,4 for four discrete examples on a state space of size L=8. For each sample size N, we compute DKL(pN∥q) exactly, while E[DN] and LN,4 are estimated via Monte Carlo. The top row shows the corresponding probability masses of p and q, while the bottom row shows the induced divergence DKL(pN∥q), the lower bound LN,4, the expected SNIS estimate E[DN], and the population divergence DKL(p∥q).
The first three examples represent mild mismatch, moderate mismatch, and a rare-mode setting, respectively. In these cases, both finite-sample quantities increase toward the population KL divergence, with E[DN] consistently larger than DKL(pN∥q). The lower bound LN,4 also closely tracks DKL(pN∥q) across the examples, despite using only M=4 auxiliary samples. This behavior is consistent with the relatively small state space in this experiment, for which the auxiliary estimator can accurately capture the finite-sample density ratio with only a modest number of samples. The final example illustrates a qualitatively different behavior: E[DN] is non-monotone and exceeds the population divergence for intermediate N, reaching approximately 0.603 at N=6 compared with DKL(p∥q)≈0.559. Overall, the lower and upper bounds closely bracket the exact finite-sample divergence in these experiments, providing further empirical validation of our theoretical guarantees across a range of target-proposal configurations.
Figure 7: Exact discrete validation of the ordering between LN,4DKL(pN∥q), E[DN], and DKL(p∥q). The top row shows p and q for four representative settings, while the bottom row shows the corresponding divergences as a function of N.
Finite-Compute Behavior. We next compare the finite-compute behavior of the upper and lower estimators in a discrete experiment with 1000 states. The target p and proposal q are constructed by evaluating Gaussian mixture and Gaussian densities, respectively, on an evenly spaced grid over [−8,8] and normalizing the resulting probability masses. The target p is a symmetric bimodal Gaussian mixture with component means ±2.75 and standard deviation 0.55, while the proposal q is a centered Gaussian with standard deviation 1.30. For this pair, DKL(p∥q)≈1.994. We consider N∈{4,8,16,32,64}. For each N, we approximate pN using 500,000 independent auxiliary draws of (X2,…,XN)∼qN−1 and use the resulting density-ratio estimate to compute a high-accuracy reference value of DKL(pN∥q). We likewise estimate the reference value of E[DN] using a large number of independent SNIS samples. To compare the two estimators at equal computational cost, we consider total proposal-sampling budgets of 4N, 8N, and 16N. For the upper estimator, a budget of KN permits averaging K independent realizations of DN, each constructed from N proposals. For the lower estimator, each outer sample Y∼pN requires an SNIS pool of size N, together with M independent auxiliary pools of size N−1. Thus, under the same total budget KN, the number of affordable outer samples is
B=⌊N+M(N−1)KN⌋.
For each (N,K) pair, we consider several values of M and select the one yielding the smallest empirical central 95% sampling-interval width. The intervals are estimated from 50,000 independent repetitions of the complete estimator.
Figure 8 shows a clear difference in finite-compute behavior. The upper estimator is comparatively stable: its empirical sampling intervals shrink as the computational budget increases, and its mean remains close to E[DN]. In contrast, the lower estimator exhibits substantially larger variability under the same proposal-sampling budget. This is particularly pronounced for small and moderate N, where the logarithm of the auxiliary density-ratio estimate can be highly variable. Increasing M improves the accuracy of the auxiliary approximation for a fixed outer sample, but it also reduces the number of outer samples B that can be afforded under a fixed budget. In most of the settings considered here, the smallest empirical interval is therefore attained at M=1, indicating that allocating computation to additional outer samples is more effective than using many auxiliary samples per output. As N increases, both DKL(pN∥q) and E[DN] approach the population divergence. For example, at N=64 we obtain
DKL(pN∥q)≈1.895,E[DN]≈1.969,
compared with DKL(p∥q)≈1.994. The lower estimator also becomes more concentrated as N and the total budget increase, but its sampling intervals remain much wider than those of the upper estimator. These results
Figure 8: Upper and lower estimators under equal computational budgets for the bimodal-target, unimodal-proposal experiment. The dashed curve shows the finite-sample divergence DKL(pN∥q). Points and error bars show the empirical means and central 95% sampling intervals of the upper and lower estimators across independent repetitions. For each (N,budget), the auxiliary sample size M for the lower estimator is chosen to minimize the empirical interval width.
illustrate the practical distinction between the two sides of Theorem 2: the lower bound provides a way to estimate the implicit divergence DKL(pN∥q) from below, but requires an additional nested Monte Carlo procedure, whereas the upper bound is obtained directly from the normalized importance weights already produced by SNIS.
Shifted-Gaussian setup. We provide an additional finite-compute comparison using the shifted-Gaussian setup from Section 2.3, considering increasing levels of target-proposal mismatch, shown in Figure 9. The results again show that increasing the computational budget substantially reduces the sampling variability of both estimators, while the lower estimator is considerably more variable than the upperbound.
J.3 Additional Experiments on Soft BoN Compute
We provide additional scenarios following the setup in the second part of Section 2.3. Specifically, we consider the discretized distribution pairs summarized in Table 1. The corresponding distributions and the performance of Soft BoN across different compute budgets are shown in Figures 10 and 11. Overall, we find that K = 16 already provides a sufficiently accurate and stable estimate across the considered scenarios, while increasing to K = 64 yields consistently tighter estimates that closely track the expected value.
Figure 9: Finite-compute behavior of the upper and lower estimators for shifted-Gaussian targets with increasing target-proposal mismatch, similar to Figure 8 but with the shifted Gaussian setup in Section 2.3.
Table 1: Distribution pairs used in the SNIS experiments in Appendix J.3. The proposal distribution is denoted by π0 and the target distribution by πβ. For the irregular PMFs, z=x/6, with x∈[−6,6].
Figure 10: SNIS divergence estimates for the mode-mismatch and tail-mismatch families. Top panels show π0 and πβ; bottom panels compare the finite-N lower quantity, universal upper bound, E[DN], the true KL divergence, and Monte Carlo error bars for K∈{1,16,64}.
Figure 11: SNIS divergence estimates for the skew-mismatch and irregular-PMF families. Top panels show π0 and πβ; bottom panels compare the finite-N lower quantity, universal upper bound, E[DN], the true KL divergence, and Monte Carlo error bars for K∈{1,16,64}.