Introduction
Large Language Models (LLMs) have become a central paradigm for generating natural language text and LLM-based systems are increasingly being adopted in practice [2 , 3 , 4 ] . Given a prompt x x x , an autoregressive LLM defines a conditional probability distribution P ( ⋅ ∣ x ) \mathbb{P}(\cdot|x) P ( ⋅ ∣ x ) over output token sequences, with P ( s ∣ x ) \mathbb{P}(s|x) P ( s ∣ x ) denoting the probability assigned to the response s s s . LLMs are pretrained on large text corpora and may subsequently be adapted through task-specific fine-tuning or preference-based post-training [5 , 6 ] .
LLMs sometimes generate unrealistic and undesirable outputs. For instance, the outputs might contain factually incorrect information or reflect biases in the training data [5 , 7 ] . Sometimes, more specific properties of the generated output text, including fluency, linguistic style, and the avoidance of undesirable repetition, are targeted to be improved [8 , 9 , 10 , 11 ] . Desirable outputs are associated with a large ‘reward’ and undesirable outputs are associated with a small ‘reward’. It is thus desirable to perturb the LLM probability distribution to an aligned distribution that has a higher expected reward.
While several techniques for LLM alignment [6 , 12 , 13 , 14 , 15 , 16 , 17 ] exist in the literature, two of the most popular techniques, which are also grounded in theory, are i) KL-constrained reinforcement learning (RL), and ii) best-of-n n n alignment. KL-constrained RL returns an aligned distribution (which we sometimes call the “KL-constrained RL distribution”) whose reward is maximized while ensuring that the KL-divergence between the reference LLM distribution, i.e., the LLM distribution before alignment, and the aligned LLM distribution is small. In best-of-n n n alignment, the algorithm instead samples n n n times from the reference LLM distribution, picking the maximum-reward output among n n n outputs generated. Unlike KL-constrained RL that returns a deterministic, analytical solution, the best-of-n n n alignment returns a random response, the distribution of which we simply call the “best-of-n n n distribution”.
In the light of analytical results on the best-of-n n n algorithm, the work of [1 ] establishes a connection between the KL-constrained RL and the best-of-n n n distributions in the restricted setting where: i) the LLM generates sequences consisting of m m m i.i.d. tokens as the response for each prompt, and ii) the reward of the length-m m m sequence can be decomposed as the sum of the reward over individual tokens. Under these assumptions, the KL-constrained RL and the best-of-n n n distributions, when n = Θ ( exp ( m ) ) n = \Theta(\exp(m)) n = Θ ( exp ( m )) , are asymptotically close as m m m grows to infinity. In other words, the optimal KL-constrained RL policy, which requires knowledge of the reference LLM distribution , is asymptotically close to the computationally efficient best-of-n n n policy, which requires no such knowledge.
While the purpose of the two assumptions is to derive analytical connections between the two alignment methods for a simple, toy setting, the assumptions are not representative of the outputs of practical LLMs, which display a Markov dependence of responses conditioned on previous contexts [18 ] . An interesting question to ask, in this light, is: Is the connection between the two alignment methods a consequence of the i.i.d. nature of the tokens, or does it hold even in the presence of memory among outputs? A related question about removing i.i.d. LLM output assumption in [1 ] was posed in the same paper. We take up this question in our work, analyzing the setting of Markov LLM output distributions.
Furthermore, the work of [1 Section 5] also observed empirically that when the LLM distribution and the reward function are both randomly generated, the KL-divergence between the distributions produced by the two alignment methods is “small” even for “small” m m m values, when the LLM outputs are i.i.d. A second question to be asked in this regard, also posed in [1 ] is: For small m m m values, what LLM distributions and reward functions give rise to small KL-divergence between the distributions returned by the two alignment methods? In particular, what is the dependence of this KL-divergence on the vocabulary size? We spend the latter part of this paper providing partial progress on this question, when m = 1 m=1 m = 1 .
Our Contributions. Our main contributions are hence an affirmative answer to the first question in the presence of memory, i.e., when the LLM outputs are Markov and when the reward function can be decomposed as the sum of local rewards of contexts, there is indeed an asymptotic closeness result between the KL-constrained RL and best-of-n n n distributions. We mention that such local reward criteria arise naturally in controlled decoding and token-level objectives, including attribute control and repetition penalties [9 ] , [11 ] , [19 ] . When m = 1 m=1 m = 1 , we also identify classes of LLM reference distributions and reward functions for which the distributions produced by the two alignment methods are close in KL-divergence. In addition, for certain special classes, we characterize how the KL-divergence between the two alignment methods depends on the vocabulary size, thereby making progress on the second question as well.
Due to the paucity of space, some proofs are relegated to the appendices.
Problem Formulation and Our Results
Notation and Assumptions
Let x ∈ X x \in\mathcal{X} x ∈ X be an input (prompt) to a language model (LM). Suppose that the vocabulary (set of possible output tokens of the language model) is V V V and that the LM is restricted to output a sequence of m + 1 m+1 m + 1 tokens. Conditioned on the input x ∈ X x \in\mathcal{X} x ∈ X , a language model (denoted by M M M ) assigns a probability for each response, i.e., for each sequence z m + 1 = ( z 0 , z 1 , … , z m ) z^{m+1}=(z_0,z_1,\ldots,z_m) z m + 1 = ( z 0 , z 1 , … , z m ) of length m + 1 m+1 m + 1 . In other words, an LM is characterized by the probability distribution
P M ( z m + 1 ∣ x ) , z m + 1 ∈ V m + 1 , x ∈ X . (1) \mathbb{P}_M(z^{m+1}\mid x), \qquad z^{m+1}\in V^{m+1},\ x\in\mathcal{X}. \tag*{(1)} P M ( z m + 1 ∣ x ) , z m + 1 ∈ V m + 1 , x ∈ X . (1)
Both classical k k k -gram LMs [20 ] and modern-day LLMs generate the next token probabilistically depending on a context consisting of the previous k − 1 k-1 k − 1 tokens, in which case the probability of the given sequence z m + 1 z^{m+1} z m + 1 conditioned on the input x x x can be decomposed as follows:
P M ( z m + 1 ∣ x ) = ∏ i = 0 m P M ( z i ∣ z i − k + 1 , … , z i − 1 , x ) . (2) \mathbb{P}_M(z^{m+1}\mid x)=\prod_{i=0}^{m}\mathbb{P}_M(z_i\mid z_{i-k+1},\ldots,z_{i-1},x). \tag*{(2)} P M ( z m + 1 ∣ x ) = i = 0 ∏ m P M ( z i ∣ z i − k + 1 , … , z i − 1 , x ) . (2)
where the sequence is appropriately padded with start tokens to ensure that z − 1 , z − 2 , … z_{-1},z_{-2},\ldots z − 1 , z − 2 , … are well-defined.
Note that (2) essentially establishes the stationary Markov nature of LMs. Formally, for a fixed prompt x x x , we absorb x x x into y i − 1 : = ( z i − k + 1 , … , z i − 1 , x ) ∈ Y y_{i-1}:=(z_{i-k+1},\ldots,z_{i-1},x)\in\mathcal{Y} y i − 1 := ( z i − k + 1 , … , z i − 1 , x ) ∈ Y , where Y = X × V k − 1 \mathcal{Y}=\mathcal{X}\times V^{k-1} Y = X × V k − 1 , to obtain
P M ( z m + 1 ∣ x ) = P M ( y m + 1 ) = P ( y 0 ) ∏ i = 1 m P ( y i ∣ y i − 1 ) , (3) \mathbb{P}_M(z^{m+1}\mid x)=\mathbb{P}_M(y^{m+1})=\mathbb{P}(y_0)\prod_{i=1}^{m}\mathbb{P}(y_i\mid y_{i-1}), \tag*{(3)} P M ( z m + 1 ∣ x ) = P M ( y m + 1 ) = P ( y 0 ) i = 1 ∏ m P ( y i ∣ y i − 1 ) , (3)
where y 0 y_0 y 0 is defined to be a start token and we define Q ( y m + 1 ) : = P M ( y m + 1 ) Q(y^{m+1}):=\mathbb{P}_M(y^{m+1}) Q ( y m + 1 ) := P M ( y m + 1 ) since the model M M M is fixed. This procedure is formally stated in Assumption II.1.
Let Δ a \Delta_a Δ a denote the probability simplex on a size-a a a alphabet.
Assumption II.1. We assume that the LM outputs a sequence y m + 1 = ( y 0 , y 1 , … , y m ) ∈ Y m + 1 y^{m+1}=(y_0,y_1,\ldots,y_m)\in\mathcal{Y}^{m+1} y m + 1 = ( y 0 , y 1 , … , y m ) ∈ Y m + 1 according to a Markov process with an irreducible aperiodic transition matrix P ∣ Y ∣ × ∣ Y ∣ P_{\lvert\mathcal{Y}\rvert\times\lvert\mathcal{Y}\rvert} P ∣ Y ∣ × ∣ Y ∣ , with stationary distribution π ∈ Δ ∣ Y ∣ \pi\in\Delta_{\lvert\mathcal{Y}\rvert} π ∈ Δ ∣ Y ∣ . We also assume that the first element of the sequence, y 0 y_0 y 0 , is drawn from π \pi π . Thus, the probability distribution of the sequence y m + 1 y^{m+1} y m + 1 is obtained as:
P M ( y m + 1 ) = Q ( y m + 1 ) = π y 0 ∏ i = 1 m P y i − 1 y i . (4) \mathbb{P}_M(y^{m+1})=Q(y^{m+1})=\pi_{y_0}\prod_{i=1}^{m}P_{y_{i-1}y_i}. \tag*{(4)} P M ( y m + 1 ) = Q ( y m + 1 ) = π y 0 i = 1 ∏ m P y i − 1 y i . (4)
For each sequence outputted by the LM for a given input (or prompt) x x x , we assume there exists a positive-valued reward function r : ( X × V m + 1 ) → R + r:(\mathcal{X}\times V^{m+1})\to\mathbb{R}_+ r : ( X × V m + 1 ) → R + . Equivalently, we write the reward as r : Y m + 1 → R + r:\mathcal{Y}^{m+1}\to\mathbb{R}_+ r : Y m + 1 → R + .
To analyze the behavior of the distribution which maximizes the reward, we utilize Assumption II.2, corresponding to the local decomposition of the reward function discussed earlier.
Assumption II.2. The reward function decomposes as the sum of the rewards of adjacent terms, i.e.
r ( y m + 1 ) = ∑ i = 1 m r ( y i − 1 , y i ) = ∑ i = 1 m r y i − 1 y i , (5) r(y^{m+1})=\sum_{i=1}^{m}r(y_{i-1},y_i)=\sum_{i=1}^{m}r_{y_{i-1}y_i}, \tag*{(5)} r ( y m + 1 ) = i = 1 ∑ m r ( y i − 1 , y i ) = i = 1 ∑ m r y i − 1 y i , (5) where r a b r_{ab} r ab is a shorthand for r ( a , b ) : Y × Y → R + r(a,b):\mathcal{Y}\times\mathcal{Y}\to\mathbb{R}_+ r ( a , b ) : Y × Y → R + .
Problem Formulation
KL-constrained RL: We attempt to obtain an aligned LM which is a probability distribution q q q , such that i) the distance, measured by the KL-divergence (as in [21 ] ) d K L ( q , Q ) d_{KL}(q,Q) d K L ( q , Q ) , between the probability distributions q q q and Q Q Q is at most m δ m\delta m δ for some δ > 0 \delta>0 δ > 0 , and ii) the expected reward of q q q taken over m + 1 m+1 m + 1 samples drawn from q q q , is maximized . Note that this expected reward is:
E y m + 1 ∼ q [ r ( Y m + 1 ) ] = ∑ y m + 1 ∈ Y m + 1 q ( y m + 1 ) r ( y m + 1 ) . (6) \mathbb{E}_{y^{m+1}\sim q}[r(Y^{m+1})]=\sum_{y^{m+1}\in\mathcal{Y}^{m+1}}q(y^{m+1})r(y^{m+1}). \tag*{(6)} E y m + 1 ∼ q [ r ( Y m + 1 )] = y m + 1 ∈ Y m + 1 ∑ q ( y m + 1 ) r ( y m + 1 ) . (6)
We require that q q q be a valid probability distribution, i.e., q ∈ Δ ∣ Y ∣ m + 1 q\in\Delta_{\lvert\mathcal{Y}\rvert^{m+1}} q ∈ Δ ∣ Y ∣ m + 1 . Thus, the KL-constrained RL can be formally stated as finding
q R L = argmax q ∈ Δ ∣ Y ∣ m + 1 ∑ y m + 1 ∈ Y m + 1 q ( y m + 1 ) r ( y m + 1 ) , q_{\mathrm{RL}}=\underset{q\in\Delta_{\lvert\mathcal{Y}\rvert^{m+1}}}{\operatorname{argmax}}\sum_{y^{m+1}\in\mathcal{Y}^{m+1}}q(y^{m+1})r(y^{m+1}), q RL = q ∈ Δ ∣ Y ∣ m + 1 argmax y m + 1 ∈ Y m + 1 ∑ q ( y m + 1 ) r ( y m + 1 ) ,
subject to d K L ( q , Q ) ≤ m δ d_{KL}(q,Q)\le m\delta d K L ( q , Q ) ≤ m δ . \hspace{1em}(KL-RL)
Best-of-n n n : Let Y m + 1 , i ∼ Q Y^{m+1,i}\sim Q Y m + 1 , i ∼ Q be a length-( m + 1 ) (m+1) ( m + 1 ) sequence outputted by the LM according to the distribution Q Q Q for some fixed i i i . Now, consider a total of n n n such length-( m + 1 ) (m+1) ( m + 1 ) sequences from Q Q Q , which we call Y m + 1 , 1 , Y m + 1 , 2 , … , Y m + 1 , n Y^{m+1,1},Y^{m+1,2},\ldots,Y^{m+1,n} Y m + 1 , 1 , Y m + 1 , 2 , … , Y m + 1 , n . The best-of-n n n algorithm sets
K ∗ = argmax i ∈ [ n ] r ( Y m + 1 , i ) K^*=\underset{i\in[n]}{\operatorname{argmax}}\ r(Y^{m+1,i}) K ∗ = i ∈ [ n ] argmax r ( Y m + 1 , i )
( B o − n ) \hspace{1em}(Bo-n) ( B o − n )
and returns Y K ∗ Y_{K^*} Y K ∗ . Essentially, the algorithm outputs the highest-reward (‘best’) sequence from n n n LM outputs. We let the probability distribution of this random output Y K ∗ Y_{K^*} Y K ∗ be denoted as q n , m b e s t q^{\mathrm{best}}_{n,m} q n , m best .
The two questions in § 1 can be formalized as:
(Q1): When the LM outputs are drawn from a Markov chain and the rewards decompose locally (Assumptions II.1 and II.2), do we still have lim m → ∞ 1 m d K L ( q n , m b e s t , q β ) = 0 \lim_{m \to\infty} \frac{1}{m}d_{KL}(q^{\mathrm{best}}_{n,m},q_\beta)=0 lim m → ∞ m 1 d K L ( q n , m best , q β ) = 0 ?
(Q2): Assume that m = 1 m=1 m = 1 . For what choice of the LM distribution Q Q Q and reward function r r r is it the case that d K L ( q n , m b e s t , q β ) d_{KL}(q^{\mathrm{best}}_{n,m},q_\beta) d K L ( q n , m best , q β ) either equals or is close to zero?
Our contributions towards (Q1)
We first prove the theorem below, which connects the KL-constrained RL solution with the exponentially tilted distribution studied in [22 ] . We define the matrix G β G_\beta G β of the same dimensions as P P P to be such that
( G β ) i j = P i j ⋅ exp ( β r i j ) (7) (G_\beta)_{ij}=P_{ij}\cdot\exp(\beta r_{ij}) \tag*{(7)} ( G β ) ij = P ij ⋅ exp ( β r ij ) (7)
Theorem II.1. Under Assumptions II.1 and II.2, the solution to (KL-RL) is
q β ( y m + 1 ) = π y 0 ∏ i = 1 m ( G β ) y i − 1 y i ∑ z m + 1 ∈ Y m + 1 π z 0 ∏ i = 1 m ( G β ) z i − 1 z i , y m + 1 ∈ Y m + 1 , q_\beta(y^{m+1})=\frac{\pi_{y_0}\prod_{i=1}^{m}(G_\beta)_{y_{i-1}y_i}}{\sum_{z^{m+1}\in\mathcal{Y}^{m+1}}\pi_{z_0}\prod_{i=1}^{m}(G_\beta)_{z_{i-1}z_i}},\qquad y^{m+1}\in\mathcal{Y}^{m+1}, q β ( y m + 1 ) = ∑ z m + 1 ∈ Y m + 1 π z 0 ∏ i = 1 m ( G β ) z i − 1 z i π y 0 ∏ i = 1 m ( G β ) y i − 1 y i , y m + 1 ∈ Y m + 1 , where β ≥ 0 \beta\geq0 β ≥ 0 is chosen such that
d K L ( q β , Q ) = m δ . (8) d_{KL}(q_\beta,Q)=m\delta. \tag*{(8)} d K L ( q β , Q ) = m δ . (8)
The proof of Theorem II.1 can be found in § 3 . G β G_\beta G β is, in general, not a stochastic matrix. However, as the next theorem shows, one can write q β q_\beta q β as a non-stationary Markov process.
Theorem II.2 (Concise). There exist an initial distribution ν \nu ν and m m m stochastic matrices p ( 1 ) , p ( 2 ) , … , p ( m ) p^{(1)},p^{(2)},\ldots,p^{(m)} p ( 1 ) , p ( 2 ) , … , p ( m ) such that
q β ( y m + 1 ) = ( ν ) y 0 ∏ t = 1 m p y t − 1 y t ( t ) . (9) q_\beta(y^{m+1})=(\nu)_{y_0}\prod_{t=1}^{m}p^{(t)}_{y_{t-1}y_t}. \tag*{(9)} q β ( y m + 1 ) = ( ν ) y 0 t = 1 ∏ m p y t − 1 y t ( t ) . (9)
Explicit characterizations of ν \nu ν and the p ( t ) p^{(t)} p ( t ) ’s can be found in Theorem III.1.
Interestingly, while ν \nu ν and the p ( t ) p^{(t)} p ( t ) distributions characterize a non-stationary Markov process, for large values of m m m , this Markov process approaches stationarity and p ( t ) ≈ p ( t − 1 ) p^{(t)}\approx p^{(t-1)} p ( t ) ≈ p ( t − 1 ) for sufficiently small t t t .
Theorem II.3 (Concise). For 1 ≤ t 1 , t 2 ≤ m 1\leq t_1,t_2\leq m 1 ≤ t 1 , t 2 ≤ m such that lim m → ∞ ( m − t 1 ) → ∞ \lim_{m\to\infty}(m-t_1)\to\infty lim m → ∞ ( m − t 1 ) → ∞ and lim m → ∞ ( m − t 2 ) → ∞ \lim_{m\to\infty}(m-t_2)\to\infty lim m → ∞ ( m − t 2 ) → ∞ , we have lim m → ∞ p ( t 1 ) = lim m → ∞ p ( t 2 ) \lim_{m\to\infty}p^{(t_1)}=\lim_{m\to\infty}p^{(t_2)} lim m → ∞ p ( t 1 ) = lim m → ∞ p ( t 2 )
The proof of Theorem II.3 and more discussion about this long-term behavior of the p ( t ) p^{(t)} p ( t ) ’s is in § 3 -A.
Next, we state a large deviation principle (LDP) for the average reward under Q Q Q . Let Y m + 1 ∼ Q Y^{m+1}\sim Q Y m + 1 ∼ Q and S m ( Y m + 1 ) : = 1 m ⋅ r ( Y m + 1 ) S_m(Y^{m+1}):=\frac{1}{m}\cdot r(Y^{m+1}) S m ( Y m + 1 ) := m 1 ⋅ r ( Y m + 1 ) .
Theorem II.4. The random variable S m S_m S m satisfies an LDP with rate
J ~ ( s ) = min { θ i j , θ i } i , j ∈ Y { ∑ i , j ∈ Y θ i b i j log ( b i j P i j ) : ∑ i , j ∈ Y r i j θ i b i j = s , ∑ i ∈ Y θ i j = θ j } , \widetilde{J}(s)=\min_{\{\theta_{ij},\theta_i\}_{i,j\in\mathcal{Y}}}\left\{\sum_{i,j\in\mathcal{Y}}\theta_i b_{ij}\log\left(\frac{b_{ij}}{P_{ij}}\right):\sum_{i,j\in\mathcal{Y}}r_{ij}\theta_i b_{ij}=s,\ \sum_{i\in\mathcal{Y}}\theta_{ij}=\theta_j\right\}, J ( s ) = { θ ij , θ i } i , j ∈ Y min ⎩ ⎨ ⎧ i , j ∈ Y ∑ θ i b ij log ( P ij b ij ) : i , j ∈ Y ∑ r ij θ i b ij = s , i ∈ Y ∑ θ ij = θ j ⎭ ⎬ ⎫ , where b i j = θ i j θ i b_{ij}=\frac{\theta_{ij}}{\theta_i} b ij = θ i θ ij . Further, J ~ ( s ) \widetilde{J}(s) J ( s ) is a good rate function.
The definition of a good rate function above is standard in the LDP literature (see, for instance, [23 Section 1.2] ). The proof of Theorem II.4 is in Section IV.
Finally, we show that the distributions produced by the two alignment methods are asymptotically close, as m m m tends to infinity. Note that the KL divergence between the best-of-n n n distribution and the reference LM distribution, d K L ( q n , m b e s t , Q ) d_{KL}(q^{\mathrm{best}}_{n,m},Q) d K L ( q n , m best , Q ) , is at most log ( n ) \log(n) log ( n ) (as in [16 Theorem 3.1] ). In particular, by taking n = exp ( m δ ) n=\exp(m\delta) n = exp ( m δ ) , we get d K L ( q n , m b e s t , Q ) ≤ m δ d_{KL}(q^{\mathrm{best}}_{n,m},Q)\leq m\delta d K L ( q n , m best , Q ) ≤ m δ . The best-of-n n n distribution thus maximizes the empirical reward while implicitly maintaining d K L ( q n , m b e s t , Q ) ≤ m δ d_{KL}(q^{\mathrm{best}}_{n,m},Q)\leq m\delta d K L ( q n , m best , Q ) ≤ m δ , while the tilted distribution formulation2 for q β q_\beta q β explicitly includes a KL-constraint between the tilted distribution and the LM distribution (i.e. d K L ( q β , Q ) ≤ m δ d_{KL}(q_\beta,Q)\leq m\delta d K L ( q β , Q ) ≤ m δ ) while maximizing the reward. It is thus somewhat intuitive to expect that the normalized KL distance between the tilted and best-of-n n n distributions asymptotically goes to 0. We formalize this intuition in the following theorem.
Theorem II.5. For n = exp ( m δ ) n=\exp(m\delta) n = exp ( m δ ) , we have
lim m → ∞ 1 m d K L ( q n , m b e s t , q β ) = 0. (10) \lim_{m\to\infty}\frac{1}{m}d_{KL}(q^{\mathrm{best}}_{n,m},q_\beta)=0. \tag*{(10)} m → ∞ lim m 1 d K L ( q n , m best , q β ) = 0. (10)
The proof of Theorem II.5 can be found in § 6 .
Our contributions towards (Q2)
As shown in Theorem II.5, the KL-constrained RL and the best-of-n n n distributions are asymptotically close when the length-( m + 1 ) (m+1) ( m + 1 ) output of the LM is Markov with mild assumptions (or i.i.d., as in [1 ] ) and when n = exp ( m δ ) n=\exp(m\delta) n = exp ( m δ ) . However, this “closeness” result holds only when m → ∞ m\to\infty m → ∞ . As we argue in this section, for certain classes of distributions and reward functions, the KL-divergence under consideration could be small even if for finite, small m m m values.
In what follows, we take m = 1 m=1 m = 1 and attempt to characterize such distributions (and (associated) reward functions. Fix some δ > 0 \delta>0 δ > 0 . Now, consider the tilted distribution q β q_\beta q β and the best-of-n n n distribution, q n , 1 b e s t q^{\mathrm{best}}_{n,1} q n , 1 best , with
δ = log ( n ) − n − 1 n (11) \delta=\log(n)-\frac{n-1}{n} \tag*{(11)} δ = log ( n ) − n n − 1 (11)
as in [16 Theorem 3.1] and both distributions supported on a set Y \mathcal{Y} Y . Our definition of “smallness” of KL-divergence between q β q_\beta q β and q n , 1 b e s t q^{\mathrm{best}}_{n,1} q n , 1 best is that the KL-divergence be exactly zero; in other words, we want q β = q n , 1 b e s t q_\beta=q^{\mathrm{best}}_{n,1} q β = q n , 1 best almost surely. We assume that independent samples from Q Q Q have distinct rewards almost surely as in [16 ] . Our interest is in understanding which choices of the initial LM distribution Q Q Q and reward r r r achieve this. We first discuss an example for which this KL-divergence is zero.
Example II.1. Suppose that Y Y Y has the p.d.f. Q ( y ) = 1 Q(y)=1 Q ( y ) = 1 , y ∈ ( 0 , 1 ] y\in(0,1] y ∈ ( 0 , 1 ] . Let
r ( y ) = b + n − 1 β ⋅ log ( y ) , y ∈ ( 0 , 1 ] , (12) r(y)=b+\frac{n-1}{\beta}\cdot\log(y),\quad y\in(0,1], \tag*{(12)} r ( y ) = b + β n − 1 ⋅ log ( y ) , y ∈ ( 0 , 1 ] , (12) where we recall that β \beta β is such that d K L ( q β , Q ) = δ d_{KL}(q_\beta,Q)=\delta d K L ( q β , Q ) = δ .
The KL-constrained RL distribution q β q_\beta q β obeys, for a suitable normalization constant C > 0 C>0 C > 0 ,
q β ( y ) = C ⋅ 1 ⋅ exp ( β ( b + n − 1 β log ( y ) ) ) (13) q_\beta(y)=C\cdot1\cdot\exp\left(\beta\left(b+\frac{n-1}{\beta}\log(y)\right)\right) \tag*{(13)} q β ( y ) = C ⋅ 1 ⋅ exp ( β ( b + β n − 1 log ( y ) ) ) (13) = C ⋅ exp ( β b ) y n − 1 = ( a ) n y n − 1 ∀ 0 < y ≤ 1 , (14) =C\cdot\exp(\beta b)y^{n-1}\overset{(a)}{=}ny^{n-1}\quad\forall\ 0<y\leq1, \tag*{(14)} = C ⋅ exp ( β b ) y n − 1 = ( a ) n y n − 1 ∀ 0 < y ≤ 1 , (14) where (a) follows since q β q_\beta q β must integrate to 1. It is also possible to show that d K L ( q β , Q ) ≤ log ( n ) − n − 1 n = δ d_{KL}(q_\beta,Q)\leq\log(n)-\frac{n-1}{n}=\delta d K L ( q β , Q ) ≤ log ( n ) − n n − 1 = δ , where the equality follows from (11). Finally, note that the best-of-n n n distribution is simply the maximum of n n n i.i.d. random variables, each drawn from Q ( y ) Q(y) Q ( y ) . Thus,
q n , 1 b e s t ( y ) = n y n − 1 , 0 < y ≤ 1. (15) q^{\mathrm{best}}_{n,1}(y)=ny^{n-1},\quad0<y\leq1. \tag*{(15)} q n , 1 best ( y ) = n y n − 1 , 0 < y ≤ 1. (15) Clearly, q β q_\beta q β equals q n , 1 b e s t q^{\mathrm{best}}_{n,1} q n , 1 best , and d K L ( q β , q n , 1 b e s t ) = 0 d_{KL}(q_\beta,q^{\mathrm{best}}_{n,1})=0 d K L ( q β , q n , 1 best ) = 0 .
In the following theorem, we provide a general result on classes of Q Q Q and r r r such that the d K L ( q β , q n , 1 b e s t ) = 0 d_{KL}(q_\beta,q^{\mathrm{best}}_{n,1})=0 d K L ( q β , q n , 1 best ) = 0 . Suppose that the random variable Y Y Y has the distribution Q Q Q and let L = r ( Y ) L=r(Y) L = r ( Y ) , and let L \mathcal{L} L denote the set of values that L L L can take. Further, let p L p_L p L denote the PDF of L L L , with associated CDF P L P_L P L .
Theorem II.6. Suppose n ≥ 2 n\geq2 n ≥ 2 and the rewards are distinct almost surely. Then, q n , 1 b e s t = q β q^{\mathrm{best}}_{n,1}=q_\beta q n , 1 best = q β almost surely if and only if ∃ β > 0 , b ∈ R \exists\beta>0,\ b\in\mathbb{R} ∃ β > 0 , b ∈ R such that
P L ( l ) = { exp ( β n − 1 ( l − b ) ) , l ≤ b , 1 , l > b . (16) P_L(l)=
\begin{cases}
\exp\left(\frac{\beta}{n-1}(l-b)\right), & l\leq b,\\
1, & l>b.
\end{cases} \tag*{(16)} P L ( l ) = { exp ( n − 1 β ( l − b ) ) , 1 , l ≤ b , l > b . (16) Further, the value of n n n must satisfy log ( n ) − n − 1 n = δ \log(n)-\frac{n-1}{n}=\delta log ( n ) − n n − 1 = δ , where we recall that β \beta β in (16) is picked satisfying d K L ( q β , Q ) = δ d_{KL}(q_\beta,Q)=\delta d K L ( q β , Q ) = δ from (8).
Thus, if the CDF of the reward L L L is a suitably shifted exponential, the KL-divergence between the KL-constrained RL and best-of-n n n distributions is zero.
Note that the above theorem implies that the KL divergence between the distributions produced by the two alignment methods is zero only in the continuous case when m = 1 m=1 m = 1 . However, typical LM output distributions are discrete . Thus, we consider the discrete analogue of Example II.1, and provide the following theorem for the dependence of the KL separation on the vocabulary size, thus shedding light on a question raised in [1 ] on the relevant KL-divergence for small m m m values.
Consider a vocabulary of size d d d , defined over the words in Y d = { 1 d , 2 d , … , d d } \mathcal{Y}_d=\left\{\frac{1}{d},\frac{2}{d},\ldots,\frac{d}{d}\right\} Y d = { d 1 , d 2 , … , d d } and consider the uniform distribution Q Q Q on Y d \mathcal{Y}_d Y d with Q ( y ) = 1 d Q(y)=\frac{1}{d} Q ( y ) = d 1 , ∀ y ∈ Y d \forall y\in\mathcal{Y}_d ∀ y ∈ Y d . For finite d d d , the reward function r ( y ) = b + n − 1 β ⋅ log ( y ) r(y)=b+\frac{n-1}{\beta}\cdot\log(y) r ( y ) = b + β n − 1 ⋅ log ( y ) , ∀ y ∈ ( 0 , 1 ] \forall y\in(0,1] ∀ y ∈ ( 0 , 1 ] which makes the best-of-n n n and tilted distributions the same in the continuous case, no longer makes the KL divergence between the two distributions equal to zero in the setting of a uniform, but discrete, distribution Q Q Q . However, we consider the same reward function even for the discrete case, and argue that the KL-divergence of interest in fact decays to zero for large enough vocabulary size d d d in the following theorem.
Theorem II.7. For n ≥ 4 n\geq4 n ≥ 4 , when Q Q Q is uniform over Y d \mathcal{Y}_d Y d and r ( y ) = b + n − 1 β log ( y ) r(y)=b+\frac{n-1}{\beta}\log(y) r ( y ) = b + β n − 1 log ( y ) , for y ∈ ( 0 , 1 ] y\in(0,1] y ∈ ( 0 , 1 ] , we have
d K L ( q n , 1 b e s t , q β ) = n 8 ( n − 2 ) 1 d 2 + O ( 1 d 3 ) . (17) d_{KL}(q^{\mathrm{best}}_{n,1},q_\beta)=\frac{n}{8(n-2)}\frac{1}{d^2}+O\left(\frac{1}{d^3}\right). \tag*{(17)} d K L ( q n , 1 best , q β ) = 8 ( n − 2 ) n d 2 1 + O ( d 3 1 ) . (17) Further, q β q_\beta q β satisfies d K L ( q β , Q ) ≤ δ d_{KL}(q_\beta,Q)\leq\delta d K L ( q β , Q ) ≤ δ , as in (8).
The proof of Theorems II.6 and II.7 and additional, related discussion can be found in Section VI.
In Figure 1 , we verify that the theoretical rate from Theorem II.7 is indeed correct by plotting the calculated values of d K L ( q n , 1 b e s t , q β ) d_{KL}(q^{\mathrm{best}}_{n,1},q_\beta) d K L ( q n , 1 best , q β ) against d d d and comparing it against the theoretical (asymptotic) rate of ( 1 8 d 2 ) \left(\frac{1}{8d^2}\right) ( 8 d 2 1 ) .
Figure 1. d K L ( q β , q n , 1 b e s t ) d_{KL}(q_\beta,q^{\mathrm{best}}_{n,1}) d K L ( q β , q n , 1 best ) and the theoretical asymptotic rate 1 8 d 2 \frac{1}{8d^2} 8 d 2 1 vs d d d for n = 10 n=10 n = 10 from Theorem II.7.
KL-CONSTRAINED RL SOLUTION
We first consider the solution to the optimization problem (KL-RL), thereby proving Theorem II.1.
Proof of Theorem II.1. It is possible to write a Lagrangian to obtain (18), analogous to [1 Lemma 1] . The solution to (KL-RL) in general is the tilted distribution [22 ] for y m + 1 ∈ Y m + 1 y^{m+1}\in\mathcal{Y}^{m+1} y m + 1 ∈ Y m + 1 :
q β ( y m + 1 ) = Q ( y m + 1 ) exp ( β r ( y m + 1 ) ) ∑ z m + 1 ∈ Y m + 1 Q ( z m + 1 ) exp ( β r ( z m + 1 ) ) . (18) q_\beta(y^{m+1})=\frac{Q(y^{m+1})\exp(\beta r(y^{m+1}))}{\sum_{z^{m+1}\in\mathcal{Y}^{m+1}}Q(z^{m+1})\exp(\beta r(z^{m+1}))}. \tag*{(18)} q β ( y m + 1 ) = ∑ z m + 1 ∈ Y m + 1 Q ( z m + 1 ) exp ( β r ( z m + 1 )) Q ( y m + 1 ) exp ( β r ( y m + 1 )) . (18)
Next, we use Assumptions II.1 and II.2 and the expression for Q Q Q from (4) to obtain
q β ( y m + 1 ) = π y 0 ∏ t = 1 m ( P y t − 1 y t exp ( β r y t − 1 y t ) ) ∑ z m + 1 ∈ Y m + 1 π z 0 ∏ t = 1 m ( P z t − 1 z t exp ( β r z t − 1 z t ) ) . q_\beta(y^{m+1})=
\frac{\pi_{y_0}\prod_{t=1}^{m}\left(P_{y_{t-1}y_t}\exp(\beta r_{y_{t-1}y_t})\right)}
{\sum_{z^{m+1}\in\mathcal{Y}^{m+1}}\pi_{z_0}\prod_{t=1}^{m}\left(P_{z_{t-1}z_t}\exp(\beta r_{z_{t-1}z_t})\right)}. q β ( y m + 1 ) = ∑ z m + 1 ∈ Y m + 1 π z 0 ∏ t = 1 m ( P z t − 1 z t exp ( β r z t − 1 z t ) ) π y 0 ∏ t = 1 m ( P y t − 1 y t exp ( β r y t − 1 y t ) ) .
Substituting G β G_\beta G β from (7) completes the result. □
We next state the formal version of Theorem II.2 with ν \nu ν and the p ( t ) p^{(t)} p ( t ) expressions defined explicitly. Let h ( t ) ∈ R ∣ Y ∣ h^{(t)} \in\mathbb{R}^{|\mathcal{Y}|} h ( t ) ∈ R ∣ Y ∣ for 0 ≤ t ≤ m 0 \le t \le m 0 ≤ t ≤ m , be defined recursively as follows:
h ( m ) = 1 ∣ Y ∣ (19) h^{(m)} = \mathbf{1}_{|\mathcal{Y}|} \tag*{(19)} h ( m ) = 1 ∣ Y ∣ (19)
h ( t ) = G β h ( t + 1 ) = G β m − t 1 ∣ Y ∣ , 0 ≤ t ≤ m − 1 , h^{(t)} = G_{\beta}h^{(t+1)} = G_{\beta}^{m-t}\mathbf{1}_{|\mathcal{Y}|}, \quad0 \le t \le m-1, h ( t ) = G β h ( t + 1 ) = G β m − t 1 ∣ Y ∣ , 0 ≤ t ≤ m − 1 ,
where 1 d \mathbf{1}_{d} 1 d denotes the vector of all ones in R d \mathbb{R}^{d} R d .
Theorem III.1. We have
q β ( y m + 1 ) = ( ν ) y 0 ∏ t = 1 m p y t − 1 y t ( t ) , ∀ y m + 1 ∈ Y m + 1 , (20) q_{\beta}(y^{m+1}) = (\nu)_{y_0}\prod_{t=1}^{m}p^{(t)}_{y_{t-1}y_t}, \quad\forall y^{m+1} \in\mathcal{Y}^{m+1}, \tag*{(20)} q β ( y m + 1 ) = ( ν ) y 0 t = 1 ∏ m p y t − 1 y t ( t ) , ∀ y m + 1 ∈ Y m + 1 , (20) where ν i = π i h i ( 0 ) π T ( G β ) m 1 ∣ Y ∣ \nu_i = \dfrac{\pi_i h_i^{(0)}}{\pi^{\mathsf{T}}(G_{\beta})^m\mathbf{1}_{|\mathcal{Y}|}} ν i = π T ( G β ) m 1 ∣ Y ∣ π i h i ( 0 ) and
p a b ( t ) = ( G β ) a b h b ( t ) h a ( t − 1 ) , 1 ≤ t ≤ m ; a , b ∈ Y . p_{ab}^{(t)} = (G_{\beta})_{ab}\dfrac{h_b^{(t)}}{h_a^{(t-1)}}, \quad1 \le t \le m; a,b \in\mathcal{Y}. p ab ( t ) = ( G β ) ab h a ( t − 1 ) h b ( t ) , 1 ≤ t ≤ m ; a , b ∈ Y . Furthermore, ν \nu ν is a valid probability distribution and p ( t ) p^{(t)} p ( t ) , 1 ≤ t ≤ m 1 \le t \le m 1 ≤ t ≤ m , are valid stochastic matrices.
The proof of this theorem involves careful algebraic manipulations and is relegated to Appendix A.
Long-term behavior
In this subsection, we prove Theorem II.3, and discuss a collection of other results pertaining to the optimization problem (KL-RL). We first show that the matrix to which the p ( t ) p^{(t)} p ( t ) probabilities converge to in Theorem II.3, which we call p p p , is the same as the solution to the optimization problem in (KL-RL) but with an additional “flow” constraint added.
Formally, instead of using q q q as the optimization variable in KL-RL, we formulate an equivalent optimization problem over the variables ( μ , p ) (\mu,p) ( μ , p ) , μ ∈ R ∣ Y ∣ \mu\in\mathbb{R}^{|\mathcal{Y}|} μ ∈ R ∣ Y ∣ , p ∈ R ∣ Y ∣ × ∣ Y ∣ p \in\mathbb{R}^{|\mathcal{Y}|\times|\mathcal{Y}|} p ∈ R ∣ Y ∣ × ∣ Y ∣ , such that the flow constraint μ T p = μ T \mu^{\mathsf{T}}p=\mu^{\mathsf{T}} μ T p = μ T is satisfied. Note that we must have
q ( y m + 1 ) = μ y 0 ∏ t = 1 m p y t − 1 y t . (21) q(y^{m+1}) = \mu_{y_0}\prod_{t=1}^{m}p_{y_{t-1}y_t}. \tag*{(21)} q ( y m + 1 ) = μ y 0 t = 1 ∏ m p y t − 1 y t . (21)
The distribution q q q thus obtained is stationary Markov, since the flow constraint is also incorporated.
The expected reward function obtained from simplifying (6) using (21) is
E Y m + 1 ∼ q [ r ( Y m + 1 ) ] = ∑ y m + 1 ∈ Y m + 1 q ( y m + 1 ) r ( y m + 1 ) = ∑ t = 1 m ∑ ( a , b ) ∈ Y × Y μ a p a b r a b = m ∑ ( a , b ) ∈ Y × Y μ a p a b r a b . (22) \begin{aligned}
\mathbb{E}_{Y^{m+1}\sim q}[r(Y^{m+1})] = \sum_{y^{m+1}\in\mathcal{Y}^{m+1}}q(y^{m+1})r(y^{m+1}) \\
&= \sum_{t=1}^{m}\sum_{(a,b)\in\mathcal{Y}\times\mathcal{Y}}\mu_a p_{ab}r_{ab}
= m\sum_{(a,b)\in\mathcal{Y}\times\mathcal{Y}}\mu_a p_{ab}r_{ab}. \tag*{(22)}
\end{aligned} E Y m + 1 ∼ q [ r ( Y m + 1 )] = y m + 1 ∈ Y m + 1 ∑ q ( y m + 1 ) r ( y m + 1 ) = t = 1 ∑ m ( a , b ) ∈ Y × Y ∑ μ a p ab r ab = m ( a , b ) ∈ Y × Y ∑ μ a p ab r ab . (22)
Furthermore, the KL-constrained RL optimization constraint in (III) can be rewritten (see, for instance, [24 Theorem 1] ) as
d K L ( q , Q ) = d K L ( μ , π ) + m d K L ( p , P ) ≤ m δ , (23) d_{\mathrm{KL}}(q,Q)=d_{\mathrm{KL}}(\mu,\pi)+m d_{\mathrm{KL}}(p,P)\le m\delta, \tag*{(23)} d KL ( q , Q ) = d KL ( μ , π ) + m d KL ( p , P ) ≤ m δ , (23)
where d K L ( p , P ) d_{\mathrm{KL}}(p,P) d KL ( p , P ) denotes the KL between two Markov chains with transition matrices p p p and P P P and with stationary distributions μ \mu μ and π \pi π respectively, defined as d K L ( p , P ) = ∑ i , j ∈ Y μ i p i j log ( p i j P i j ) d_{\mathrm{KL}}(p,P)=\sum_{i,j\in\mathcal{Y}}\mu_i p_{ij}\log\left(\dfrac{p_{ij}}{P_{ij}}\right) d KL ( p , P ) = ∑ i , j ∈ Y μ i p ij log ( P ij p ij ) . Equivalently, d K L ( p , P ) ≤ δ + o ( 1 ) d_{\mathrm{KL}}(p,P)\le\delta+o(1) d KL ( p , P ) ≤ δ + o ( 1 ) . We neglect the o ( 1 ) o(1) o ( 1 ) term in our constraint and set our constraint to be d K L ( p , P ) ≤ δ d_{\mathrm{KL}}(p,P)\le\delta d KL ( p , P ) ≤ δ .
This gives us the following optimization problem (Δ a × a \Delta_{a\times a} Δ a × a denotes the set of a × a a\times a a × a stochastic matrices):
max μ ∈ Δ ∣ Y ∣ , p ∈ Δ ∣ Y ∣ × ∣ Y ∣ ∑ ( a , b ) ∈ Y × Y μ a p a b r a b subject to d K L ( p , P ) ≤ δ , μ T p = μ T . \begin{aligned}
\max_{\mu\in\Delta^{|\mathcal{Y}|},\\ p\in\Delta^{|\mathcal{Y}|\times|\mathcal{Y}|}} \quad& \sum_{(a,b)\in\mathcal{Y}\times\mathcal{Y}}\mu_a p_{ab}r_{ab}\\
\text{subject to} \quad& d_{\mathrm{KL}}(p,P)\le\delta,\ \mu^{\mathsf{T}}p=\mu^{\mathsf{T}}.
\end{aligned} μ ∈ Δ ∣ Y ∣ , p ∈ Δ ∣ Y ∣ × ∣ Y ∣ max subject to ( a , b ) ∈ Y × Y ∑ μ a p ab r ab d KL ( p , P ) ≤ δ , μ T p = μ T .
(KL-RL with Flow)
Recall the definition of G β G_{\beta} G β from Theorem III.1. The following theorem gives the solution to the optimization problem above, where we crucially use that P P P is aperiodic and irreducible (Assumption II.1) to obtain the Perron eigenvalue [25 Page 674, Equation 8.3.10] and the corresponding eigenvector of G β G_{\beta} G β .
Theorem III.2. The solution to (KL-RL with Flow) is
p a b = ( G β ) a b h b λ β h a (24) p_{ab}=\frac{(G_{\beta})_{ab}h_b}{\lambda_{\beta}h_a} \tag*{(24)} p ab = λ β h a ( G β ) ab h b (24) and μ \mu μ is the (unique) solution to μ T p = μ T \mu^{\mathsf{T}}p=\mu^{\mathsf{T}} μ T p = μ T , where λ β \lambda_{\beta} λ β is the Perron eigenvalue of ( G β ) (G_{\beta}) ( G β ) and h h h is the corresponding right Perron eigenvector, i.e., G β h = λ β h G_{\beta}h=\lambda_{\beta}h G β h = λ β h , with β \beta β chosen such that d K L ( p , P ) = δ d_{\mathrm{KL}}(p,P)=\delta d KL ( p , P ) = δ .
The proof of this theorem involves working with the Lagrangian and is relegated to Appendix B.
Next, suppose that the value of the solution to the optimization problem (KL-RL with Flow) is s δ s_{\delta} s δ . We provide an equivalent expression for s δ s_{\delta} s δ in the following theorem. In particular, for a fixed δ > 0 \delta>0 δ > 0 , the value s δ s_{\delta} s δ is related to the rate of change of log ( λ β ) \log(\lambda_{\beta}) log ( λ β ) with respect to β \beta β , where β \beta β is chosen as in Theorem III.2.
Theorem III.3. Let Λ β = log ( λ β ) \Lambda_{\beta}=\log(\lambda_{\beta}) Λ β = log ( λ β ) . Then, s δ = ∂ Λ β ∂ β = Λ β ′ s_{\delta}=\dfrac{\partial\Lambda_{\beta}}{\partial\beta}=\Lambda'_{\beta} s δ = ∂ β ∂ Λ β = Λ β ′ , where β \beta β is as in Theorem III.2.
The proof of this theorem involves taking the derivative of Λ β \Lambda_{\beta} Λ β using the multivariable chain rule and is relegated to Appendix C.
Next, we state the following lemma, which follows from the Perron-Frobenius Theorem (see, for instance [25 Page 674, Equation 8.3.10] ) and the proof of which is relegated to Appendix D. Let g g g be the left Perron eigenvector of G β G_{\beta} G β , where the magnitude of g g g is taken such that g T h = 1 g^{\mathsf{T}}h=1 g T h = 1 .
Lemma III.4. We have G β m = λ β m h g T + o ( λ β m ) G_{\beta}^{m}=\lambda_{\beta}^{m}hg^{\mathsf{T}}+o(\lambda_{\beta}^{m}) G β m = λ β m h g T + o ( λ β m ) .
Finally, we provide the full version of Theorem II.3, relating the matrices p ( t ) p^{(t)} p ( t ) arising from the optimization problem without the flow constraint (KL-RL) and the matrix p p p , arising from the optimization problem with the flow constraint (i.e. (KL-RL with Flow)). We show that the matrices p ( t ) p^{(t)} p ( t ) converge to p p p as m → ∞ m\to\infty m → ∞ in the following theorem, the proof of which uses Lemma III.4 and is relegated to Appendix E.
Theorem III.5. For 1 ≤ t ≤ m 1\le t\le m 1 ≤ t ≤ m such that lim m → ∞ ( m − t ) → ∞ \lim_{m\to\infty}(m-t)\to\infty lim m → ∞ ( m − t ) → ∞ , we have lim m → ∞ p ( t ) → p \lim_{m\to\infty}p^{(t)}\to p lim m → ∞ p ( t ) → p .
LDP FOR AVERAGE REWARD
In this section, we prove Theorem II.4. Among the m m m transitions in the m + 1 m+1 m + 1 samples, let the random variable θ i j \theta_{ij} θ ij denote the empirical fraction of transitions from i i i to j j j , where i , j ∈ Y i,j \in\mathcal{Y} i , j ∈ Y , i.e.,
θ i j = ∑ t = 1 m 1 Y t − 1 = i , Y t = j m , (25) \theta_{ij}=\frac{\sum_{t=1}^{m}\mathbf{1}_{Y_{t-1}=i,Y_t=j}}{m}, \tag*{(25)} θ ij = m ∑ t = 1 m 1 Y t − 1 = i , Y t = j , (25)
and let θ i = ∑ j ∈ Y θ i j \theta_i=\sum_{j\in\mathcal{Y}}\theta_{ij} θ i = ∑ j ∈ Y θ ij . Recall that b i j = θ i j θ i b_{ij}=\frac{\theta_{ij}}{\theta_i} b ij = θ i θ ij . Note that θ j ≠ ∑ i ∈ Y θ i j \theta_j\ne\sum_{i\in\mathcal{Y}}\theta_{ij} θ j = ∑ i ∈ Y θ ij in general.
The theorem below establishes an LDP for the empirical transitions probabilities θ : = { θ i j } \theta:=\{\theta_{ij}\} θ := { θ ij } (i.e. a Markovian Sanov’s theorem ), where we note that we get a non-trivial rate only if θ j = ∑ i ∈ Y θ i j \theta_j=\sum_{i\in\mathcal{Y}}\theta_{ij} θ j = ∑ i ∈ Y θ ij , ∀ j ∈ Y \forall j\in\mathcal{Y} ∀ j ∈ Y .
Theorem IV.1 ([26 ] , Section 3.1.3). θ \theta θ has an LDP with rate function:
J ( θ ) = { d K L ( b , P ) if θ j = ∑ i ∈ Y θ i j , ∀ j ∈ Y , ∞ , otherwise. (26) J(\theta)=
\begin{cases}
d_{KL}(b,P) & \text{if }\theta_j=\sum_{i\in\mathcal{Y}}\theta_{ij},\ \forall j\in\mathcal{Y},\\
\infty, & \text{otherwise.}
\end{cases} \tag*{(26)} J ( θ ) = { d K L ( b , P ) ∞ , if θ j = ∑ i ∈ Y θ ij , ∀ j ∈ Y , otherwise. (26) Further, J ( θ ) J(\theta) J ( θ ) is a good rate function.
Noting that S m S_m S m is a continuous function of { θ a b } a , b ∈ Y \{\theta_{ab}\}_{a,b\in\mathcal{Y}} { θ ab } a , b ∈ Y and using the Contraction principle [27 Theorem 4.2.1] yields the desired result, the full proof of which is relegated to Appendix F. We remark that this procedure affords a simpler argument than the one used in [1 ] for the setting of i.i.d. outputs as well.
The rate function obtained in Theorem II.4 is similar to the one in (KL-RL with Flow), with the following important difference: the aim in (KL-RL with Flow) is to maximize the expected reward subject to a KL constraint between the tilted and LM distribution, while in Theorem II.4, the aim is to to minimize the KL divergence between the tilted and LM distributions for a given expected reward. Let t δ ≜ max { s : J ~ ( s ) ≤ δ } t_\delta\triangleq\max\{s:\widetilde{J}(s)\le\delta\} t δ ≜ max { s : J ( s ) ≤ δ } .
We show that t δ t_\delta t δ equals s δ s_\delta s δ in the following lemma, the proof of which is relegated to Appendix G.
Lemma IV.2. For s δ s_\delta s δ being the optimum value of the optimization problem in (KL-RL with Flow), s δ = t δ s_\delta=t_\delta s δ = t δ .
CONNECTING THE KL-CONSTRAINED RL AND BEST-OF-n n n SOLUTIONS
In this section, we prove Theorem II.5. First, we use (4) and the denominator from (38) to obtain
d K L ( q n , m b e s t , q ) = E Y m + 1 ∼ q n , m b e s t [ log q n , m b e s t ( Y m + 1 ) q β ( Y m + 1 ) ] = E q n , m b e s t [ log q n , m b e s t ( Y m + 1 ) Q ( Y m + 1 ) − log q β ( Y m + 1 ) Q ( Y m + 1 ) ] = d K L ( q n , m b e s t , Q ) − β E q n , m b e s t [ r ( Y m + 1 ) ] − log ( π ⊤ ( G β ) m 1 ∣ Y ∣ ) . (27) \begin{aligned}
d_{KL}(q^{\mathrm{best}}_{n,m},q)
&=\mathbb{E}_{Y^{m+1}\sim q^{\mathrm{best}}_{n,m}}\left[\log\frac{q^{\mathrm{best}}_{n,m}(Y^{m+1})}{q_\beta(Y^{m+1})}\right]\\
&=\mathbb{E}_{q^{\mathrm{best}}_{n,m}}\left[\log\frac{q^{\mathrm{best}}_{n,m}(Y^{m+1})}{Q(Y^{m+1})}-\log\frac{q_\beta(Y^{m+1})}{Q(Y^{m+1})}\right]\\
&=d_{KL}(q^{\mathrm{best}}_{n,m},Q)-\beta\mathbb{E}_{q^{\mathrm{best}}_{n,m}}\left[r(Y^{m+1})\right]-\log\left(\pi^\top(G_\beta)^m\mathbf{1}_{|\mathcal{Y}|}\right). \tag*{(27)}
\end{aligned} d K L ( q n , m best , q ) = E Y m + 1 ∼ q n , m best [ log q β ( Y m + 1 ) q n , m best ( Y m + 1 ) ] = E q n , m best [ log Q ( Y m + 1 ) q n , m best ( Y m + 1 ) − log Q ( Y m + 1 ) q β ( Y m + 1 ) ] = d K L ( q n , m best , Q ) − β E q n , m best [ r ( Y m + 1 ) ] − log ( π ⊤ ( G β ) m 1 ∣ Y ∣ ) . (27)
Note that the first term on the right-hand side is d K L ( q n , m b e s t , Q ) ≤ log ( n ) − n − 1 n d_{KL}(q^{\mathrm{best}}_{n,m},Q)\le\log(n)^{-\frac{n-1}{n}} d K L ( q n , m best , Q ) ≤ log ( n ) − n n − 1 from [16 Theorem 3.1] , which we recall is at most m δ m\delta m δ since n = exp ( m δ ) n=\exp(m\delta) n = exp ( m δ ) . To analyze the third term in the right-hand side above, we use Lemma III.4 to get
lim m → ∞ 1 m log ( π ⊤ ( G β ) m 1 ∣ Y ∣ ) = lim m → ∞ log ( λ β m ⋅ ( π ⊤ h g ⊤ 1 ∣ Y ∣ + o ( 1 ) ) ) m = log ( λ β ) . \lim_{m\to\infty}\frac{1}{m}\log\left(\pi^\top(G_\beta)^m\mathbf{1}_{|\mathcal{Y}|}\right)
=\lim_{m\to\infty}\frac{\log\left(\lambda_\beta^m\cdot(\pi^\top h g^\top\mathbf{1}_{|\mathcal{Y}|}+o(1))\right)}{m}
=\log(\lambda_\beta). m → ∞ lim m 1 log ( π ⊤ ( G β ) m 1 ∣ Y ∣ ) = m → ∞ lim m log ( λ β m ⋅ ( π ⊤ h g ⊤ 1 ∣ Y ∣ + o ( 1 )) ) = log ( λ β ) .
It is left to analyze the second term in (27), i.e. E Z m + 1 ∼ q n , m b e s t [ r ( Z m + 1 ) ] \mathbb{E}_{Z^{m+1}\sim q^{\mathrm{best}}_{n,m}}[r(Z^{m+1})] E Z m + 1 ∼ q n , m best [ r ( Z m + 1 )] . Let T m , n ( Z m + 1 ) = 1 m r ( Z m + 1 ) T_{m,n}(Z^{m+1})=\frac{1}{m}r(Z^{m+1}) T m , n ( Z m + 1 ) = m 1 r ( Z m + 1 ) , where Z m + 1 ∼ q n , m b e s t Z^{m+1}\sim q^{\mathrm{best}}_{n,m} Z m + 1 ∼ q n , m best . Recall that we have an LDP for S m ( Y m + 1 ) S_m(Y^{m+1}) S m ( Y m + 1 ) from Theorem II.4, where S m S_m S m is the average reward when Y m + 1 Y^{m+1} Y m + 1 follows the distribution q β q_\beta q β . However, (27) has the expectation in terms of the distribution q n , m b e s t q^{\mathrm{best}}_{n,m} q n , m best and thus it is necessary to connect the expected value of the average reward under Q Q Q to that under q n , m b e s t q^{\mathrm{best}}_{n,m} q n , m best .
By the definition of best-of-n n n , note that the reward T m , n T_{m,n} T m , n is the maximum of the rewards of n n n i.i.d. reward samples obtained from Q Q Q . Formally, let S m ( 1 ) , S m ( 2 ) , … S m ( n ) S_m^{(1)},S_m^{(2)},\ldots S_m^{(n)} S m ( 1 ) , S m ( 2 ) , … S m ( n ) be n n n i.i.d. copies of S m S_m S m . Then,
T m , n = max i = 1 n S m ( i ) . (28) T_{m,n}=\max_{i=1}^{n}S_m^{(i)}. \tag*{(28)} T m , n = i = 1 max n S m ( i ) . (28)
We are interested in E [ T m , n ] \mathbb{E}[T_{m,n}] E [ T m , n ] when n = exp ( m δ ) n=\exp(m\delta) n = exp ( m δ ) . First, we consider the random variable T m , exp ( m δ ) T_{m,\exp(m\delta)} T m , e x p ( m δ ) and establish its convergence in probability to s δ s_\delta s δ .
Lemma V.1. We have T m , exp ( m δ ) ⟶ P s δ T_{m,\exp(m\delta)}\overset{\mathbb{P}}{\longrightarrow}s_\delta T m , e x p ( m δ ) ⟶ P s δ .
The proof of this theorem uses the LDP rate function from Theorem II.4 and is relegated to Appendix H.
The following corollary on the expected value of T m , exp ( m δ ) T_{m,\exp(m\delta)} T m , e x p ( m δ ) holds since T m , exp ( m δ ) T_{m,\exp(m\delta)} T m , e x p ( m δ ) is bounded.
Corollary V.2. We have E [ T m , exp ( m δ ) ] ⟶ s δ \mathbb{E}[T_{m,\exp(m\delta)}]\longrightarrow s_\delta E [ T m , e x p ( m δ ) ] ⟶ s δ .
Now, we have shown that
lim m → ∞ 1 m d K L ( q n , m b e s t , q ) = δ − β s δ + log ( λ β ) . (29) \lim_{m\to\infty}\frac{1}{m}d_{KL}(q^{\mathrm{best}}_{n,m},q)=\delta-\beta s_\delta+\log(\lambda_\beta). \tag*{(29)} m → ∞ lim m 1 d K L ( q n , m best , q ) = δ − β s δ + log ( λ β ) . (29)
It is left to show that this expression is zero, which we do in the following lemma, the proof of which is algebraic and is relegated to Appendix I. Recall from Theorem III.3 that Λ β = log ( λ β ) \Lambda_\beta=\log(\lambda_\beta) Λ β = log ( λ β ) and s δ = Λ β ′ s_\delta=\Lambda'_\beta s δ = Λ β ′ .
Lemma V.3. We have δ − β Λ β ′ + Λ β = 0 \delta-\beta\Lambda'_\beta+\Lambda_\beta=0 δ − β Λ β ′ + Λ β = 0 .
CLOSENESS OF BEST-OF-n n n AND THE KL-RL DISTRIBUTION FOR m = 1 m=1 m = 1
We first state some measure theoretic assumptions. Assume that Y \mathcal{Y} Y is a Borel space, equipped with its Borel σ \sigma σ -algebra B ( Y ) \mathcal{B}(\mathcal{Y}) B ( Y ) , so that the conditional distributions given L = r ( Y ) L=r(Y) L = r ( Y ) exist. Recall that Q Q Q denotes the law of Y Y Y , and that q β q_\beta q β denotes the tilted distribution satisfying the following Radon–Nikodym derivative:
d q β d Q ( y ) = e β r ( y ) A β . (30) \frac{dq_\beta}{dQ}(y)=\frac{e^{\beta r(y)}}{A_\beta}. \tag*{(30)} d Q d q β ( y ) = A β e β r ( y ) . (30)
where A β A_{\beta} A β is a suitable normalization constant. Assume that r : Y → R r:\mathcal{Y}\to\mathbb{R} r : Y → R is Borel measurable. Let p L p_L p L and p L ′ p_{L'} p L ′ denote the laws of L = r ( Y ) L=r(Y) L = r ( Y ) under Q Q Q and q β q_{\beta} q β , respectively and let the support of L L L be L \mathcal{L} L .
We note the following lemma, where we use that the ‘tilt’ (i.e. exp ( β r ( y ) ) \exp(\beta r(y)) exp ( β r ( y )) term) in q β q_{\beta} q β depends only on r ( y ) r(y) r ( y ) and the proof of which is relegated to Appendix J.
Lemma VI.1. For B ∈ B ( Y ) B\in\mathcal{B}(\mathcal{Y}) B ∈ B ( Y ) , for p L ′ p_{L'} p L ′ -almost every l l l ,
q β ( Y ′ ∈ B ∣ L ′ = l ) = Q ( Y ∈ B ∣ L = l ) q_{\beta}(Y'\in B\mid L'=l)=Q(Y\in B\mid L=l) q β ( Y ′ ∈ B ∣ L ′ = l ) = Q ( Y ∈ B ∣ L = l )
We note the corollary below about the KL divergences, which follows by using the chain rule for KL divergence [28 Theorem 2.5.3] .
Corollary VI.2. We have that d K L ( p L ′ , p L ) = d K L ( q β , Q ) d_{KL}(p_{L'},p_L)=d_{KL}(q_{\beta},Q) d K L ( p L ′ , p L ) = d K L ( q β , Q ) .
This corollary is useful in proving Theorem II.6.
We will assume that L L L has a continuous CDF P L ( l ) P_L(l) P L ( l ) , l ∈ L l\in\mathcal{L} l ∈ L for simplicity.3 Recall the definitions of F F F and F − F^{-} F − for the best-of-n n n policy from [16 ] :
F ( y ) = P Z ∼ Q ( r ( Z ) ≤ r ( y ) ) , y ∈ Y (31) F(y)=\mathbb{P}_{Z\sim Q}(r(Z)\le r(y)),\qquad y\in\mathcal{Y} \tag*{(31)} F ( y ) = P Z ∼ Q ( r ( Z ) ≤ r ( y )) , y ∈ Y (31)
F − ( y ) = P Z ∼ Q ( r ( Z ) < r ( y ) ) , y ∈ Y . (32) F^{-}(y)=\mathbb{P}_{Z\sim Q}(r(Z)<r(y)),\qquad y\in\mathcal{Y}. \tag*{(32)} F − ( y ) = P Z ∼ Q ( r ( Z ) < r ( y )) , y ∈ Y . (32)
In our notation, F ( y ) = P L ( r ( y ) ) F(y)=P_L(r(y)) F ( y ) = P L ( r ( y )) , y ∈ Y y\in\mathcal{Y} y ∈ Y . In [16 Lemma 2.3] , the probability mass function of the best-of-n n n policy was given to be q n , 1 b e s t ( y ) = ( F ( y ) ) n − ( F − ( y ) ) n q^{\mathrm{best}}_{n,1}(y)=(F(y))^n-(F^{-}(y))^n q n , 1 best ( y ) = ( F ( y ) ) n − ( F − ( y ) ) n . We next give the continuous analogue of this equation in the following lemma, the proof of which is relegated to Appendix K.
Lemma VI.3. q n , 1 b e s t q^{\mathrm{best}}_{n,1} q n , 1 best is absolutely continuous with respect to Q Q Q , with the Radon–Nikodym derivative d q n , 1 b e s t d Q ( y ) = n P L ( r ( y ) ) n − 1 \frac{dq^{\mathrm{best}}_{n,1}}{dQ}(y)=nP_L(r(y))^{n-1} d Q d q n , 1 best ( y ) = n P L ( r ( y ) ) n − 1 .
Finally, we note that the KL–divergence between two distributions if zero if and only if they are equal almost surely and use the expressions for the best-of-n n n distribution from Lemma VI.3 and the tilted distribution from (30) to obtain Theorem II.6, the proof of which is relegated to Appendix L.
Remark VI.1. It appears that the reward function in Theorem II.6 is dependent on β \beta β but the expressions for both q n , 1 b e s t q^{\mathrm{best}}_{n,1} q n , 1 best and q β q_{\beta} q β do not depend on β \beta β . This is since the value of β \beta β and r ( y ) r(y) r ( y ) are picked jointly, such that the effect of β \beta β “cancels” in q β q_{\beta} q β .
Discrete Case
Best-of-n n n distribution: Let y i = i / d y_i=i/d y i = i / d for i ∈ [ d ] i\in[d] i ∈ [ d ] . Note that the expression for r ( y ) r(y) r ( y ) from Theorem II.6 is a strictly increasing in y y y . From this,
q n , 1 b e s t ( y ) = y n − ( y − 1 d ) n , y ∈ Y d (33) q^{\mathrm{best}}_{n,1}(y)=y^n-\left(y-\frac{1}{d}\right)^n,\qquad y\in\mathcal{Y}_d \tag*{(33)} q n , 1 best ( y ) = y n − ( y − d 1 ) n , y ∈ Y d (33)
q n , 1 b e s t ( y i ) = i n − ( i − 1 ) n d n , i ∈ [ d ] . (34) q^{\mathrm{best}}_{n,1}(y_i)=\frac{i^n-(i-1)^n}{d^n},\qquad i\in[d]. \tag*{(34)} q n , 1 best ( y i ) = d n i n − ( i − 1 ) n , i ∈ [ d ] . (34)
Tilted Distribution: We apply the definition of the tilted distribution to obtain
q β ( y ) ∝ 1 ⋅ exp ( β r ( y ) ) = exp ( β ( b + n − 1 β log ( y ) ) ) ∝ exp ( ( ( n − 1 ) log ( y ) ) ) = y n − 1 , y ∈ Y d , (35) q_{\beta}(y)\propto1\cdot\exp(\beta r(y))=\exp\left(\beta\left(b+\frac{n-1}{\beta}\log(y)\right)\right)
\propto\exp(((n-1)\log(y)))=y^{n-1},\qquad y\in\mathcal{Y}_d, \tag*{(35)} q β ( y ) ∝ 1 ⋅ exp ( β r ( y )) = exp ( β ( b + β n − 1 log ( y ) ) ) ∝ exp ((( n − 1 ) log ( y ))) = y n − 1 , y ∈ Y d , (35)
q β ( y i ) = ( i / d ) n − 1 ∑ j = 1 d ( j / d ) n − 1 = i n − 1 S d , n − 1 , i ∈ [ d ] , (36) q_{\beta}(y_i)=\frac{(i/d)^{n-1}}{\sum_{j=1}^{d}(j/d)^{n-1}}=\frac{i^{n-1}}{S_{d,n-1}},\qquad i\in[d], \tag*{(36)} q β ( y i ) = ∑ j = 1 d ( j / d ) n − 1 ( i / d ) n − 1 = S d , n − 1 i n − 1 , i ∈ [ d ] , (36)
where S d , n − 1 ≜ ∑ j = 1 d j n − 1 S_{d,n-1}\triangleq\sum_{j=1}^{d}j^{n-1} S d , n − 1 ≜ ∑ j = 1 d j n − 1 .
Note that q β q_{\beta} q β in this case is actually independent of β \beta β . We verify below that the constraint d K L ( q β , Q ) ≤ δ d_{KL}(q_{\beta},Q)\le\delta d K L ( q β , Q ) ≤ δ is satisfied, the proof of which is in Appendix M.
Lemma VI.4. We have d K L ( q β , Q ) ≤ log ( n ) − n − 1 n = δ d_{KL}(q_{\beta},Q)\le\log(n)-\frac{n-1}{n}=\delta d K L ( q β , Q ) ≤ log ( n ) − n n − 1 = δ .
Finally, we compute
d K L ( q n , 1 b e s t , q β ) = ∑ i ∈ [ d ] i n − ( i − 1 ) n d n log ( i n − ( i − 1 ) n d n ⋅ S d , n − 1 i n − 1 ) . d_{KL}\left(q^{\mathrm{best}}_{n,1},q_{\beta}\right)
=\sum_{i\in[d]}\frac{i^n-(i-1)^n}{d^n}\log\left(\frac{i^n-(i-1)^n}{d^n}\cdot\frac{S_{d,n-1}}{i^{n-1}}\right). d K L ( q n , 1 best , q β ) = i ∈ [ d ] ∑ d n i n − ( i − 1 ) n log ( d n i n − ( i − 1 ) n ⋅ i n − 1 S d , n − 1 ) .
This is the exact finite-d d d expression, but we want an approximation of this to glean insights about the dependence on d d d and n n n . Note that the numerator has an i n − 1 i^{n-1} i n − 1 term while the denominator has a term which can be Taylor-expanded to an i n − 1 i^{n-1} i n − 1 order term. We perform these expansions and cancel out the corresponding terms to get Theorem II.7, the full proof of which is in Appendix N.
Conclusions
In this work, we studied two popular Language Model (LM) alignment methods: KL-constrained RL, which, although optimal in terms of expected reward, requires full knowledge of the LM distribution, and best-of-n n n , which is a computationally inexpensive method widely adopted in practice. Assuming Markov LM outputs and local decomposition of rewards, we showed that the two aligned distributions are asymptotically close, as the length of the outputs increases to infinity. This answers an extension raised in [1 ] (which in fact studied the same problem under i.i.d. outputs) to a more practical setting. We further identified classes of LM distributions and reward functions for which the two aligned distributions remain close in a finite, non-asymptotic regime, making progress on another question posed in [1 ] . Future directions include analyzing asymptotic closeness under missing assumptions and analyzing non-asymptotic closeness for arbitrary discrete distributions.
AI Use Statement
OpenAI’s GPT 5.5 model was used to generate the code for the Python Matplotlib plots in Figure 1 and in cleaning up the proofs of Lemma V.1, Lemma VI.4, and Theorem II.7. GPT 5.6 used to proof-read the paper and for grammatical and stylistic changes. The authors assume full responsibility for the contents of the paper.
Proof of Theorem III.1
Proof of Theorem III.1. First, consider the denominator of the expression from Theorem II.1. Since the summation is over all sequences z m + 1 ∈ Y m + 1 z^{m+1} \in\mathcal{Y}^{m+1} z m + 1 ∈ Y m + 1 , it is possible to write
∑ z m + 1 ∈ Y m + 1 π z 0 ∏ t = 1 m ( G β ) z t − 1 z t 1 z t = π ⊤ ( G β ) m 1 ∣ Y ∣ . (37) \sum_{z^{m+1}\in\mathcal{Y}^{m+1}} \pi_{z_0}\prod_{t=1}^{m}(G_\beta)_{z_{t-1}z_t}1_{z_t}=\pi^{\top}(G_\beta)^m\mathbf{1}_{|\mathcal{Y}|}. \tag*{(37)} z m + 1 ∈ Y m + 1 ∑ π z 0 t = 1 ∏ m ( G β ) z t − 1 z t 1 z t = π ⊤ ( G β ) m 1 ∣ Y ∣ . (37)
Next, consider the numerator and use h m ( y m ) = 1 h_m(y_m)=1 h m ( y m ) = 1 as below:
π y 0 ∏ t = 1 m ( G β ) y t − 1 y t = π y 0 ( h 0 ) y 0 ( h 0 ) y 0 ∏ t = 1 m ( G β ) y t − 1 y t ( h t ) y t ( h t ) y t (38) \pi_{y_0}\prod_{t=1}^{m}(G_\beta)_{y_{t-1}y_t}
=\pi_{y_0}\frac{(h_0)_{y_0}}{(h_0)_{y_0}}\prod_{t=1}^{m}(G_\beta)_{y_{t-1}y_t}\frac{(h_t)_{y_t}}{(h_t)_{y_t}} \tag*{(38)} π y 0 t = 1 ∏ m ( G β ) y t − 1 y t = π y 0 ( h 0 ) y 0 ( h 0 ) y 0 t = 1 ∏ m ( G β ) y t − 1 y t ( h t ) y t ( h t ) y t (38)
= π y 0 ( h 0 ) y 0 ∏ t = 1 m ( G β ) y t − 1 y t ( h t ) y t ( h t − 1 ) y t − 1 (39) =\pi_{y_0}(h_0)_{y_0}\prod_{t=1}^{m}(G_\beta)_{y_{t-1}y_t}\frac{(h_t)_{y_t}}{(h_{t-1})_{y_{t-1}}} \tag*{(39)} = π y 0 ( h 0 ) y 0 t = 1 ∏ m ( G β ) y t − 1 y t ( h t − 1 ) y t − 1 ( h t ) y t (39)
= π y 0 ( h 0 ) y 0 ∏ t = 1 m p y t − 1 y t ( t ) . (40) =\pi_{y_0}(h_0)_{y_0}\prod_{t=1}^{m}p^{(t)}_{y_{t-1}y_t}. \tag*{(40)} = π y 0 ( h 0 ) y 0 t = 1 ∏ m p y t − 1 y t ( t ) . (40)
Next, we verify that ν \nu ν is a valid probability distribution. Clearly, non-negativity holds.
∑ i ∈ Y ν i = ∑ i ∈ Y π i h i ( 0 ) π ⊤ ( G β ) m 1 ∣ Y ∣ = ∑ i ∈ Y π i ( G β m 1 ∣ Y ∣ ) i π ⊤ ( G β ) m 1 ∣ Y ∣ = 1. (41) \sum_{i\in\mathcal{Y}}\nu_i
=\frac{\sum_{i\in\mathcal{Y}}\pi_i h_i^{(0)}}{\pi^{\top}(G_\beta)^m\mathbf{1}_{|\mathcal{Y}|}}
=\frac{\sum_{i\in\mathcal{Y}}\pi_i(G_\beta^m\mathbf{1}_{|\mathcal{Y}|})_i}{\pi^{\top}(G_\beta)^m\mathbf{1}_{|\mathcal{Y}|}}
=1. \tag*{(41)} i ∈ Y ∑ ν i = π ⊤ ( G β ) m 1 ∣ Y ∣ ∑ i ∈ Y π i h i ( 0 ) = π ⊤ ( G β ) m 1 ∣ Y ∣ ∑ i ∈ Y π i ( G β m 1 ∣ Y ∣ ) i = 1. (41)
Finally, we verify that the p ( t ) p^{(t)} p ( t ) 's are valid stochastic matrices, where we use the definition from (19):
∑ b ∈ Y p ( t ) ( a , b ) = ∑ b ∈ Y ( G β ) a b h b ( t ) h a ( t − 1 ) = 1 ∀ 1 ≤ t ∈ m , ∀ a ∈ Y . (42) \sum_{b\in\mathcal{Y}}p^{(t)}(a,b)=\sum_{b\in\mathcal{Y}}(G_\beta)_{ab}\frac{h_b^{(t)}}{h_a^{(t-1)}}=1\quad\forall1\leq t\in m,\ \forall a\in\mathcal{Y}. \tag*{(42)} b ∈ Y ∑ p ( t ) ( a , b ) = b ∈ Y ∑ ( G β ) ab h a ( t − 1 ) h b ( t ) = 1 ∀1 ≤ t ∈ m , ∀ a ∈ Y . (42)
Proof of Theorem III.2
Proof. We solve this problem by writing a Lagrangian for suitable constants β \beta β , c a c_a c a , v b v_b v b , η \eta η for a , b ∈ Y a,b\in\mathcal{Y} a , b ∈ Y , as follows:
L = ∑ ( a , b ) ∈ Y × Y μ a p a b r a b − 1 β ( d K L ( p , P ) − δ ) + ∑ a ∈ Y μ a c a ( ∑ b ∈ Y p a b − 1 ) + ∑ b ∈ Y v b ( ∑ a ∈ Y μ a p a b − μ b ) + η ( ∑ a μ a − 1 ) . (43) \mathcal{L}=\sum_{(a,b)\in\mathcal{Y}\times\mathcal{Y}}\mu_a p_{ab}r_{ab}-\frac{1}{\beta}\left(d_{\mathrm{KL}}(p,P)-\delta\right)+\sum_{a\in\mathcal{Y}}\mu_a c_a\left(\sum_{b\in\mathcal{Y}}p_{ab}-1\right)+\sum_{b\in\mathcal{Y}}v_b\left(\sum_{a\in\mathcal{Y}}\mu_a p_{ab}-\mu_b\right)+\eta\left(\sum_a\mu_a-1\right). \tag*{(43)} L = ( a , b ) ∈ Y × Y ∑ μ a p ab r ab − β 1 ( d KL ( p , P ) − δ ) + a ∈ Y ∑ μ a c a ( b ∈ Y ∑ p ab − 1 ) + b ∈ Y ∑ v b ( a ∈ Y ∑ μ a p ab − μ b ) + η ( a ∑ μ a − 1 ) . (43)
Taking gradients with respect to p a b p_{ab} p ab first, we obtain
μ a r a b − 1 β μ a ( 1 + log ( p a b P a b ) ) + μ a c a + v b μ a = 0 , (44) \mu_a r_{ab}-\frac{1}{\beta}\mu_a\left(1+\log\left(\frac{p_{ab}}{P_{ab}}\right)\right)+\mu_a c_a+v_b\mu_a=0, \tag*{(44)} μ a r ab − β 1 μ a ( 1 + log ( P ab p ab ) ) + μ a c a + v b μ a = 0 , (44)
thereby yielding
p a b = C a D b P a b exp ( β r a b ) = C a D b ( G β ) a b , a , b ∈ Y , (45) p_{ab}=C_aD_bP_{ab}\exp(\beta r_{ab})=C_aD_b(G_\beta)_{ab},\quad a,b\in\mathcal{Y}, \tag*{(45)} p ab = C a D b P ab exp ( β r ab ) = C a D b ( G β ) ab , a , b ∈ Y , (45)
for suitable constants C a , D b ≥ 0 C_a,D_b\geq0 C a , D b ≥ 0 .
Recall from Assumption II.1 that P P P is aperiodic and irreducible. Using the definition ( G β ) a b = P a b exp ( β r a b ) (G_\beta)_{ab}=P_{ab}\exp(\beta r_{ab}) ( G β ) ab = P ab exp ( β r ab ) , it follows that G β G_\beta G β is primitive. From standard arguments (see, for instance [25 Page 674, Equation 8.3.10] ), it also follows that G β G_\beta G β will have a unique Perron eigenvalue λ β \lambda_\beta λ β , and a unique right Perron eigenvector (up to scaling) h ∈ R ∣ Y ∣ h\in\mathbb{R}^{|\mathcal{Y}|} h ∈ R ∣ Y ∣ . Now, take D b = h b D_b=h_b D b = h b and C a = 1 λ β h a C_a=\frac{1}{\lambda_\beta h_a} C a = λ β h a 1 as in the theorem statement, where h h h is defined as in the theorem statement. Such a h h h would exist since G G G is a non-negative matrix.
It is left to verify all the constraints. First, we verify the row-stochasticity constraint:
∑ b ∈ Y p a b = ( G β h ) a λ β h a = λ β h a λ β h a = 1. (46) \sum_{b\in\mathcal{Y}}p_{ab}=\frac{(G_\beta h)_a}{\lambda_\beta h_a}=\frac{\lambda_\beta h_a}{\lambda_\beta h_a}=1. \tag*{(46)} b ∈ Y ∑ p ab = λ β h a ( G β h ) a = λ β h a λ β h a = 1. (46)
The value of μ \mu μ is chosen such that it is the left eigenvector of p p p , with the eigenvalue 1, and such that ∑ a ∈ Y μ a = 1 \sum_{a\in\mathcal{Y}}\mu_a = 1 ∑ a ∈ Y μ a = 1 is satisfied. This choice of μ \mu μ ensures that both these constraints are trivially satisfied. Finally, the value of β \beta β is chosen such that d K L ( p , P ) = δ d_{KL}(p,P)=\delta d K L ( p , P ) = δ .
Next, we argue that μ \mu μ is unique. Let D h = diag ( h 1 , h 2 , … , h ∣ Y ∣ ) D_h=\operatorname{diag}(h_1,h_2,\ldots,h_{|\mathcal{Y}|}) D h = diag ( h 1 , h 2 , … , h ∣ Y ∣ ) . From this, note that
p = D h − 1 G β λ β D h . (47) p=D_h^{-1}\frac{G_\beta}{\lambda_\beta}D_h. \tag*{(47)} p = D h − 1 λ β G β D h . (47)
Thus, p p p is similar to G β λ β \frac{G_\beta}{\lambda_\beta} λ β G β . Since G β λ β \frac{G_\beta}{\lambda_\beta} λ β G β itself has a unique left Perron vector (up to scaling) corresponding to the eigenvalue 1, p p p , via similarity with G β λ β \frac{G_\beta}{\lambda_\beta} λ β G β , also has an unique left Perron eigenvector (say μ \mu μ ) corresponding to the eigenvalue 1. μ \mu μ will hence be that (unique) positive vector satisfying μ T p = μ T \mu^T p=\mu^T μ T p = μ T , whose elements sum up to 1.
Proof of Theorem III.3
Proof. Recall that s δ = ∑ ( i , j ) ∈ Y × Y μ i p i j r i j s_\delta=\sum_{(i,j)\in\mathcal{Y}\times\mathcal{Y}}\mu_i p_{ij}r_{ij} s δ = ∑ ( i , j ) ∈ Y × Y μ i p ij r ij , where μ \mu μ and p p p are given by Theorem III.2. Although h h h (see Theorem III.2) is a function of β \beta β , we omit an explicit dependence on β \beta β in the notation, for brevity. Let g g g be the left eigenvector of G β G_\beta G β corresponding to the eigenvalue λ β \lambda_\beta λ β , i.e. g T G β = λ β g T g^T G_\beta=\lambda_\beta g^T g T G β = λ β g T and let its magnitude be such that g T h = 1 g^T h=1 g T h = 1 .
First, we relate μ \mu μ with g g g and h h h . Take the quantity
∑ i ∈ Y g i h i p i j = ∑ i ∈ Y g i h i ( G β ) i j h j λ β h i = h j λ β ∑ i ∈ Y g i ( G β ) i j = g j h j . (48) \sum_{i\in\mathcal{Y}}g_i h_i p_{ij}=\sum_{i\in\mathcal{Y}}g_i h_i\frac{(G_\beta)_{ij}h_j}{\lambda_\beta h_i}=\frac{h_j}{\lambda_\beta}\sum_{i\in\mathcal{Y}}g_i(G_\beta)_{ij}=g_jh_j. \tag*{(48)} i ∈ Y ∑ g i h i p ij = i ∈ Y ∑ g i h i λ β h i ( G β ) ij h j = λ β h j i ∈ Y ∑ g i ( G β ) ij = g j h j . (48)
Also recall that ∑ j ∈ Y g j h j = 1 \sum_{j\in\mathcal{Y}}g_jh_j=1 ∑ j ∈ Y g j h j = 1 . Recall from Theorem III.2 that p p p has a unique left eigenvector μ \mu μ corresponding to the eigenvalue 1 whose elements also sum up to 1. From the above discussion, we see that the vector g j h j g_jh_j g j h j is the unique left eigenvector (with eigenvalue 1) for p p p whose elements sum up to 1, i.e., we must have μ j = g j h j \mu_j=g_jh_j μ j = g j h j .
Now, differentiating the expression G β h = λ β h G_\beta h=\lambda_\beta h G β h = λ β h with respect to β \beta β on both sides, we get:
G β h ′ + G β ′ h = λ β ′ h + λ β h ′ , (49) G_\beta h' + G'_\beta h=\lambda'_\beta h+\lambda_\beta h', \tag*{(49)} G β h ′ + G β ′ h = λ β ′ h + λ β h ′ , (49)
where ′ ' ′ denotes the derivative with respect to β \beta β . By left-multiplying both sides with g T g^T g T , we get
g T G β h ′ + g T G β ′ h = λ β ′ g T h + λ β g T h ′ . (50) g^T G_\beta h' + g^T G'_\beta h=\lambda'_\beta g^T h+\lambda_\beta g^T h'. \tag*{(50)} g T G β h ′ + g T G β ′ h = λ β ′ g T h + λ β g T h ′ . (50)
Observing that g T G β = λ β g T g^T G_\beta=\lambda_\beta g^T g T G β = λ β g T , we obtain
g T G β ′ h = λ β ′ . (51) g^T G'_\beta h=\lambda'_\beta. \tag*{(51)} g T G β ′ h = λ β ′ . (51)
Note that ( G β ′ ) i j = ( G β ) i j r i j (G'_\beta)_{ij}=(G_\beta)_{ij}r_{ij} ( G β ′ ) ij = ( G β ) ij r ij from the definition in Theorem II.1. From this, we have
λ β ′ = ∑ i , j ∈ Y g i ( G β ) i j r i j h j , (52) \lambda'_\beta=\sum_{i,j\in\mathcal{Y}}g_i(G_\beta)_{ij}r_{ij}h_j, \tag*{(52)} λ β ′ = i , j ∈ Y ∑ g i ( G β ) ij r ij h j , (52)
and hence that
Λ β ′ = λ β ′ λ β = ∑ i , j ∈ Y g i ( G β ) i j r i j h j λ β . (53) \Lambda'_\beta=\frac{\lambda'_\beta}{\lambda_\beta}=\sum_{i,j\in\mathcal{Y}}\frac{g_i(G_\beta)_{ij}r_{ij}h_j}{\lambda_\beta}. \tag*{(53)} Λ β ′ = λ β λ β ′ = i , j ∈ Y ∑ λ β g i ( G β ) ij r ij h j . (53)
Finally, we use the definition of p i j p_{ij} p ij and μ i = g i h i \mu_i=g_i h_i μ i = g i h i to get
Λ β ′ = ∑ i , j ∈ Y g i h i r i j p i j = ∑ i , j ∈ Y μ i r i j p i j = s δ . (54) \Lambda'_\beta=\sum_{i,j\in\mathcal{Y}}g_i h_i r_{ij}p_{ij}=\sum_{i,j\in\mathcal{Y}}\mu_i r_{ij}p_{ij}=s_\delta. \tag*{(54)} Λ β ′ = i , j ∈ Y ∑ g i h i r ij p ij = i , j ∈ Y ∑ μ i r ij p ij = s δ . (54)
Proof of Lemma III.4
Proof. Recall the earlier argument from the proof of Theorem III.2 that the Perron-Frobenius Theorem can be applied on the matrix G β G_\beta G β and that it has a unique Perron eigenvalue λ β \lambda_\beta λ β , a unique left Perron eigenvector g g g , and a unique right Perron eigenvector h h h . From the Perron Frobenius theorem, if g g g and h h h are normalized such that g T h = 1 g^T h=1 g T h = 1 , we have
lim n → ∞ G β n λ β n = h g T . (55) \lim_{n\to\infty}\frac{G_\beta^n}{\lambda_\beta^n}=hg^T. \tag*{(55)} n → ∞ lim λ β n G β n = h g T . (55)
From this,
G β n λ β n = h g T + o ( 1 ) . (56) \frac{G_\beta^n}{\lambda_\beta^n}=hg^T+o(1). \tag*{(56)} λ β n G β n = h g T + o ( 1 ) . (56)
Multiplying by λ β n \lambda_\beta^n λ β n completes the proof.
Proof of Theorem III.5
Proof. Using Lemma III.4, we obtain
h ( t ) = G β m − t − 1 1 ∣ Y ∣ = λ β m − t ( g T 1 ∣ Y ∣ ) h + o ( λ β m − t ) (57) h^{(t)}=G_\beta^{m-t-1}\mathbf{1}_{|\mathcal{Y}|}=\lambda_\beta^{m-t}(g^T\mathbf{1}_{|\mathcal{Y}|})h+o(\lambda_\beta^{m-t}) \tag*{(57)} h ( t ) = G β m − t − 1 1 ∣ Y ∣ = λ β m − t ( g T 1 ∣ Y ∣ ) h + o ( λ β m − t ) (57)
and
G β h ( t ) = λ β m − t ( g T 1 ∣ Y ∣ ) G β h + o ( λ β m − t + 1 ) (58) G_\beta h^{(t)}=\lambda_\beta^{m-t}(g^T\mathbf{1}_{|\mathcal{Y}|})G_\beta h+o(\lambda_\beta^{m-t+1}) \tag*{(58)} G β h ( t ) = λ β m − t ( g T 1 ∣ Y ∣ ) G β h + o ( λ β m − t + 1 ) (58)
= λ β m − t + 1 ( g T 1 ∣ Y ∣ ) h + o ( λ β m − t + 1 ) . (59) =\lambda_\beta^{m-t+1}(g^T\mathbf{1}_{|\mathcal{Y}|})h+o(\lambda_\beta^{m-t+1}). \tag*{(59)} = λ β m − t + 1 ( g T 1 ∣ Y ∣ ) h + o ( λ β m − t + 1 ) . (59)
From the above two equations, we get that for a , b ∈ Y a,b\in\mathcal{Y} a , b ∈ Y ,
lim m → ∞ p a , b ( t ) = lim m → ∞ ( G β ) a b h b ( t ) h a ( t − 1 ) (60) \lim_{m\to\infty}p_{a,b}^{(t)}=\lim_{m\to\infty}(G_\beta)_{ab}\frac{h_b^{(t)}}{h_a^{(t-1)}} \tag*{(60)} m → ∞ lim p a , b ( t ) = m → ∞ lim ( G β ) ab h a ( t − 1 ) h b ( t ) (60)
= ( G β ) a b lim m → ∞ h b ( t ) ( G β h ( t ) ) a (61) =(G_\beta)_{ab}\lim_{m\to\infty}\frac{h_b^{(t)}}{(G_\beta h^{(t)})_a} \tag*{(61)} = ( G β ) ab m → ∞ lim ( G β h ( t ) ) a h b ( t ) (61)
= ( G β ) a b lim m → ∞ λ β m − t ( g T 1 ∣ Y ∣ ) h b + o ( λ β m − t ) λ β m − t + 1 ( g T 1 ∣ Y ∣ ) h a + o ( λ β m − t + 1 ) (62) =(G_\beta)_{ab}\lim_{m\to\infty}\frac{\lambda_\beta^{m-t}(g^T\mathbf{1}_{|\mathcal{Y}|})h_b+o(\lambda_\beta^{m-t})}{\lambda_\beta^{m-t+1}(g^T\mathbf{1}_{|\mathcal{Y}|})h_a+o(\lambda_\beta^{m-t+1})} \tag*{(62)} = ( G β ) ab m → ∞ lim λ β m − t + 1 ( g T 1 ∣ Y ∣ ) h a + o ( λ β m − t + 1 ) λ β m − t ( g T 1 ∣ Y ∣ ) h b + o ( λ β m − t ) (62)
= ( G β ) a b h b λ β h a = p a b . (63) =(G_\beta)_{ab}\frac{h_b}{\lambda_\beta h_a}=p_{ab}. \tag*{(63)} = ( G β ) ab λ β h a h b = p ab . (63)
Proof of Theorem II.4
Proof. Note that
S m ( Y m + 1 ) = 1 m ⋅ r ( Y m + 1 ) = ∑ a , b ∈ Y θ a b r a b . (64) S_m(Y^{m+1})=\frac{1}{m}\cdot r(Y^{m+1})=\sum_{a,b\in\mathcal{Y}}\theta_{ab}r_{ab}. \tag*{(64)} S m ( Y m + 1 ) = m 1 ⋅ r ( Y m + 1 ) = a , b ∈ Y ∑ θ ab r ab . (64)
From this, note that S m S_m S m is a continuous function of { θ a b } \{\theta_{ab}\} { θ ab } . Let S m = ϕ ( θ ) S_m=\phi(\theta) S m = ϕ ( θ ) for some continuous function ϕ \phi ϕ . Using the contraction principle [27 Theorem 4.2.1] and noting that J ( s ) J(s) J ( s ) is a good rate function, S m S_m S m also satisfies a LDP with rate
J ~ ( s ) = min { J ( θ ) : ϕ ( θ ) = s } . (65) \widetilde{J}(s)=\min\{J(\theta):\phi(\theta)=s\}. \tag*{(65)} J ( s ) = min { J ( θ ) : ϕ ( θ ) = s } . (65)
In our case, using Theorem IV.1, we obtain the rate in the theorem statement. Proving that J ~ ( s ) \widetilde{J}(s) J ( s ) is a good rate function also follows from the contraction principle, since the rate function of a random variable obtained by a continuous map of a random variable with a good rate function is itself good (see, for instance, [27 Theorem 4.2.1] ).
Proof of Lemma IV.2
Proof. First, note that t δ t_\delta t δ can be written alternatively as below:
t δ = max { s : min μ ∈ Δ ∣ Y ∣ , p ∈ Δ ∣ Y ∣ × ∣ Y ∣ ∑ i , j ∈ Y μ i p i j log ( p i j P i j ) ≤ δ subject to μ T p = μ T , ∑ i , j ∈ Y μ i p i j r i j = s } . (66) t_\delta=\max\left\{s:\min_{\mu\in\Delta_{|\mathcal{Y}|},\,p\in\Delta_{|\mathcal{Y}|\times|\mathcal{Y}|}}\sum_{i,j\in\mathcal{Y}}\mu_i p_{ij}\log\left(\frac{p_{ij}}{P_{ij}}\right)\le\delta\text{ subject to }\mu^T p=\mu^T,\ \sum_{i,j\in\mathcal{Y}}\mu_i p_{ij}r_{ij}=s\right\}. \tag*{(66)} t δ = max ⎩ ⎨ ⎧ s : μ ∈ Δ ∣ Y ∣ , p ∈ Δ ∣ Y ∣ × ∣ Y ∣ min i , j ∈ Y ∑ μ i p ij log ( P ij p ij ) ≤ δ subject to μ T p = μ T , i , j ∈ Y ∑ μ i p ij r ij = s ⎭ ⎬ ⎫ . (66)
In Lemma II.4, θ i \theta_i θ i and b b b are ‘dummy’ variables and we replace them respectively by μ \mu μ and p p p :
J ~ ( s ) = min μ ∈ Δ ∣ Y ∣ , p ∈ Δ ∣ Y ∣ × ∣ Y ∣ { ∑ i , j ∈ Y μ i p i j log ( p i j P i j ) : ∑ i , j ∈ Y r i j μ i p i j = s , ∑ i ∈ Y μ i p i j = μ j } . (67) \widetilde{J}(s)=\min_{\mu\in\Delta_{|\mathcal{Y}|},\,p\in\Delta_{|\mathcal{Y}|\times|\mathcal{Y}|}}\left\{\sum_{i,j\in\mathcal{Y}}\mu_i p_{ij}\log\left(\frac{p_{ij}}{P_{ij}}\right):\sum_{i,j\in\mathcal{Y}}r_{ij}\mu_i p_{ij}=s,\ \sum_{i\in\mathcal{Y}}\mu_i p_{ij}=\mu_j\right\}. \tag*{(67)} J ( s ) = μ ∈ Δ ∣ Y ∣ , p ∈ Δ ∣ Y ∣ × ∣ Y ∣ min ⎩ ⎨ ⎧ i , j ∈ Y ∑ μ i p ij log ( P ij p ij ) : i , j ∈ Y ∑ r ij μ i p ij = s , i ∈ Y ∑ μ i p ij = μ j ⎭ ⎬ ⎫ . (67)
We show the result by proving s δ ≤ t δ s_\delta\le t_\delta s δ ≤ t δ and t δ ≤ s δ t_\delta\le s_\delta t δ ≤ s δ . First, let ( μ ∗ , p ∗ ) (\mu^*,p^*) ( μ ∗ , p ∗ ) be an optimal solution to the optimization problem in (KL-RL with Flow). Then,
s δ = ∑ i , j ∈ Y μ i ∗ p i j ∗ r i j , (68) s_\delta=\sum_{i,j\in\mathcal{Y}}\mu_i^*p_{ij}^*r_{ij}, \tag*{(68)} s δ = i , j ∈ Y ∑ μ i ∗ p ij ∗ r ij , (68)
and
∑ i , j ∈ Y μ i ∗ p i j ∗ log ( p i j ∗ P i j ) ≤ δ . (69) \sum_{i,j\in\mathcal{Y}}\mu_i^*p_{ij}^*\log\left(\frac{p_{ij}^*}{P_{ij}}\right)\le\delta. \tag*{(69)} i , j ∈ Y ∑ μ i ∗ p ij ∗ log ( P ij p ij ∗ ) ≤ δ . (69)
Since ( μ ⋆ , p ⋆ ) (\mu^\star,p^\star) ( μ ⋆ , p ⋆ ) is feasible for the minimization defining J ~ ( s δ ) \widetilde{J}(s_\delta) J ( s δ ) , we have
J ~ ( s δ ) ≤ ∑ i , j ∈ Y μ i ⋆ p i j ⋆ log ( p i j ⋆ P i j ) ≤ δ . (70) \widetilde{J}(s_\delta) \le\sum_{i,j\in\mathcal{Y}} \mu_i^\star p_{ij}^\star\log\left(\frac{p_{ij}^\star}{P_{ij}}\right) \le\delta. \tag*{(70)} J ( s δ ) ≤ i , j ∈ Y ∑ μ i ⋆ p ij ⋆ log ( P ij p ij ⋆ ) ≤ δ . (70)
Therefore, s δ s_\delta s δ is feasible in the definition of t δ t_\delta t δ , and hence s δ ≤ t δ s_\delta\le t_\delta s δ ≤ t δ .
Conversely, let s s s be such that
J ~ ( s ) ≤ δ . (71) \widetilde{J}(s) \le\delta. \tag*{(71)} J ( s ) ≤ δ . (71)
By the definition of J ~ ( s ) \widetilde{J}(s) J ( s ) , there exists a feasible pair ( μ ( s ) , p ( s ) ) (\mu^{(s)},p^{(s)}) ( μ ( s ) , p ( s ) ) satisfying
( μ ( s ) ) T p ( s ) = ( μ ( s ) ) T , (72) (\mu^{(s)})^{T}p^{(s)}=(\mu^{(s)})^{T}, \tag*{(72)} ( μ ( s ) ) T p ( s ) = ( μ ( s ) ) T , (72)
∑ i , j ∈ Y μ i ( s ) p i j ( s ) r i j = s , (73) \sum_{i,j\in\mathcal{Y}}\mu_i^{(s)}p_{ij}^{(s)}r_{ij}=s, \tag*{(73)} i , j ∈ Y ∑ μ i ( s ) p ij ( s ) r ij = s , (73)
and
∑ i , j ∈ Y μ i ( s ) p i j ( s ) log ( p i j ( s ) P i j ) ≤ δ . (74) \sum_{i,j\in\mathcal{Y}}\mu_i^{(s)}p_{ij}^{(s)}\log\left(\frac{p_{ij}^{(s)}}{P_{ij}}\right)\le\delta. \tag*{(74)} i , j ∈ Y ∑ μ i ( s ) p ij ( s ) log ( P ij p ij ( s ) ) ≤ δ . (74)
Thus, ( μ ( s ) , p ( s ) ) (\mu^{(s)},p^{(s)}) ( μ ( s ) , p ( s ) ) is feasible for the optimization problem in (KL-RL with Flow). By the definition of s δ s_\delta s δ , it follows that s ≤ s δ s\le s_\delta s ≤ s δ . Since this holds for every s s s satisfying J ~ ( s ) ≤ δ \widetilde{J}(s)\le\delta J ( s ) ≤ δ , we obtain t δ ≤ s δ t_\delta\le s_\delta t δ ≤ s δ .
Combining the two inequalities gives the desired result.
Proof of Lemma V.1
Proof. First, we consider the probability P ( T m , exp ( m δ ) ≥ s δ + ϵ ) \mathbb{P}(T_{m,\exp(m\delta)}\ge s_\delta+\epsilon) P ( T m , e x p ( m δ ) ≥ s δ + ϵ ) for some ϵ > 0 \epsilon>0 ϵ > 0 . Note from (28), using the union bound, and using the LDP for S m S_m S m from Theorem II.4 that
P ( T m , exp ( m δ ) ≥ s δ + ϵ ) ≤ n P ( S m ≥ s δ + ϵ ) ≤ n exp ( − m inf s ≥ s δ + ϵ J ~ ( s ) + o ( m ) ) = exp ( m ( δ − inf s ≥ s δ + ϵ J ~ ( s ) ) + o ( m ) ) . (75) \begin{aligned}
\mathbb{P}(T_{m,\exp(m\delta)}\ge s_\delta+\epsilon)\le n\mathbb{P}(S_m\ge s_\delta+\epsilon) \\
&\le n\exp\left(-m\inf_{s\ge s_\delta+\epsilon}\widetilde{J}(s)+o(m)\right)=\exp\left(m\left(\delta-\inf_{s\ge s_\delta+\epsilon}\widetilde{J}(s)\right)+o(m)\right). \tag*{(75)}
\end{aligned} P ( T m , e x p ( m δ ) ≥ s δ + ϵ ) ≤ n P ( S m ≥ s δ + ϵ ) ≤ n exp ( − m s ≥ s δ + ϵ inf J ( s ) + o ( m ) ) = exp ( m ( δ − s ≥ s δ + ϵ inf J ( s ) ) + o ( m ) ) . (75)
Recall from Lemma IV.2 that s δ = sup { s : J ~ ( s ) ≤ δ } s_\delta=\sup\{s:\widetilde{J}(s)\le\delta\} s δ = sup { s : J ( s ) ≤ δ } . From this, note that for s > s δ s>s_\delta s > s δ , we necessarily have J ~ ( s ) > δ \widetilde{J}(s)>\delta J ( s ) > δ . Thus, for s ≥ s δ + ϵ > s δ s\ge s_\delta+\epsilon>s_\delta s ≥ s δ + ϵ > s δ , we have J ~ ( s ) > δ \widetilde{J}(s)>\delta J ( s ) > δ . Thus,
δ − inf s ≥ s δ + ϵ J ~ ( s ) < 0 (76) \delta-\inf_{s\ge s_\delta+\epsilon}\widetilde{J}(s)<0 \tag*{(76)} δ − s ≥ s δ + ϵ inf J ( s ) < 0 (76)
and lim m → ∞ P ( T m , exp ( m δ ) ≥ s δ + ϵ ) = 0 \lim_{m\to\infty}\mathbb{P}(T_{m,\exp(m\delta)}\ge s_\delta+\epsilon)=0 lim m → ∞ P ( T m , e x p ( m δ ) ≥ s δ + ϵ ) = 0 .
Next, consider P ( T m , exp ( m δ ) ≤ s δ − ϵ ) \mathbb{P}(T_{m,\exp(m\delta)}\le s_\delta-\epsilon) P ( T m , e x p ( m δ ) ≤ s δ − ϵ ) . Note that
P ( T m , exp ( m δ ) ≤ s δ − ϵ ) = ( 1 − P ( S m > s δ − ϵ ) ) n ≤ exp ( − n P ( S m > s δ − ϵ ) ) . (77) \mathbb{P}(T_{m,\exp(m\delta)}\le s_\delta-\epsilon)=\left(1-\mathbb{P}(S_m>s_\delta-\epsilon)\right)^n\le\exp\left(-n\mathbb{P}(S_m>s_\delta-\epsilon)\right). \tag*{(77)} P ( T m , e x p ( m δ ) ≤ s δ − ϵ ) = ( 1 − P ( S m > s δ − ϵ ) ) n ≤ exp ( − n P ( S m > s δ − ϵ ) ) . (77)
We next argue that J ~ ( s ) \widetilde{J}(s) J ( s ) is a convex function of s s s . To see this, first note that J ( θ ) J(\theta) J ( θ ) itself is convex since the Markovian KL divergence is convex in the first argument. Next, recall that the map from θ \theta θ to S m S_m S m is a linear map as in (65). Now, consider the function
L ( s , θ ) = { J ( θ ) , ϕ ( θ ) = s , ∞ , otherwise . (78) L(s,\theta)=
\begin{cases}
J(\theta), & \phi(\theta)=s,\\
\infty, & \text{otherwise}.
\end{cases} \tag*{(78)} L ( s , θ ) = { J ( θ ) , ∞ , ϕ ( θ ) = s , otherwise . (78)
Note that L ( s , θ ) L(s,\theta) L ( s , θ ) is convex since J ( θ ) J(\theta) J ( θ ) is convex. Finally, noting that J ~ ( s ) = min θ L ( s , θ ) \widetilde{J}(s)=\min_\theta L(s,\theta) J ( s ) = min θ L ( s , θ ) gives the desired result that J ~ ( s ) \widetilde{J}(s) J ( s ) is convex.
Recall that J ~ ( s δ ) ≤ δ \widetilde{J}(s_\delta)\le\delta J ( s δ ) ≤ δ .
If J ~ ( s δ ) < δ \widetilde{J}(s_\delta)<\delta J ( s δ ) < δ , note that inf s > s δ − ϵ J ~ ( s ) ≤ J ~ ( s δ ) = δ − γ \inf_{s>s_\delta-\epsilon}\widetilde{J}(s)\le\widetilde{J}(s_\delta)=\delta-\gamma inf s > s δ − ϵ J ( s ) ≤ J ( s δ ) = δ − γ for some γ > 0 \gamma>0 γ > 0 .
The other case has J ~ ( s δ ) = δ \widetilde{J}(s_\delta)=\delta J ( s δ ) = δ . Since J ~ ( s ) \widetilde{J}(s) J ( s ) is a rate function, we know that at the mean value s 0 = E [ S m ] s_0=\mathbb{E}[S_m] s 0 = E [ S m ] , we have J ~ ( s 0 ) = 0 \widetilde{J}(s_0)=0 J ( s 0 ) = 0 . Now, there are two possibilities:
a) If s 0 > s δ − ϵ s_0>s_\delta-\epsilon s 0 > s δ − ϵ , we have J ~ ( s 0 ) = δ − γ \widetilde{J}(s_0)=\delta-\gamma J ( s 0 ) = δ − γ where γ = δ > 0 \gamma=\delta>0 γ = δ > 0 . Thus, we have inf s > s δ − ϵ J ~ ( s ) ≤ J ~ ( s 0 ) = δ − γ \inf_{s>s_\delta-\epsilon}\widetilde{J}(s)\le\widetilde{J}(s_0)=\delta-\gamma inf s > s δ − ϵ J ( s ) ≤ J ( s 0 ) = δ − γ .
b) If s 0 ≤ s δ − ϵ s_0\le s_\delta-\epsilon s 0 ≤ s δ − ϵ , suppose s 0 = s δ − β s_0=s_\delta-\beta s 0 = s δ − β for some β ≥ ϵ \beta\ge\epsilon β ≥ ϵ . Now, consider an s δ − Δ ∈ ( s δ − ϵ , s δ ) s_\delta-\Delta\in(s_\delta-\epsilon,s_\delta) s δ − Δ ∈ ( s δ − ϵ , s δ ) , where Δ < ϵ \Delta<\epsilon Δ < ϵ . From the convexity of J ~ \widetilde{J} J and since 0 < Δ β < 1 0<\frac{\Delta}{\beta}<1 0 < β Δ < 1 , we know that
J ~ ( s δ − Δ ) = J ~ ( ( 1 − Δ β ) s δ + Δ β ( s 0 ) ) ≤ ( 1 − Δ β ) δ + Δ β J ~ ( s 0 ) < δ . (79) \widetilde{J}(s_\delta-\Delta)=\widetilde{J}\left(\left(1-\frac{\Delta}{\beta}\right)s_\delta+\frac{\Delta}{\beta}(s_0)\right)\le\left(1-\frac{\Delta}{\beta}\right)\delta+\frac{\Delta}{\beta}\widetilde{J}(s_0)<\delta. \tag*{(79)} J ( s δ − Δ ) = J ( ( 1 − β Δ ) s δ + β Δ ( s 0 ) ) ≤ ( 1 − β Δ ) δ + β Δ J ( s 0 ) < δ . (79)
Suppose that J ~ ( s δ − Δ ) = δ − γ \widetilde{J}(s_\delta-\Delta)=\delta-\gamma J ( s δ − Δ ) = δ − γ for some γ > 0 \gamma>0 γ > 0 . Thus, we have inf s > s δ − ϵ J ~ ( s ) ≤ J ~ ( s δ − Δ ) = δ − γ \inf_{s>s_\delta-\epsilon}\widetilde{J}(s)\leq\widetilde{J}(s_\delta-\Delta)=\delta-\gamma inf s > s δ − ϵ J ( s ) ≤ J ( s δ − Δ ) = δ − γ .
In all three of the cases, we have inf s > s δ − ϵ J ~ ( s ) ≤ δ − γ \inf_{s>s_\delta-\epsilon}\widetilde{J}(s)\leq\delta-\gamma inf s > s δ − ϵ J ( s ) ≤ δ − γ for some γ > 0 \gamma>0 γ > 0 and thus
P ( S m > s δ − ϵ ) ≥ exp ( − m inf s > s δ − ϵ J ~ ( s ) + o ( m ) ) ≥ exp ( − m ( δ − γ ) + o ( m ) ) . (80) \mathbb{P}(S_m>s_\delta-\epsilon)\geq\exp\left(-m\inf_{s>s_\delta-\epsilon}\widetilde{J}(s)+o(m)\right)
\geq\exp\left(-m(\delta-\gamma)+o(m)\right). \tag*{(80)} P ( S m > s δ − ϵ ) ≥ exp ( − m s > s δ − ϵ inf J ( s ) + o ( m ) ) ≥ exp ( − m ( δ − γ ) + o ( m ) ) . (80)
From (77) , we hence have
P ( T m , exp ( m δ ) ≤ s δ − ϵ ) ≤ exp ( − exp ( m δ ) exp ( − m ( δ − γ ) + o ( m ) ) ) ≤ exp ( − exp ( m γ + o ( m ) ) ) . (81) \mathbb{P}(T_{m,\exp(m\delta)}\leq s_\delta-\epsilon)\leq\exp\left(-\exp(m\delta)\exp\left(-m(\delta-\gamma)+o(m)\right)\right)\leq\exp\left(-\exp\left(m\gamma+o(m)\right)\right). \tag*{(81)} P ( T m , e x p ( m δ ) ≤ s δ − ϵ ) ≤ exp ( − exp ( m δ ) exp ( − m ( δ − γ ) + o ( m ) ) ) ≤ exp ( − exp ( mγ + o ( m ) ) ) . (81)
Taking the limit as m → ∞ m\to\infty m → ∞ on both sides above gives the desired result.
Proof of Lemma V.3
Proof. Recall from Theorem III.2 that
p i j = G i j h j λ h i = P i j exp ( β R i j ) h j λ h i . (82) p_{ij}=\frac{G_{ij}h_j}{\lambda h_i}=\frac{P_{ij}\exp(\beta R_{ij})h_j}{\lambda h_i}. \tag*{(82)} p ij = λ h i G ij h j = λ h i P ij exp ( β R ij ) h j . (82)
From this,
log ( p i j P i j ) = β R i j + log h j − log h i − log λ . (83) \log\left(\frac{p_{ij}}{P_{ij}}\right)=\beta R_{ij}+\log h_j-\log h_i-\log\lambda. \tag*{(83)} log ( P ij p ij ) = β R ij + log h j − log h i − log λ . (83)
Recall that μ \mu μ is the stationary distribution for p p p . Hence,
d K L ( p , P ) = ∑ i , j ∈ Y μ i p i j log ( p i j P i j ) (84) d_{KL}(p,P)=\sum_{i,j\in\mathcal{Y}}\mu_i p_{ij}\log\left(\frac{p_{ij}}{P_{ij}}\right) \tag*{(84)} d K L ( p , P ) = i , j ∈ Y ∑ μ i p ij log ( P ij p ij ) (84)
= ∑ i , j ∈ Y μ i p i j ( β R i j + log h j − log h i − log λ ) (85) =\sum_{i,j\in\mathcal{Y}}\mu_i p_{ij}\left(\beta R_{ij}+\log h_j-\log h_i-\log\lambda\right) \tag*{(85)} = i , j ∈ Y ∑ μ i p ij ( β R ij + log h j − log h i − log λ ) (85)
= β ∑ i , j ∈ Y μ i p i j R i j + ∑ i , j ∈ Y μ i p i j log h j − ∑ i , j ∈ Y μ i p i j log h i − log λ . (86) =\beta\sum_{i,j\in\mathcal{Y}}\mu_i p_{ij}R_{ij}+\sum_{i,j\in\mathcal{Y}}\mu_i p_{ij}\log h_j-\sum_{i,j\in\mathcal{Y}}\mu_i p_{ij}\log h_i-\log\lambda. \tag*{(86)} = β i , j ∈ Y ∑ μ i p ij R ij + i , j ∈ Y ∑ μ i p ij log h j − i , j ∈ Y ∑ μ i p ij log h i − log λ . (86)
Since μ \mu μ is stationary for p p p ,
∑ i ∈ Y μ i p i j = μ j ∀ j ∈ Y . (87) \sum_{i\in\mathcal{Y}}\mu_i p_{ij}=\mu_j\quad\forall j\in\mathcal{Y}. \tag*{(87)} i ∈ Y ∑ μ i p ij = μ j ∀ j ∈ Y . (87)
Thus, since
∑ i , j ∈ Y μ i p i j log h j = ∑ j ∈ Y μ j log h j , ∑ i , j ∈ Y μ i p i j log h i = ∑ i ∈ Y μ i log h i , (88) \sum_{i,j\in\mathcal{Y}}\mu_i p_{ij}\log h_j=\sum_{j\in\mathcal{Y}}\mu_j\log h_j,\qquad
\sum_{i,j\in\mathcal{Y}}\mu_i p_{ij}\log h_i=\sum_{i\in\mathcal{Y}}\mu_i\log h_i, \tag*{(88)} i , j ∈ Y ∑ μ i p ij log h j = j ∈ Y ∑ μ j log h j , i , j ∈ Y ∑ μ i p ij log h i = i ∈ Y ∑ μ i log h i , (88)
and the second and third terms in (86) cancel. Putting everything together, we obtain
d K L ( p , P ) = β ∑ i , j ∈ Y μ i p i j R i j − log λ (89) d_{KL}(p,P)=\beta\sum_{i,j\in\mathcal{Y}}\mu_i p_{ij}R_{ij}-\log\lambda \tag*{(89)} d K L ( p , P ) = β i , j ∈ Y ∑ μ i p ij R ij − log λ (89)
= β s δ − Λ . (90) =\beta s_\delta-\Lambda. \tag*{(90)} = β s δ − Λ. (90)
Since s δ = Λ ′ s_\delta=\Lambda^\prime s δ = Λ ′ and since the value of β \beta β is chosen so that d K L ( p , P ) = δ d_{KL}(p,P)=\delta d K L ( p , P ) = δ as in (8) , the desired result follows.
Proof of Lemma VI.1
Proof. Let g ( l ) = e β l A β g(l)=\frac{e^{\beta l}}{A_\beta} g ( l ) = A β e β l , so that
d Q β d Q ( y ) = g ( r ( y ) ) . (91) \frac{dQ_\beta}{dQ}(y)=g(r(y)). \tag*{(91)} d Q d Q β ( y ) = g ( r ( y )) . (91)
Let B ∈ B ( Y ) B\in\mathcal{B}(\mathcal{Y}) B ∈ B ( Y ) , and let C ∈ B ( R ) C\in\mathcal{B}(\mathbb{R}) C ∈ B ( R ) be a Borel subset of R \mathbb{R} R . Then
q β ( Y ′ ∈ B , L ′ ∈ C ) = E q β [ 1 Y ′ ∈ B 1 L ′ ∈ C ] = E Q [ 1 Y ∈ B 1 L ∈ C g ( L ) ] . (92) q_\beta(Y^\prime\in B,L^\prime\in C)=\mathbb{E}_{q_\beta}\left[1_{Y^\prime\in B}1_{L^\prime\in C}\right]=\mathbb{E}_{Q}\left[1_{Y\in B}1_{L\in C}g(L)\right]. \tag*{(92)} q β ( Y ′ ∈ B , L ′ ∈ C ) = E q β [ 1 Y ′ ∈ B 1 L ′ ∈ C ] = E Q [ 1 Y ∈ B 1 L ∈ C g ( L ) ] . (92)
Next, use the tower law of expectations, conditioning on L L L :
q β ( Y ′ ∈ B , L ′ ∈ C ) = E Q [ E Q [ 1 Y ∈ B 1 L ∈ C g ( L ) ∣ L ] ] = E Q [ 1 L ∈ C g ( L ) E Q [ 1 Y ∈ B ∣ L ] ] = E Q [ 1 L ∈ C g ( L ) Q ( Y ∈ B ∣ L ) ] . (93) q_\beta(Y^\prime\in B,L^\prime\in C)=\mathbb{E}_{Q}\left[\mathbb{E}_{Q}\left[1_{Y\in B}1_{L\in C}g(L)\mid L\right]\right]=\mathbb{E}_{Q}\left[1_{L\in C}g(L)\mathbb{E}_{Q}\left[1_{Y\in B}\mid L\right]\right]=\mathbb{E}_{Q}\left[1_{L\in C}g(L)Q(Y\in B\mid L)\right]. \tag*{(93)} q β ( Y ′ ∈ B , L ′ ∈ C ) = E Q [ E Q [ 1 Y ∈ B 1 L ∈ C g ( L ) ∣ L ] ] = E Q [ 1 L ∈ C g ( L ) E Q [ 1 Y ∈ B ∣ L ] ] = E Q [ 1 L ∈ C g ( L ) Q ( Y ∈ B ∣ L ) ] . (93)
Now, take B = Y B=\mathcal{Y} B = Y to obtain
p L ′ ( C ) = E Q [ 1 L ∈ C g ( L ) ] , (94) p_{L'}(C)=\mathbb{E}_{Q}[1_{L\in C}g(L)], \tag*{(94)} p L ′ ( C ) = E Q [ 1 L ∈ C g ( L )] , (94)
from which we obtain
d p L ′ d p L ( l ) = e β l A β = g ( l ) . (95) \frac{dp_{L'}}{dp_L}(l)=\frac{e^{\beta l}}{A_\beta}=g(l). \tag*{(95)} d p L d p L ′ ( l ) = A β e β l = g ( l ) . (95)
Finally, note that
q β ( Y ′ ∈ B ∣ L ′ = l ) = q β ( Y ′ ∈ B , L ′ = l ) q β ( L ′ = l ) (96) q_\beta(Y'\in B\mid L'=l)=\frac{q_\beta(Y'\in B,L'=l)}{q_\beta(L'=l)} \tag*{(96)} q β ( Y ′ ∈ B ∣ L ′ = l ) = q β ( L ′ = l ) q β ( Y ′ ∈ B , L ′ = l ) (96)
= E Q [ 1 Y ∈ B , L = l g ( l ) ] E Q [ 1 L = l g ( l ) ] (97) =\frac{\mathbb{E}_{Q}[1_{Y\in B,L=l}g(l)]}{\mathbb{E}_{Q}[1_{L=l}g(l)]} \tag*{(97)} = E Q [ 1 L = l g ( l )] E Q [ 1 Y ∈ B , L = l g ( l )] (97)
= E Q [ 1 Y ∈ B , L = l ] E Q [ 1 L = l ] (98) =\frac{\mathbb{E}_{Q}[1_{Y\in B,L=l}]}{\mathbb{E}_{Q}[1_{L=l}]} \tag*{(98)} = E Q [ 1 L = l ] E Q [ 1 Y ∈ B , L = l ] (98)
= Q ( Y ∈ B , L = l ) Q ( L = l ) (99) =\frac{Q(Y\in B,L=l)}{Q(L=l)} \tag*{(99)} = Q ( L = l ) Q ( Y ∈ B , L = l ) (99)
= Q ( Y ∈ B ∣ L = l ) . (100) =Q(Y\in B\mid L=l). \tag*{(100)} = Q ( Y ∈ B ∣ L = l ) . (100)
Proof of Lemma VI.3
Proof. Let B ∈ B ( Y ) B\in\mathcal{B}(\mathcal{Y}) B ∈ B ( Y ) be a Borel set. By symmetry of the n n n samples,
q n , 1 b e s t ( B ) = ∑ i = 1 n P ( Y i ∈ B , r ( Y i ) > max j ≠ i r ( Y j ) ) (101) q^{\mathrm{best}}_{n,1}(B)=\sum_{i=1}^{n}\mathbb{P}\left(Y_i\in B,\ r(Y_i)>\max_{j\ne i}r(Y_j)\right) \tag*{(101)} q n , 1 best ( B ) = i = 1 ∑ n P ( Y i ∈ B , r ( Y i ) > j = i max r ( Y j ) ) (101)
= n P ( Y 1 ∈ B , r ( Y j ) < r ( Y 1 ) , ∀ j = 2 , … , n ) . (102) =n\mathbb{P}\left(Y_1\in B,\ r(Y_j)<r(Y_1),\ \forall j=2,\ldots,n\right). \tag*{(102)} = n P ( Y 1 ∈ B , r ( Y j ) < r ( Y 1 ) , ∀ j = 2 , … , n ) . (102)
Conditioning on Y 1 Y_1 Y 1 , using independence, and using (31) ,
q n , 1 b e s t ( B ) = n E Q [ 1 { Y ∈ B } P ( r ( Y j ) < r ( Y ) , ∀ j = 2 , … , n ∣ Y ) ] (103) q^{\mathrm{best}}_{n,1}(B)=n\mathbb{E}_{Q}\left[1_{\{Y\in B\}}\mathbb{P}\left(r(Y_j)<r(Y),\ \forall j=2,\ldots,n\mid Y\right)\right] \tag*{(103)} q n , 1 best ( B ) = n E Q [ 1 { Y ∈ B } P ( r ( Y j ) < r ( Y ) , ∀ j = 2 , … , n ∣ Y ) ] (103)
= n E Q [ 1 { Y ∈ B } P L ( r ( Y ) ) n − 1 ] . (104) =n\mathbb{E}_{Q}\left[1_{\{Y\in B\}}P_L(r(Y))^{n-1}\right]. \tag*{(104)} = n E Q [ 1 { Y ∈ B } P L ( r ( Y ) ) n − 1 ] . (104)
Since this holds for every Borel set B ∈ B ( Y ) B\in\mathcal{B}(\mathcal{Y}) B ∈ B ( Y ) , the desired result follows.
Proof of Theorem II.6
Proof. Assume that q n , 1 b e s t = q β q^{\mathrm{best}}_{n,1}=q_\beta q n , 1 best = q β . Since both distributions are absolutely continuous with respect to Q Q Q , their Radon–Nikodym derivatives with respect to Q Q Q must agree almost surely. Hence, by (30) and Lemma (VI.3),
n P L ( r ( y ) ) n − 1 = exp ( β r ( y ) ) A β (105) nP_L(r(y))^{n-1}=\frac{\exp(\beta r(y))}{A_\beta} \tag*{(105)} n P L ( r ( y ) ) n − 1 = A β exp ( β r ( y )) (105)
almost surely. Equivalently,
n P L ( l ) n − 1 = exp ( β l ) A β (106) nP_L(l)^{n-1}=\frac{\exp(\beta l)}{A_\beta} \tag*{(106)} n P L ( l ) n − 1 = A β exp ( β l ) (106)
almost surely. From this,
P L ( l ) = exp ( β ( l − b ) n − 1 ) (107) P_L(l)=\exp\left(\frac{\beta(l-b)}{n-1}\right) \tag*{(107)} P L ( l ) = exp ( n − 1 β ( l − b ) ) (107)
almost surely, where b = 1 β log ( n A β ) > 0 b=\frac{1}{\beta}\log(nA_\beta)>0 b = β 1 log ( n A β ) > 0 .
Since exp ( β ( l − b ) n − 1 ) \exp\left(\frac{\beta(l-b)}{n-1}\right) exp ( n − 1 β ( l − b ) ) is a continuous function of l l l and it is the CDF of the random variable L L L , it must be that L \mathcal{L} L , the support of L L L , is also continuous. Further, since P L P_L P L is a CDF, it must have a value of 1 1 1 for b ≥ l b\ge l b ≥ l . From this, we get L = ( − ∞ , b ] \mathcal{L}=(-\infty,b] L = ( − ∞ , b ] . This proves the forward direction of the theorem.
Conversely, suppose that L L L has the CDF as in the theorem statement. Its density is
p L ( l ) = λ exp ( λ ( l − b ) ) 1 { l ≤ b } , (108) p_L(l)=\lambda\exp(\lambda(l-b))1_{\{l\le b\}}, \tag*{(108)} p L ( l ) = λ exp ( λ ( l − b )) 1 { l ≤ b } , (108)
where λ = β n − 1 \lambda= \frac{\beta}{n-1} λ = n − 1 β . Then,
A β = E Q [ exp ( β L ) ] = λ λ + β exp ( β b ) = exp ( β b ) n . (109) A_{\beta} = \mathbb{E}_{Q}[\exp(\beta L)] = \frac{\lambda}{\lambda+\beta}\exp(\beta b) = \frac{\exp(\beta b)}{n}. \tag*{(109)} A β = E Q [ exp ( β L )] = λ + β λ exp ( β b ) = n exp ( β b ) . (109)
Therefore,
d q β d Q ( y ) = exp ( β r ( y ) ) A β = n exp ( β ( r ( y ) − b ) ) = n P L ( r ( y ) ) n − 1 = d q n , 1 b e s t d Q ( y ) (110) \frac{dq_{\beta}}{dQ}(y) = \frac{\exp(\beta r(y))}{A_{\beta}} = n\exp(\beta(r(y)-b)) = nP_{L}(r(y))^{n-1} = \frac{dq^{\mathrm{best}}_{n,1}}{dQ}(y) \tag*{(110)} d Q d q β ( y ) = A β exp ( β r ( y )) = n exp ( β ( r ( y ) − b )) = n P L ( r ( y ) ) n − 1 = d Q d q n , 1 best ( y ) (110)
almost surely. Hence, the converse also follows.
It remains to compute the KL divergence between the tilted distribution q β q_{\beta} q β and the distribution Q Q Q to ensure that the condition that d K L ( q β , Q ) ≤ m δ = δ d_{KL}(q_{\beta},Q) \le m\delta= \delta d K L ( q β , Q ) ≤ m δ = δ is satisfied. First, note from (30) and this theorem statement that L ′ L' L ′ also follows a reverse exponential distribution. Namely, for a suitable constant C > 0 C>0 C > 0 ,
p L ′ ( l ) = C exp ( β n − 1 ( l − b ) ) exp ( β l ) , l ≤ b (111) p_{L'}(l) = C\exp\left(\frac{\beta}{n-1}(l-b)\right)\exp(\beta l), \qquad l \le b \tag*{(111)} p L ′ ( l ) = C exp ( n − 1 β ( l − b ) ) exp ( β l ) , l ≤ b (111)
= exp ( β n n − 1 ( l − b ) ) , l ≤ b . (112) = \exp\left(\frac{\beta n}{n-1}(l-b)\right), \qquad l \le b. \tag*{(112)} = exp ( n − 1 β n ( l − b ) ) , l ≤ b . (112)
Clearly, L ′ L' L ′ also follows a reverse exponential distribution with parameter β n n − 1 \frac{\beta n}{n-1} n − 1 β n .
Next, note from Corollary VI.2 and using the expression for KL-divergence between two exponential distributions with parameters β n n − 1 \frac{\beta n}{n-1} n − 1 β n and β n − 1 \frac{\beta}{n-1} n − 1 β (see, for instance, [29 Table 1] ) that
d K L ( q β , Q ) = d K L ( p L ′ , p L ) = log ( n − 1 β ⋅ β n n − 1 ) + 1 n − 1 = log ( n ) + n − 1 n . (113) d_{KL}(q_{\beta},Q) = d_{KL}(p_{L'},p_L) = \log\left(\frac{n-1}{\beta}\cdot\frac{\beta n}{n-1}\right)+\frac{1}{n}-1 = \log(n)+\frac{n-1}{n}. \tag*{(113)} d K L ( q β , Q ) = d K L ( p L ′ , p L ) = log ( β n − 1 ⋅ n − 1 β n ) + n 1 − 1 = log ( n ) + n n − 1 . (113)
Recalling that the value of β \beta β is chosen such that d K L ( q β , Q ) = δ d_{KL}(q_{\beta},Q)=\delta d K L ( q β , Q ) = δ from (8) gives the desired result.
Proof of Lemma VI.4
First, we will show that the vector of probabilities q β q_{\beta} q β is majorized by q n , 1 b e s t q^{\mathrm{best}}_{n,1} q n , 1 best . Recall that q β ( y i ) = i n − 1 S d , n − 1 q_{\beta}(y_i)=\frac{i^{n-1}}{S_{d,n-1}} q β ( y i ) = S d , n − 1 i n − 1 and q n , 1 b e s t ( y i ) = i n − ( i − 1 ) n d n ∀ i ∈ [ d ] q^{\mathrm{best}}_{n,1}(y_i)=\frac{i^n-(i-1)^n}{d^n}\ \forall i\in[d] q n , 1 best ( y i ) = d n i n − ( i − 1 ) n ∀ i ∈ [ d ] . Thus,
r i = q n , 1 b e s t ( y i ) q β ( y i ) = S d , n − 1 d n ⋅ i n − ( i − 1 ) n i n − 1 = S d , n − 1 i d n ⋅ ( 1 − ( 1 − 1 i ) n ) (114) r_i=\frac{q^{\mathrm{best}}_{n,1}(y_i)}{q_{\beta}(y_i)}=\frac{S_{d,n-1}}{d^n}\cdot\frac{i^n-(i-1)^n}{i^{n-1}}=\frac{S_{d,n-1}i}{d^n}\cdot\left(1-\left(1-\frac{1}{i}\right)^n\right) \tag*{(114)} r i = q β ( y i ) q n , 1 best ( y i ) = d n S d , n − 1 ⋅ i n − 1 i n − ( i − 1 ) n = d n S d , n − 1 i ⋅ ( 1 − ( 1 − i 1 ) n ) (114)
It can be seen that this is an increasing sequence with i ∈ [ d ] i\in[d] i ∈ [ d ] (by, for instance, differentiating with respect to i i i ). Also recall that ∑ i ∈ [ d ] q n , 1 b e s t ( y i ) = ∑ i ∈ [ d ] q β ( y i ) = 1 \sum_{i\in[d]}q^{\mathrm{best}}_{n,1}(y_i)=\sum_{i\in[d]}q_{\beta}(y_i)=1 ∑ i ∈ [ d ] q n , 1 best ( y i ) = ∑ i ∈ [ d ] q β ( y i ) = 1 . Thus, there exists an index i 0 i_0 i 0 such that
q n , 1 b e s t ( y i ) ≤ q β ( y i ) , ∀ i ≤ i 0 and q n , 1 b e s t ( y i ) > q β ( y i ) , ∀ i > i 0 . (115) q^{\mathrm{best}}_{n,1}(y_i)\le q_{\beta}(y_i),\ \forall i\le i_0
\qquad\text{and}\qquad
q^{\mathrm{best}}_{n,1}(y_i)>q_{\beta}(y_i),\ \forall i>i_0. \tag*{(115)} q n , 1 best ( y i ) ≤ q β ( y i ) , ∀ i ≤ i 0 and q n , 1 best ( y i ) > q β ( y i ) , ∀ i > i 0 . (115)
This means that the prefix sums (sum of k k k largest elements) satisfy ∑ i = 1 k q n , 1 b e s t ( y d − i ) ≥ ∑ i = 1 k q β ( y d − i ) \sum_{i=1}^{k}q^{\mathrm{best}}_{n,1}(y_{d-i})\ge\sum_{i=1}^{k}q_{\beta}(y_{d-i}) ∑ i = 1 k q n , 1 best ( y d − i ) ≥ ∑ i = 1 k q β ( y d − i ) , ∀ k ∈ [ d ] \forall k\in[d] ∀ k ∈ [ d ] , with the equality holding only when k = d k=d k = d . From this, q n , 1 b e s t q^{\mathrm{best}}_{n,1} q n , 1 best majorizes q β q_{\beta} q β . By using Karamata’s inequality (see, for instance, [30 Theorem 1] ) and noting that d K L d_{KL} d K L is convex in the first argument, we obtain
d K L ( q β , Q ) ≤ d K L ( q n , 1 b e s t , Q ) . (116) d_{KL}(q_{\beta},Q)\le d_{KL}(q^{\mathrm{best}}_{n,1},Q). \tag*{(116)} d K L ( q β , Q ) ≤ d K L ( q n , 1 best , Q ) . (116)
Now, we attempt to upper bound d K L ( q n , 1 b e s t , Q ) d_{KL}(q^{\mathrm{best}}_{n,1},Q) d K L ( q n , 1 best , Q ) . Now, consider the function: f ( x ) = ⌈ d x d ⌉ f(x)=\left\lceil\frac{dx}{d}\right\rceil f ( x ) = ⌈ d d x ⌉ , which is essentially a function that takes a continuous distribution and discretizes it. Consider the two (continuous) distributions: s ( x ) = n x n − 1 s(x)=nx^{n-1} s ( x ) = n x n − 1 , 0 < x ≤ 1 0<x\le1 0 < x ≤ 1 and t ( x ) = 1 t(x)=1 t ( x ) = 1 , 0 < x ≤ 1 0<x\le1 0 < x ≤ 1 . Note that if X ∼ s X\sim s X ∼ s , then
P ( f ( X ) = i d ) = P ( i − 1 d < X ≤ i d ) = P ( X ≤ i d ) − P ( X ≤ i − 1 d ) = i n − ( i − 1 ) n d n = q n , 1 b e s t ( y i ) (117) \mathbb{P}\left(f(X)=\frac{i}{d}\right)=\mathbb{P}\left(\frac{i-1}{d}<X\le\frac{i}{d}\right)=\mathbb{P}\left(X\le\frac{i}{d}\right)-\mathbb{P}\left(X\le\frac{i-1}{d}\right)=\frac{i^n-(i-1)^n}{d^n}=q^{\mathrm{best}}_{n,1}(y_i) \tag*{(117)} P ( f ( X ) = d i ) = P ( d i − 1 < X ≤ d i ) = P ( X ≤ d i ) − P ( X ≤ d i − 1 ) = d n i n − ( i − 1 ) n = q n , 1 best ( y i ) (117)
and thus f ( X ) ∼ q n , 1 b e s t f(X)\sim q^{\mathrm{best}}_{n,1} f ( X ) ∼ q n , 1 best . Similarly, if Y ∼ t Y\sim t Y ∼ t , then f ( Y ) ∼ Q f(Y)\sim Q f ( Y ) ∼ Q . Finally, we use the data processing inequality for KL-divergence [31 Corollary 2.18] using the function ‘f f f ’ to obtain
d K L ( q n , 1 b e s t , Q ) ≤ d K L ( s , t ) = ∫ 0 + 1 n x n − 1 log ( n x n − 1 ) d x . (118) d_{KL}(q^{\mathrm{best}}_{n,1},Q)\le d_{KL}(s,t)=\int_{0^+}^{1} nx^{n-1}\log(nx^{n-1})\,dx. \tag*{(118)} d K L ( q n , 1 best , Q ) ≤ d K L ( s , t ) = ∫ 0 + 1 n x n − 1 log ( n x n − 1 ) d x . (118)
It is possible to solve this integration using integration by parts to obtain
d K L ( s , t ) = log ( n ) − n − 1 n . (119) d_{KL}(s,t)=\log(n)-\frac{n-1}{n}. \tag*{(119)} d K L ( s , t ) = log ( n ) − n n − 1 . (119)
Combining equations (116) , (118) , and (119) yields the desired result.
Proof of Theorem II.7
Proof. Recall that we need to calculate the below quantity for n ≥ 4 n \ge4 n ≥ 4 :
d K L ( q n , 1 b e s t , q β ) = ∑ i ∈ [ d ] i n − ( i − 1 ) n d n log ( i n − ( i − 1 ) n d n ⋅ S d , n − 1 i n − 1 ) . (120) d_{KL}\left(q^{\mathrm{best}}_{n,1},q_{\beta}\right)=\sum_{i\in[d]}\frac{i^n-(i-1)^n}{d^n}\log\left(\frac{i^n-(i-1)^n}{d^n}\cdot\frac{S_{d,n-1}}{i^{n-1}}\right). \tag*{(120)} d K L ( q n , 1 best , q β ) = i ∈ [ d ] ∑ d n i n − ( i − 1 ) n log ( d n i n − ( i − 1 ) n ⋅ i n − 1 S d , n − 1 ) . (120)
where S d , n − 1 = ∑ j = 1 d j n − 1 S_{d,n-1}=\sum_{j=1}^{d}j^{n-1} S d , n − 1 = ∑ j = 1 d j n − 1 .
First, note from the binomial expansion that
i n − ( i − 1 ) n = n i n − 1 − n ( n − 1 ) 2 i n − 2 + O ( i n − 3 ) , (121) i^n-(i-1)^n=ni^{n-1}-\frac{n(n-1)}{2}i^{n-2}+O(i^{n-3}), \tag*{(121)} i n − ( i − 1 ) n = n i n − 1 − 2 n ( n − 1 ) i n − 2 + O ( i n − 3 ) , (121)
i n − ( i − 1 ) n i n − 1 = n − n ( n − 1 ) 2 i + O ( 1 i 2 ) . (122) \frac{i^n-(i-1)^n}{i^{n-1}}=n-\frac{n(n-1)}{2i}+O\left(\frac{1}{i^2}\right). \tag*{(122)} i n − 1 i n − ( i − 1 ) n = n − 2 i n ( n − 1 ) + O ( i 2 1 ) . (122)
Also note from Faulhaber’s formula [32 ] that
S d , n − 1 = d n n + 1 2 d n − 1 + O ( d n − 2 ) , (123) S_{d,n-1}=\frac{d^n}{n}+\frac{1}{2}d^{n-1}+O(d^{n-2}), \tag*{(123)} S d , n − 1 = n d n + 2 1 d n − 1 + O ( d n − 2 ) , (123)
S d , n − 1 d n = 1 n + 1 2 d + O ( 1 d 2 ) . (124) \frac{S_{d,n-1}}{d^n}=\frac{1}{n}+\frac{1}{2d}+O\left(\frac{1}{d^2}\right). \tag*{(124)} d n S d , n − 1 = n 1 + 2 d 1 + O ( d 2 1 ) . (124)
Thus,
( i n − ( i − 1 ) n d n ⋅ S d , n − 1 i n − 1 ) = ( n − n ( n − 1 ) 2 i + O ( 1 i 2 ) ) ⋅ ( 1 n + 1 2 d + O ( 1 d 2 ) ) , (125) \left(\frac{i^n-(i-1)^n}{d^n}\cdot\frac{S_{d,n-1}}{i^{n-1}}\right)=\left(n-\frac{n(n-1)}{2i}+O\left(\frac{1}{i^2}\right)\right)\cdot\left(\frac{1}{n}+\frac{1}{2d}+O\left(\frac{1}{d^2}\right)\right), \tag*{(125)} ( d n i n − ( i − 1 ) n ⋅ i n − 1 S d , n − 1 ) = ( n − 2 i n ( n − 1 ) + O ( i 2 1 ) ) ⋅ ( n 1 + 2 d 1 + O ( d 2 1 ) ) , (125)
= 1 + n 2 d − n − 1 2 i + O ( 1 i 2 ) . (126) =1+\frac{n}{2d}-\frac{n-1}{2i}+O\left(\frac{1}{i^2}\right). \tag*{(126)} = 1 + 2 d n − 2 i n − 1 + O ( i 2 1 ) . (126)
Let
δ i = q n , 1 b e s t ( y i ) q β ( y i ) − 1 = n 2 d − n − 1 2 i + O ( 1 i 2 ) . (127) \delta_i=\frac{q^{\mathrm{best}}_{n,1}(y_i)}{q_{\beta}(y_i)}-1=\frac{n}{2d}-\frac{n-1}{2i}+O\left(\frac{1}{i^2}\right). \tag*{(127)} δ i = q β ( y i ) q n , 1 best ( y i ) − 1 = 2 d n − 2 i n − 1 + O ( i 2 1 ) . (127)
Recall that q n , 1 b e s t q^{\mathrm{best}}_{n,1} q n , 1 best and q β q_{\beta} q β are both distributions, and thus satisfy
∑ i ∈ [ d ] q β ( y i ) δ i = 0. (128) \sum_{i\in[d]}q_{\beta}(y_i)\delta_i=0. \tag*{(128)} i ∈ [ d ] ∑ q β ( y i ) δ i = 0. (128)
Thus, we have
d K L ( q n , 1 b e s t , q β ) = ∑ i ∈ [ d ] q n , 1 b e s t ( y i ) log ( 1 + δ i ) = ( a ) ∑ i ∈ [ d ] q β ( y i ) ( 1 + δ i ) log ( 1 + δ i ) (129) d_{KL}\left(q^{\mathrm{best}}_{n,1},q_{\beta}\right)=\sum_{i\in[d]}q^{\mathrm{best}}_{n,1}(y_i)\log(1+\delta_i)\mathrel{\overset{(a)}{=}}\sum_{i\in[d]}q_{\beta}(y_i)(1+\delta_i)\log(1+\delta_i) \tag*{(129)} d K L ( q n , 1 best , q β ) = i ∈ [ d ] ∑ q n , 1 best ( y i ) log ( 1 + δ i ) = ( a ) i ∈ [ d ] ∑ q β ( y i ) ( 1 + δ i ) log ( 1 + δ i ) (129)
= ( b ) ∑ i ∈ [ d ] q β ( y i ) ( δ i + δ i 2 2 + O ( δ i 3 ) ) (130) \mathrel{\overset{(b)}{=}}\sum_{i\in[d]}q_{\beta}(y_i)\left(\delta_i+\frac{\delta_i^2}{2}+O(\delta_i^3)\right) \tag*{(130)} = ( b ) i ∈ [ d ] ∑ q β ( y i ) ( δ i + 2 δ i 2 + O ( δ i 3 ) ) (130)
= ( c ) ∑ i ∈ [ d ] q β ( y i ) ( δ i 2 2 + O ( δ i 3 ) ) . (131) \mathrel{\overset{(c)}{=}}\sum_{i\in[d]}q_{\beta}(y_i)\left(\frac{\delta_i^2}{2}+O(\delta_i^3)\right). \tag*{(131)} = ( c ) i ∈ [ d ] ∑ q β ( y i ) ( 2 δ i 2 + O ( δ i 3 ) ) . (131)
where (a) uses q n , 1 b e s t ( y i ) = q β ( y i ) ( 1 + δ i ) ∀ i ∈ [ d ] q^{\mathrm{best}}_{n,1}(y_i)=q_{\beta}(y_i)(1+\delta_i)\forall i\in[d] q n , 1 best ( y i ) = q β ( y i ) ( 1 + δ i ) ∀ i ∈ [ d ] , (b) uses log ( 1 + δ i ) = δ i − δ i 2 2 + O ( δ i 3 ) \log(1+\delta_i)=\delta_i-\frac{\delta_i^2}{2}+O(\delta_i^3) log ( 1 + δ i ) = δ i − 2 δ i 2 + O ( δ i 3 ) , and (c) uses (129). Next, note from (128) that
δ i 2 = n 2 4 d 2 + ( n − 1 ) 2 4 i 2 − 2 n ( n − 1 ) 4 i d + O ( 1 i 3 ) (132) \delta_i^2=\frac{n^2}{4d^2}+\frac{(n-1)^2}{4i^2}-\frac{2n(n-1)}{4id}+O\left(\frac{1}{i^3}\right) \tag*{(132)} δ i 2 = 4 d 2 n 2 + 4 i 2 ( n − 1 ) 2 − 4 i d 2 n ( n − 1 ) + O ( i 3 1 ) (132)
and that
∑ i ∈ [ d ] O ( q β ( y i ) δ i 3 ) = ∑ i ∈ [ d ] O ( i n − 1 S d , n − 1 1 i 3 ) = ∑ i ∈ [ d ] O ( i n − 4 S d , n − 1 ) = O ( S d , n − 4 S d , n − 1 ) = O ( 1 d 3 ) , (133) \sum_{i\in[d]}O(q_{\beta}(y_i)\delta_i^3)=\sum_{i\in[d]}O\left(\frac{i^{n-1}}{S_{d,n-1}}\frac{1}{i^3}\right)=\sum_{i\in[d]}O\left(\frac{i^{n-4}}{S_{d,n-1}}\right)=O\left(\frac{S_{d,n-4}}{S_{d,n-1}}\right)=O\left(\frac{1}{d^3}\right), \tag*{(133)} i ∈ [ d ] ∑ O ( q β ( y i ) δ i 3 ) = i ∈ [ d ] ∑ O ( S d , n − 1 i n − 1 i 3 1 ) = i ∈ [ d ] ∑ O ( S d , n − 1 i n − 4 ) = O ( S d , n − 1 S d , n − 4 ) = O ( d 3 1 ) , (133)
where the last step uses Faulhaber’s formula [32 ] again.
Next, we perform some algebraic manipulations and use Faulhaber’s formula [32 ] for the last time to get the desired result.
d K L ( q n , 1 b e s t , q B ) = 1 2 ∑ i ∈ [ d ] i n − 1 S d , n − 1 ( n 2 4 d 2 + ( n − 1 ) 2 4 i 2 − n ( n − 1 ) 2 i d ) + O ( 1 d 3 ) (134) d_{KL}\left(q^{\mathrm{best}}_{n,1},q_B\right)=\frac{1}{2}\sum_{i\in[d]}\frac{i^{n-1}}{S_{d,n-1}}\left(\frac{n^2}{4d^2}+\frac{(n-1)^2}{4i^2}-\frac{n(n-1)}{2id}\right)+O\left(\frac{1}{d^3}\right) \tag*{(134)} d K L ( q n , 1 best , q B ) = 2 1 i ∈ [ d ] ∑ S d , n − 1 i n − 1 ( 4 d 2 n 2 + 4 i 2 ( n − 1 ) 2 − 2 i d n ( n − 1 ) ) + O ( d 3 1 ) (134)
= 1 2 ∑ i ∈ [ d ] i n − 1 S d , n − 1 ( n 2 4 d 2 + ( n − 1 ) 2 4 i 2 − n ( n − 1 ) 2 i d ) + O ( 1 d 3 ) (135) =\frac{1}{2}\sum_{i\in[d]}\frac{i^{n-1}}{S_{d,n-1}}\left(\frac{n^2}{4d^2}+\frac{(n-1)^2}{4i^2}-\frac{n(n-1)}{2id}\right)+O\left(\frac{1}{d^3}\right) \tag*{(135)} = 2 1 i ∈ [ d ] ∑ S d , n − 1 i n − 1 ( 4 d 2 n 2 + 4 i 2 ( n − 1 ) 2 − 2 i d n ( n − 1 ) ) + O ( d 3 1 ) (135)
= S d , n − 1 S d , n − 1 n 2 8 d 2 + ( n − 1 ) 2 S d , n − 3 8 S d , n − 1 − n ( n − 1 ) S d , n − 2 4 S d , n − 1 d + O ( 1 d 3 ) (136) =\frac{S_{d,n-1}}{S_{d,n-1}}\frac{n^2}{8d^2}+\frac{(n-1)^2S_{d,n-3}}{8S_{d,n-1}}-\frac{n(n-1)S_{d,n-2}}{4S_{d,n-1}d}+O\left(\frac{1}{d^3}\right) \tag*{(136)} = S d , n − 1 S d , n − 1 8 d 2 n 2 + 8 S d , n − 1 ( n − 1 ) 2 S d , n − 3 − 4 S d , n − 1 d n ( n − 1 ) S d , n − 2 + O ( d 3 1 ) (136)
= n 2 8 d 2 + ( n − 1 ) 2 n 8 d 2 ( n − 2 ) − n 2 4 d 2 + O ( 1 d 3 ) (137) =\frac{n^2}{8d^2}+\frac{(n-1)^2n}{8d^2(n-2)}-\frac{n^2}{4d^2}+O\left(\frac{1}{d^3}\right) \tag*{(137)} = 8 d 2 n 2 + 8 d 2 ( n − 2 ) ( n − 1 ) 2 n − 4 d 2 n 2 + O ( d 3 1 ) (137)
= n ( n − 2 ) 8 d 2 + O ( 1 d 3 ) . (138) =\frac{n}{(n-2)8d^2}+O\left(\frac{1}{d^3}\right). \tag*{(138)} = ( n − 2 ) 8 d 2 n + O ( d 3 1 ) . (138)