Introduction
Autoregressive language models generate an entire response through a sequence of local decisions: sample the next token given the prompt and the tokens already produced. An ordinary randomized sampler, in contrast, is unconstrained by the order in which its output is produced. A long pseudorandom string, for example, can be derived from a short random seed, even though the visible prefix does not reveal its continuation.
In this work we fully characterize the class of distributions that can be sampled efficiently one token at a time, using only the preceding output.
The probability chain rule factors every distribution into next-token conditionals: p ( x 1 x 2 x 3 ) = p ( x 1 ) p ( x 2 ∣ x 1 ) p ( x 3 ∣ x 1 x 2 ) p(x_1x_2x_3) = p(x_1)p(x_2 \mid x_1)p(x_3 \mid x_1x_2) p ( x 1 x 2 x 3 ) = p ( x 1 ) p ( x 2 ∣ x 1 ) p ( x 3 ∣ x 1 x 2 ) . However, this formula says nothing about the complexity of sampling those conditionals. An efficient algorithm for generating a whole string need not provide an efficient way to continue from a prefix drawn from the same distribution. Impagliazzo and Levin [7 ] furnish a sufficient hypothesis for universal efficient sequential sampleability : The average-case invertibility of all efficient functions. Their hypothesis is unreasonable as it would forbid cryptography. (We may be in for surprises!)
We study an abstraction of autoregressive generation called a sequential sampler (see Figure 1 ). This is a collection of probabilistic circuits C ( 1 n ) = ( C 1 , C 2 , … , C n ) C(1^n) = (C_1, C_2, \ldots, C_n) C ( 1 n ) = ( C 1 , C 2 , … , C n ) generating token sequence X 1 , X 2 , … , X n X_1, X_2, \ldots, X_n X 1 , X 2 , … , X n . Circuit C i C_i C i takes as inputs the prefix X < i = ( X 1 , … , X i − 1 ) X_{<i} = (X_1, \ldots, X_{i-1}) X < i = ( X 1 , … , X i − 1 ) , and possibly a bounded state s i − 1 s_{i-1} s i − 1 produced by C i − 1 C_{i-1} C i − 1 . It outputs the next token-state pair ( X i , s i ) (X_i, s_i) ( X i , s i ) . When s i s_i s i are empty the sampler is stateless .
Figure 1. A three-token sequential sampler.
Every step can reread the entire prefix sampled so far. Private information generated during one step, including randomness, can only be explicitly passed along through the state. Prompts, as well as other fixed model parameters, can be hardwired into the circuits, so we impose no restriction on the training procedure, attention mechanism, or depth of the next-token computation beyond efficiency, i.e., that the circuit size be polynomial in the total output length. The model captures generation from fixed autoregressive parameters when all information retained between steps is determined by the prompt and generated prefix.
Earlier work by Lin et al. [11 ] identifies sampleability limitations for autoregressive models satisfying the stronger assumption that next-token probabilities are efficiently computable. Fortnow [5 ] shows that the distributions that can be sampled in this manner are precisely the ones whose cumulative distribution function is efficiently computable [10 ] . Our model allows for a richer class of distributions.
More relevant to our model is the limitation observed by Wu [17 ] : A stateless sequential sampler cannot generate a number followed by its prime factorization, unless factoring is easy. Vadhan and Zheng [16 ] and Agrawal et al. [1 ] fully characterize this type of obstruction for stateless, fixed-order samplers.
Our approach is based on the duality between conditional sampleability and pseudoentropy discovered by Vadhan and Zheng [16 ] . Agrawal et al. [1 ] interpret this connection in the context of stateless sequential sampling. We derive analogous characterizations for stateful and insertional samplers.
Our Results
All reasonable sampling notions tolerate some error of the sampler C ( 1 n ) C(1^n) C ( 1 n ) relative to the target distribution Y Y Y . A natural measure, which we adopt in this work, is their KL-divergence D K L ( Y ∥ C ( 1 n ) ) D_{\mathrm{KL}}(Y \mathbin\Vert C(1^n)) D KL ( Y ∥ C ( 1 n )) . Note that small KL-divergence implies small total variation distance.
Characterizing sequential samplers. For left-to-right generation, the relevant quantity is next-block pseudoentropy . It measures how much entropy the next token can appear to have, given the true preceding prefix, summed over the positions. The next-block pseudoentropy gap is the difference between this quantity and the true entropy of the complete string. This equivalence follows from the work of Vadhan and Zheng [16 ] and was informally discussed by Agrawal et al. [1 ] . We give a formal, quantitative statement and proof:
Theorem 1.1 (Vadhan and Zheng [16 ] , Agrawal et al. [1 ] , see Theorem 3.3). A distribution has a small next-block pseudoentropy gap if and only if it admits an efficient stateless sequential sampler with small KL error.
The next-token circuits can be chosen with full knowledge of the target, independently of any learning algorithm. A large pseudoentropy gap therefore identifies a limitation that persists even when training and model selection are unrestricted.
We show that the above extends beyond stateless samplers. The reason is that private state can be eliminated, at a cost polynomial in the number of possible states:
Theorem 1.2 (Theorem 4.3 , informal). A sequential sampler with k k k bits of state can be approximated in KL-divergence by a stateless sequential sampler. The circuit-size overhead is 2 k 2^k 2 k and polynomial in the other parameters, including token alphabet size.
A factor 2 k 2^k 2 k blowup in overhead is inevitable—in the worst case—for simulation that estimates the state distribution from independent samples. As intuition, a pseudorandom generator with a k k k -bit seed admits an efficient stateful implementation that stores the seed. A stateless implementation, however, seems to effectively require brute-force search over all possible seeds. See § 4.3 .
Insertional Samplers. An insertional sampler can insert a new token anywhere in the output, not just at the terminal position. The Insertion Transformer [15 ] is endowed with this capability. The sampler still retains bounded private state, but can generate information in an order suited to the task.
We introduce the notion of insertional pseudoentropy gap to measure how much the apparent conditional entropy can exceed the actual conditional entropy, summed over the insertions, for every insertional decomposition of the target. We show a duality between insertional pseudoentropy and sampleability:
Theorem 1.3 (Theorem 5.6 , informal). A distribution has a small insertional pseudoentropy gap if and only if it admits an efficient stateless insertional sampler with small KL error.
Insertional samplers are more powerful than sequential ones: Going back to the factoring example, one can simply output the factors first, then insert their product in the first position of the sequence. In fact, this is not just a property of factoring: For any one-way function f f f ,1 the pair ( f ( X ) , X ) (f(X), X) ( f ( X ) , X ) is hard to sample in a left-to-right manner but easy to sample insertionally (Proposition 7.1).
In contrast to the pair ( f ( X ) , X ) (f(X), X) ( f ( X ) , X ) which is easy to sample from right-to-left, a pseudorandom generator2 is not sequentially samplable for any fixed ordering. This is because it has next-bit pseudoentropy with respect to every fixed ordering of the output bits (see Corollary 8.2). Thus, one might expect that the pseudorandom generator output distribution is not insertionally sampleable. Yet, surprisingly, we demonstrate the existence of pseudorandom generators whose output can be sampled insertionally:
Theorem 1.4 (Theorem 6.1 , informal). Assuming one-way functions exist, there is a PRG whose distribution can be sampled by a stateless insertional sampler.
Our construction crucially exploits the stochasticity of the insertion positions. We further demonstrate a separation between insertional and arbitrary samplers, indicating a limitation of their computational capabilities:
Theorem 1.5 (Theorem 7.2 , informal). Assuming the existence of very hard-to-invert one-way functions, there is an efficiently sampleable distribution that cannot be sampled efficiently in a stateless insertional manner.
The token alphabet in our hard distribution has bit-length linear in the sequence length n n n . We do not know if this dependence is necessary.
Consequences (§ 8 ). Our results reveal fundamental tradeoffs between the expressive power of generative models and their cryptographic capabilities. More restrictive architectures provide automatic safety guarantees. More expressive architectures, in contrast, could be useful for training cryptographic functionalities.
Cryptographic capabilities and safeguards. Autoregressive models face limits even on useful tasks that ordinary programs perform routinely. Our results imply that they cannot faithfully sample the output of a pseudorandom generator, a necessity for encryption. Supporting these capabilities requires sufficient private state or access to external resources.
This limitation can be beneficial for safety. Untrusted agents might try to establish a covert channel via steganographic techniques. Bounding the state of transformer-type agents constrains their ability to communicate in secret.
A case for insertion-based models. At the level of generation rules, insertion is strictly more expressive than left-to-right generation in our stateless setting. The freedom to choose where to write can therefore expand a model’s capabilities without adding private memory. For example, as we have shown, useful cryptography can be computed statelessly by insertion-based models but not by models with any apriori fixed order. This provides a theoretical foundation for pursuing insertion-based models as an alternative to strictly autoregressive generation.
Further Related Work
Computational entropy provides several ways to express the difficulty of producing correlated outputs. Inaccessible entropy, introduced by Haitner et al. [6 ] , measures the entropy an online generator can produce when its previous random coins are included in the conditioning information. Agrawal et al. [1 ] unify this notion with next-block pseudoentropy through hardness in relative entropy. We use the prefix-only sampling connection from this theory as a foundation; the insertional analysis must additionally handle intermediate strings and the information in their generation order.
Our next-token circuits sample their outputs, and their output probabilities need not be efficiently evaluable. This distinguishes the model from the probability-evaluation setting of Lin et al. [11 ] . Wu’s factoring-based example [17 ] already exhibits a limitation for randomized prefix-only generation. The entropy characterization provides a general criterion; our insertional analysis extends this viewpoint to alternative generation orders.
Recent work also studies the computational role of generation order. Kim et al. [9 ] analyze hard masking conditionals under computational assumptions and the benefits of choosing favorable orders. Yang et al. [18 ] compare autoregressive, masked, and editing-based generation; their autoregressive simulation of arbitrary orders emits position–token pairs and permits postprocessing. Our samplers must directly produce the prescribed output string, so that simulation does not imply equivalence in our model. Jiang et al. [JHC26] study parallel sampling efficiency and simulation of randomized circuits by diffusion models with auxiliary tokens. Their resource bounds complement our focus on the distributions that can be generated under restrictions on private state and output order.
Mazor, Morgan, and Pass [13 ] show that efficient autoregressive models with efficiently evaluable next-token probabilities are equivalent to efficient monotone, prefix-free compression, up to an additive two bits between excess cross-entropy and compression redundancy. Combining this with the Vadhan–Zheng characterization relates next-bit pseudoentropy to monotone incompressibility. Their cryptographic separation uses a distribution of the form ( G ( U ) , U ) (G(U), U) ( G ( U ) , U ) for a pseudorandom generator G G G , closely related to our fixed-order sampling obstruction based on ( f ( U ) , U ) (f(U), U) ( f ( U ) , U ) . Our main results quantify the cost of eliminating private state and characterize the power and limitations of insertional sampling, allowing general randomized transitions without requiring efficient probability evaluation. Thus, the two works share a fixed-order pseudoentropy foundation while developing complementary compression and sampling perspectives. Interestingly, the notion of insertional generation does not seem to be captured by monotone compression.
Preliminaries
For n ∈ N n \in\mathbb{N} n ∈ N , define the set [ n ] = { 1 , … , n } [n] = \{1, \ldots, n\} [ n ] = { 1 , … , n } . For any set X X X , we define X 0 : = { ∅ } X^0 := \{\emptyset\} X 0 := { ∅ } where ∅ \emptyset ∅ denotes the empty string. We say that a string x x x is a subsequence of y y y if x x x can be produced from y y y by deletions.
For any two random variables or two distributions X , Y X,Y X , Y , we will use Δ ( X , Y ) : = 1 2 ⋅ ∑ a ∈ supp ( X ) ∪ supp ( Y ) ∣ Pr [ X = a ] − Pr [ Y = a ] ∣ ∈ [ 0 , 1 ] \Delta(X,Y) := \frac{1}{2}\cdot\sum_{a\in\operatorname{supp}(X)\cup\operatorname{supp}(Y)} \lvert\Pr[X=a]-\Pr[Y=a]\rvert\in[0,1] Δ ( X , Y ) := 2 1 ⋅ ∑ a ∈ supp ( X ) ∪ supp ( Y ) ∣ Pr [ X = a ] − Pr [ Y = a ]∣ ∈ [ 0 , 1 ] to denote the total variation distance between X X X and Y Y Y . Our default logarithm function log \log log is in base two. Every randomized circuit uses fresh independent fair coins. If X , Y X,Y X , Y are random variables where Y Y Y has support Y \mathcal{Y} Y , then for any y ∈ Y y\in\mathcal{Y} y ∈ Y we use the notation X ∣ Y = y X\mid_{Y=y} X ∣ Y = y to denote the conditional distribution of X X X conditioned on the event that Y = y Y=y Y = y .
A function f f f in parameter λ ∈ N \lambda\in\mathbb{N} λ ∈ N is noticeable if there exists a polynomial p ( λ ) p(\lambda) p ( λ ) such that for all sufficiently large λ \lambda λ , f ( λ ) > 1 / p ( λ ) f(\lambda)>1/p(\lambda) f ( λ ) > 1/ p ( λ ) . For a parameter λ ∈ N \lambda\in\mathbb{N} λ ∈ N , for any two functions α = α ( λ ) \alpha=\alpha(\lambda) α = α ( λ ) and β = β ( λ ) \beta=\beta(\lambda) β = β ( λ ) , we say that β \beta β is noticeably larger α \alpha α if there exists a noticeable function γ = γ ( λ ) \gamma=\gamma(\lambda) γ = γ ( λ ) such that β > α + γ \beta>\alpha+\gamma β > α + γ . A function f f f in parameter λ ∈ N \lambda\in\mathbb{N} λ ∈ N is negligible if for all polynomials p ( λ ) p(\lambda) p ( λ ) , for sufficiently large enough λ \lambda λ , we have f ( λ ) < 1 / p ( λ ) f(\lambda)<1/p(\lambda) f ( λ ) < 1/ p ( λ ) .
Basic Information Theory
We now recall relevant definitions and related facts from information theory.
Definition 2.1 (Shannon entropy). For a discrete random variable X X X with finite support, we define the Shannon entropy of X X X to be H ( X ) : = − E x ∼ X [ log 2 Pr ( X = x ) ] H(X):=-\mathbb{E}_{x\sim X}[\log_2\Pr(X=x)] H ( X ) := − E x ∼ X [ log 2 Pr ( X = x )] .
Definition 2.2 (Binary entropy). For p ∈ [ 0 , 1 ] p\in[0,1] p ∈ [ 0 , 1 ] , define the binary entropy function h ( p ) = − p log 2 p − ( 1 − p ) log 2 ( 1 − p ) h(p)=-p\log_2p-(1-p)\log_2(1-p) h ( p ) = − p log 2 p − ( 1 − p ) log 2 ( 1 − p ) .
Definition 2.3 (KL divergence). Let P , Q P,Q P , Q be distributions over a finite set Ω \Omega Ω . If P P P is absolutely continuous with respect to Q Q Q , meaning that P ( a ) > 0 P(a)>0 P ( a ) > 0 implies Q ( a ) > 0 Q(a)>0 Q ( a ) > 0 , then the KL divergence from P P P to Q Q Q is
D K L ( P ∥ Q ) : = ∑ a ∈ Ω P ( a ) log P ( a ) Q ( a ) . D_{\mathrm{KL}}(P\mathbin{\|}Q):=\sum_{a\in\Omega}P(a)\log\frac{P(a)}{Q(a)}. D KL ( P ∥ Q ) := a ∈ Ω ∑ P ( a ) log Q ( a ) P ( a ) . If P P P is not absolutely continuous with respect to Q Q Q , we define D K L ( P ∥ Q ) = + ∞ D_{\mathrm{KL}}(P\mathbin{\|}Q)=+\infty D KL ( P ∥ Q ) = + ∞ .
Fact 2.4 (Nonnegativity of KL divergence; see Theorem 2.6.3 in Cover and Thomas [4 ] ). For any two distributions P , Q P,Q P , Q over a finite set Ω \Omega Ω , D K L ( P ∥ Q ) ≥ 0 D_{\mathrm{KL}}(P\mathbin{\|}Q)\ge0 D KL ( P ∥ Q ) ≥ 0 .
Fact 2.5 (Pinsker’s inequality; Lemma 11.6.1 in Cover and Thomas [4 ] ). For finite distributions P , Q P,Q P , Q ,
Δ ( P , Q ) ≤ ( ln 2 ) D K L ( P ∥ Q ) 2 . \Delta(P,Q)\le\sqrt{\frac{(\ln2)D_{\mathrm{KL}}(P\mathbin{\|}Q)}{2}}. Δ ( P , Q ) ≤ 2 ( ln 2 ) D KL ( P ∥ Q ) .
Definition 2.6 (Markov chain; see Chapter 4 in Cover and Thomas [4 ] ). A sequence of random variables Z 1 , … , Z n Z_1,\ldots,Z_n Z 1 , … , Z n over finite sets is a Markov chain, denoted Z 1 − Z 2 − ⋯ − Z n Z_1-Z_2-\cdots-Z_n Z 1 − Z 2 − ⋯ − Z n if for every i ∈ { 2 , … , n − 1 } , i\in\{2,\ldots,n-1\}, i ∈ { 2 , … , n − 1 } ,
Pr [ Z i + 1 = z i + 1 ∣ Z 1 = z 1 , … , Z i = z i ] = Pr [ Z i + 1 = z i + 1 ∣ Z i = z i ] \Pr[Z_{i+1}=z_{i+1}\mid Z_1=z_1,\ldots,Z_i=z_i]=\Pr[Z_{i+1}=z_{i+1}\mid Z_i=z_i] Pr [ Z i + 1 = z i + 1 ∣ Z 1 = z 1 , … , Z i = z i ] = Pr [ Z i + 1 = z i + 1 ∣ Z i = z i ] whenever the conditioning event has positive probability. Equivalently, for every i ∈ { 2 , … , n − 1 } i\in\{2,\ldots,n-1\} i ∈ { 2 , … , n − 1 } , Z i + 1 Z_{i+1} Z i + 1 is conditionally independent of ( Z 1 , … , Z i − 1 ) (Z_1,\ldots,Z_{i-1}) ( Z 1 , … , Z i − 1 ) given Z i Z_i Z i .
The KL chain rule compares two joint distributions by first comparing one variable, then comparing the other conditioned on the first.
Fact 2.7 (KL chain rule; Theorem 2.5.3 in Cover and Thomas [4 ] ). Let P X Y P_{XY} P X Y and Q X Y Q_{XY} Q X Y be distributions over the same finite set X × Y \mathcal{X} \times\mathcal{Y} X × Y . Then
D K L ( P X Y ∥ Q X Y ) = D K L ( P X ∥ Q X ) + E x ∼ P X D K L ( P Y ∣ X = x ∥ Q Y ∣ X = x ) . D_{\mathrm{KL}}(P_{XY} \mathbin\Vert Q_{XY}) = D_{\mathrm{KL}}(P_X \mathbin\Vert Q_X) + \mathbb{E}_{x \sim P_X} D_{\mathrm{KL}}(P_{Y\mid X=x} \mathbin\Vert Q_{Y\mid X=x}). D KL ( P X Y ∥ Q X Y ) = D KL ( P X ∥ Q X ) + E x ∼ P X D KL ( P Y ∣ X = x ∥ Q Y ∣ X = x ) . Conditional distributions on events of probability zero may be chosen arbitrarily, and the expectation sums only over x x x with P X ( x ) > 0 P_X(x) > 0 P X ( x ) > 0 . The identity allows infinite divergence.
Iterating the chain rule gives a sum over steps, each conditioned on the full preceding history. For Markov chains, the conditioning reduces to the preceding variable.
Fact 2.8 (KL chain rule for Markov chains). Let n ≥ 1 n \ge1 n ≥ 1 and let X 0 , … , X n X_0, \ldots, X_n X 0 , … , X n and Y 0 , … , Y n Y_0, \ldots, Y_n Y 0 , … , Y n be Markov chains, where for each i i i the variables X i , Y i X_i, Y_i X i , Y i take values in the same finite set, which may depend on i i i . If they have the same initial distribution, X 0 ≡ Y 0 X_0 \equiv Y_0 X 0 ≡ Y 0 , then
D K L ( ( X 0 , … , X n ) ∥ ( Y 0 , … , Y n ) ) = ∑ i = 1 n E x ∼ X i − 1 D K L ( X i ∣ X i − 1 = x ∥ Y i ∣ Y i − 1 = x ) . (1) D_{\mathrm{KL}}\left((X_0,\ldots,X_n) \mathbin\Vert(Y_0,\ldots,Y_n)\right) = \sum_{i=1}^{n} \mathbb{E}_{x \sim X_{i-1}} D_{\mathrm{KL}}\left(X_i \mid X_{i-1}=x \mathbin\Vert Y_i \mid Y_{i-1}=x\right). \tag*{(1)} D KL ( ( X 0 , … , X n ) ∥ ( Y 0 , … , Y n ) ) = i = 1 ∑ n E x ∼ X i − 1 D KL ( X i ∣ X i − 1 = x ∥ Y i ∣ Y i − 1 = x ) . (1) Both transitions are conditioned on the same value x x x , sampled from X i − 1 X_{i-1} X i − 1 , with the same conventions for zero-probability events as above.
Proof. Applying Fact 2.7 to the first coordinate gives
D K L ( ( X 0 , … , X n ) ∥ ( Y 0 , … , Y n ) ) = D K L ( X 0 ∥ Y 0 ) + E x 0 ∼ X 0 D K L ( ( X 1 , … , X n ) ∣ X 0 = x 0 ∥ ( Y 1 , … , Y n ) ∣ Y 0 = x 0 ) . \begin{aligned}
D_{\mathrm{KL}}\left((X_0,\ldots,X_n) \mathbin\Vert(Y_0,\ldots,Y_n)\right)
={}&D_{\mathrm{KL}}(X_0 \mathbin\Vert Y_0) + \mathbb{E}_{x_0 \sim X_0} D_{\mathrm{KL}}\left((X_1,\ldots,X_n) \mid X_0=x_0 \mathbin\Vert(Y_1,\ldots,Y_n) \mid Y_0=x_0\right).
\end{aligned} D KL ( ( X 0 , … , X n ) ∥ ( Y 0 , … , Y n ) ) = D KL ( X 0 ∥ Y 0 ) + E x 0 ∼ X 0 D KL ( ( X 1 , … , X n ) ∣ X 0 = x 0 ∥ ( Y 1 , … , Y n ) ∣ Y 0 = x 0 ) .
Here D K L ( X 0 ∥ Y 0 ) = 0 D_{\mathrm{KL}}(X_0 \mathbin\Vert Y_0) = 0 D KL ( X 0 ∥ Y 0 ) = 0 because X 0 ≡ Y 0 X_0 \equiv Y_0 X 0 ≡ Y 0 . For n = 1 n = 1 n = 1 , this already gives the claim. For i ∈ [ n ] i \in[n] i ∈ [ n ] , write X < i = ( X 0 , … , X i − 1 ) X_{<i} = (X_0,\ldots,X_{i-1}) X < i = ( X 0 , … , X i − 1 ) and Y < i = ( Y 0 , … , Y i − 1 ) Y_{<i} = (Y_0,\ldots,Y_{i-1}) Y < i = ( Y 0 , … , Y i − 1 ) . For n ≥ 2 n \ge2 n ≥ 2 , applying the same fact inside the expectation separates the next coordinate:
D K L ( ( X 0 , … , X n ) ∥ ( Y 0 , … , Y n ) ) = D K L ( X 0 ∥ Y 0 ) + E x 0 ∼ X 0 D K L ( X 1 ∣ X 0 = x 0 ∥ Y 1 ∣ Y 0 = x 0 ) + E ( x 0 , x 1 ) ∼ ( X 0 , X 1 ) D K L ( ( X 2 , … , X n ) ∣ X 0 = x 0 , X 1 = x 1 ∥ ( Y 2 , … , Y n ) ∣ Y 0 = x 0 , Y 1 = x 1 ) = ∑ i = 1 n E x < i ∼ X < i D K L ( X i ∣ X < i = x < i ∥ Y i ∣ Y < i = x < i ) . \begin{aligned}
D_{\mathrm{KL}}\left((X_0,\ldots,X_n) \mathbin\Vert(Y_0,\ldots,Y_n)\right)
={}&D_{\mathrm{KL}}(X_0 \mathbin\Vert Y_0) + \mathbb{E}_{x_0 \sim X_0}D_{\mathrm{KL}}(X_1 \mid X_0=x_0 \mathbin\Vert Y_1 \mid Y_0=x_0) \\
&+ \mathbb{E}_{(x_0,x_1)\sim(X_0,X_1)}D_{\mathrm{KL}}\left((X_2,\ldots,X_n)\mid X_0=x_0,X_1=x_1 \mathbin\Vert(Y_2,\ldots,Y_n)\mid Y_0=x_0,Y_1=x_1\right) \\
={}&\sum_{i=1}^{n}\mathbb{E}_{x_{<i}\sim X_{<i}}D_{\mathrm{KL}}\left(X_i\mid X_{<i}=x_{<i} \mathbin\Vert Y_i\mid Y_{<i}=x_{<i}\right).
\end{aligned} D KL ( ( X 0 , … , X n ) ∥ ( Y 0 , … , Y n ) ) = = D KL ( X 0 ∥ Y 0 ) + E x 0 ∼ X 0 D KL ( X 1 ∣ X 0 = x 0 ∥ Y 1 ∣ Y 0 = x 0 ) + E ( x 0 , x 1 ) ∼ ( X 0 , X 1 ) D KL ( ( X 2 , … , X n ) ∣ X 0 = x 0 , X 1 = x 1 ∥ ( Y 2 , … , Y n ) ∣ Y 0 = x 0 , Y 1 = x 1 ) i = 1 ∑ n E x < i ∼ X < i D KL ( X i ∣ X < i = x < i ∥ Y i ∣ Y < i = x < i ) .
The Markov property gives
X i ∣ X < i = x < i ≡ X i ∣ X i − 1 = x i − 1 , Y i ∣ Y < i = x < i ≡ Y i ∣ Y i − 1 = x i − 1 . \begin{aligned}
X_i\mid X_{<i}=x_{<i} &\equiv X_i\mid X_{i-1}=x_{i-1}, \\
Y_i\mid Y_{<i}=x_{<i} &\equiv Y_i\mid Y_{i-1}=x_{i-1}.
\end{aligned} X i ∣ X < i = x < i Y i ∣ Y < i = x < i ≡ X i ∣ X i − 1 = x i − 1 , ≡ Y i ∣ Y i − 1 = x i − 1 .
Consequently, tuples x < i x_{<i} x < i with the same last value x i − 1 = x x_{i-1}=x x i − 1 = x give the same KL divergence. Their weights in the expectation add up to Pr [ X i − 1 = x ] \Pr[X_{i-1}=x] Pr [ X i − 1 = x ] :
E x < i ∼ X < i D K L ( X i ∣ X < i = x < i ∥ Y i ∣ Y < i = x < i ) = ∑ x ( ∑ x < i : x i − 1 = x Pr [ X < i = x < i ] ) D K L ( X i ∣ X i − 1 = x ∥ Y i ∣ Y i − 1 = x ) = E x ∼ X i − 1 D K L ( X i ∣ X i − 1 = x ∥ Y i ∣ Y i − 1 = x ) . \begin{aligned}
\mathbb{E}_{x_{<i}\sim X_{<i}} D_{\mathrm{KL}}\left(X_i \mid X_{<i}=x_{<i}\mathbin\Vert Y_i \mid Y_{<i}=x_{<i}\right)
&= \sum_x \left(\sum_{x_{<i}:x_{i-1}=x}\Pr[X_{<i}=x_{<i}]\right)D_{\mathrm{KL}}\left(X_i \mid X_{i-1}=x\mathbin\Vert Y_i \mid Y_{i-1}=x\right)\\
&= \mathbb{E}_{x\sim X_{i-1}}D_{\mathrm{KL}}\left(X_i \mid X_{i-1}=x\mathbin\Vert Y_i \mid Y_{i-1}=x\right).
\end{aligned} E x < i ∼ X < i D KL ( X i ∣ X < i = x < i ∥ Y i ∣ Y < i = x < i ) = x ∑ ( x < i : x i − 1 = x ∑ Pr [ X < i = x < i ] ) D KL ( X i ∣ X i − 1 = x ∥ Y i ∣ Y i − 1 = x ) = E x ∼ X i − 1 D KL ( X i ∣ X i − 1 = x ∥ Y i ∣ Y i − 1 = x ) .
Substituting these equalities into the expansion proves (1) .
The KL inequality below follows from the log-sum inequality [4 Theorem 2.7.1] .
Fact 2.9 (Data processing inequality). Let P X , Q X P_X,Q_X P X , Q X be distributions on a finite set X \mathcal{X} X . Let P Y , Q Y P_Y,Q_Y P Y , Q Y be obtained by applying the same randomized map from X \mathcal{X} X to a finite set Y \mathcal{Y} Y . Then D K L ( P Y ∥ Q Y ) ≤ D K L ( P X ∥ Q X ) D_{\mathrm{KL}}(P_Y\mathbin\Vert Q_Y)\le D_{\mathrm{KL}}(P_X\mathbin\Vert Q_X) D KL ( P Y ∥ Q Y ) ≤ D KL ( P X ∥ Q X ) .
Laplace Estimator
The Laplace estimator allows us to smooth over the cases in which the KL-divergence may be infinity, i.e. it gives every sample non-zero probability mass to prevent this occurrence. In this preliminary section, we recall its definition, basic properties, and the Boolean circuit complexity of the Laplace estimator. In particular, we recall results that imply that we can efficiently batch-sample the Laplace estimator.
Definition 2.10 (Laplace estimator; see e.g. [3 ] ). Let P P P be a distribution over a finite domain Ω \Omega Ω of size ∣ Ω ∣ = K |\Omega|=K ∣Ω∣ = K . For N > 0 N>0 N > 0 , let x ˉ = x ( 1 ) , … , x ( N ) \bar{x}=x^{(1)},\ldots,x^{(N)} x ˉ = x ( 1 ) , … , x ( N ) be i.i.d. samples according to P P P . The Laplace estimator is defined (w.r.t. x ˉ \bar{x} x ˉ ) for any ω ∈ Ω \omega\in\Omega ω ∈ Ω as
P ^ N ( ω ) = 1 N + K ( 1 + ∑ j = 1 N 1 ( x ( j ) = ω ) ) (2) \widehat{P}_N(\omega)=\frac{1}{N+K}\left(1+\sum_{j=1}^{N}\mathbf{1}(x^{(j)}=\omega)\right) \tag*{(2)} P N ( ω ) = N + K 1 ( 1 + j = 1 ∑ N 1 ( x ( j ) = ω ) ) (2)
The following claim extends the standard expected KL bound for the Laplace estimator (the case Q = P Q=P Q = P ; see MG22, Proposition 4) to an arbitrary target distribution Q Q Q .
Claim 2.11. Let P , Q P,Q P , Q be distributions over a finite domain Ω \Omega Ω of size K ≥ 1 K\ge1 K ≥ 1 , and let N ≥ 1 N\ge1 N ≥ 1 be an integer. Let P ^ N \widehat{P}_N P N be the Laplace estimate from N N N independent samples of P P P . Then
E D K L ( Q ∥ P ^ N ) ≤ D K L ( Q ∥ P ) + log N + K N + 1 ≤ D K L ( Q ∥ P ) + ( K − 1 ) log e N + 1 , \mathbb{E}D_{\mathrm{KL}}\left(Q\mathbin\Vert\widehat{P}_N\right)\le D_{\mathrm{KL}}(Q\mathbin\Vert P)+\log\frac{N+K}{N+1}\le D_{\mathrm{KL}}(Q\mathbin\Vert P)+\frac{(K-1)\log e}{N+1}, E D KL ( Q ∥ P N ) ≤ D KL ( Q ∥ P ) + log N + 1 N + K ≤ D KL ( Q ∥ P ) + N + 1 ( K − 1 ) log e , where the expectation is over the samples and logarithms have base two.
Proof. If Q Q Q is not absolutely continuous with respect to P P P , the right-hand side is infinite and the claim holds. Otherwise, fix x ∈ supp ( Q ) x\in\operatorname{supp}(Q) x ∈ supp ( Q ) and put p = P ( x ) > 0 p=P(x)>0 p = P ( x ) > 0 . Its sample count V x V_x V x has distribution Bin ( N , p ) \operatorname{Bin}(N,p) Bin ( N , p ) , and P ^ N ( x ) = ( V x + 1 ) / ( N + K ) \widehat{P}_N(x)=(V_x+1)/(N+K) P N ( x ) = ( V x + 1 ) / ( N + K ) . Hence
E [ P ( x ) P ^ N ( x ) ] = p ( N + K ) E [ 1 V x + 1 ] = N + K N + 1 ( 1 − ( 1 − p ) N + 1 ) ≤ N + K N + 1 . \mathbb{E}\left[\frac{P(x)}{\widehat{P}_N(x)}\right]=p(N+K)\mathbb{E}\left[\frac{1}{V_x+1}\right]
=\frac{N+K}{N+1}\left(1-(1-p)^{N+1}\right)\le\frac{N+K}{N+1}. E [ P N ( x ) P ( x ) ] = p ( N + K ) E [ V x + 1 1 ] = N + 1 N + K ( 1 − ( 1 − p ) N + 1 ) ≤ N + 1 N + K .
The second equality follows by expanding the binomial expectation and using ( N v ) / ( v + 1 ) = ( N + 1 v + 1 ) / ( N + 1 ) \binom{N}{v}/(v+1)=\binom{N+1}{v+1}/(N+1) ( v N ) / ( v + 1 ) = ( v + 1 N + 1 ) / ( N + 1 ) . Expanding KL divergence and applying Jensen’s inequality now gives
E D K L ( Q ∥ P ^ N ) = D K L ( Q ∥ P ) + ∑ x ∈ supp ( Q ) Q ( x ) E log P ( x ) P ^ N ( x ) ≤ D K L ( Q ∥ P ) + ∑ x ∈ supp ( Q ) Q ( x ) log E [ P ( x ) P ^ N ( x ) ] ≤ D K L ( Q ∥ P ) + log N + K N + 1 . \begin{aligned}
\mathbb{E}D_{\mathrm{KL}}\left(Q\mathbin\Vert\widehat{P}_N\right)=D_{\mathrm{KL}}(Q\mathbin\Vert P)+\sum_{x\in\operatorname{supp}(Q)}Q(x)\mathbb{E}\log\frac{P(x)}{\widehat{P}_N(x)} \\
&\le D_{\mathrm{KL}}(Q\mathbin\Vert P)+\sum_{x\in\operatorname{supp}(Q)}Q(x)\log\mathbb{E}\left[\frac{P(x)}{\widehat{P}_N(x)}\right] \\
&\le D_{\mathrm{KL}}(Q\mathbin\Vert P)+\log\frac{N+K}{N+1}.
\end{aligned} E D KL ( Q ∥ P N ) = D KL ( Q ∥ P ) + x ∈ supp ( Q ) ∑ Q ( x ) E log P N ( x ) P ( x ) ≤ D KL ( Q ∥ P ) + x ∈ supp ( Q ) ∑ Q ( x ) log E [ P N ( x ) P ( x ) ] ≤ D KL ( Q ∥ P ) + log N + 1 N + K .
Finally, log ( 1 + y ) ≤ y log e \log(1+y)\le y\log e log ( 1 + y ) ≤ y log e for y ≥ 0 y\ge0 y ≥ 0 gives the second bound.
Lemma 2.12 (Conditional KL bound from joint Laplace estimation). Let A \mathcal{A} A and B \mathcal{B} B be finite domains, and K = ∣ A ∣ ⋅ ∣ B ∣ K=|\mathcal{A}|\cdot|\mathcal{B}| K = ∣ A ∣ ⋅ ∣ B ∣ . Let P , Q P,Q P , Q be two distributions over A × B \mathcal{A}\times\mathcal{B} A × B . Let ( Z t , T t ) t = 1 M (Z_t,T_t)_{t=1}^{M} ( Z t , T t ) t = 1 M be i.i.d. samples from Q Q Q , and let Q ^ \widehat{Q} Q and Q ^ B ∣ A ( ⋅ ∣ x ) \widehat{Q}_{B\mid A}(\cdot\mid x) Q B ∣ A ( ⋅ ∣ x ) denote the corresponding joint and conditional (given x ∈ A x\in\mathcal{A} x ∈ A ) Laplace estimates respectively. Then,
E ( Z t , T t ) t = 1 M ∼ Q M E x ∼ P A D K L ( P B ∣ A ( ⋅ ∣ x ) ∥ Q ^ B ∣ A ( ⋅ ∣ x ) ) ≤ D K L ( P ∥ Q ) + K − 1 M + 1 log e . \mathbb{E}_{(Z_t,T_t)_{t=1}^{M}\sim Q^M}\mathbb{E}_{x\sim P_A}D_{\mathrm{KL}}\left(P_{B\mid A}(\cdot\mid x)\mathbin\Vert\widehat{Q}_{B\mid A}(\cdot\mid x)\right)\le D_{\mathrm{KL}}(P\mathbin\Vert Q)+\frac{K-1}{M+1}\log e. E ( Z t , T t ) t = 1 M ∼ Q M E x ∼ P A D KL ( P B ∣ A ( ⋅ ∣ x ) ∥ Q B ∣ A ( ⋅ ∣ x ) ) ≤ D KL ( P ∥ Q ) + M + 1 K − 1 log e .
Proof. For any realization of the sample pairs ( Z t , T t ) t = 1 M (Z_t,T_t)_{t=1}^{M} ( Z t , T t ) t = 1 M , by the chain rule of KL divergence,
E x ∼ P A D K L ( P B ∣ A ( ⋅ ∣ x ) ∥ Q ^ B ∣ A ( ⋅ ∣ x ) ) ≤ D K L ( P ∥ Q ^ ) . \mathbb{E}_{x\sim P_A}D_{\mathrm{KL}}\left(P_{B\mid A}(\cdot\mid x)\mathbin\Vert\widehat{Q}_{B\mid A}(\cdot\mid x)\right)\le D_{\mathrm{KL}}(P\mathbin\Vert\widehat{Q}). E x ∼ P A D KL ( P B ∣ A ( ⋅ ∣ x ) ∥ Q B ∣ A ( ⋅ ∣ x ) ) ≤ D KL ( P ∥ Q ) .
Moreover, by Claim 2.11 ,
E ( Z t , T t ) t = 1 M ∼ Q M D K L ( P ∥ Q ^ ) ≤ D K L ( P ∥ Q ) + K − 1 M + 1 log e . \mathbb{E}_{(Z_t,T_t)_{t=1}^{M}\sim Q^M}D_{\mathrm{KL}}(P\mathbin\Vert\widehat{Q})\le D_{\mathrm{KL}}(P\mathbin\Vert Q)+\frac{K-1}{M+1}\log e. E ( Z t , T t ) t = 1 M ∼ Q M D KL ( P ∥ Q ) ≤ D KL ( P ∥ Q ) + M + 1 K − 1 log e .
Putting the two bounds together gives the promised result.
We now give an analysis of the circuit complexity of sampling the Laplace estimator. Recall that given N N N samples from an alphabet of size K K K , the Laplace estimator outputs one of K K K output symbols with probability exactly given by one plus the number of its occurrences in the N N N samples divided by N + K N+K N + K .
A simple circuit with unbounded-fan-in OR gates implements this estimator with N + K N+K N + K input wires that are all set to zero except for a single input wire that is set to 1. This circuit has one unbounded fan-in OR gate for each of the K K K output symbols. Enumerate the K K K OR gates. For i ∈ [ K ] i\in[K] i ∈ [ K ] , connect the i i i th input wire as an input to the i i i th OR gate. Then, letting each of the remaining N N N input wires represent the samples, connect these to their corresponding symbol. This circuit exactly implements the Laplace estimator.
However, we consider circuit complexity in terms of fan-in two and in terms of input wires that are uniformly distributed on { 0 , 1 } \{0,1\} { 0 , 1 } . This results in the following fact.
Fact 2.13. Let P P P be any distribution over a finite domain of size K K K . For any constant c ≥ 0 c \ge0 c ≥ 0 , for any N = O ( K c ) N = O(K^c) N = O ( K c ) samples sampled from P P P , there exists a Boolean circuit C C C depending only on the N N N sample values and the domain size K K K with O ~ ( N + K ) \widetilde{O}(N+K) O ( N + K ) two-input gates such that C C C on λ = ⌈ ( log 2 N ) 2 ⌉ + ⌈ log 2 ( N + K ) ⌉ + 1 \lambda= \lceil(\log_2 N)^2\rceil+ \lceil\log_2(N+K)\rceil+ 1 λ = ⌈( log 2 N ) 2 ⌉ + ⌈ log 2 ( N + K )⌉ + 1 independent uniform random input wires samples a distribution that is 2 − log 2 N 2^{-\log_2 N} 2 − l o g 2 N KL-distance within the Laplace estimator define above.
Proof. Fix any N N N samples x 1 , … , x N ∈ [ K ] x_1,\ldots,x_N \in[K] x 1 , … , x N ∈ [ K ] .
Given λ : = ⌈ log 2 2 N ⌉ + ⌈ log 2 ( N + K ) ⌉ + 1 \lambda:= \lceil\log_2^2 N\rceil+ \lceil\log_2(N+K)\rceil+ 1 λ := ⌈ log 2 2 N ⌉ + ⌈ log 2 ( N + K )⌉ + 1 input wires uniformly randomly distributed, let U U U be uniformly distributed over [ 0 , … , 2 λ − 1 ] [0,\ldots,2^\lambda-1] [ 0 , … , 2 λ − 1 ] , compute J : = 1 + ⌊ ( N + K ) ⋅ U ⋅ 2 − λ ⌋ ∈ [ N + K ] J := 1+\lfloor(N+K)\cdot U\cdot2^{-\lambda}\rfloor\in[N+K] J := 1 + ⌊( N + K ) ⋅ U ⋅ 2 − λ ⌋ ∈ [ N + K ] . If J ≤ K J \le K J ≤ K output the J J J -th symbol. If J > K J > K J > K , output the symbol x J − K x_{J-K} x J − K .
The total Boolean circuit complexity is O ~ ( N + K ) \widetilde{O}(N+K) O ( N + K ) . Multiplying U U U with N + K N+K N + K takes O ( λ ⋅ log ( N + K ) ) O(\lambda\cdot\log(N+K)) O ( λ ⋅ log ( N + K )) gates, dividing by 2 λ 2^\lambda 2 λ is throwing away the lower λ \lambda λ bits using zero gates, and adding 1 1 1 takes log ( N + K ) \log(N+K) log ( N + K ) gates. Encode J J J by the ⌈ log 2 ( N + K ) ⌉ \lceil\log_2(N+K)\rceil ⌈ log 2 ( N + K )⌉ -bit representation of J − 1 J-1 J − 1 . First convert this encoding into N + K N+K N + K wires, exactly one of which is one, using O ( N + K ) O(N+K) O ( N + K ) gates. Combine the wires corresponding to each symbol using N N N two-input OR gates in total, and encode the resulting K K K symbol-indicator wires in binary using O ( K ) O(K) O ( K ) additional gates. Thus this conversion costs O ( N + K ) O(N+K) O ( N + K ) gates.
We now bound the KL-divergence. Let P ~ ( σ ) = Pr [ C ( U ) = σ ] \widetilde{P}(\sigma) = \Pr[C(U)=\sigma] P ( σ ) = Pr [ C ( U ) = σ ] for σ ∈ [ K ] \sigma\in[K] σ ∈ [ K ] . Let P ^ \widehat{P} P be the Laplace estimate of the samples x 1 , … , x N x_1,\ldots,x_N x 1 , … , x N . Each index j ∈ [ N + K ] j \in[N+K] j ∈ [ N + K ] satisfies
Pr [ J = j ] ≤ 1 N + K + 1 2 λ . \Pr[J=j] \le\frac{1}{N+K}+\frac{1}{2^\lambda}. Pr [ J = j ] ≤ N + K 1 + 2 λ 1 .
Summing over the 1 + ∣ { i ∈ [ N ] : x i = σ } ∣ 1+\lvert\{i\in[N]:x_i=\sigma\}\rvert 1 + ∣{ i ∈ [ N ] : x i = σ }∣ indices that output symbol σ \sigma σ , we obtain
P ~ ( σ ) ≤ ( 1 + N + K 2 λ ) P ^ ( σ ) ≤ ( 1 + 2 − log 2 N − 1 ) P ^ ( σ ) . \widetilde{P}(\sigma) \le\left(1+\frac{N+K}{2^\lambda}\right)\widehat{P}(\sigma) \le\left(1+2^{-\log_2 N-1}\right)\widehat{P}(\sigma). P ( σ ) ≤ ( 1 + 2 λ N + K ) P ( σ ) ≤ ( 1 + 2 − l o g 2 N − 1 ) P ( σ ) .
Therefore, opening the definition of KL divergence,
D K L ( P ~ ∥ P ^ ) = ∑ σ ∈ [ K ] P ~ ( σ ) log 2 P ~ ( σ ) P ^ ( σ ) ≤ ∑ σ ∈ [ K ] P ~ ( σ ) log 2 ( 1 + 2 − log 2 N − 1 ) ≤ ∑ σ ∈ [ K ] P ~ ( σ ) 2 − log 2 N = 2 − log 2 N , \begin{aligned}
D_{\mathrm{KL}}(\widetilde{P}\|\widehat{P})
&= \sum_{\sigma\in[K]} \widetilde{P}(\sigma)\log_2\frac{\widetilde{P}(\sigma)}{\widehat{P}(\sigma)} \\
&\le\sum_{\sigma\in[K]} \widetilde{P}(\sigma)\log_2\left(1+2^{-\log_2 N-1}\right) \\
&\le\sum_{\sigma\in[K]} \widetilde{P}(\sigma)2^{-\log_2 N} \\
&= 2^{-\log_2 N},
\end{aligned} D KL ( P ∥ P ) = σ ∈ [ K ] ∑ P ( σ ) log 2 P ( σ ) P ( σ ) ≤ σ ∈ [ K ] ∑ P ( σ ) log 2 ( 1 + 2 − l o g 2 N − 1 ) ≤ σ ∈ [ K ] ∑ P ( σ ) 2 − l o g 2 N = 2 − l o g 2 N ,
where we used log 2 ( 1 + t ) ≤ t log 2 e ≤ 2 t \log_2(1+t)\le t\log_2 e\le2t log 2 ( 1 + t ) ≤ t log 2 e ≤ 2 t for any t > 0 t>0 t > 0 .
If we naively sample the Laplace estimator N N N times, the resulting circuit complexity would blow-up by N N N , resulting in a complexity of O ~ ( N ( N + K ) ) \widetilde{O}(N(N+K)) O ( N ( N + K )) . This complexity is primarily due to a table look-up, i.e. the above algorithm looks up one of K K K symbols in a table of size N + K N+K N + K . However, it has long been known how to batch table look-ups to remove this overhead. We now recall the sorting-network bound used for this construction.
A sorting network is a fixed sequence of compare-and-swap operations: each operation takes two binary integers and returns their minimum and maximum. The locations compared do not depend on the input values. Mazor and Pass [14 Lemma 10] recall a sorting-circuit bound of O ( N ⋅ poly ( log N , w ) ) O(N \cdot\operatorname{poly}(\log N,w)) O ( N ⋅ poly ( log N , w )) for N N N integers of w w w bits each. We use the following explicit bound from Batcher’s construction to keep track of the logarithmic factors.
Theorem 2.14 (Sorting networks [2 ] ). For every pair of integers N , w ≥ 1 N,w \ge1 N , w ≥ 1 , there is a sorting network with O ( N log 2 ( 2 N ) ) O(N\log^2(2N)) O ( N log 2 ( 2 N )) compare-and-swap operations that sorts any N N N w w w -bit integers in nondecreasing order. Each operation can be implemented using O ( w ) O(w) O ( w ) two-input Boolean gates. Consequently, there is a deterministic Boolean circuit Sort N , w \operatorname{Sort}_{N,w} Sort N , w of size O ( N w log 2 ( 2 N ) ) O(Nw\log^2(2N)) O ( N w log 2 ( 2 N )) that outputs a sorted permutation of its N N N inputs. The circuit construction is deterministic and depends only on N , w N,w N , w .
Corollary 2.15 (Batched table lookup). Let M , K , L ≥ 1 M,K,L \ge1 M , K , L ≥ 1 be integers with 2 ≤ K ≤ M 2 \le K \le M 2 ≤ K ≤ M . There exists a Boolean circuit depending only on M , K , L M,K,L M , K , L that, on binary-encoded inputs a = ( a 1 , … , a M ) ∈ [ K ] M a=(a_1,\ldots,a_M)\in[K]^M a = ( a 1 , … , a M ) ∈ [ K ] M and ( J 1 , … , J L ) ∈ [ M ] L (J_1,\ldots,J_L)\in[M]^L ( J 1 , … , J L ) ∈ [ M ] L , outputs ( a J 1 , … , a J L ) (a_{J_1},\ldots,a_{J_L}) ( a J 1 , … , a J L ) , using O ( ( M + L ) log 3 ( 2 ( M + L ) ) ) = O ~ ( M + L ) O((M+L)\log^3(2(M+L)))=\widetilde{O}(M+L) O (( M + L ) log 3 ( 2 ( M + L ))) = O ( M + L ) two-input gates. The circuit construction is deterministic.
Proof. Set R = M + L R=M+L R = M + L . A record is a tuple ( d , τ , q , v ) (d,\tau,q,v) ( d , τ , q , v ) whose coordinates are a table address d d d , a type bit τ \tau τ (0 for a table entry, 1 for a query), a query index q q q , and a value v v v . Unused coordinates are set to zero. Form the R R R records
( j , 0 , 0 , a j ) ( j ∈ [ M ] ) , ( J q , 1 , q , 0 ) ( q ∈ [ L ] ) . (j,0,0,a_j)\quad(j\in[M]),\qquad(J_q,1,q,0)\quad(q\in[L]). ( j , 0 , 0 , a j ) ( j ∈ [ M ]) , ( J q , 1 , q , 0 ) ( q ∈ [ L ]) .
For h = ⌈ log ( R + 1 ) ⌉ h=\lceil\log(R+1)\rceil h = ⌈ log ( R + 1 )⌉ , represent ( d , τ , q , v ) (d,\tau,q,v) ( d , τ , q , v ) by the 4 h 4h 4 h -bit integer
d 2 3 h + τ 2 2 h + q 2 h + v . d2^{3h}+\tau2^{2h}+q2^h+v. d 2 3 h + τ 2 2 h + q 2 h + v .
Since d , q , v ≤ R < 2 h d,q,v\le R<2^h d , q , v ≤ R < 2 h , numerical order on these encodings agrees with lexicographic order on the tuples, and 4 h = O ( log ( 2 R ) ) 4h=O(\log(2R)) 4 h = O ( log ( 2 R )) .
Apply Theorem 2.14 to sort these records lexicographically. Thus, for each q ∈ [ L ] q\in[L] q ∈ [ L ] , the query record ( J q , 1 , q , 0 ) (J_q,1,q,0) ( J q , 1 , q , 0 ) occurs after ( J q , 0 , 0 , a J q ) (J_q,0,0,a_{J_q}) ( J q , 0 , 0 , a J q ) , with no other table, i.e. type bit 0, between them. Write the sorted records as ( d r , τ r , q r , v r ) r = 1 R (d_r,\tau_r,q_r,v_r)_{r=1}^R ( d r , τ r , q r , v r ) r = 1 R and compute
c 0 = 0 , c r = { v r , τ r = 0 , c r − 1 , τ r = 1. c_0=0,\qquad c_r=
\begin{cases}
v_r, & \tau_r=0,\\
c_{r-1}, & \tau_r=1.
\end{cases} c 0 = 0 , c r = { v r , c r − 1 , τ r = 0 , τ r = 1.
For a query record with q r = q q_r=q q r = q , we have c r = a J q c_r=a_{J_q} c r = a J q . This computation uses O ( R log K ) O(R\log K) O ( R log K ) gates.
Finally, sort the triples ( 1 − τ r , q r , c r ) (1-\tau_r,q_r,c_r) ( 1 − τ r , q r , c r ) lexicographically, using the integer encodings ( 1 − τ r ) 2 2 h + q r 2 h + c r (1-\tau_r)2^{2h}+q_r2^h+c_r ( 1 − τ r ) 2 2 h + q r 2 h + c r . The first L L L triples correspond to queries in increasing order of q q q , so their third coordinates give ( a J 1 , … , a J L ) (a_{J_1},\ldots,a_{J_L}) ( a J 1 , … , a J L ) . Each of the two sorting networks uses O ( R log 3 ( 2 R ) ) O(R\log^3(2R)) O ( R log 3 ( 2 R )) gates, giving the claimed size bound. All operations are fixed by M , K , L M,K,L M , K , L , so the circuit construction is deterministic.
Corollary 2.16 (Batched sampling from a Laplace estimate). Let N , K , λ ≥ 1 N,K,\lambda\ge1 N , K , λ ≥ 1 . There exists a Boolean circuit depending only on N , K , λ N,K,\lambda N , K , λ , with O ~ ( λ ( N + K ) ) \widetilde{O}(\lambda(N+K)) O ( λ ( N + K )) two-input gates, that takes binary-encoded samples x 1 , … , x N ∈ [ K ] x_1,\ldots,x_N \in[K] x 1 , … , x N ∈ [ K ] as inputs and uses N λ N\lambda N λ independent uniform random bits. For every fixed input, its N N N outputs are independent with a common distribution P ~ \widetilde{P} P satisfying
D K L ( P ~ ⊗ N ∥ P ^ ⊗ N ) ≤ 2 N ( N + K ) 2 − λ . D_{\mathrm{KL}}\left(\widetilde{P}^{\otimes N}\mathbin{\Vert}\widehat{P}^{\otimes N}\right) \le2N(N+K)2^{-\lambda}. D KL ( P ⊗ N ∥ P ⊗ N ) ≤ 2 N ( N + K ) 2 − λ . Here, P ^ \widehat{P} P is the Laplace estimate of the input samples, and O ~ \widetilde{O} O hides polylogarithmic factors in N N N and K K K .
Proof. For K = 1 K=1 K = 1 , output N N N copies of the sole symbol. Henceforth assume K ≥ 2 K\ge2 K ≥ 2 . Write T = N + K T=N+K T = N + K , and form the table a = ( 1 , … , K , x 1 , … , x N ) ∈ [ K ] T a=(1,\ldots,K,x_1,\ldots,x_N)\in[K]^T a = ( 1 , … , K , x 1 , … , x N ) ∈ [ K ] T . For each i ∈ [ N ] i\in[N] i ∈ [ N ] , use a separate block of λ \lambda λ random bits to generate U i U_i U i uniformly in { 0 , … , 2 λ − 1 } \{0,\ldots,2^\lambda-1\} { 0 , … , 2 λ − 1 } , and compute J i = 1 + ⌊ T U i 2 λ ⌋ J_i=1+\left\lfloor\frac{TU_i}{2^\lambda}\right\rfloor J i = 1 + ⌊ 2 λ T U i ⌋ . Computing all indices requires O ( N λ log ( 2 T ) ) O(N\lambda\log(2T)) O ( N λ log ( 2 T )) two-input gates. By Corollary 2.15, computing ( a J 1 , … , a J N ) (a_{J_1},\ldots,a_{J_N}) ( a J 1 , … , a J N ) requires O ( T log 3 ( 2 T ) ) O(T\log^3(2T)) O ( T log 3 ( 2 T )) additional gates. The total size is therefore O ~ ( λ T ) \widetilde{O}(\lambda T) O ( λ T ) .
For every fixed input, the outputs are independent, since each equals a J i a_{J_i} a J i and the indices are independent. Moreover, for every j ∈ [ T ] j\in[T] j ∈ [ T ] , Pr [ J i = j ] ≤ 1 T + 2 − λ \Pr[J_i=j]\le\frac{1}{T}+2^{-\lambda} Pr [ J i = j ] ≤ T 1 + 2 − λ . Summing over the table positions containing σ \sigma σ gives P ~ ( σ ) ≤ ( 1 + T 2 − λ ) P ^ ( σ ) \widetilde{P}(\sigma)\le(1+T2^{-\lambda})\widehat{P}(\sigma) P ( σ ) ≤ ( 1 + T 2 − λ ) P ( σ ) . Consequently,
D K L ( P ~ ⊗ N ∥ P ^ ⊗ N ) = N D K L ( P ~ ∥ P ^ ) D_{\mathrm{KL}}\left(\widetilde{P}^{\otimes N}\mathbin{\Vert}\widehat{P}^{\otimes N}\right)=ND_{\mathrm{KL}}(\widetilde{P}\mathbin{\Vert}\widehat{P}) D KL ( P ⊗ N ∥ P ⊗ N ) = N D KL ( P ∥ P ) ≤ N log 2 ( 1 + T 2 − λ ) \le N\log_2(1+T2^{-\lambda}) ≤ N log 2 ( 1 + T 2 − λ ) ≤ 2 N T 2 − λ , \le2NT2^{-\lambda}, ≤ 2 N T 2 − λ , using the fact that log 2 ( 1 + t ) ≤ 2 t \log_2(1+t)\le2t log 2 ( 1 + t ) ≤ 2 t for t > 0 t>0 t > 0 .
The same construction allows an input bit for each sample to specify whether it is used. We record this extension with the KL bound needed below.
Corollary 2.17 (Batched Laplace sampling from selected samples). Let N , K , λ ≥ 1 N,K,\lambda\ge1 N , K , λ ≥ 1 , T = N + K T=N+K T = N + K , and η = T 2 − λ < 1 \eta=T2^{-\lambda}<1 η = T 2 − λ < 1 . There is a Boolean circuit depending only on N , K , λ N,K,\lambda N , K , λ , of size
O ( T log 3 ( 2 T ) + N λ log ( 2 T ) ) = O ~ ( λ T ) , O(T\log^3(2T)+N\lambda\log(2T))=\widetilde{O}(\lambda T), O ( T log 3 ( 2 T ) + N λ log ( 2 T )) = O ( λ T ) , that takes binary-encoded samples x 1 , … , x N ∈ [ K ] x_1,\ldots,x_N\in[K] x 1 , … , x N ∈ [ K ] and selection bits b 1 , … , b N ∈ { 0 , 1 } b_1,\ldots,b_N\in\{0,1\} b 1 , … , b N ∈ { 0 , 1 } as inputs, where b t = 1 b_t=1 b t = 1 means that x t x_t x t is included in the estimate. Set H = ∑ t = 1 N b t H=\sum_{t=1}^N b_t H = ∑ t = 1 N b t , and let P ^ \widehat{P} P be the Laplace estimate of the selected samples:
P ^ ( σ ) = 1 + ∑ t = 1 N b t 1 [ x t = σ ] H + K ( σ ∈ [ K ] ) . \widehat{P}(\sigma)=\frac{1+\sum_{t=1}^N b_t\mathbf{1}[x_t=\sigma]}{H+K}\qquad(\sigma\in[K]). P ( σ ) = H + K 1 + ∑ t = 1 N b t 1 [ x t = σ ] ( σ ∈ [ K ]) . Thus P ^ \widehat{P} P is uniform when H = 0 H=0 H = 0 .
Using N λ N\lambda N λ independent uniform random bits, the Boolean circuit outputs N N N symbols that, conditional on these inputs, are independent with a common distribution P ~ \widetilde{P} P . This distribution depends only on the selected samples, in their original order. Then, for every distribution Q Q Q over [ K ] [K] [ K ] ,
D K L ( Q ∥ P ~ ) ≤ D K L ( Q ∥ P ^ ) + log 2 1 1 − η . D_{\mathrm{KL}}(Q\mathbin{\Vert}\widetilde{P})\le D_{\mathrm{KL}}(Q\mathbin{\Vert}\widehat{P})+\log_2\frac{1}{1-\eta}. D KL ( Q ∥ P ) ≤ D KL ( Q ∥ P ) + log 2 1 − η 1 . The circuit construction is deterministic, and O ~ \widetilde{O} O hides polylogarithmic factors in N N N and K K K .
Proof. The case K = 1 K = 1 K = 1 is immediate. Assume K ≥ 2 K \ge2 K ≥ 2 and compute H = ∑ t = 1 N b t H = \sum_{t=1}^{N} b_t H = ∑ t = 1 N b t . For h = ⌈ log ( 2 T ) ⌉ h = \lceil\log(2T)\rceil h = ⌈ log ( 2 T )⌉ , represent each triple ( 1 − b t , t − 1 , x t − 1 ) (1-b_t,t-1,x_t-1) ( 1 − b t , t − 1 , x t − 1 ) by the ( 2 h + 1 ) (2h+1) ( 2 h + 1 ) -bit integer
( 1 − b t ) 2 2 h + ( t − 1 ) 2 h + ( x t − 1 ) , (1-b_t)2^{2h}+(t-1)2^h+(x_t-1), ( 1 − b t ) 2 2 h + ( t − 1 ) 2 h + ( x t − 1 ) ,
and sort these integers. This sorts the triples lexicographically. The first coordinate places the selected samples first. The second coordinate preserves their original order, and the third coordinate is the sample encoded as x t − 1 x_t-1 x t − 1 . Let y 1 , … , y N y_1,\ldots,y_N y 1 , … , y N be the corresponding samples in sorted order. Then y 1 , … , y H y_1,\ldots,y_H y 1 , … , y H are exactly the selected samples, in their original order. By Theorem 2.14 , sorting costs O ( N log 2 ( 2 N ) log ( 2 T ) ) O(N\log^2(2N)\log(2T)) O ( N log 2 ( 2 N ) log ( 2 T )) gates; computing H H H costs O ( N log ( 2 N ) ) O(N\log(2N)) O ( N log ( 2 N )) gates.
Use the construction of Corollary 2.16 with the table a = ( 1 , … , K , y 1 , … , y N ) a=(1,\ldots,K,y_1,\ldots,y_N) a = ( 1 , … , K , y 1 , … , y N ) , but compute
J i = 1 + ⌊ ( H + K ) U i 2 λ ⌋ ( i ∈ [ N ] ) . J_i=1+\left\lfloor\frac{(H+K)U_i}{2^\lambda}\right\rfloor\qquad(i\in[N]). J i = 1 + ⌊ 2 λ ( H + K ) U i ⌋ ( i ∈ [ N ]) .
Here the U i U_i U i are independent and uniform in { 0 , … , 2 λ − 1 } \{0,\ldots,2^\lambda-1\} { 0 , … , 2 λ − 1 } . The indices lie in [ H + K ] [H+K] [ H + K ] , so the lookups are restricted to ( 1 , … , K , y 1 , … , y H ) (1,\ldots,K,y_1,\ldots,y_H) ( 1 , … , K , y 1 , … , y H ) ; this also handles H = 0 H=0 H = 0 . Computing the indices costs O ( N λ log ( 2 T ) ) O(N\lambda\log(2T)) O ( N λ log ( 2 T )) gates, and the lookups cost O ( T log 3 ( 2 T ) ) O(T\log^3(2T)) O ( T log 3 ( 2 T )) gates. The sorting and counting costs are absorbed in this bound. The outputs remain independent conditional on the inputs, and their common distribution depends only on the selected samples in their original order.
For every j ∈ [ H + K ] j\in[H+K] j ∈ [ H + K ] , the lower rounding bound gives
Pr [ J i = j ] ≥ 1 H + K − 2 − λ ≥ 1 − η H + K . \Pr[J_i=j]\ge\frac{1}{H+K}-2^{-\lambda}\ge\frac{1-\eta}{H+K}. Pr [ J i = j ] ≥ H + K 1 − 2 − λ ≥ H + K 1 − η .
Summing over the positions containing σ \sigma σ gives P ~ ( σ ) ≥ ( 1 − η ) P ^ ( σ ) \widetilde{P}(\sigma)\ge(1-\eta)\widehat{P}(\sigma) P ( σ ) ≥ ( 1 − η ) P ( σ ) . For η < 1 \eta<1 η < 1 ,
D K L ( Q ∥ P ~ ) = D K L ( Q ∥ P ^ ) + ∑ σ ∈ [ K ] Q ( σ ) log 2 P ^ ( σ ) P ~ ( σ ) ≤ D K L ( Q ∥ P ^ ) + log 2 1 1 − η . D_{\mathrm{KL}}(Q\mathbin\Vert\widetilde{P})=D_{\mathrm{KL}}(Q\mathbin\Vert\widehat{P})+\sum_{\sigma\in[K]}Q(\sigma)\log_2\frac{\widehat{P}(\sigma)}{\widetilde{P}(\sigma)}
\le D_{\mathrm{KL}}(Q\mathbin\Vert\widehat{P})+\log_2\frac{1}{1-\eta}. D KL ( Q ∥ P ) = D KL ( Q ∥ P ) + σ ∈ [ K ] ∑ Q ( σ ) log 2 P ( σ ) P ( σ ) ≤ D KL ( Q ∥ P ) + log 2 1 − η 1 .
One-Way Functions
We use the length-preserving form of one-way functions, with security against nonuniform circuits.
Definition 2.18 (One-way functions against circuits). Let f = ( f λ ) λ ≥ 1 f=(f_\lambda)_{\lambda\ge1} f = ( f λ ) λ ≥ 1 be a function family with f λ : { 0 , 1 } λ → { 0 , 1 } λ f_\lambda:\{0,1\}^\lambda\to\{0,1\}^\lambda f λ : { 0 , 1 } λ → { 0 , 1 } λ , where f λ ( x ) f_\lambda(x) f λ ( x ) is computable from ( 1 λ , x ) (1^\lambda,x) ( 1 λ , x ) in deterministic polynomial time. For functions T : N → [ 1 , ∞ ) T:\mathbb{N}\to[1,\infty) T : N → [ 1 , ∞ ) and ϵ : N → [ 0 , 1 ] \epsilon:\mathbb{N}\to[0,1] ϵ : N → [ 0 , 1 ] , we say that f f f is ( T , ϵ ) (T,\epsilon) ( T , ϵ ) -one-way against circuits if, for all sufficiently large λ \lambda λ , every randomized circuit A λ A_\lambda A λ of size at most T ( λ ) T(\lambda) T ( λ ) satisfies
Pr X ← U λ , R [ A λ ( f λ ( X ) ; R ) ∈ f λ − 1 ( f λ ( X ) ) ] ≤ ϵ ( λ ) . \Pr_{X\leftarrow U_\lambda,R}\left[A_\lambda(f_\lambda(X);R)\in f_\lambda^{-1}(f_\lambda(X))\right]\le\epsilon(\lambda). X ← U λ , R Pr [ A λ ( f λ ( X ) ; R ) ∈ f λ − 1 ( f λ ( X )) ] ≤ ϵ ( λ ) . Here R R R denotes independent uniform random coins for A λ A_\lambda A λ . The circuit may depend arbitrarily on λ \lambda λ , and success means finding any preimage; an output ⊥ \perp ⊥ counts as failure.
We call f f f a one-way function against polynomial-size circuits if it is ( λ c , λ − c ) (\lambda^c,\lambda^{-c}) ( λ c , λ − c ) -one-way for every constant c > 0 c>0 c > 0 . For a size bound T T T , we call f f f T T T -secure if it is ( T , 1 / T ) (T,1/T) ( T , 1/ T ) -one-way.
Pseudoentropy
Definition 2.19 (Pseudoentropy, nonuniform setting [16 ] ). Let X X X be a random variable over a finite set. We say that X X X has ( T , ε ) (T,\varepsilon) ( T , ε ) nonuniform pseudoentropy at least k k k if there exists a random variable Y Y Y over the same set with
H ( Y ) ≥ k H(Y) \ge k H ( Y ) ≥ k and
X X X and Y Y Y are ( T , ε ) (T,\varepsilon) ( T , ε ) nonuniformly indistinguishable.
Here indistinguishability means that every Boolean circuit of size at most T T T has distinguishing advantage at most ε \varepsilon ε in absolute value.
If X = X ( n ) X = X(n) X = X ( n ) , we say that X X X has nonuniform pseudoentropy at least k = k ( n ) k = k(n) k = k ( n ) if, for every constant c > 0 c > 0 c > 0 , it has ( n c , n − c ) (n^c,n^{-c}) ( n c , n − c ) nonuniform pseudoentropy at least k ( n ) − n − c k(n) - n^{-c} k ( n ) − n − c for all sufficiently large n n n .
Definition 2.20 (Conditional pseudoentropy, nonuniform setting [16 ] ). Let ( X , B ) (X,B) ( X , B ) take values in the finite set X × B \mathcal{X} \times\mathcal{B} X × B . We say that B B B has ( T , ε ) (T,\varepsilon) ( T , ε ) conditional pseudoentropy at least k k k given X X X if there exists a random variable Z Z Z over B \mathcal{B} B , jointly distributed with X X X , such that
H ( Z ∣ X ) ≥ k H(Z \mid X) \ge k H ( Z ∣ X ) ≥ k and
( X , B ) (X,B) ( X , B ) and ( X , Z ) (X,Z) ( X , Z ) are ( T , ε ) (T,\varepsilon) ( T , ε ) nonuniformly indistinguishable.
The conditional pseudoentropy is the supremum of such k k k . The ( T , ε ) (T,\varepsilon) ( T , ε ) conditional pseudoentropy gap of B B B given X X X is this supremum minus H ( B ∣ X ) H(B \mid X) H ( B ∣ X ) . The asymptotic definition uses the same quantifiers and entropy slack as Definition Definition 2.19 .
The maximum exists: the conditional distributions of Z Z Z form a compact set, the indistinguishability constraints are closed, and conditional entropy is continuous. Taking Z = B Z = B Z = B shows that the gap is nonnegative.
Definition 2.21 (Next-block pseudoentropy [16 Definition 2.12] ). Let n , ℓ ≥ 1 n,\ell\ge1 n , ℓ ≥ 1 , let Y = ( Y 1 , … , Y n ) Y = (Y_1,\ldots,Y_n) Y = ( Y 1 , … , Y n ) take values in ( { 0 , 1 } ℓ ) n (\{0,1\}^{\ell})^n ({ 0 , 1 } ℓ ) n , and let I I I be uniform on [ n ] [n] [ n ] , independently of Y Y Y . We say that Y Y Y has ( t , ε ) (t,\varepsilon) ( t , ε ) next-block pseudoentropy at least k k k if there exists a random variable Z Z Z over { 0 , 1 } ℓ \{0,1\}^{\ell} { 0 , 1 } ℓ , jointly distributed with ( I , Y ) (I,Y) ( I , Y ) , such that
H ( Z ∣ Y < I ) ≥ k / n H(Z \mid Y_{<I}) \ge k/n H ( Z ∣ Y < I ) ≥ k / n and
( Y < I , Y I ) (Y_{<I},Y_I) ( Y < I , Y I ) and ( Y < I , Z ) (Y_{<I},Z) ( Y < I , Z ) are ( t , ε ) (t,\varepsilon) ( t , ε ) nonuniformly indistinguishable.
For ℓ = 1 \ell= 1 ℓ = 1 , we also call this next-bit pseudoentropy.
For families indexed by n n n , next-block pseudoentropy at least k ( n ) k(n) k ( n ) means that, for every c > 0 c > 0 c > 0 and all sufficiently large n n n , the ( n c , n − c ) (n^c,n^{-c}) ( n c , n − c ) next-block pseudoentropy is at least k ( n ) − n − c k(n) - n^{-c} k ( n ) − n − c . This is the nonuniform asymptotic convention; polynomial rescaling absorbs the number of blocks when comparing it with the conditional definition.
Definition 2.22 (KL-hardness for conditional sampling [16 ] ). Let ( X , B ) (X,B) ( X , B ) take values in { 0 , 1 } m × [ q ] \{0,1\}^m \times[q] { 0 , 1 } m × [ q ] . We say that B B B is ( t , δ ) (t,\delta) ( t , δ ) K L KL K L -hard to sample given X X X if every randomized circuit S : { 0 , 1 } m → [ q ] S:\{0,1\}^m \to[q] S : { 0 , 1 } m → [ q ] of size at most t t t satisfies D K L ( ( X , B ) ∥ ( X , S ( X ) ) ) > δ D_{\mathrm{KL}}((X,B)\mathbin{\|}(X,S(X))) > \delta D KL (( X , B ) ∥ ( X , S ( X ))) > δ .
We use the following two consequences of the Vadhan–Zheng characterization, stated directly in terms of conditional samplers. In the first part, the distinguishing error ϵ \epsilon ϵ and the additive KL-divergence loss η \eta η are separate parameters.
Theorem 2.23 (Characterizing conditional pseudoentropy, nonuniform setting). There exist a universal constant c 1 ∈ ( 0 , 1 ] c_1 \in(0,1] c 1 ∈ ( 0 , 1 ] and a polynomial p 0 p_0 p 0 with nonnegative coefficients and constant term at least one such that the following holds. Let ( X , B ) (X,B) ( X , B ) take values in { 0 , 1 } m × [ q ] \{0,1\}^m \times[q] { 0 , 1 } m × [ q ] , with m ≥ 0 m \ge0 m ≥ 0 and q ≥ 2 q \ge2 q ≥ 2 , and let t ≥ 1 t \ge1 t ≥ 1 , δ , g ≥ 0 \delta,g \ge0 δ , g ≥ 0 , and 0 < ϵ , η , σ < 1 0 < \epsilon,\eta,\sigma< 1 0 < ϵ , η , σ < 1 .
If B B B has ( t , ϵ ) (t,\epsilon) ( t , ϵ ) conditional pseudoentropy gap at least δ \delta δ given X X X , then every randomized circuit S : { 0 , 1 } m → [ q ] S:\{0,1\}^m \to[q] S : { 0 , 1 } m → [ q ] of size at most
min { t c 1 , σ / ϵ } p 0 ( m , q , 1 / η , log ( 1 / σ ) ) \frac{\min\{t^{c_1},\sigma/\epsilon\}}{p_0(m,q,1/\eta,\log(1/\sigma))} p 0 ( m , q , 1/ η , log ( 1/ σ )) min { t c 1 , σ / ϵ } satisfies D K L ( ( X , B ) ∥ ( X , S ( X ) ) ) > δ − σ − η D_{\mathrm{KL}}((X,B)\mathbin\Vert(X,S(X))) > \delta-\sigma-\eta D KL (( X , B ) ∥ ( X , S ( X ))) > δ − σ − η .
If the ( t , η ) (t,\eta) ( t , η ) conditional pseudoentropy gap of B B B given X X X is at most g g g , then there exists a randomized circuit S : { 0 , 1 } m → [ q ] S:\{0,1\}^m \to[q] S : { 0 , 1 } m → [ q ] of size at most p 0 ( t , m , q , 1 / η ) p_0(t,m,q,1/\eta) p 0 ( t , m , q , 1/ η ) such that
D K L ( ( X , B ) ∥ ( X , S ( X ) ) ) ≤ g + 2 η . D_{\mathrm{KL}}((X,B)\mathbin\Vert(X,S(X))) \le g+2\eta. D KL (( X , B ) ∥ ( X , S ( X ))) ≤ g + 2 η .
Proof. The first part combines [16 Theorem 3.8 and Lemma 3.6] , with respective KL-divergence losses σ \sigma σ and η \eta η . Choosing c 1 c_1 c 1 sufficiently small and p 0 p_0 p 0 sufficiently large gives the stated circuit sizes. For m = 0 m=0 m = 0 , add a fixed conditioning bit; for δ = 0 \delta=0 δ = 0 , the first part follows from nonnegativity of KL-divergence.
For the second part, suppose that every sampler of size at most p 0 ( t , m , q , 1 / η ) p_0(t,m,q,1/\eta) p 0 ( t , m , q , 1/ η ) has KL-divergence greater than g + 2 η g+2\eta g + 2 η . For sufficiently large p 0 p_0 p 0 , the same results give a ( t , η ) (t,\eta) ( t , η ) conditional pseudoentropy gap at least g + η g+\eta g + η , contradicting its upper bound g g g . One polynomial p 0 p_0 p 0 can be chosen large enough for both parts, absorbing constant shifts of its arguments.
The running time of the resulting sampler is polynomial in the inverse accuracy. Consequently, the finite-parameter statement supplies a family of polynomial-size samplers for inverse-polynomial accuracies.
Sequential Sampling Algorithms
Definition 3.1 ((ℓ , s , B \ell,s,B ℓ , s , B )-Sequential Sampling Algorithm). We define a sequential sampling algorithm of size B B B to be a sequence of randomized boolean circuits C ( 1 n ) = ( C 1 , C 2 , … , C n ) C(1^n)=(C_1,C_2,\ldots,C_n) C ( 1 n ) = ( C 1 , C 2 , … , C n ) for an output length n ∈ N n\in\mathbb{N} n ∈ N such that all circuits C i C_i C i are of size at most B B B .
We use C ( 1 n ) C(1^n) C ( 1 n ) to denote the distribution of ( x 1 , … , x n ) (x_1,\ldots,x_n) ( x 1 , … , x n ) sampled iteratively as follows: for i = 1 i=1 i = 1 , sample ( x 1 , s t 1 ) ← C 1 ( 1 n ) (x_1,\mathrm{st}_1)\gets C_1(1^n) ( x 1 , st 1 ) ← C 1 ( 1 n ) and for i > 1 i>1 i > 1 sample ( x i , s t i ) ← C i ( 1 n , s t i − 1 , x 1 , … , x i − 1 ) (x_i,\mathrm{st}_i)\gets C_i(1^n,\mathrm{st}_{i-1},x_1,\ldots,x_{i-1}) ( x i , st i ) ← C i ( 1 n , st i − 1 , x 1 , … , x i − 1 ) . We use ℓ \ell ℓ and s s s to denote the lengths of the x i x_i x i 's and s t i \mathrm{st}_i st i 's respectively.
All invocations use fresh independent random coins. The input 1 n 1^n 1 n is fixed for each circuit family and is suppressed when convenient.
Remark 3.2. When s = 0 s=0 s = 0 , we refer to an ( ℓ , 0 , B ) (\ell,0,B) ( ℓ , 0 , B ) -sequential sampler simply as a stateless ( ℓ , B ) (\ell,B) ( ℓ , B ) -sequential sampler.
Characterization of Sequential Sampling
We apply Theorem 2.23 with the visible prefix as the conditioning variable and the next block as the variable to be sampled. Choosing the block uniformly gives a characterization of stateless sequential sampling. The dependence on the alphabet size 2 ℓ 2^\ell 2 ℓ is polynomial, contributing a polynomial factor in n n n when ℓ = O ( log n ) \ell= O(\log n) ℓ = O ( log n ) .
Theorem 3.3 (Characterization of stateless sequential sampling). There exist a universal constant c 0 ∈ ( 0 , 1 ] c_0 \in(0,1] c 0 ∈ ( 0 , 1 ] and a polynomial p p p with nonnegative coefficients and constant term at least one such that the following holds. Let n , ℓ ≥ 1 n,\ell\ge1 n , ℓ ≥ 1 , let Y = ( Y 1 , … , Y n ) Y = (Y_1,\ldots,Y_n) Y = ( Y 1 , … , Y n ) take values in ( { 0 , 1 } ℓ ) n \left(\{0,1\}^{\ell}\right)^n ( { 0 , 1 } ℓ ) n , and let t ≥ 1 t \ge1 t ≥ 1 , δ ≥ 0 \delta\ge0 δ ≥ 0 , and 0 < ϵ , η , σ < 1 0 < \epsilon,\eta,\sigma< 1 0 < ϵ , η , σ < 1 .
If Y Y Y has ( t , ϵ ) (t,\epsilon) ( t , ϵ ) next-block pseudoentropy at least H ( Y ) + δ H(Y) + \delta H ( Y ) + δ , then, for every B ≥ 1 B \ge1 B ≥ 1 satisfying
B ≤ min { t c 0 , σ / ( n ϵ ) } p ( n , 2 ℓ , 1 / η , log ( n / σ ) ) , B \le\frac{\min\{t^{c_0},\sigma/(n\epsilon)\}}{p(n,2^\ell,1/\eta,\log(n/\sigma))}, B ≤ p ( n , 2 ℓ , 1/ η , log ( n / σ )) min { t c 0 , σ / ( n ϵ )} , every stateless ( ℓ , B ) (\ell,B) ( ℓ , B ) -sequential sampler C C C satisfies D K L ( Y ∥ C ( 1 n ) ) > δ − σ − n η D_{\mathrm{KL}}(Y \mathbin\Vert C(1^n)) > \delta- \sigma- n\eta D KL ( Y ∥ C ( 1 n )) > δ − σ − n η .
If δ ≥ ϵ \delta\ge\epsilon δ ≥ ϵ and the ( t , ϵ ) (t,\epsilon) ( t , ϵ ) next-block pseudoentropy of Y Y Y is at most H ( Y ) + δ − ϵ H(Y) + \delta- \epsilon H ( Y ) + δ − ϵ , then there exists a stateless ( ℓ , B ) (\ell,B) ( ℓ , B ) -sequential sampler C C C with
B ≤ p ( t , n , 2 ℓ , 1 / ϵ ) , D K L ( Y ∥ C ( 1 n ) ) ≤ δ . B \le p(t,n,2^\ell,1/\epsilon), \qquad D_{\mathrm{KL}}(Y \mathbin\Vert C(1^n)) \le\delta. B ≤ p ( t , n , 2 ℓ , 1/ ϵ ) , D KL ( Y ∥ C ( 1 n )) ≤ δ .
We prove the two directions separately. Throughout, I I I is uniform on [ n ] [n] [ n ] and independent of Y Y Y , and X = ( I , Y < I ) X = (I,Y_{<I}) X = ( I , Y < I ) . Write m = O ( n ℓ ) m = O(n\ell) m = O ( n ℓ ) for the input length of X X X and q = 2 ℓ q = 2^\ell q = 2 ℓ for the alphabet size.
Lemma 3.4 (Next-block pseudoentropy implies conditional sampling hardness). Under the hypotheses and size condition of the first part of Theorem 3.3 , every stateless ( ℓ , B ) (\ell,B) ( ℓ , B ) -sequential sampler C C C satisfies
E i ← [ n ] D K L ( ( Y < i , Y i ) ∥ ( Y < i , C i ( Y < i ) ) ) > δ − σ n − η . \mathop{\mathbb{E}}_{i\leftarrow[n]} D_{\mathrm{KL}}\left((Y_{<i},Y_i)\mathbin\Vert(Y_{<i},C_i(Y_{<i}))\right) > \frac{\delta-\sigma}{n} - \eta. E i ← [ n ] D KL ( ( Y < i , Y i ) ∥ ( Y < i , C i ( Y < i )) ) > n δ − σ − η .
Proof. By Definition 2.21, there is a random variable Z Z Z jointly distributed with ( I , Y ) (I,Y) ( I , Y ) such that ( X , Z ) (X,Z) ( X , Z ) and ( X , Y I ) (X,Y_I) ( X , Y I ) are ( t , ϵ ) (t,\epsilon) ( t , ϵ ) -indistinguishable and
H ( Z ∣ Y < I ) = 1 n ∑ i = 1 n H ( Z ∣ Y < i , I = i ) ≥ H ( Y ) + δ n . H(Z\mid Y_{<I}) = \frac{1}{n}\sum_{i=1}^{n} H(Z\mid Y_{<i},I=i) \ge\frac{H(Y)+\delta}{n}. H ( Z ∣ Y < I ) = n 1 i = 1 ∑ n H ( Z ∣ Y < i , I = i ) ≥ n H ( Y ) + δ .
Here Y < I Y_{<I} Y < I determines I I I . Since H ( Y I ∣ X ) = H ( Y ) / n H(Y_I\mid X) = H(Y)/n H ( Y I ∣ X ) = H ( Y ) / n , the ( t , ϵ ) (t,\epsilon) ( t , ϵ ) conditional pseudoentropy gap of Y I Y_I Y I given X X X is at least δ / n \delta/n δ / n . This is an average over the index and does not give the same gap for each fixed i i i . Fix a stateless sampler C C C . To apply Theorem 2.23 , we therefore need a sampler that, given ( I , Y < I ) (I,Y_{<I}) ( I , Y < I ) , samples exactly C I ( Y < I ) C_I(Y_{<I}) C I ( Y < I ) . The loss η \eta η in that theorem comes from approximating a sampler’s output probabilities to obtain the predictor used in its proof.
We now construct this sampler, which we call S S S . It contains one copy of each C j C_j C j and, on input ( i , y < i ) (i,y_{<i}) ( i , y < i ) , selects C i C_i C i to produce the output C i ( y < i ) C_i(y_{<i}) C i ( y < i ) . The size increases, but remains sufficiently small for the first part of Theorem 2.23 to apply. Namely, we implement this selection by ANDing each output bit of C j C_j C j with the comparison i = j i=j i = j , and then ORing these bits over j ∈ [ n ] j \in[n] j ∈ [ n ] . This sets every unselected output to zero, leaving only the output of C i C_i C i .
Each C j C_j C j contributes at most B B B gates, with O ( n ℓ ) O(n\ell) O ( n ℓ ) more for its index comparison and output masking, giving B + O ( n ℓ ) B+O(n\ell) B + O ( n ℓ ) gates per copy. With n n n copies and O ( n ℓ ) O(n\ell) O ( n ℓ ) gates for the final ORs, the size of S S S is O ( n ( B + n ℓ ) ) = O ( n 2 ℓ B ) O(n(B+n\ell))=O(n^2\ell B) O ( n ( B + n ℓ )) = O ( n 2 ℓ B ) . Take c 0 = c 1 c_0=c_1 c 0 = c 1 . Since m = O ( n q ) m=O(nq) m = O ( n q ) and p 0 p_0 p 0 has nonnegative coefficients, choose the fixed polynomial p p p sufficiently large to absorb the O ( n 2 q ) O(n^2q) O ( n 2 q ) overhead and the dependence of p 0 p_0 p 0 on m m m . The assumed bound on B B B then makes the size of S S S at most
min { t c 1 , σ / ( n ϵ ) } p 0 ( m , q , 1 / η , log ( n / σ ) ) . \frac{\min\{t^{c_1},\sigma/(n\epsilon)\}}{p_0(m,q,1/\eta,\log(n/\sigma))}. p 0 ( m , q , 1/ η , log ( n / σ )) min { t c 1 , σ / ( n ϵ )} .
Therefore, the first part of Theorem 2.23 , with gap δ / n \delta/n δ / n , loss σ / n \sigma/n σ / n , and the same t t t , ϵ \epsilon ϵ , and η \eta η , gives
D K L ( ( X , Y I ) ∥ ( X , S ( X ) ) ) = 1 n ∑ i = 1 n D K L ( ( Y < i , Y i ) ∥ ( Y < i , C i ( Y < i ) ) ) > δ − σ n − η . (3) D_{\mathrm{KL}}\bigl((X,Y_I)\mathbin{\|}(X,S(X))\bigr)
=\frac{1}{n}\sum_{i=1}^{n}D_{\mathrm{KL}}\bigl((Y_{<i},Y_i)\mathbin{\|}(Y_{<i},C_i(Y_{<i}))\bigr)
>\frac{\delta-\sigma}{n}-\eta. \tag*{(3)} D KL ( ( X , Y I ) ∥ ( X , S ( X )) ) = n 1 i = 1 ∑ n D KL ( ( Y < i , Y i ) ∥ ( Y < i , C i ( Y < i )) ) > n δ − σ − η . (3)
The equality conditions on the common uniform index I I I .
Lemma 3.5 (Small next-block pseudoentropy gap gives samplers). Under the hypotheses of the second part of Theorem 3.3 , there is a stateless ( ℓ , B ) (\ell,B) ( ℓ , B ) -sequential sampler C C C , with B ≤ p ( t , n , 2 ℓ , 1 / ϵ ) B\le p(t,n,2^\ell,1/\epsilon) B ≤ p ( t , n , 2 ℓ , 1/ ϵ ) , such that
E i ← [ n ] D K L ( ( Y < i , Y i ) ∥ ( Y < i , C i ( Y < i ) ) ) ≤ δ n . \mathop{\mathbb{E}}_{i\leftarrow[n]}D_{\mathrm{KL}}\bigl((Y_{<i},Y_i)\mathbin{\|}(Y_{<i},C_i(Y_{<i}))\bigr)\le\frac{\delta}{n}. E i ← [ n ] D KL ( ( Y < i , Y i ) ∥ ( Y < i , C i ( Y < i )) ) ≤ n δ .
Proof. By assumption, the ( t , ϵ ) (t,\epsilon) ( t , ϵ ) next-block pseudoentropy of Y Y Y is at most H ( Y ) + δ − ϵ H(Y)+\delta-\epsilon H ( Y ) + δ − ϵ . We use this bound in the second part of Theorem 2.23 to obtain a sampler S S S that receives ( i , y < i ) (i,y_{<i}) ( i , y < i ) and samples Y I Y_I Y I given X X X up to KL-divergence δ / n \delta/n δ / n . Fixing its index input to i i i gives the circuit C i C_i C i : on input y < i y_{<i} y < i , it outputs S ( i , y < i ) S(i,y_{<i}) S ( i , y < i ) .
By Definition 2.21 and H ( Y I ∣ X ) = H ( Y ) / n H(Y_I\mid X)=H(Y)/n H ( Y I ∣ X ) = H ( Y ) / n , the ( t , ϵ ) (t,\epsilon) ( t , ϵ ) conditional pseudoentropy gap of Y I Y_I Y I given X X X is at most ( δ − ϵ ) / n (\delta-\epsilon)/n ( δ − ϵ ) / n . The target KL-divergence δ / n \delta/n δ / n leaves ϵ / n \epsilon/n ϵ / n for the theorem’s additive loss 2 η 2\eta 2 η . We therefore set η ′ = ϵ / ( 2 n ) \eta'=\epsilon/(2n) η ′ = ϵ / ( 2 n ) . Since η ′ ≤ ϵ \eta'\le\epsilon η ′ ≤ ϵ , every distribution satisfying ( t , η ′ ) (t,\eta') ( t , η ′ ) -indistinguishability also satisfies ( t , ϵ ) (t,\epsilon) ( t , ϵ ) -indistinguishability, so the same upper bound on the gap holds at error η ′ \eta' η ′ . Since δ ≥ ϵ \delta\ge\epsilon δ ≥ ϵ and 0 < η ′ < 1 0<\eta'<1 0 < η ′ < 1 , we can therefore apply that theorem with g = ( δ − ϵ ) / n g=(\delta-\epsilon)/n g = ( δ − ϵ ) / n and η ′ \eta' η ′ in place of η \eta η . It gives a randomized circuit S S S of size at most p 0 ( t , m , q , 2 n / ϵ ) p_0(t,m,q,2n/\epsilon) p 0 ( t , m , q , 2 n / ϵ ) such that
D K L ( ( X , Y I ) ∥ ( X , S ( X ) ) ) ≤ δ − ϵ n + 2 η ′ = δ n . D_{\mathrm{KL}}\bigl((X,Y_I)\mathbin{\|}(X,S(X))\bigr)
\le\frac{\delta-\epsilon}{n}+2\eta'=\frac{\delta}{n}. D KL ( ( X , Y I ) ∥ ( X , S ( X )) ) ≤ n δ − ϵ + 2 η ′ = n δ .
For each i ∈ [ n ] i\in[n] i ∈ [ n ] , define C i ( y < i ) = S ( i , y < i ) C_i(y_{<i})=S(i,y_{<i}) C i ( y < i ) = S ( i , y < i ) by hardwiring the index input to i i i . This does not increase the circuit size. Using fresh independent coins at every step, the circuits C i C_i C i form a stateless sequential sampler. Since m = O ( n q ) m=O(nq) m = O ( n q ) , their size is bounded by a fixed polynomial in t t t , n n n , q q q , 1 / ϵ 1/\epsilon 1/ ϵ . Enlarge the polynomial p p p from the preceding lemma to dominate this bound, retaining nonnegative coefficients and constant term at least one. This is compatible with that lemma because enlarging p p p only strengthens its size hypothesis. Thus B ≤ p ( t , n , 2 ℓ , 1 / ϵ ) B\le p(t,n,2^\ell,1/\epsilon) B ≤ p ( t , n , 2 ℓ , 1/ ϵ ) .
Finally, the two distributions in the KL-divergence have the same uniform index I I I . Conditioning on this index gives
E i ← [ n ] D K L ( ( Y < i , Y i ) ∥ ( Y < i , C i ( Y < i ) ) ) = D K L ( ( X , Y I ) ∥ ( X , S ( X ) ) ) ≤ δ n . \mathbb{E}_{i\leftarrow[n]} D_{\mathrm{KL}}\bigl((Y_{<i},Y_i)\mathbin\Vert(Y_{<i},C_i(Y_{<i}))\bigr)=D_{\mathrm{KL}}\bigl((X,Y_I)\mathbin\Vert(X,S(X))\bigr)\le\frac{\delta}{n}. E i ← [ n ] D KL ( ( Y < i , Y i ) ∥ ( Y < i , C i ( Y < i )) ) = D KL ( ( X , Y I ) ∥ ( X , S ( X )) ) ≤ n δ .
Proof of Theorem 3.3 . Since the sampler is stateless and uses fresh coins at each step, Pr [ C ( 1 n ) = y ] = ∏ i Pr [ C i ( y < i ) = y i ] \Pr[C(1^n)=y]=\prod_i\Pr[C_i(y_{<i})=y_i] Pr [ C ( 1 n ) = y ] = ∏ i Pr [ C i ( y < i ) = y i ] . Together with the analogous factorization of Pr [ Y = y ] \Pr[Y=y] Pr [ Y = y ] , this gives
D K L ( Y ∥ C ( 1 n ) ) = ∑ i = 1 n D K L ( ( Y < i , Y i ) ∥ ( Y < i , C i ( Y < i ) ) ) = n E i ← [ n ] D K L ( ( Y < i , Y i ) ∥ ( Y < i , C i ( Y < i ) ) ) . \begin{aligned}
D_{\mathrm{KL}}(Y\mathbin\Vert C(1^n))=\sum_{i=1}^{n}D_{\mathrm{KL}}\bigl((Y_{<i},Y_i)\mathbin\Vert(Y_{<i},C_i(Y_{<i}))\bigr) \\
&=n\mathbb{E}_{i\leftarrow[n]}D_{\mathrm{KL}}\bigl((Y_{<i},Y_i)\mathbin\Vert(Y_{<i},C_i(Y_{<i}))\bigr).
\end{aligned} D KL ( Y ∥ C ( 1 n )) = i = 1 ∑ n D KL ( ( Y < i , Y i ) ∥ ( Y < i , C i ( Y < i )) ) = n E i ← [ n ] D KL ( ( Y < i , Y i ) ∥ ( Y < i , C i ( Y < i )) ) .
Indeed, when the divergence is finite, its definition gives
D K L ( Y ∥ C ( 1 n ) ) = ∑ y ∈ supp ( Y ) Pr [ Y = y ] ∑ i = 1 n log Pr [ Y i = y i ∣ Y < i = y < i ] Pr [ C i ( y < i ) = y i ] . D_{\mathrm{KL}}(Y\mathbin\Vert C(1^n))=\sum_{y\in\operatorname{supp}(Y)}\Pr[Y=y]\sum_{i=1}^{n}\log\frac{\Pr[Y_i=y_i\mid Y_{<i}=y_{<i}]}{\Pr[C_i(y_{<i})=y_i]}. D KL ( Y ∥ C ( 1 n )) = y ∈ supp ( Y ) ∑ Pr [ Y = y ] i = 1 ∑ n log Pr [ C i ( y < i ) = y i ] Pr [ Y i = y i ∣ Y < i = y < i ] .
For each i i i , marginalizing over y > i y_{>i} y > i identifies its contribution as D K L ( ( Y < i , Y i ) ∥ ( Y < i , C i ( Y < i ) ) ) D_{\mathrm{KL}}\bigl((Y_{<i},Y_i)\mathbin\Vert(Y_{<i},C_i(Y_{<i}))\bigr) D KL ( ( Y < i , Y i ) ∥ ( Y < i , C i ( Y < i )) ) . If some y ∈ supp ( Y ) y\in\operatorname{supp}(Y) y ∈ supp ( Y ) has zero probability under C C C , at least one of its next-block probabilities is zero; the corresponding summand and the total KL-divergence are both infinite. The first conclusion now follows from Lemma 3.4 , and the second from Lemma 3.5 .
Stateful Sequential Sampling
Private state lets a sampler retain information that its visible output has not revealed. We show how to recover the next-token distribution from the prefix alone, at a cost essentially linear in the number of possible states. The simulation estimates the distribution of the hidden state conditioned on the visible prefix.
Sequential Samplers with State
Let X \mathcal{X} X denote the output alphabet of a block, so that ∣ X ∣ = 2 ℓ |\mathcal{X}|=2^\ell ∣ X ∣ = 2 ℓ , and let S = { 0 , 1 } k \mathcal{S}=\{0,1\}^k S = { 0 , 1 } k denote the state space.
Definition 4.1 (Sequential sampler with k k k bits of state). A sequential sampler with k k k bits of state and size B B B for n n n blocks over alphabet X \mathcal{X} X is a sequence C = ( C 1 , … , C n ) C=(C_1,\ldots,C_n) C = ( C 1 , … , C n ) of randomized circuits, each of size at most B B B , with state space S = { 0 , 1 } k \mathcal{S}=\{0,1\}^k S = { 0 , 1 } k . The variables ( X 1 , S 1 ) , … , ( X n , S n ) (X_1,S_1),\ldots,(X_n,S_n) ( X 1 , S 1 ) , … , ( X n , S n ) are generated using independent random coins for each circuit:
( X 1 , S 1 ) ← C 1 ( 1 n ) , (X_1,S_1)\leftarrow C_1(1^n), ( X 1 , S 1 ) ← C 1 ( 1 n ) , and for i ≥ 2 i\ge2 i ≥ 2 ,
( X i , S i ) ← C i ( 1 n , X < i , S i − 1 ) . (X_i,S_i)\leftarrow C_i(1^n,X_{<i},S_{i-1}). ( X i , S i ) ← C i ( 1 n , X < i , S i − 1 ) . The sampler C C C outputs X = ( X 1 , … , X n ) X=(X_1,\ldots,X_n) X = ( X 1 , … , X n ) ; the states S 1 , … , S n S_1,\ldots,S_n S 1 , … , S n are not part of its output.
To simulate C i C_i C i for i ≥ 2 i \ge2 i ≥ 2 on a prefix x < i x_{<i} x < i such that Pr [ X < i = x < i ] > 0 \Pr[X_{<i}=x_{<i}]>0 Pr [ X < i = x < i ] > 0 , it suffices to sample S i − 1 S_{i-1} S i − 1 conditioned on X < i = x < i X_{<i}=x_{<i} X < i = x < i , and then run C i ( 1 n , x < i , S i − 1 ) C_i(1^n,x_{<i},S_{i-1}) C i ( 1 n , x < i , S i − 1 ) . The following lemma justifies using only this state distribution, without reconstructing the preceding private states.
Lemma 4.2 (Markov chain of sequential sampling states). Let ( X 1 , S 1 ) , … , ( X n , S n ) (X_1,S_1),\ldots,(X_n,S_n) ( X 1 , S 1 ) , … , ( X n , S n ) be generated by a sequential sampler with private state. For i ∈ [ n ] i \in[n] i ∈ [ n ] , define A i : = ( X ≤ i , S i ) A_i := (X_{\le i},S_i) A i := ( X ≤ i , S i ) . Then A 1 − A 2 − ⋯ − A n A_1 - A_2 - \cdots- A_n A 1 − A 2 − ⋯ − A n is a Markov chain.
Proof. Fix i ∈ { 2 , … , n } i \in\{2,\ldots,n\} i ∈ { 2 , … , n } and a 1 , … , a i − 1 a_1,\ldots,a_{i-1} a 1 , … , a i − 1 such that Pr [ A 1 = a 1 , … , A i − 1 = a i − 1 ] > 0 \Pr[A_1=a_1,\ldots,A_{i-1}=a_{i-1}]>0 Pr [ A 1 = a 1 , … , A i − 1 = a i − 1 ] > 0 . Write a i − 1 = ( x < i , s i − 1 ) a_{i-1}=(x_{<i},s_{i-1}) a i − 1 = ( x < i , s i − 1 ) . For every x i ∈ X x_i \in\mathcal{X} x i ∈ X and s i ∈ S s_i \in\mathcal{S} s i ∈ S , put a i = ( x ≤ i , s i ) a_i=(x_{\le i},s_i) a i = ( x ≤ i , s i ) . Since C i C_i C i uses fresh random coins,
Pr [ A i = a i ∣ A 1 = a 1 , … , A i − 1 = a i − 1 ] = Pr [ C i ( 1 n , x < i , s i − 1 ) = ( x i , s i ) ] = Pr [ A i = a i ∣ A i − 1 = a i − 1 ] . \begin{aligned}
\Pr[A_i=a_i \mid A_1=a_1,\ldots,A_{i-1}=a_{i-1}]
&= \Pr[C_i(1^n,x_{<i},s_{i-1})=(x_i,s_i)] \\
&= \Pr[A_i=a_i \mid A_{i-1}=a_{i-1}].
\end{aligned} Pr [ A i = a i ∣ A 1 = a 1 , … , A i − 1 = a i − 1 ] = Pr [ C i ( 1 n , x < i , s i − 1 ) = ( x i , s i )] = Pr [ A i = a i ∣ A i − 1 = a i − 1 ] .
If the prefix in a i a_i a i does not extend x < i x_{<i} x < i , both conditional probabilities are zero. This proves the Markov property.
Sampling from an Empirical Distribution
Before constructing a stateless sampler from a stateful one, we give a sampling circuit that reduces the circuit-size overhead. In the construction below, we run C i C_i C i m m m times to estimate the distribution of states supplied to C i + 1 C_{i+1} C i + 1 . We use the Laplace estimate (Definition 2.10 ) to give every state positive probability and keep the KL error finite. Once these samples have been obtained, a direct implementation on a domain [ K ] = { 1 , … , K } [K]=\{1,\ldots,K\} [ K ] = { 1 , … , K } uses O ~ ( m ) \widetilde{O}(m) O ( m ) gates per sample, where the tilde hides polylogarithmic factors in m m m and K K K . Producing m m m independent samples separately therefore costs O ~ ( m 2 ) \widetilde{O}(m^2) O ( m 2 ) gates. By batching the table lookups for these draws, we reduce this cost to O ~ ( m ) \widetilde{O}(m) O ( m ) . Corollary 2.17 gives the circuit and bounds its additional KL error. We use it below with N = m ≥ K N=m\ge K N = m ≥ K , so its size is O ~ ( m ) \widetilde{O}(m) O ( m ) when λ = O ( log ( m + K ) ) \lambda=O(\log(m+K)) λ = O ( log ( m + K )) .
Theorem 4.3 (State elimination for sequential samplers (small KL)). Let n ≥ 1 n \ge1 n ≥ 1 and k , ℓ ≥ 0 k,\ell\ge0 k , ℓ ≥ 0 be integers, and let 0 < δ ≤ 1 0<\delta\le1 0 < δ ≤ 1 . Let C = ( C 1 , … , C n ) C=(C_1,\ldots,C_n) C = ( C 1 , … , C n ) be a sequential sampler with k k k bits of private state and size at most B B B per circuit, over alphabet X = { 0 , 1 } ℓ \mathcal{X}=\{0,1\}^{\ell} X = { 0 , 1 } ℓ , and let S = { 0 , 1 } k \mathcal{S}=\{0,1\}^k S = { 0 , 1 } k . There is a stateless sequential sampler D = ( D 1 , … , D n ) D=(D_1,\ldots,D_n) D = ( D 1 , … , D n ) such that D K L ( C ( 1 n ) ∥ D ( 1 n ) ) ≤ δ D_{\mathrm{KL}}(C(1^n)\mathbin\Vert D(1^n))\le\delta D KL ( C ( 1 n ) ∥ D ( 1 n )) ≤ δ and every D i D_i D i has Boolean circuit size at most
O ( n 3 ∣ X ∣ ∣ S ∣ δ [ B + log 3 ( n ∣ X ∣ ∣ S ∣ δ ) ] ) . O\left(\frac{n^3|\mathcal{X}||\mathcal{S}|}{\delta}\left[B+\log^3\left(\frac{n|\mathcal{X}||\mathcal{S}|}{\delta}\right)\right]\right). O ( δ n 3 ∣ X ∣∣ S ∣ [ B + log 3 ( δ n ∣ X ∣∣ S ∣ ) ] ) . The circuit construction is deterministic; all sampling and estimation randomness is internal to the circuits.
The dependence on the number of states is linear up to logarithmic factors. The analysis estimates the joint distribution of a token and state before conditioning on the observed token. Applying the KL chain rule to its Laplace estimate bounds the average error after conditioning, even when some tokens are rare.
At step j j j , the simulation estimates the joint distribution of ( X j , S j ) (X_j,S_j) ( X j , S j ) conditioned on X < j = x < j X_{<j}=x_{<j} X < j = x < j , using a fixed number of samples. Conditioning this estimate on its first component being x j x_j x j gives an estimate of the distribution of S j S_j S j conditioned on X ≤ j = x ≤ j X_{\leq j}=x_{\leq j} X ≤ j = x ≤ j . The KL chain rule bounds the expected KL error of this state estimate, for x j ∼ X j ∣ X < j = x < j x_j \sim X_j \mid X_{<j}=x_{<j} x j ∼ X j ∣ X < j = x < j , by the KL error of the joint estimate.
Proof. Write X = C ( 1 n ) X=C(1^n) X = C ( 1 n ) . Let D 1 D_1 D 1 run C 1 ( 1 n ) C_1(1^n) C 1 ( 1 n ) and return the first component of its output. Thus D 1 ( 1 n ) ≡ X 1 D_1(1^n)\equiv X_1 D 1 ( 1 n ) ≡ X 1 , proving the case n = 1 n=1 n = 1 . Assume n ≥ 2 n\geq2 n ≥ 2 and set
m = ⌈ 4 n 2 ∣ X ∣ ∣ S ∣ δ ⌉ . m=\left\lceil\frac{4n^2|\mathcal{X}||\mathcal{S}|}{\delta}\right\rceil. m = ⌈ δ 4 n 2 ∣ X ∣∣ S ∣ ⌉ .
We use the circuit Sample from Corollary 2.17 with
N = m , K = ∣ S ∣ , λ = ⌈ log ( 2 m ( m + ∣ S ∣ ) ) ⌉ , N=m,\qquad K=|\mathcal{S}|,\qquad\lambda=\left\lceil\log(2m(m+|\mathcal{S}|))\right\rceil, N = m , K = ∣ S ∣ , λ = ⌈ log ( 2 m ( m + ∣ S ∣ )) ⌉ ,
identifying [ ∣ S ∣ ] [|\mathcal{S}|] [ ∣ S ∣ ] with S \mathcal{S} S . For a list L L L of at most m m m states, Sample( L ) (L) ( L ) receives states v 1 , … , v m ∈ S v_1,\ldots,v_m\in\mathcal{S} v 1 , … , v m ∈ S and selection bits b 1 , … , b m b_1,\ldots,b_m b 1 , … , b m such that L = ( v t : b t = 1 ) L=(v_t:b_t=1) L = ( v t : b t = 1 ) , in increasing order of t t t . Write π ~ L \widetilde{\pi}^{L} π L for its Laplace estimate and π ~ L \widetilde{\pi}^{L} π L for the common distribution of the m m m independent outputs. Since η = ( m + ∣ S ∣ ) 2 − λ ≤ 1 / ( 2 m ) \eta=(m+|\mathcal{S}|)2^{-\lambda}\leq1/(2m) η = ( m + ∣ S ∣ ) 2 − λ ≤ 1/ ( 2 m ) , the corollary gives, for every distribution P P P over S \mathcal{S} S ,
D K L ( P ∥ π ~ L ) ≤ D K L ( P ∥ π ~ L ) + 1 m . (4) D_{\mathrm{KL}}\left(P\mathbin\Vert\widetilde{\pi}^{L}\right)\leq D_{\mathrm{KL}}\left(P\mathbin\Vert\widetilde{\pi}^{L}\right)+\frac{1}{m}. \tag*{(4)} D KL ( P ∥ π L ) ≤ D KL ( P ∥ π L ) + m 1 . (4)
where log ( 1 / ( 1 − 1 / ( 2 m ) ) ) ≤ 1 / m \log(1/(1-1/(2m)))\leq1/m log ( 1/ ( 1 − 1/ ( 2 m ))) ≤ 1/ m follows from ( 1 − 1 / ( 2 m ) ) m ≥ 1 / 2 (1-1/(2m))^m\geq1/2 ( 1 − 1/ ( 2 m ) ) m ≥ 1/2 .
In the algorithm below, a list L j L_j L j formed from sampled pairs ( Z t , T t ) t = 1 m (Z_t,T_t)_{t=1}^m ( Z t , T t ) t = 1 m is represented by the states ( T t ) t = 1 m (T_t)_{t=1}^m ( T t ) t = 1 m and selection bits ( 1 [ Z t = x j ] ) t = 1 m (\mathbf{1}[Z_t=x_j])_{t=1}^m ( 1 [ Z t = x j ] ) t = 1 m . Each list preserves repetitions and sample order, and may be empty. All lists are computed inside D i D_i D i ; no state is passed between the circuits D 1 , … , D n D_1,\ldots,D_n D 1 , … , D n .
For i ≥ 2 i\geq2 i ≥ 2 , the circuit D i ( 1 n , x < i ) D_i(1^n,x_{<i}) D i ( 1 n , x < i ) runs the following algorithm, using fresh independent random bits in every call:
Draw m m m pairs from C 1 ( 1 n ) C_1(1^n) C 1 ( 1 n ) . Form a list L 1 L_1 L 1 of states, consisting of the second components of those symbol-state pairs whose first component equals x 1 x_1 x 1 .
For j = 2 , … , i − 1 j=2,\ldots,i-1 j = 2 , … , i − 1 , run Sample( L j − 1 ) (L_{j-1}) ( L j − 1 ) to obtain m m m states s 1 , … , s m s_1,\ldots,s_m s 1 , … , s m . For each t ∈ [ m ] t\in[m] t ∈ [ m ] , run C j ( 1 n , x < j , s t ) C_j(1^n,x_{<j},s_t) C j ( 1 n , x < j , s t ) . Form a list L j L_j L j from the second components of those symbol-state pairs whose first component equals x j x_j x j .
Run Sample( L i − 1 ) (L_{i-1}) ( L i − 1 ) , take its first output s s s , and return the first component of C i ( 1 n , x < i , s ) C_i(1^n,x_{<i},s) C i ( 1 n , x < i , s ) .
For Pr [ X ≤ j = x ≤ j ] > 0 \Pr[X_{\leq j}=x_{\leq j}]>0 Pr [ X ≤ j = x ≤ j ] > 0 , let
π j x ≤ j ( s ) = Pr [ S j = s ∣ X ≤ j = x ≤ j ] \pi_j^{x_{\leq j}}(s)=\Pr[S_j=s\mid X_{\leq j}=x_{\leq j}] π j x ≤ j ( s ) = Pr [ S j = s ∣ X ≤ j = x ≤ j ]
denote the true state posterior distribution. In the following, [ ⋅ ] 1 [\cdot]_1 [ ⋅ ] 1 denotes the first output component. Let
ε j = E x ≤ j ∼ X ≤ j E L j ∣ x ≤ j D K L ( π j x ≤ j ∥ π ~ L j ) , \varepsilon_j=\mathop{\mathbb{E}}_{x_{\leq j}\sim X_{\leq j}}\mathop{\mathbb{E}}_{L_j\mid x_{\leq j}}D_{\mathrm{KL}}\left(\pi_j^{x_{\leq j}}\mathbin\Vert\widetilde{\pi}^{L_j}\right), ε j = E x ≤ j ∼ X ≤ j E L j ∣ x ≤ j D KL ( π j x ≤ j ∥ π L j ) ,
where the expectation E L j ∣ x ≤ j \mathbb{E}_{L_j \mid x_{\leq j}} E L j ∣ x ≤ j averages only over the algorithm’s random bits on input x ≤ j x_{\leq j} x ≤ j , independent of X X X . By the chain rule of KL (Fact 2.7),
D K L ( C ( 1 n ) ∥ D ( 1 n ) ) = ∑ i = 2 n E x < i ∼ X < i D K L ( X i ∣ X < i = x < i ∥ D i ( 1 n , x < i ) ) ≤ ∑ i = 2 n E x < i ∼ X < i E L i − 1 ∣ x < i D K L ( X i ∣ X < i = x < i ∥ [ C i ( 1 n , x < i , [ Sample ( L i − 1 ) ] 1 ) ] 1 ) , \begin{aligned}
D_{\mathrm{KL}}\left(C(1^n)\mathbin\Vert D(1^n)\right)
&= \sum_{i=2}^{n} \mathbb{E}_{x_{<i}\sim X_{<i}} D_{\mathrm{KL}}\left(X_i \mid X_{<i}=x_{<i}\mathbin\Vert D_i(1^n,x_{<i})\right) \\
&\leq\sum_{i=2}^{n} \mathbb{E}_{x_{<i}\sim X_{<i}} \mathbb{E}_{L_{i-1}\mid x_{<i}} D_{\mathrm{KL}}\left(X_i \mid X_{<i}=x_{<i}\mathbin\Vert\left[C_i(1^n,x_{<i},[\operatorname{Sample}(L_{i-1})]_1)\right]_1\right),
\end{aligned} D KL ( C ( 1 n ) ∥ D ( 1 n ) ) = i = 2 ∑ n E x < i ∼ X < i D KL ( X i ∣ X < i = x < i ∥ D i ( 1 n , x < i ) ) ≤ i = 2 ∑ n E x < i ∼ X < i E L i − 1 ∣ x < i D KL ( X i ∣ X < i = x < i ∥ [ C i ( 1 n , x < i , [ Sample ( L i − 1 ) ] 1 ) ] 1 ) ,
where the last inequality follows from the convexity of KL divergence, as D i D_i D i constructs L i − 1 L_{i-1} L i − 1 using fresh randomness. Conditioned on X < i = x < i X_{<i}=x_{<i} X < i = x < i , by Lemma 4.2 , X i X_i X i is the first component of C i C_i C i when given as input the prefix x < i x_{<i} x < i together with a state distributed according to π i − 1 x < i \pi^{x_{<i}}_{i-1} π i − 1 x < i . Thus, for any fixed list of states L L L , by DPI (fact 2.9),
D K L ( X i ∣ X < i = x < i ∥ [ C i ( 1 n , x < i , [ Sample ( L ) ] 1 ) ] 1 ) ≤ D K L ( π i − 1 x < i ∥ π ~ L ) , D_{\mathrm{KL}}\left(X_i \mid X_{<i}=x_{<i}\mathbin\Vert\left[C_i(1^n,x_{<i},[\operatorname{Sample}(L)]_1)\right]_1\right)
\leq D_{\mathrm{KL}}\left(\pi^{x_{<i}}_{i-1}\mathbin\Vert\widetilde{\pi}^{L}\right), D KL ( X i ∣ X < i = x < i ∥ [ C i ( 1 n , x < i , [ Sample ( L ) ] 1 ) ] 1 ) ≤ D KL ( π i − 1 x < i ∥ π L ) ,
which together with the previous bound gives us
D K L ( C ( 1 n ) ∥ D ( 1 n ) ) ≤ ∑ j = 1 n − 1 ε j . (5) D_{\mathrm{KL}}\left(C(1^n)\mathbin\Vert D(1^n)\right)\leq\sum_{j=1}^{n-1}\varepsilon_j. \tag*{(5)} D KL ( C ( 1 n ) ∥ D ( 1 n ) ) ≤ j = 1 ∑ n − 1 ε j . (5)
For 2 ≤ j ≤ n − 1 2\leq j\leq n-1 2 ≤ j ≤ n − 1 , fix x < j x_{<j} x < j with Pr [ X < j = x < j ] > 0 \Pr[X_{<j}=x_{<j}]>0 Pr [ X < j = x < j ] > 0 and a realization L L L of the computed list L j − 1 L_{j-1} L j − 1 . Set
P j ( x , s ) = Pr [ X j = x , S j = s ∣ X < j = x < j ] , P_j(x,s)=\Pr[X_j=x,S_j=s\mid X_{<j}=x_{<j}], P j ( x , s ) = Pr [ X j = x , S j = s ∣ X < j = x < j ] ,
Q j ( x , s ) = Pr [ C j ( 1 n , x < j , [ Sample ( L ) ] 1 ) = ( x , s ) ] . Q_j(x,s)=\Pr[C_j(1^n,x_{<j},[\operatorname{Sample}(L)]_1)=(x,s)]. Q j ( x , s ) = Pr [ C j ( 1 n , x < j , [ Sample ( L ) ] 1 ) = ( x , s )] .
By Lemma 4.2 , P j P_j P j and Q j Q_j Q j result from running C j ( 1 n , x < j , ⋅ ) C_j(1^n,x_{<j},\cdot) C j ( 1 n , x < j , ⋅ ) on π j − 1 x < j \pi^{x_{<j}}_{j-1} π j − 1 x < j and π ~ L \widetilde{\pi}^{L} π L , respectively. Thus, by DPI (Fact 2.9 ),
D K L ( P j ∥ Q j ) ≤ D K L ( π j − 1 x < j ∥ π ~ L ) . (6) D_{\mathrm{KL}}(P_j\mathbin\Vert Q_j)\leq D_{\mathrm{KL}}\left(\pi^{x_{<j}}_{j-1}\mathbin\Vert\widetilde{\pi}^{L}\right). \tag*{(6)} D KL ( P j ∥ Q j ) ≤ D KL ( π j − 1 x < j ∥ π L ) . (6)
Step 2 produces m m m i.i.d. pairs ( Z t , T t ) t = 1 m (Z_t,T_t)_{t=1}^{m} ( Z t , T t ) t = 1 m from Q j Q_j Q j , and forms the next list of states L j = ( T t : Z t = x j ) L_j=(T_t:Z_t=x_j) L j = ( T t : Z t = x j ) . Let Q ^ j \widehat{Q}_j Q j denote the joint Laplace estimate from these pairs. That is, letting
N x , s = ∑ t = 1 m 1 [ ( Z t , T t ) = ( x , s ) ] , N_{x,s}=\sum_{t=1}^{m}\mathbf{1}[(Z_t,T_t)=(x,s)], N x , s = t = 1 ∑ m 1 [( Z t , T t ) = ( x , s )] ,
Q ^ j ( x , s ) = N x , s + 1 m + ∣ X ∣ ∣ S ∣ . \widehat{Q}_j(x,s)=\frac{N_{x,s}+1}{m+|\mathcal{X}||\mathcal{S}|}. Q j ( x , s ) = m + ∣ X ∣∣ S ∣ N x , s + 1 .
The corresponding conditional Laplace estimate is exactly that of L j L_j L j :
π ^ L j ( s ) = Q ^ j ( s ∣ x j ) = N x j , s + 1 N x j + ∣ S ∣ , N x = ∑ s ∈ S N x , s . \widehat{\pi}^{L_j}(s)=\widehat{Q}_j(s\mid x_j)=\frac{N_{x_j,s}+1}{N_{x_j}+|\mathcal{S}|},\qquad N_x=\sum_{s\in\mathcal{S}}N_{x,s}. π L j ( s ) = Q j ( s ∣ x j ) = N x j + ∣ S ∣ N x j , s + 1 , N x = s ∈ S ∑ N x , s .
By (4), for every realization of L j L_j L j ,
D K L ( π j x ≤ j ∥ π ~ L j ) ≤ D K L ( π j x ≤ j ∥ Q ^ j ( ⋅ ∣ x j ) ) + 1 m . D_{\mathrm{KL}}\left(\pi^{x_{\leq j}}_j\mathbin\Vert\widetilde{\pi}^{L_j}\right)\leq D_{\mathrm{KL}}\left(\pi^{x_{\leq j}}_j\mathbin\Vert\widehat{Q}_j(\cdot\mid x_j)\right)+\frac{1}{m}. D KL ( π j x ≤ j ∥ π L j ) ≤ D KL ( π j x ≤ j ∥ Q j ( ⋅ ∣ x j ) ) + m 1 .
Conditional on X < j = x < j X_{<j}=x_{<j} X < j = x < j and L j − 1 = L L_{j-1}=L L j − 1 = L , the sampled pairs are independent of X j X_j X j . Therefore, writing P j , X P_{j,\mathcal{X}} P j , X for the token marginal of P j P_j P j ,
E ( Z t , T t ) t = 1 m ∼ Q j m E x j ∼ P j , X D K L ( π j − 1 x < j ∥ π ~ j L ) ≤ E ( Z t , T t ) t = 1 m ∼ Q j m E x j ∼ P j , X D K L ( π j − 1 x < j ∥ Q ^ j ( ⋅ ∣ x j ) ) + 1 m ≤ D K L ( P j ∥ Q j ) + ( ∣ X ∣ ∣ S ∣ − 1 ) log e m + 1 + 1 m ≤ D K L ( π j − 1 x < j ∥ π ~ L ) + 2 ∣ X ∣ ∣ S ∣ m . \begin{aligned}
\mathop{\mathbb{E}}_{(Z_t,T_t)_{t=1}^m\sim Q_j^m}\mathop{\mathbb{E}}_{x_j\sim P_{j,\mathcal{X}}}D_{\mathrm{KL}}\left(\pi^{x_{<j}}_{j-1}\mathbin\Vert\widetilde{\pi}^{L}_j\right) \\
&\leq\mathop{\mathbb{E}}_{(Z_t,T_t)_{t=1}^m\sim Q_j^m}\mathop{\mathbb{E}}_{x_j\sim P_{j,\mathcal{X}}}D_{\mathrm{KL}}\left(\pi^{x_{<j}}_{j-1}\mathbin\Vert\widehat{Q}_j(\cdot\mid x_j)\right)+\frac{1}{m} \\
&\leq D_{\mathrm{KL}}\left(P_j\mathbin\Vert Q_j\right)+\frac{(|\mathcal{X}||\mathcal{S}|-1)\log e}{m+1}+\frac{1}{m} \\
&\leq D_{\mathrm{KL}}\left(\pi^{x_{<j}}_{j-1}\mathbin\Vert\widetilde{\pi}^{L}\right)+\frac{2|\mathcal{X}||\mathcal{S}|}{m}.
\end{aligned} E ( Z t , T t ) t = 1 m ∼ Q j m E x j ∼ P j , X D KL ( π j − 1 x < j ∥ π j L ) ≤ E ( Z t , T t ) t = 1 m ∼ Q j m E x j ∼ P j , X D KL ( π j − 1 x < j ∥ Q j ( ⋅ ∣ x j ) ) + m 1 ≤ D KL ( P j ∥ Q j ) + m + 1 ( ∣ X ∣∣ S ∣ − 1 ) log e + m 1 ≤ D KL ( π j − 1 x < j ∥ π L ) + m 2∣ X ∣∣ S ∣ .
where the second-last inequality follows from Lemma 2.12 and the last inequality from eq. (6) and log e < 2 \log e<2 log e < 2 . For j = 1 j=1 j = 1 , step 1 gives P 1 = Q 1 = C 1 ( 1 n ) P_1=Q_1=C_1(1^n) P 1 = Q 1 = C 1 ( 1 n ) , so the same calculation ends at 2 ∣ X ∣ ∣ S ∣ / m 2|\mathcal{X}||\mathcal{S}|/m 2∣ X ∣∣ S ∣/ m . For j ≥ 2 j\geq2 j ≥ 2 , averaging over x < j ∼ X < j x_{<j}\sim X_{<j} x < j ∼ X < j and the list L j − 1 L_{j-1} L j − 1 computed on that prefix gives
ε 1 ≤ 2 ∣ X ∣ ∣ S ∣ m , \varepsilon_1\leq\frac{2|\mathcal{X}||\mathcal{S}|}{m}, ε 1 ≤ m 2∣ X ∣∣ S ∣ ,
ε j ≤ ε j − 1 + 2 ∣ X ∣ ∣ S ∣ m ( 2 ≤ j ≤ n − 1 ) , \varepsilon_j\leq\varepsilon_{j-1}+\frac{2|\mathcal{X}||\mathcal{S}|}{m}\qquad(2\leq j\leq n-1), ε j ≤ ε j − 1 + m 2∣ X ∣∣ S ∣ ( 2 ≤ j ≤ n − 1 ) ,
ε j ≤ 2 j ∣ X ∣ ∣ S ∣ m ( 1 ≤ j ≤ n − 1 ) . \varepsilon_j\leq\frac{2j|\mathcal{X}||\mathcal{S}|}{m}\qquad(1\leq j\leq n-1). ε j ≤ m 2 j ∣ X ∣∣ S ∣ ( 1 ≤ j ≤ n − 1 ) .
Therefore, by Equation (5) ,
D K L ( C ( 1 n ) ∥ D ( 1 n ) ) ≤ ∑ j = 1 n − 1 ε j ≤ 2 ∣ X ∣ ∣ S ∣ m ∑ j = 1 n − 1 j = n ( n − 1 ) ∣ X ∣ ∣ S ∣ m ≤ δ , \begin{aligned}
D_{\mathrm{KL}}\left(C(1^n)\mathbin\Vert D(1^n)\right)\leq\sum_{j=1}^{n-1}\varepsilon_j\leq\frac{2|\mathcal{X}||\mathcal{S}|}{m}\sum_{j=1}^{n-1}j \\
&=\frac{n(n-1)|\mathcal{X}||\mathcal{S}|}{m}\leq\delta,
\end{aligned} D KL ( C ( 1 n ) ∥ D ( 1 n ) ) ≤ j = 1 ∑ n − 1 ε j ≤ m 2∣ X ∣∣ S ∣ j = 1 ∑ n − 1 j = m n ( n − 1 ) ∣ X ∣∣ S ∣ ≤ δ ,
as promised.
Boolean circuit size. Since m ≥ ∣ S ∣ m\geq|\mathcal{S}| m ≥ ∣ S ∣ and λ = O ( log ( 2 m ) ) \lambda=O(\log(2m)) λ = O ( log ( 2 m )) , Corollary 2.17 gives
∣ S a m p l e ∣ = O ( m log 3 ( 2 m ) ) . |\mathrm{Sample}|=O(m\log^3(2m)). ∣ Sample ∣ = O ( m log 3 ( 2 m )) .
Forming the input to S a m p l e ( L j ) \mathrm{Sample}(L_j) Sample ( L j ) uses m m m copies of C j C_j C j , each of size at most B B B , and m m m comparisons with x j x_j x j , each costing O ( ℓ ) O(\ell) O ( ℓ ) gates. The sorting and counting costs are included in ∣ S a m p l e ∣ |\mathrm{Sample}| ∣ Sample ∣ . There are i − 1 i-1 i − 1 such lists, i − 1 i-1 i − 1 calls to S a m p l e \mathrm{Sample} Sample , and one final call to C i C_i C i . Thus
∣ D i ∣ = O ( i ⋅ m ⋅ [ B + ℓ + log 3 ( 2 m ) ] ) = O ( n 3 ∣ X ∣ ∣ S ∣ δ [ B + log 3 ( 2 n ∣ X ∣ ∣ S ∣ δ ) ] ) , \begin{aligned}
|D_i|=O\left(i\cdot m\cdot\left[B+\ell+\log^3(2m)\right]\right) \\
&=O\left(\frac{n^3|\mathcal{X}||\mathcal{S}|}{\delta}\left[B+\log^3\left(\frac{2n|\mathcal{X}||\mathcal{S}|}{\delta}\right)\right]\right),
\end{aligned} ∣ D i ∣ = O ( i ⋅ m ⋅ [ B + ℓ + log 3 ( 2 m ) ] ) = O ( δ n 3 ∣ X ∣∣ S ∣ [ B + log 3 ( δ 2 n ∣ X ∣∣ S ∣ ) ] ) ,
since i ≤ n i\leq n i ≤ n , m = O ( n 2 ∣ X ∣ ∣ S ∣ / δ ) m=O(n^2|\mathcal{X}||\mathcal{S}|/\delta) m = O ( n 2 ∣ X ∣∣ S ∣/ δ ) , and ℓ = log ∣ X ∣ = O ( log ( 2 m ) ) \ell=\log|\mathcal{X}|=O(\log(2m)) ℓ = log ∣ X ∣ = O ( log ( 2 m )) . All calls and list representations have fixed size, so this construction gives a stateless randomized Boolean circuit.
For polynomial-size alphabets and k = O ( log n ) k = O(\log n) k = O ( log n ) , the simulation has polynomial size at any specified inverse-polynomial KL accuracy. Thus every distribution generated efficiently with logarithmic private state can be approximated efficiently without it. Together with the known characterization by next-block pseudoentropy (Theorem 3.3 ), this extends sampling obstructions to logarithmic state; the cryptographic consequences below apply this connection.
Sample Complexity of Estimating the State Distribution
The construction in Theorem 4.3 estimates the entire conditional state distribution before sampling a state from that estimate. We show that, when this distribution is unknown and the only access to it is through independent samples, expected KL divergence at most 1 / 4 1/4 1/4 requires Ω ( ∣ S ∣ ) = Ω ( 2 k ) \Omega(|S|) = \Omega(2^k) Ω ( ∣ S ∣ ) = Ω ( 2 k ) samples. This establishes the necessity of the linear dependence on ∣ S ∣ |S| ∣ S ∣ when estimating the state distribution from independent samples, but it does not by itself establish a matching circuit-size lower bound for Theorem 4.3 .
Proposition 4.4 (Sample lower bound for estimating the state distribution). Let k ≥ 1 k \ge1 k ≥ 1 and N ≥ 0 N \ge0 N ≥ 0 be integers, and let S = { 0 , 1 } k S = \{0,1\}^k S = { 0 , 1 } k . Suppose that a randomized algorithm receives at most N N N independent samples from an unknown distribution P P P over S S S and outputs a vector of probabilities π ^ \hat{\pi} π ^ over S S S , with no subsequent access to the sampling oracle. The algorithm receives no other information about P P P . Then there is a distribution P P P for which
E [ D K L ( P ∥ π ^ ) ] ≥ 1 − 2 N ∣ S ∣ . \mathbb{E}\left[D_{\mathrm{KL}}(P \mathbin{\|} \hat{\pi})\right] \ge1 - \frac{2N}{|S|}. E [ D KL ( P ∥ π ^ ) ] ≥ 1 − ∣ S ∣ 2 N . where the expectation is over the samples and the algorithm’s internal randomness. Consequently, if E [ D K L ( P ∥ π ^ ) ] ≤ 1 / 4 \mathbb{E}[D_{\mathrm{KL}}(P \mathbin{\|} \hat{\pi})] \le1/4 E [ D KL ( P ∥ π ^ )] ≤ 1/4 for every P P P , then N ≥ 3 ∣ S ∣ / 8 = 3 ⋅ 2 k − 3 N \ge3|S|/8 = 3 \cdot2^{k-3} N ≥ 3∣ S ∣/8 = 3 ⋅ 2 k − 3 .
Proof. We partition the states into pairs and choose one state from each pair using a hidden bit. Each sample reveals only the bit for its pair; every pair that is never sampled contributes to the expected KL error.
Let m = 2 k − 1 m = 2^{k-1} m = 2 k − 1 and identify S S S with [ m ] × { 0 , 1 } [m] \times\{0,1\} [ m ] × { 0 , 1 } . For each θ = ( θ 1 , … , θ m ) ∈ { 0 , 1 } m \theta= (\theta_1,\ldots,\theta_m) \in\{0,1\}^m θ = ( θ 1 , … , θ m ) ∈ { 0 , 1 } m , define
P θ ( a , b ) = { 1 / m , b = θ a , 0 , b ≠ θ a . P_\theta(a,b) =
\begin{cases}
1/m, & b = \theta_a,\\
0, & b \ne\theta_a.
\end{cases} P θ ( a , b ) = { 1/ m , 0 , b = θ a , b = θ a .
Choose Θ \Theta Θ uniformly from { 0 , 1 } m \{0,1\}^m { 0 , 1 } m . Conditional on Θ \Theta Θ , a sample from P Θ P_\Theta P Θ is generated by choosing A A A uniformly from [ m ] [m] [ m ] , independently of Θ \Theta Θ , and returning ( A , Θ A ) (A,\Theta_A) ( A , Θ A ) . We may generate N N N independent samples in advance and let the algorithm read as many as it requests, ignoring any unused samples.
Let W W W consist of these N N N samples and the algorithm’s independent random coins. Fix W W W , so that the output π ^ \hat{\pi} π ^ is fixed, and let U ⊆ [ m ] U \subseteq[m] U ⊆ [ m ] contain the first coordinates absent from the samples. For each a ∉ U a \notin U a ∈ / U , the samples determine Θ a \Theta_a Θ a ; conditional on W W W , the bits ( Θ a ) a ∈ U (\Theta_a)_{a \in U} ( Θ a ) a ∈ U remain independent and uniform. Consequently, the distribution P ˉ = E [ P Θ ∣ W ] \bar{P} = \mathbb{E}[P_\Theta\mid W] P ˉ = E [ P Θ ∣ W ] satisfies
P ˉ ( a , b ) = { 1 / m , a ∉ U and b = Θ a , 0 , a ∉ U and b ≠ Θ a , 1 / ( 2 m ) , a ∈ U . \bar{P}(a,b) =
\begin{cases}
1/m, & a \notin U \text{ and } b = \Theta_a,\\
0, & a \notin U \text{ and } b \ne\Theta_a,\\
1/(2m), & a \in U.
\end{cases} P ˉ ( a , b ) = ⎩ ⎨ ⎧ 1/ m , 0 , 1/ ( 2 m ) , a ∈ / U and b = Θ a , a ∈ / U and b = Θ a , a ∈ U .
In particular,
H ( P ˉ ) = m − ∣ U ∣ m log m + ∣ U ∣ m log ( 2 m ) = log m + ∣ U ∣ m , H ( P θ ) = log m . H(\bar{P}) = \frac{m-|U|}{m}\log m + \frac{|U|}{m}\log(2m) = \log m + \frac{|U|}{m}, \qquad H(P_\theta)=\log m. H ( P ˉ ) = m m − ∣ U ∣ log m + m ∣ U ∣ log ( 2 m ) = log m + m ∣ U ∣ , H ( P θ ) = log m .
Expanding KL divergence gives
E [ D K L ( P Θ ∥ π ^ ) ∣ W ] = − log m − ∑ s ∈ S P ˉ ( s ) log π ^ ( s ) = D K L ( P ˉ ∥ π ^ ) + H ( P ˉ ) − log m ≥ ∣ U ∣ m . \begin{aligned}
\mathbb{E}\left[D_{\mathrm{KL}}(P_\Theta\mathbin\Vert\hat{\pi}) \mid W\right] = -\log m-\sum_{s\in\mathcal{S}}\bar{P}(s)\log\hat{\pi}(s) \\
&= D_{\mathrm{KL}}(\bar{P}\mathbin\Vert\hat{\pi})+H(\bar{P})-\log m\geq\frac{|U|}{m}.
\end{aligned} E [ D KL ( P Θ ∥ π ^ ) ∣ W ] = − log m − s ∈ S ∑ P ˉ ( s ) log π ^ ( s ) = D KL ( P ˉ ∥ π ^ ) + H ( P ˉ ) − log m ≥ m ∣ U ∣ .
At most N N N pairs appear among the samples, so ∣ U ∣ ≥ m − N |U|\geq m-N ∣ U ∣ ≥ m − N . Therefore
E [ D K L ( P Θ ∥ π ^ ) ] ≥ E ∣ U ∣ m ≥ 1 − N m = 1 − 2 N ∣ S ∣ . \mathbb{E}\left[D_{\mathrm{KL}}(P_\Theta\mathbin\Vert\hat{\pi})\right]\geq\frac{\mathbb{E}|U|}{m}\geq1-\frac{N}{m}=1-\frac{2N}{|\mathcal{S}|}. E [ D KL ( P Θ ∥ π ^ ) ] ≥ m E ∣ U ∣ ≥ 1 − m N = 1 − ∣ S ∣ 2 N .
Averaging over the uniform choice of Θ \Theta Θ implies that some fixed θ \theta θ satisfies the same lower bound, with expectation only over its samples and the algorithm’s coins. If this expectation is at most 1 / 4 1/4 1/4 for every P θ P_\theta P θ , then 1 − 2 N / ∣ S ∣ ≤ 1 / 4 1-2N/|\mathcal{S}|\leq1/4 1 − 2 N /∣ S ∣ ≤ 1/4 , or N ≥ 3 ∣ S ∣ / 8 N\geq3|\mathcal{S}|/8 N ≥ 3∣ S ∣/8 .
Every distribution P θ P_\theta P θ used in the proof can occur as a conditional state distribution: the first circuit can output a fixed block x 1 x_1 x 1 , choose A A A uniformly from [ 2 k − 1 ] [2^{k-1}] [ 2 k − 1 ] , and set S 1 = ( A , θ A ) S_1=(A,\theta_A) S 1 = ( A , θ A ) . Then π 1 x 1 = P θ \pi_1^{x_1}=P_\theta π 1 x 1 = P θ . Thus the lower bound applies even when independent samples from π 1 x 1 = P θ \pi_1^{x_1}=P_\theta π 1 x 1 = P θ are supplied directly. The first circuit may encode θ \theta θ in its description; the proposition assumes access only to samples, rather than to that description.
Insertional Sampling and Insertional Pseudoentropy
An insertional sampler chooses both the next token and where to place it. This abstracts the insertion framework of Stern et al. [15 ] , with one sampled insertion per step. The current string is the only information retained between steps; each circuit uses fresh independent coins.
Definition 5.1 (Stateless Insertional Sampler). Let n , ℓ ≥ 1 n,\ell\geq1 n , ℓ ≥ 1 and let L L L be a distribution over ( { 0 , 1 } ℓ ) n \left(\{0,1\}^{\ell}\right)^n ( { 0 , 1 } ℓ ) n . An insertional sampler C = ( C 1 , … , C n ) \mathcal{C}=(C_1,\ldots,C_n) C = ( C 1 , … , C n ) of L L L is a sequence of randomized (possibly unbounded) circuits, where
C ( 1 n ) : = C n ( C n − 1 ( ⋯ ( C 1 ( ∅ ) ) ) ) ≡ L C(1^n):=C_n(C_{n-1}(\cdots(C_1(\varnothing))))\equiv L C ( 1 n ) := C n ( C n − 1 ( ⋯ ( C 1 ( ∅ )))) ≡ L , and
for every i ∈ [ n ] i\in[n] i ∈ [ n ] and x ∈ ( { 0 , 1 } ℓ ) i − 1 x\in\left(\{0,1\}^{\ell}\right)^{i-1} x ∈ ( { 0 , 1 } ℓ ) i − 1 , C i ( x ) C_i(x) C i ( x ) is a distribution over strings in ( { 0 , 1 } ℓ ) i \left(\{0,1\}^{\ell}\right)^i ( { 0 , 1 } ℓ ) i for which x x x is a subsequence.
We say that C \mathcal{C} C has size B B B if for all i ∈ [ n ] i\in[n] i ∈ [ n ] , C i C_i C i is of size at most B B B .
Definition 5.2 (Insertional decomposition). Let n , ℓ ≥ 1 n,\ell\geq1 n , ℓ ≥ 1 and let L L L be a distribution over ( { 0 , 1 } ℓ ) n \left(\{0,1\}^{\ell}\right)^n ( { 0 , 1 } ℓ ) n . An insertional decomposition ( L 0 , … , L n ) (L_0,\ldots,L_n) ( L 0 , … , L n ) of L L L is a sequence of jointly distributed random variables, where
L n ≡ L L_n \equiv L L n ≡ L , and
for every i ∈ [ n ] i \in[n] i ∈ [ n ] and x ∈ ( { 0 , 1 } ℓ ) i − 1 x \in(\{0,1\}^{\ell})^{i-1} x ∈ ({ 0 , 1 } ℓ ) i − 1 with Pr [ L i − 1 = x ] > 0 \Pr[L_{i-1}=x]>0 Pr [ L i − 1 = x ] > 0 , L i ∣ L i − 1 = x L_i \mid L_{i-1}=x L i ∣ L i − 1 = x is a distribution over strings in ( { 0 , 1 } ℓ ) i (\{0,1\}^{\ell})^i ({ 0 , 1 } ℓ ) i for which x x x is a subsequence.
For each insertional decomposition, we compare the apparent conditional entropy of each insertion with its actual conditional entropy. The randomness in choosing the insertion order therefore does not itself contribute to the pseudoentropy gap.
Definition 5.3 (Insertional Pseudoentropy). Let n , ℓ ≥ 1 n,\ell\ge1 n , ℓ ≥ 1 and let L L L be distributed over ( { 0 , 1 } ℓ ) n (\{0,1\}^{\ell})^n ({ 0 , 1 } ℓ ) n . Let T ≥ 1 T \ge1 T ≥ 1 , k ≥ 0 k \ge0 k ≥ 0 , and 0 < ε < 1 0 < \varepsilon< 1 0 < ε < 1 ; these quantities may depend on a security parameter λ \lambda λ . We say that L L L has ( T , ε ) (T,\varepsilon) ( T , ε ) insertional pseudoentropy at least k k k if, for every insertional decomposition ( L 0 , … , L n ) (L_0,\ldots,L_n) ( L 0 , … , L n ) of L L L , with I I I uniform on [ n ] [n] [ n ] independently of the decomposition, there exists a random variable Z Z Z , jointly distributed with ( I , L 0 , … , L n ) (I,L_0,\ldots,L_n) ( I , L 0 , … , L n ) and satisfying Z ∈ ( { 0 , 1 } ℓ ) i Z \in(\{0,1\}^{\ell})^i Z ∈ ({ 0 , 1 } ℓ ) i whenever I = i I=i I = i , such that
H ( Z ∣ I , L I − 1 ) − H ( L I ∣ I , L I − 1 ) ≥ k − H ( L ) n H(Z \mid I,L_{I-1}) - H(L_I \mid I,L_{I-1}) \ge\frac{k-H(L)}{n} H ( Z ∣ I , L I − 1 ) − H ( L I ∣ I , L I − 1 ) ≥ n k − H ( L ) , and
( I , L I , L I − 1 ) (I,L_I,L_{I-1}) ( I , L I , L I − 1 ) and ( I , Z , L I − 1 ) (I,Z,L_{I-1}) ( I , Z , L I − 1 ) are ( T , ε ) (T,\varepsilon) ( T , ε ) nonuniformly indistinguishable.
The insertional pseudoentropy is the supremum of the values k k k satisfying this definition.
Remark 5.4 (Comparison with next-block pseudoentropy). Both definitions measure the increase in conditional entropy that can remain computationally undetectable. In next-block pseudoentropy, the entropy chain rule makes the subtraction of the actual conditional entropy implicit. For Y = ( Y 1 , … , Y n ) Y=(Y_1,\ldots,Y_n) Y = ( Y 1 , … , Y n ) with Y i ∈ { 0 , 1 } ℓ Y_i \in\{0,1\}^{\ell} Y i ∈ { 0 , 1 } ℓ , ℓ ≥ 1 \ell\ge1 ℓ ≥ 1 , and I I I uniform on [ n ] [n] [ n ] independently of Y Y Y , the length of Y < I Y_{<I} Y < I determines I I I , so
n H ( Y I ∣ Y < I ) = ∑ i = 1 n H ( Y i ∣ Y < i ) = H ( Y ) . nH(Y_I \mid Y_{<I}) = \sum_{i=1}^{n} H(Y_i \mid Y_{<i}) = H(Y). n H ( Y I ∣ Y < I ) = i = 1 ∑ n H ( Y i ∣ Y < i ) = H ( Y ) .
Consequently, the condition H ( Z ∣ Y < I ) ≥ k / n H(Z \mid Y_{<I}) \ge k/n H ( Z ∣ Y < I ) ≥ k / n in Definition 2.21 is equivalent to
H ( Z ∣ Y < I ) − H ( Y I ∣ Y < I ) ≥ k − H ( Y ) n . H(Z \mid Y_{<I}) - H(Y_I \mid Y_{<I}) \ge\frac{k-H(Y)}{n}. H ( Z ∣ Y < I ) − H ( Y I ∣ Y < I ) ≥ n k − H ( Y ) .
This is the same entropy-gap form as in Definition 5.3 . For an insertional decomposition, however, the entropy chain rule gives
n H ( L I ∣ I , L I − 1 ) = ∑ i = 1 n H ( L i ∣ L i − 1 ) = ∑ i = 1 n ( H ( L i ) − H ( L i − 1 ) + H ( L i − 1 ∣ L i ) ) = H ( L ) + ∑ i = 1 n H ( L i − 1 ∣ L i ) . \begin{aligned}
nH(L_I \mid I,L_{I-1}) &= \sum_{i=1}^{n} H(L_i \mid L_{i-1}) \\
&= \sum_{i=1}^{n} \left(H(L_i)-H(L_{i-1})+H(L_{i-1} \mid L_i)\right) \\
&= H(L)+\sum_{i=1}^{n} H(L_{i-1} \mid L_i).
\end{aligned} n H ( L I ∣ I , L I − 1 ) = i = 1 ∑ n H ( L i ∣ L i − 1 ) = i = 1 ∑ n ( H ( L i ) − H ( L i − 1 ) + H ( L i − 1 ∣ L i ) ) = H ( L ) + i = 1 ∑ n H ( L i − 1 ∣ L i ) .
In next-block pseudoentropy, a prefix determines all prior information, whereas in insertional pseudoentropy, a string given by L i L_i L i does not necessarily determine its preceding string L i − 1 L_{i-1} L i − 1 . For example, for even i i i , if L i L_i L i is $01$ repeated i / 2 i/2 i /2 times, then there are i i i distinct possibilities for $L_{i-1}. and a random choice of L i − 1 L_{i-1} L i − 1 among them would result in H ( L i − 1 ∣ L i ) = log i H(L_{i-1}\mid L_i)=\log i H ( L i − 1 ∣ L i ) = log i . Therefore, the sum ∑ i ∈ [ n ] H ( L i − 1 ∣ L i ) \sum_{i\in[n]} H(L_{i-1}\mid L_i) ∑ i ∈ [ n ] H ( L i − 1 ∣ L i ) could be as large as log ( n ! ) \log(n!) log ( n !) . Subtracting the actual conditional entropy in Definition 5.3 ensures that the gap k − H ( L ) k-H(L) k − H ( L ) does not count randomness in the choice of insertion order. The quantification over every insertional decomposition accounts for the sampler’s freedom to choose this order. This is implicitly the case for next-block pseudoentropy since left-to-right generation has a single fixed prefix decomposition.
The insertional pseudoentropy gap is the insertional pseudoentropy minus H ( L ) H(L) H ( L ) . Taking Z = L I Z=L_I Z = L I shows that this gap is nonnegative. The joint distribution of Z Z Z is chosen for each decomposition before the distinguishing circuit: the same Z Z Z must fool every Boolean circuit of size at most T T T . The guarantee also holds for randomized circuits with independent coins, by fixing their coins and averaging. The length of L I − 1 L_{I-1} L I − 1 determines I I I , so conditioning on ( I , L I − 1 ) (I,L_{I-1}) ( I , L I − 1 ) is equivalent to conditioning on L I − 1 L_{I-1} L I − 1 . The variable Z Z Z need not be a valid one-symbol extension of L I − 1 L_{I-1} L I − 1 .
Remark 5.5 (Equivalent formulation). Equivalently, every insertional decomposition ( L 0 , … , L n ) (L_0,\ldots,L_n) ( L 0 , … , L n ) admits random variables Z i ∈ ( { 0 , 1 } ℓ ) i Z_i\in(\{0,1\}^{\ell})^i Z i ∈ ({ 0 , 1 } ℓ ) i , jointly distributed with the decomposition and independently of I I I , satisfying
∑ i = 1 n ( H ( Z i ∣ L i − 1 ) − H ( L i ∣ L i − 1 ) ) ≥ k − H ( L ) \sum_{i=1}^{n}\left(H(Z_i\mid L_{i-1})-H(L_i\mid L_{i-1})\right)\ge k-H(L) i = 1 ∑ n ( H ( Z i ∣ L i − 1 ) − H ( L i ∣ L i − 1 ) ) ≥ k − H ( L )
and making ( I , Z I , L I − 1 ) (I,Z_I,L_{I-1}) ( I , Z I , L I − 1 ) and ( I , L I , L I − 1 ) (I,L_I,L_{I-1}) ( I , L I , L I − 1 ) ( T , ϵ ) (T,\epsilon) ( T , ϵ ) nonuniformly indistinguishable. The family is chosen once for all distinguishing circuits.
Given Z Z Z , draw each Z i Z_i Z i conditionally on the decomposition using the distribution of Z Z Z given I = i I=i I = i and L i − 1 L_{i-1} L i − 1 , with fresh randomness independent of I I I . On zero-probability conditioning events, choose any distribution on ( { 0 , 1 } ℓ ) i (\{0,1\}^{\ell})^i ({ 0 , 1 } ℓ ) i . Conversely, given such a family, take Z = Z I Z=Z_I Z = Z I with I I I independent of the decomposition and the family. These constructions preserve the joint distributions being compared and give
H ( Z ∣ I , L I − 1 ) = 1 n ∑ i = 1 n H ( Z i ∣ L i − 1 ) , H(Z\mid I,L_{I-1})=\frac{1}{n}\sum_{i=1}^{n}H(Z_i\mid L_{i-1}), H ( Z ∣ I , L I − 1 ) = n 1 i = 1 ∑ n H ( Z i ∣ L i − 1 ) ,
H ( L I ∣ I , L I − 1 ) = 1 n ∑ i = 1 n H ( L i ∣ L i − 1 ) . H(L_I\mid I,L_{I-1})=\frac{1}{n}\sum_{i=1}^{n}H(L_i\mid L_{i-1}). H ( L I ∣ I , L I − 1 ) = n 1 i = 1 ∑ n H ( L i ∣ L i − 1 ) .
Thus both formulations have the same entropy gap, circuit size, and distinguishing error.
Characterization of Insertional Samplability
Theorem 5.6 (Characterization of stateless insertional sampling). There exist a universal constant c 0 ∈ ( 0 , 1 ] c_0\in(0,1] c 0 ∈ ( 0 , 1 ] and a polynomial p p p with nonnegative coefficients and constant term at least one such that the following holds. Let n , ℓ ≥ 1 n,\ell\ge1 n , ℓ ≥ 1 and let L L L take values in ( { 0 , 1 } ℓ ) n (\{0,1\}^{\ell})^n ({ 0 , 1 } ℓ ) n . Let t ≥ 1 t\ge1 t ≥ 1 , 0 < ϵ , η , σ < 1 0<\epsilon,\eta,\sigma<1 0 < ϵ , η , σ < 1 , and δ ≥ ϵ \delta\ge\epsilon δ ≥ ϵ .
If L L L has ( t , ϵ ) (t,\epsilon) ( t , ϵ ) insertional pseudoentropy at least H ( L ) + δ H(L)+\delta H ( L ) + δ , then, for every B ≥ 1 B\ge1 B ≥ 1 satisfying
B ≤ min { t c 0 , σ / ( n ϵ ) } p ( n , 2 ℓ , 1 / η , log ( n / σ ) ) . B\le\frac{\min\{t^{c_0},\sigma/(n\epsilon)\}}{p(n,2^\ell,1/\eta,\log(n/\sigma))}. B ≤ p ( n , 2 ℓ , 1/ η , log ( n / σ )) min { t c 0 , σ / ( n ϵ )} .
every size-B B B stateless insertional sampler C C C over { 0 , 1 } ℓ \{0,1\}^{\ell} { 0 , 1 } ℓ satisfies
D K L ( L ∥ C ( 1 n ) ) > δ − σ − n η . D_{\mathrm{KL}}(L \mathbin\Vert C(1^n)) > \delta-\sigma-n\eta. D KL ( L ∥ C ( 1 n )) > δ − σ − n η .
If the ( t , ϵ ) (t,\epsilon) ( t , ϵ ) insertional pseudoentropy of L L L is at most H ( L ) + δ − ϵ H(L)+\delta-\epsilon H ( L ) + δ − ϵ , then there exists a size-B B B stateless insertional sampler C C C over { 0 , 1 } ℓ \{0,1\}^{\ell} { 0 , 1 } ℓ with
B ≤ p ( t , n , 2 ℓ , 1 / ϵ ) , D K L ( L ∥ C ( 1 n ) ) ≤ δ . B \le p(t,n,2^{\ell},1/\epsilon), \qquad D_{\mathrm{KL}}(L \mathbin\Vert C(1^n)) \le\delta. B ≤ p ( t , n , 2 ℓ , 1/ ϵ ) , D KL ( L ∥ C ( 1 n )) ≤ δ .
Remark 5.7. If δ < ϵ \delta< \epsilon δ < ϵ and some B ≥ 1 B \ge1 B ≥ 1 satisfies the size bound in item 1, then p ≥ 1 p \ge1 p ≥ 1 forces σ ≥ n ϵ > δ \sigma\ge n\epsilon> \delta σ ≥ n ϵ > δ , so the claimed lower bound is negative and the inequality follows from nonnegativity of KL-divergence. If no such B B B exists, item 1 is vacuous.
Lemma 5.8 (Distinct one-symbol insertions). Let i , ℓ ≥ 1 i,\ell\ge1 i , ℓ ≥ 1 and w ∈ ( { 0 , 1 } ℓ ) i − 1 w \in(\{0,1\}^{\ell})^{i-1} w ∈ ({ 0 , 1 } ℓ ) i − 1 . The set
E i ( w ) = { z ∈ ( { 0 , 1 } ℓ ) i : w is a subsequence of z } \mathcal{E}_i(w)=\{z\in(\{0,1\}^{\ell})^i:w\text{ is a subsequence of }z\} E i ( w ) = { z ∈ ({ 0 , 1 } ℓ ) i : w is a subsequence of z } has exactly K i = i ( 2 ℓ − 1 ) + 1 K_i=i(2^{\ell}-1)+1 K i = i ( 2 ℓ − 1 ) + 1 elements and admits a bijection Ext i ( w , ⋅ ) : [ K i ] → E i ( w ) \operatorname{Ext}_i(w,\cdot):[K_i]\to\mathcal{E}_i(w) Ext i ( w , ⋅ ) : [ K i ] → E i ( w ) . Given ( i , ℓ , w , k ) (i,\ell,w,k) ( i , ℓ , w , k ) , one can compute Ext i ( w , k ) \operatorname{Ext}_i(w,k) Ext i ( w , k ) in poly ( i , 2 ℓ ) \operatorname{poly}(i,2^{\ell}) poly ( i , 2 ℓ ) time. Given ( i , ℓ , w , z ) (i,\ell,w,z) ( i , ℓ , w , z ) with z ∈ E i ( w ) z\in\mathcal{E}_i(w) z ∈ E i ( w ) , one can compute the unique k ∈ [ K i ] k\in[K_i] k ∈ [ K i ] satisfying Ext i ( w , k ) = z \operatorname{Ext}_i(w,k)=z Ext i ( w , k ) = z in the same time bound.
Proof. We count each resulting string once by choosing the rightmost position at which its inserted symbol can be placed. For a ∈ { 0 , 1 } ℓ a\in\{0,1\}^{\ell} a ∈ { 0 , 1 } ℓ and j ∈ [ i ] j\in[i] j ∈ [ i ] , write
Ins ( w , a , j ) = ( w 1 , … , w j − 1 , a , w j , … , w i − 1 ) . \operatorname{Ins}(w,a,j)=(w_1,\ldots,w_{j-1},a,w_j,\ldots,w_{i-1}). Ins ( w , a , j ) = ( w 1 , … , w j − 1 , a , w j , … , w i − 1 ) .
For a , b ∈ { 0 , 1 } ℓ a,b\in\{0,1\}^{\ell} a , b ∈ { 0 , 1 } ℓ and 1 ≤ j < k ≤ i 1\le j<k\le i 1 ≤ j < k ≤ i , comparison of coordinates j , … , k j,\ldots,k j , … , k gives
Ins ( w , a , j ) = Ins ( w , b , k ) ⟺ a = w j = ⋯ = w k − 1 = b . \operatorname{Ins}(w,a,j)=\operatorname{Ins}(w,b,k)\quad\Longleftrightarrow\quad a=w_j=\cdots=w_{k-1}=b. Ins ( w , a , j ) = Ins ( w , b , k ) ⟺ a = w j = ⋯ = w k − 1 = b .
Retain all pairs ( a , j ) (a,j) ( a , j ) with j = i j=i j = i , and those with j < i j<i j < i and a ≠ w j a\ne w_j a = w j . By the displayed equivalence, these are exactly the rightmost representations, one for each output. Hence
∣ E i ( w ) ∣ = 2 ℓ + ( i − 1 ) ( 2 ℓ − 1 ) = i ( 2 ℓ − 1 ) + 1. |\mathcal{E}_i(w)|=2^{\ell}+(i-1)(2^{\ell}-1)=i(2^{\ell}-1)+1. ∣ E i ( w ) ∣ = 2 ℓ + ( i − 1 ) ( 2 ℓ − 1 ) = i ( 2 ℓ − 1 ) + 1.
Order the retained pairs by increasing j j j , then lexicographically by a a a . Define Ext i ( w , k ) \operatorname{Ext}_i(w,k) Ext i ( w , k ) by inserting the symbol at the position specified by the k k k -th pair. To invert this map given w w w and z z z , enumerate the retained pairs and return the index of the unique pair whose insertion produces z z z . Both algorithms examine at most i 2 ℓ i2^{\ell} i 2 ℓ pairs and use O ( i ℓ ) O(i\ell) O ( i ℓ ) time per pair, giving the claimed poly ( i , 2 ℓ ) \operatorname{poly}(i,2^{\ell}) poly ( i , 2 ℓ ) bound. □
Lemma 5.9 (Conditional and final KL-divergence). Let n , ℓ ≥ 1 n,\ell\ge1 n , ℓ ≥ 1 and let L L L be distributed over ( { 0 , 1 } ℓ ) n (\{0,1\}^{\ell})^n ({ 0 , 1 } ℓ ) n . For every sequence C = ( C 1 , … , C n ) C=(C_1,\ldots,C_n) C = ( C 1 , … , C n ) of valid insertion circuits,
inf ( L 0 , … , L n ) ∑ i = 1 n D K L ( ( L i − 1 , L i ) ∥ ( L i − 1 , C i ( L i − 1 ) ) ) = D K L ( L ∥ C ( 1 n ) ) , \inf_{(L_0,\ldots,L_n)}\sum_{i=1}^{n}D_{\mathrm{KL}}\bigl((L_{i-1},L_i)\mathbin\Vert(L_{i-1},C_i(L_{i-1}))\bigr)=D_{\mathrm{KL}}(L\mathbin\Vert C(1^n)), ( L 0 , … , L n ) inf i = 1 ∑ n D KL ( ( L i − 1 , L i ) ∥ ( L i − 1 , C i ( L i − 1 )) ) = D KL ( L ∥ C ( 1 n )) , where the infimum is over insertional decompositions of L L L . Moreover, if D K L ( L ∥ C ( 1 n ) ) < ∞ D_{\mathrm{KL}}(L\mathbin\Vert C(1^n))<\infty D KL ( L ∥ C ( 1 n )) < ∞ , there exists an insertional decomposition ( L 0 , … , L n ) (L_0,\ldots,L_n) ( L 0 , … , L n ) of L L L that forms a Markov chain and satisfies
∑ i = 1 n D K L ( ( L i − 1 , L i ) ∥ ( L i − 1 , C i ( L i − 1 ) ) ) = D K L ( L ∥ C ( 1 n ) ) . \sum_{i=1}^{n}D_{\mathrm{KL}}\bigl((L_{i-1},L_i)\mathbin\Vert(L_{i-1},C_i(L_{i-1}))\bigr)=D_{\mathrm{KL}}(L\mathbin\Vert C(1^n)). i = 1 ∑ n D KL ( ( L i − 1 , L i ) ∥ ( L i − 1 , C i ( L i − 1 )) ) = D KL ( L ∥ C ( 1 n )) .
Proof. Let ( L 0 , … , L n ) (L_0,\ldots,L_n) ( L 0 , … , L n ) be any insertional decomposition of L L L , and X 0 = ∅ X_0=\emptyset X 0 = ∅ , X i ← C i ( X i − 1 ) X_i \gets C_i(X_{i-1}) X i ← C i ( X i − 1 ) with fresh independent coins, so X n ≡ C ( 1 n ) X_n \equiv C(1^n) X n ≡ C ( 1 n ) . Then,
D K L ( L ∥ C ( 1 n ) ) = D K L ( L n ∥ X n ) ≤ D K L ( ( L n − 1 , L n ) ∥ ( X n − 1 , X n ) ) = D K L ( L n − 1 ∥ X n − 1 ) + E x ∼ L n − 1 D K L ( L n ∣ L n − 1 = x ∥ C n ( x ) ) ≤ ∑ i = 1 n E x ∼ L i − 1 D K L ( L i ∣ L i − 1 = x ∥ C i ( x ) ) = ∑ i = 1 n D K L ( ( L i − 1 , L i ) ∥ ( L i − 1 , C i ( L i − 1 ) ) ) . \begin{aligned}
D_{\mathrm{KL}}(L\mathbin\Vert C(1^n))=D_{\mathrm{KL}}(L_n\mathbin\Vert X_n) \\
&\le D_{\mathrm{KL}}\bigl((L_{n-1},L_n)\mathbin\Vert(X_{n-1},X_n)\bigr) \\
&=D_{\mathrm{KL}}(L_{n-1}\mathbin\Vert X_{n-1})+\mathop{\mathbb{E}}_{x\sim L_{n-1}}D_{\mathrm{KL}}(L_n\mid L_{n-1}=x\mathbin\Vert C_n(x)) \\
&\le\sum_{i=1}^{n}\mathop{\mathbb{E}}_{x\sim L_{i-1}}D_{\mathrm{KL}}(L_i\mid L_{i-1}=x\mathbin\Vert C_i(x)) \\
&=\sum_{i=1}^{n}D_{\mathrm{KL}}\bigl((L_{i-1},L_i)\mathbin\Vert(L_{i-1},C_i(L_{i-1}))\bigr).
\end{aligned} D KL ( L ∥ C ( 1 n )) = D KL ( L n ∥ X n ) ≤ D KL ( ( L n − 1 , L n ) ∥ ( X n − 1 , X n ) ) = D KL ( L n − 1 ∥ X n − 1 ) + E x ∼ L n − 1 D KL ( L n ∣ L n − 1 = x ∥ C n ( x )) ≤ i = 1 ∑ n E x ∼ L i − 1 D KL ( L i ∣ L i − 1 = x ∥ C i ( x )) = i = 1 ∑ n D KL ( ( L i − 1 , L i ) ∥ ( L i − 1 , C i ( L i − 1 )) ) .
The first inequality is Fact 2.9 applied to the map that keeps the second coordinate. The next equality is Fact 2.7: given X n − 1 = x X_{n-1}=x X n − 1 = x , the distribution of X n X_n X n is C n ( x ) C_n(x) C n ( x ) . Repeating these two steps down to i = 1 i=1 i = 1 gives the sum, since D K L ( L 0 ∥ X 0 ) = 0 D_{\mathrm{KL}}(L_0\mathbin\Vert X_0)=0 D KL ( L 0 ∥ X 0 ) = 0 . The last equality applies the same chain rule to two pairs with the same first-coordinate distribution L i − 1 L_{i-1} L i − 1 . Since the decomposition was arbitrary, the final KL divergence is at most the infimum in the statement.
Write Q ( x 0 , … , x n ) = Pr [ X 0 = x 0 , … , X n = x n ] Q(x_0,\ldots,x_n)=\Pr[X_0=x_0,\ldots,X_n=x_n] Q ( x 0 , … , x n ) = Pr [ X 0 = x 0 , … , X n = x n ] and Q n ( z ) = Pr [ X n = z ] Q_n(z)=\Pr[X_n=z] Q n ( z ) = Pr [ X n = z ] . For the reverse inequality, assume D K L ( L ∥ Q n ) < ∞ D_{\mathrm{KL}}(L\mathbin\Vert Q_n)<\infty D KL ( L ∥ Q n ) < ∞ and define
M ( x 0 , … , x n ) = { Q ( x 0 , … , x n ) Pr [ L = x n ] Q n ( x n ) , Q n ( x n ) > 0 , 0 , Q n ( x n ) = 0. M(x_0,\ldots,x_n)=
\begin{cases}
Q(x_0,\ldots,x_n)\dfrac{\Pr[L=x_n]}{Q_n(x_n)}, & Q_n(x_n)>0,\\
0, & Q_n(x_n)=0.
\end{cases} M ( x 0 , … , x n ) = ⎩ ⎨ ⎧ Q ( x 0 , … , x n ) Q n ( x n ) Pr [ L = x n ] , 0 , Q n ( x n ) > 0 , Q n ( x n ) = 0.
For Q n ( z ) > 0 Q_n(z)>0 Q n ( z ) > 0 ,
∑ x 0 , … , x n − 1 M ( x 0 , … , x n − 1 , z ) = Pr [ L = z ] Q n ( z ) ∑ x 0 , … , x n − 1 Q ( x 0 , … , x n − 1 , z ) = Pr [ L = z ] . \sum_{x_0,\ldots,x_{n-1}}M(x_0,\ldots,x_{n-1},z)
=\dfrac{\Pr[L=z]}{Q_n(z)}
\sum_{x_0,\ldots,x_{n-1}}Q(x_0,\ldots,x_{n-1},z)
=\Pr[L=z]. x 0 , … , x n − 1 ∑ M ( x 0 , … , x n − 1 , z ) = Q n ( z ) Pr [ L = z ] x 0 , … , x n − 1 ∑ Q ( x 0 , … , x n − 1 , z ) = Pr [ L = z ] .
Both sides are zero otherwise, since supp ( L ) ⊆ supp ( Q n ) \operatorname{supp}(L)\subseteq\operatorname{supp}(Q_n) supp ( L ) ⊆ supp ( Q n ) . Thus ( M 0 , … , M n ) ∼ M (M_0,\ldots,M_n)\sim M ( M 0 , … , M n ) ∼ M satisfies M n ≡ L M_n\equiv L M n ≡ L . Since supp ( M ) ⊆ supp ( Q ) \operatorname{supp}(M)\subseteq\operatorname{supp}(Q) supp ( M ) ⊆ supp ( Q ) , M 0 = ∅ M_0=\emptyset M 0 = ∅ and every step inserts one symbol.
To compute the conditional probabilities, for i ∈ { 0 , … , n } i\in\{0,\ldots,n\} i ∈ { 0 , … , n } set
h i ( w ) = ∑ z : Q n ( z ) > 0 Pr [ X n = z ∣ X i = w ] Pr [ L = z ] Q n ( z ) ( w ∈ supp ( X i ) ) , h_i(w)=\sum_{z:Q_n(z)>0}\Pr[X_n=z\mid X_i=w]\frac{\Pr[L=z]}{Q_n(z)}
\qquad(w\in\operatorname{supp}(X_i)), h i ( w ) = z : Q n ( z ) > 0 ∑ Pr [ X n = z ∣ X i = w ] Q n ( z ) Pr [ L = z ] ( w ∈ supp ( X i )) ,
and set h i ( w ) = 0 h_i(w)=0 h i ( w ) = 0 otherwise. The Markov property of ( X 0 , … , X n ) (X_0,\ldots,X_n) ( X 0 , … , X n ) gives
Pr [ M 0 = x 0 , … , M i = x i ] = ∑ z : Q n ( z ) > 0 Pr [ X 0 = x 0 , … , X i = x i , X n = z ] Pr [ L = z ] Q n ( z ) = Pr [ X 0 = x 0 , … , X i = x i ] h i ( x i ) . \begin{aligned}
\Pr[M_0=x_0,\ldots,M_i=x_i] \\
&=\sum_{z:Q_n(z)>0}\Pr[X_0=x_0,\ldots,X_i=x_i,X_n=z]\frac{\Pr[L=z]}{Q_n(z)} \\
&=\Pr[X_0=x_0,\ldots,X_i=x_i]h_i(x_i).
\end{aligned} Pr [ M 0 = x 0 , … , M i = x i ] = z : Q n ( z ) > 0 ∑ Pr [ X 0 = x 0 , … , X i = x i , X n = z ] Q n ( z ) Pr [ L = z ] = Pr [ X 0 = x 0 , … , X i = x i ] h i ( x i ) .
For i ∈ [ n ] i \in[n] i ∈ [ n ] and every tuple with Pr [ M 0 = x 0 , … , M i − 1 = x i − 1 ] > 0 \Pr[M_0=x_0,\ldots,M_{i-1}=x_{i-1}]>0 Pr [ M 0 = x 0 , … , M i − 1 = x i − 1 ] > 0 , division gives
Pr [ M i = z ∣ M 0 = x 0 , … , M i − 1 = x i − 1 ] = Pr [ C i ( x i − 1 ) = z ] h i ( z ) h i − 1 ( x i − 1 ) = Pr [ M i = z ∣ M i − 1 = x i − 1 ] . \begin{aligned}
\Pr[M_i=z\mid M_0=x_0,\ldots,M_{i-1}=x_{i-1}]
&=\Pr[C_i(x_{i-1})=z]\frac{h_i(z)}{h_{i-1}(x_{i-1})}\\
&=\Pr[M_i=z\mid M_{i-1}=x_{i-1}].
\end{aligned} Pr [ M i = z ∣ M 0 = x 0 , … , M i − 1 = x i − 1 ] = Pr [ C i ( x i − 1 ) = z ] h i − 1 ( x i − 1 ) h i ( z ) = Pr [ M i = z ∣ M i − 1 = x i − 1 ] .
The ratio depends on the preceding tuple only through x i − 1 x_{i-1} x i − 1 , so the last equality holds and ( M 0 , … , M n ) (M_0,\ldots,M_n) ( M 0 , … , M n ) is a Markov insertional decomposition of L L L . By Fact 2.8,
∑ i = 1 n D K L ( ( M i − 1 , M i ) ∥ ( M i − 1 , C i ( M i − 1 ) ) ) = D K L ( M ∥ Q ) = ∑ ( x 0 , … , x n ) ∈ supp ( M ) M ( x 0 , … , x n ) log Pr [ L = x n ] Q n ( x n ) = ∑ z ∈ supp ( L ) Pr [ L = z ] log Pr [ L = z ] Q n ( z ) = D K L ( L ∥ C ( 1 n ) ) . \begin{aligned}
\sum_{i=1}^{n}D_{\mathrm{KL}}\bigl((M_{i-1},M_i)\mathbin{\|}(M_{i-1},C_i(M_{i-1}))\bigr)
&=D_{\mathrm{KL}}(M\mathbin{\|}Q)\\
&=\sum_{(x_0,\ldots,x_n)\in\operatorname{supp}(M)}M(x_0,\ldots,x_n)\log\frac{\Pr[L=x_n]}{Q_n(x_n)}\\
&=\sum_{z\in\operatorname{supp}(L)}\Pr[L=z]\log\frac{\Pr[L=z]}{Q_n(z)}\\
&=D_{\mathrm{KL}}(L\mathbin{\|}C(1^n)).
\end{aligned} i = 1 ∑ n D KL ( ( M i − 1 , M i ) ∥ ( M i − 1 , C i ( M i − 1 )) ) = D KL ( M ∥ Q ) = ( x 0 , … , x n ) ∈ supp ( M ) ∑ M ( x 0 , … , x n ) log Q n ( x n ) Pr [ L = x n ] = z ∈ supp ( L ) ∑ Pr [ L = z ] log Q n ( z ) Pr [ L = z ] = D KL ( L ∥ C ( 1 n )) .
This decomposition attains the infimum.
Lemma 5.10. (Insertional pseudoentropy implies conditional sampling hardness.) Under the hypotheses and size condition of the first part of Theorem 5.6 , every insertional decomposition ( L 0 , … , L n ) (L_0,\ldots,L_n) ( L 0 , … , L n ) of L L L and every size- B B B stateless insertional sampler C C C over { 0 , 1 } ℓ \{0,1\}^{\ell} { 0 , 1 } ℓ satisfy
E i ← [ n ] D K L ( ( L i − 1 , L i ) ∥ ( L i − 1 , C i ( L i − 1 ) ) ) > δ − σ n − η . \mathbb{E}_{i\leftarrow[n]}D_{\mathrm{KL}}\bigl((L_{i-1},L_i)\mathbin{\|}(L_{i-1},C_i(L_{i-1}))\bigr)>\frac{\delta-\sigma}{n}-\eta. E i ← [ n ] D KL ( ( L i − 1 , L i ) ∥ ( L i − 1 , C i ( L i − 1 )) ) > n δ − σ − η .
Proof. Fix an insertional decomposition ( L 0 , … , L n ) (L_0,\ldots,L_n) ( L 0 , … , L n ) and a sampler C C C , and put
d i = D K L ( ( L i − 1 , L i ) ∥ ( L i − 1 , C i ( L i − 1 ) ) ) , d = ∑ i = 1 n d i . d_i=D_{\mathrm{KL}}\bigl((L_{i-1},L_i)\mathbin{\|}(L_{i-1},C_i(L_{i-1}))\bigr),\qquad d=\sum_{i=1}^{n}d_i. d i = D KL ( ( L i − 1 , L i ) ∥ ( L i − 1 , C i ( L i − 1 )) ) , d = i = 1 ∑ n d i .
If d = ∞ d=\infty d = ∞ , the claim follows, so assume d < ∞ d<\infty d < ∞ . By Definition 5.3 and Remark 5.5, choose a family Z i ∈ ( { 0 , 1 } ℓ ) i Z_i\in(\{0,1\}^{\ell})^i Z i ∈ ({ 0 , 1 } ℓ ) i such that
∑ i = 1 n H ( Z i ∣ L i − 1 ) ≥ ∑ i = 1 n H ( L i ∣ L i − 1 ) + δ \sum_{i=1}^{n}H(Z_i\mid L_{i-1})\geq\sum_{i=1}^{n}H(L_i\mid L_{i-1})+\delta i = 1 ∑ n H ( Z i ∣ L i − 1 ) ≥ i = 1 ∑ n H ( L i ∣ L i − 1 ) + δ
and ( I , Z I , L I − 1 ) (I,Z_I,L_{I-1}) ( I , Z I , L I − 1 ) and ( I , L I , L I − 1 ) (I,L_I,L_{I-1}) ( I , L I , L I − 1 ) are ( t , ϵ ) (t,\epsilon) ( t , ϵ ) nonuniformly indistinguishable, where I I I is uniform on [ n ] [n] [ n ] and independent of the family and decomposition. We estimate the sampler’s output probabilities and test their negative logarithms. The expected negative logarithm will be at least H ( Z i ∣ L i − 1 ) H(Z_i\mid L_{i-1}) H ( Z i ∣ L i − 1 ) on Z i Z_i Z i and at most H ( L i ∣ L i − 1 ) + d i + η / 4 H(L_i\mid L_{i-1})+d_i+\eta/4 H ( L i ∣ L i − 1 ) + d i + η /4 on L i L_i L i . Indistinguishability compares their averages over the uniform index I I I . Let E i ( w ) \mathcal{E}_i(w) E i ( w ) and K i = i ( 2 ℓ − 1 ) + 1 K_i=i(2^\ell-1)+1 K i = i ( 2 ℓ − 1 ) + 1 be as in Lemma 5.8 , and set
q = n 2 ℓ , M = ⌈ 32 q / η ⌉ , θ = 2 − ⌈ log ( 32 / η ) ⌉ , Λ = n ℓ + log ( 1 / θ ) . q=n2^\ell,\qquad M=\lceil32q/\eta\rceil,\qquad\theta=2^{-\lceil\log(32/\eta)\rceil},\qquad\Lambda=n\ell+\log(1/\theta). q = n 2 ℓ , M = ⌈ 32 q / η ⌉ , θ = 2 − ⌈ l o g ( 32/ η )⌉ , Λ = n ℓ + log ( 1/ θ ) .
On input ( i , z , w ) (i,z,w) ( i , z , w ) , draw M M M samples from C i ( w ) C_i(w) C i ( w ) with independent coins, also independent of the decomposition and auxiliary family. Let N z N_z N z count the samples equal to z z z . Define
P ^ w ( z ) = { N z + 1 M + K i , z ∈ E i ( w ) , 0 , z ∉ E i ( w ) , R w ( z ) = ( 1 − θ ) P ^ w ( z ) + θ 2 i ℓ . \widehat{P}_w(z)=
\begin{cases}
\dfrac{N_z+1}{M+K_i}, & z\in\mathcal{E}_i(w),\\
0, & z\notin\mathcal{E}_i(w),
\end{cases}
\qquad
R_w(z)=(1-\theta)\widehat{P}_w(z)+\frac{\theta}{2^{i\ell}}. P w ( z ) = ⎩ ⎨ ⎧ M + K i N z + 1 , 0 , z ∈ E i ( w ) , z ∈ / E i ( w ) , R w ( z ) = ( 1 − θ ) P w ( z ) + 2 i ℓ θ .
Since ∑ z ∈ E i ( w ) N z = M \sum_{z\in\mathcal{E}_i(w)}N_z=M ∑ z ∈ E i ( w ) N z = M , both P ^ w \widehat{P}_w P w and R w R_w R w are probability distributions. The uniform term is needed because Z i Z_i Z i need not belong to E i ( L i − 1 ) \mathcal{E}_i(L_{i-1}) E i ( L i − 1 ) . For every length-i i i string z z z ,
θ 2 i ℓ ≤ R w ( z ) ≤ 1 , 0 ≤ − log R w ( z ) ≤ Λ . \frac{\theta}{2^{i\ell}}\le R_w(z)\le1,\qquad0\le-\log R_w(z)\le\Lambda. 2 i ℓ θ ≤ R w ( z ) ≤ 1 , 0 ≤ − log R w ( z ) ≤ Λ.
Set b = ⌈ log ( 16 Λ / η ) ⌉ b=\lceil\log(16\Lambda/\eta)\rceil b = ⌈ log ( 16Λ/ η )⌉ and ρ = 2 − b \rho=2^{-b} ρ = 2 − b . The circuit D D D accepts with probability
ρ ⌊ − log R w ( z ) Λ ρ ⌋ . \rho\left\lfloor\frac{-\log R_w(z)}{\Lambda\rho}\right\rfloor. ρ ⌊ Λ ρ − log R w ( z ) ⌋ .
For each i i i , store the displayed floor for the M + 1 M+1 M + 1 valid-extension counts N z = 0 , … , M N_z=0,\ldots,M N z = 0 , … , M and for the single invalid-extension case. This gives n ( M + 2 ) n(M+2) n ( M + 2 ) entries, each an integer in { 0 , … , 2 b } \{0,\ldots,2^b\} { 0 , … , 2 b } stored using b + 1 b+1 b + 1 bits. Draw a fresh uniform b b b -bit integer and accept exactly when it is smaller than the stored integer. The circuit contains M M M copies of each C j C_j C j ; it selects the count from the branch j = i j=i j = i , whose copies receive w w w ; the other branches receive fixed strings of the required lengths. Membership in E i ( w ) \mathcal{E}_i(w) E i ( w ) is tested by deleting each position of z z z and comparing the resulting string with w w w . Selection, counting, these comparisons, and table lookup require poly ( n , M , ℓ , b ) \operatorname{poly}(n,M,\ell,b) poly ( n , M , ℓ , b ) additional gates. Consequently, for a universal polynomial A A A ,
∣ D ∣ ≤ n M B + poly ( n , M , ℓ , b ) ≤ B A ( n , 2 ℓ , 1 / η ) . |D|\le nMB+\operatorname{poly}(n,M,\ell,b)\le BA(n,2^\ell,1/\eta). ∣ D ∣ ≤ n M B + poly ( n , M , ℓ , b ) ≤ B A ( n , 2 ℓ , 1/ η ) .
where the last inequality uses B ≥ 1 B\ge1 B ≥ 1 and the choices of M , b M,b M , b . Choose the polynomial p p p in Theorem 5.6 large enough that p ( n , 2 ℓ , 1 / η , log ( n / σ ) ) ≥ max { A ( n , 2 ℓ , 1 / η ) , 2 Λ } p(n,2^\ell,1/\eta,\log(n/\sigma))\ge\max\{A(n,2^\ell,1/\eta),2\Lambda\} p ( n , 2 ℓ , 1/ η , log ( n / σ )) ≥ max { A ( n , 2 ℓ , 1/ η ) , 2Λ } . The assumed size bound and c 0 ≤ 1 c_0\le1 c 0 ≤ 1 give
∣ D ∣ ≤ B A ( n , 2 ℓ , 1 / η ) ≤ t c 0 ≤ t , n Λ ϵ ≤ σ / 2 , Λ ρ ≤ η / 16. |D|\le BA(n,2^\ell,1/\eta)\le t^{c_0}\le t,\qquad n\Lambda\epsilon\le\sigma/2,\qquad\Lambda\rho\le\eta/16. ∣ D ∣ ≤ B A ( n , 2 ℓ , 1/ η ) ≤ t c 0 ≤ t , n Λ ϵ ≤ σ /2 , Λ ρ ≤ η /16.
We first bound the expected negative logarithm on L i L_i L i . For w ∈ supp ( L i − 1 ) w\in\operatorname{supp}(L_{i-1}) w ∈ supp ( L i − 1 ) , apply Claim 2.11 on E i ( w ) \mathcal{E}_i(w) E i ( w ) with P = C i ( w ) P=C_i(w) P = C i ( w ) , Q = L i ∣ L i − 1 = w Q=L_i\mid L_{i-1}=w Q = L i ∣ L i − 1 = w , and M M M samples. Since R w ( z ) ≥ ( 1 − θ ) P ^ w ( z ) R_w(z)\ge(1-\theta)\widehat{P}_w(z) R w ( z ) ≥ ( 1 − θ ) P w ( z ) ,
E D K L ( L i ∣ L i − 1 = w ∥ R w ) ≤ E D K L ( L i ∣ L i − 1 = w ∥ P ^ w ) − log ( 1 − θ ) ≤ D K L ( L i ∣ L i − 1 = w ∥ C i ( w ) ) + log M + K i M + 1 − log ( 1 − θ ) . \begin{aligned}
\mathbb{E}\,D_{\mathrm{KL}}\left(L_i\mid L_{i-1}=w\mathbin{\|}R_w\right)
\le\mathbb{E}\,D_{\mathrm{KL}}\left(L_i\mid L_{i-1}=w\mathbin{\|}\widehat{P}_w\right)-\log(1-\theta) \\
&\le D_{\mathrm{KL}}\left(L_i\mid L_{i-1}=w\mathbin{\|}C_i(w)\right)+\log\frac{M+K_i}{M+1}-\log(1-\theta).
\end{aligned} E D KL ( L i ∣ L i − 1 = w ∥ R w ) ≤ E D KL ( L i ∣ L i − 1 = w ∥ P w ) − log ( 1 − θ ) ≤ D KL ( L i ∣ L i − 1 = w ∥ C i ( w ) ) + log M + 1 M + K i − log ( 1 − θ ) .
Here expectations are over the M M M samples. Since K i ≤ q K_i\le q K i ≤ q and θ ≤ η / 32 \theta\le\eta/32 θ ≤ η /32 , the parameter choices give
log M + K i M + 1 − log ( 1 − θ ) < η / 4. \log\frac{M+K_i}{M+1}-\log(1-\theta)<\eta/4. log M + 1 M + K i − log ( 1 − θ ) < η /4.
Drawing the samples independently of L i L_i L i conditional on L i − 1 L_{i-1} L i − 1 and applying Fact 2.7 to d i d_i d i gives
E [ − log R L i − 1 ( L i ) ] = H ( L i ∣ L i − 1 ) + E w ∼ L i − 1 E D K L ( L i ∣ L i − 1 = w ∥ R w ) ≤ H ( L i ∣ L i − 1 ) + d i + η / 4. \mathbb{E}[-\log R_{L_{i-1}}(L_i)] = H(L_i \mid L_{i-1}) + \mathbb{E}_{w\sim L_{i-1}} \mathbb{E} D_{\mathrm{KL}}(L_i \mid L_{i-1}=w \mathbin{\|} R_w)
\le H(L_i \mid L_{i-1}) + d_i + \eta/4. E [ − log R L i − 1 ( L i )] = H ( L i ∣ L i − 1 ) + E w ∼ L i − 1 E D KL ( L i ∣ L i − 1 = w ∥ R w ) ≤ H ( L i ∣ L i − 1 ) + d i + η /4.
The same samples are independent of Z i Z_i Z i conditional on L i − 1 L_{i-1} L i − 1 . For every w ∈ supp ( L i − 1 ) w \in\operatorname{supp}(L_{i-1}) w ∈ supp ( L i − 1 ) and every value of R w R_w R w ,
E z ∼ Z i ∣ L i − 1 = w [ − log R w ( z ) ] = H ( Z i ∣ L i − 1 = w ) + D K L ( Z i ∣ L i − 1 = w ∥ R w ) ≥ H ( Z i ∣ L i − 1 = w ) . \mathbb{E}_{z\sim Z_i\mid L_{i-1}=w}[-\log R_w(z)] = H(Z_i \mid L_{i-1}=w) + D_{\mathrm{KL}}(Z_i \mid L_{i-1}=w \mathbin{\|} R_w)
\ge H(Z_i \mid L_{i-1}=w). E z ∼ Z i ∣ L i − 1 = w [ − log R w ( z )] = H ( Z i ∣ L i − 1 = w ) + D KL ( Z i ∣ L i − 1 = w ∥ R w ) ≥ H ( Z i ∣ L i − 1 = w ) .
For V i = L i V_i=L_i V i = L i or V i = Z i V_i=Z_i V i = Z i , the rounding gives
∣ Λ Pr [ D ( i , V i , L i − 1 ) = 1 ] − E [ − log R L i − 1 ( V i ) ] ∣ ≤ Λ ρ . \left|\Lambda\Pr[D(i,V_i,L_{i-1})=1]-\mathbb{E}[-\log R_{L_{i-1}}(V_i)]\right|\le\Lambda\rho. ∣ Λ Pr [ D ( i , V i , L i − 1 ) = 1 ] − E [ − log R L i − 1 ( V i )] ∣ ≤ Λ ρ .
Here the expectations include the fresh samples drawn by D D D . Since ∣ D ∣ ≤ t |D|\le t ∣ D ∣ ≤ t , indistinguishability gives
∣ ∑ i Pr [ D ( i , Z i , L i − 1 ) = 1 ] − ∑ i Pr [ D ( i , L i , L i − 1 ) = 1 ] ∣ ≤ n ϵ . \left|\sum_i\Pr[D(i,Z_i,L_{i-1})=1]-\sum_i\Pr[D(i,L_i,L_{i-1})=1]\right|\le n\epsilon. i ∑ Pr [ D ( i , Z i , L i − 1 ) = 1 ] − i ∑ Pr [ D ( i , L i , L i − 1 ) = 1 ] ≤ n ϵ .
Combining these inequalities,
∑ i H ( L i ∣ L i − 1 ) + δ ≤ ∑ i H ( Z i ∣ L i − 1 ) ≤ ∑ i E [ − log R L i − 1 ( Z i ) ] ≤ Λ ∑ i Pr [ D ( i , Z i , L i − 1 ) = 1 ] + n Λ ρ ≤ Λ ∑ i Pr [ D ( i , L i , L i − 1 ) = 1 ] + n Λ ϵ + n Λ ρ ≤ ∑ i E [ − log R L i − 1 ( L i ) ] + n Λ ϵ + 2 n Λ ρ ≤ ∑ i H ( L i ∣ L i − 1 ) + d + n η / 4 + n Λ ϵ + 2 n Λ ρ ≤ ∑ i H ( L i ∣ L i − 1 ) + d + σ / 2 + 3 n η / 8. \begin{aligned}
\sum_i H(L_i\mid L_{i-1})+\delta
&\le\sum_i H(Z_i\mid L_{i-1})\\
&\le\sum_i\mathbb{E}[-\log R_{L_{i-1}}(Z_i)]\\
&\le\Lambda\sum_i\Pr[D(i,Z_i,L_{i-1})=1]+n\Lambda\rho\\
&\le\Lambda\sum_i\Pr[D(i,L_i,L_{i-1})=1]+n\Lambda\epsilon+n\Lambda\rho\\
&\le\sum_i\mathbb{E}[-\log R_{L_{i-1}}(L_i)]+n\Lambda\epsilon+2n\Lambda\rho\\
&\le\sum_i H(L_i\mid L_{i-1})+d+n\eta/4+n\Lambda\epsilon+2n\Lambda\rho\\
&\le\sum_i H(L_i\mid L_{i-1})+d+\sigma/2+3n\eta/8.
\end{aligned} i ∑ H ( L i ∣ L i − 1 ) + δ ≤ i ∑ H ( Z i ∣ L i − 1 ) ≤ i ∑ E [ − log R L i − 1 ( Z i )] ≤ Λ i ∑ Pr [ D ( i , Z i , L i − 1 ) = 1 ] + n Λ ρ ≤ Λ i ∑ Pr [ D ( i , L i , L i − 1 ) = 1 ] + n Λ ϵ + n Λ ρ ≤ i ∑ E [ − log R L i − 1 ( L i )] + n Λ ϵ + 2 n Λ ρ ≤ i ∑ H ( L i ∣ L i − 1 ) + d + n η /4 + n Λ ϵ + 2 n Λ ρ ≤ i ∑ H ( L i ∣ L i − 1 ) + d + σ /2 + 3 n η /8.
Subtracting ∑ i H ( L i ∣ L i − 1 ) \sum_i H(L_i\mid L_{i-1}) ∑ i H ( L i ∣ L i − 1 ) from both sides gives d > δ − σ − n η d>\delta-\sigma-n\eta d > δ − σ − n η . Dividing by n n n proves the claim.
Lemma 5.11. (Small insertional pseudoentropy gives conditional samplers.) Under the hypotheses of the second part of Theorem 5.6 , there are an insertional decomposition ( L 0 , … , L n ) (L_0,\ldots,L_n) ( L 0 , … , L n ) of L L L and a size-B B B stateless insertional sampler C C C over { 0 , 1 } ℓ \{0,1\}^{\ell} { 0 , 1 } ℓ , with B ≤ p ( t , n , 2 ℓ , 1 / ϵ ) B\le p(t,n,2^\ell,1/\epsilon) B ≤ p ( t , n , 2 ℓ , 1/ ϵ ) , such that
E i ← [ n ] D K L ( ( L i − 1 , L i ) ∥ ( L i − 1 , C i ( L i − 1 ) ) ) ≤ δ n . \mathbb{E}_{i\gets[n]}D_{\mathrm{KL}}\bigl((L_{i-1},L_i)\mathbin{\|}(L_{i-1},C_i(L_{i-1}))\bigr)\le\frac{\delta}{n}. E i ← [ n ] D KL ( ( L i − 1 , L i ) ∥ ( L i − 1 , C i ( L i − 1 )) ) ≤ n δ .
Proof. By assumption, the ( t , ϵ ) (t,\epsilon) ( t , ϵ ) insertional pseudoentropy of L L L is at most H ( L ) + δ − ϵ H(L)+\delta-\epsilon H ( L ) + δ − ϵ . Indexing the valid extensions in Lemma 5.8 gives alphabets of size at most n 2 ℓ n2^\ell n 2 ℓ for applying item 2 of Theorem 2.23 . We bound the sum of the indices’ conditional pseudoentropy gaps by combining their maximizing auxiliary variables into one variable in Definition 5.3 . Set
k ∗ = H ( L ) + δ − ϵ / 2 , η ′ = ϵ / ( 4 n ) , 2 n η ′ = ϵ / 2. k_* = H(L) + \delta- \epsilon/2,\qquad\eta' = \epsilon/(4n),\qquad2n\eta' = \epsilon/2. k ∗ = H ( L ) + δ − ϵ /2 , η ′ = ϵ / ( 4 n ) , 2 n η ′ = ϵ /2.
Since H ( L ) + δ − ϵ < k ∗ H(L)+\delta-\epsilon<k_* H ( L ) + δ − ϵ < k ∗ , Definition 5.3 gives an insertional decomposition ( L 0 , … , L n ) (L_0,\ldots,L_n) ( L 0 , … , L n ) for which every Z Z Z satisfying the length and ( t , ϵ ) (t,\epsilon) ( t , ϵ ) -indistinguishability conditions in that definition satisfies
n H ( Z ∣ I , L I − 1 ) − ∑ i = 1 n H ( L i ∣ L i − 1 ) < k ∗ − H ( L ) = δ − ϵ / 2. nH(Z\mid I,L_{I-1})-\sum_{i=1}^{n}H(L_i\mid L_{i-1})<k_*-H(L)=\delta-\epsilon/2. n H ( Z ∣ I , L I − 1 ) − i = 1 ∑ n H ( L i ∣ L i − 1 ) < k ∗ − H ( L ) = δ − ϵ /2.
Here I I I is uniform on [ n ] [n] [ n ] and independent of the decomposition.
For each i i i , let K i = i ( 2 ℓ − 1 ) + 1 K_i=i(2^\ell-1)+1 K i = i ( 2 ℓ − 1 ) + 1 and let Ext i ( w , ⋅ ) : [ K i ] → E i ( w ) \operatorname{Ext}_i(w,\cdot):[K_i]\to\mathcal{E}_i(w) Ext i ( w , ⋅ ) : [ K i ] → E i ( w ) be the bijection in Lemma 5.8 . Define A i ∈ [ K i ] A_i\in[K_i] A i ∈ [ K i ] by L i = Ext i ( L i − 1 , A i ) L_i=\operatorname{Ext}_i(L_{i-1},A_i) L i = Ext i ( L i − 1 , A i ) . Since the map is a bijection for each fixed L i − 1 = w L_{i-1}=w L i − 1 = w ,
H ( A i ∣ L i − 1 ) = H ( L i ∣ L i − 1 ) . H(A_i\mid L_{i-1})=H(L_i\mid L_{i-1}). H ( A i ∣ L i − 1 ) = H ( L i ∣ L i − 1 ) .
Let R ( n , 2 ℓ ) R(n,2^\ell) R ( n , 2 ℓ ) be a fixed polynomial bounding the circuit size of each Ext i \operatorname{Ext}_i Ext i and the overhead for composing it with a circuit whose index input is fixed to i i i , and put t ′ = t + R ( n , 2 ℓ ) t'=t+R(n,2^\ell) t ′ = t + R ( n , 2 ℓ ) . Such a polynomial exists by the algorithms in Lemma 5.8 .
Let h i h_i h i be the maximum ( t ′ , η ′ ) (t',\eta') ( t ′ , η ′ ) conditional pseudoentropy of A i A_i A i given L i − 1 L_{i-1} L i − 1 over the alphabet [ K i ] [K_i] [ K i ] , and put
g i = h i − H ( A i ∣ L i − 1 ) ≥ 0. g_i=h_i-H(A_i\mid L_{i-1})\ge0. g i = h i − H ( A i ∣ L i − 1 ) ≥ 0.
Nonnegativity follows by using A i A_i A i itself as an auxiliary variable. We will show ∑ i g i < δ − ϵ / 2 \sum_i g_i<\delta-\epsilon/2 ∑ i g i < δ − ϵ /2 . By the compactness observation after Definition 2.20 , choose maximizing A i ′ ∈ [ K i ] A'_i\in[K_i] A i ′ ∈ [ K i ] such that H ( A i ′ ∣ L i − 1 ) = h i H(A'_i\mid L_{i-1})=h_i H ( A i ′ ∣ L i − 1 ) = h i and ( L i − 1 , A i ′ ) (L_{i-1},A'_i) ( L i − 1 , A i ′ ) and ( L i − 1 , A i ) (L_{i-1},A_i) ( L i − 1 , A i ) are ( t ′ , η ′ ) (t',\eta') ( t ′ , η ′ ) nonuniformly indistinguishable. Realize these pairs jointly with ( L 0 , … , L n ) (L_0,\ldots,L_n) ( L 0 , … , L n ) by setting
Pr [ A 1 ′ = a 1 , … , A n ′ = a n ∣ L 0 = w 0 , … , L n = w n ] = ∏ i = 1 n Pr [ A i ′ = a i ∣ L i − 1 = w i − 1 ] \Pr[A'_1=a_1,\ldots,A'_n=a_n\mid L_0=w_0,\ldots,L_n=w_n]
=\prod_{i=1}^{n}\Pr[A'_i=a_i\mid L_{i-1}=w_{i-1}] Pr [ A 1 ′ = a 1 , … , A n ′ = a n ∣ L 0 = w 0 , … , L n = w n ] = i = 1 ∏ n Pr [ A i ′ = a i ∣ L i − 1 = w i − 1 ]
for every tuple ( w 0 , … , w n ) (w_0,\ldots,w_n) ( w 0 , … , w n ) of positive probability, using the chosen pair distributions on the right. This preserves each distribution ( L i − 1 , A i ′ ) (L_{i-1},A'_i) ( L i − 1 , A i ′ ) . Put
Z i = Ext i ( L i − 1 , A i ′ ) , H ( Z i ∣ L i − 1 ) = H ( A i ′ ∣ L i − 1 ) = h i , Z_i=\operatorname{Ext}_i(L_{i-1},A'_i),\qquad H(Z_i\mid L_{i-1})=H(A'_i\mid L_{i-1})=h_i, Z i = Ext i ( L i − 1 , A i ′ ) , H ( Z i ∣ L i − 1 ) = H ( A i ′ ∣ L i − 1 ) = h i ,
choose I I I independently of this family and the decomposition, and set Z = Z I Z=Z_I Z = Z I .
Fix any Boolean circuit D D D of size at most t t t . For each fixed i i i , the circuit with inputs w ∈ ( { 0 , 1 } ℓ ) i − 1 w\in(\{0,1\}^{\ell})^{i-1} w ∈ ({ 0 , 1 } ℓ ) i − 1 and a ∈ [ K i ] a\in[K_i] a ∈ [ K i ] given by
D i ( w , a ) = D ( i , Ext i ( w , a ) , w ) D_i(w,a)=D(i,\operatorname{Ext}_i(w,a),w) D i ( w , a ) = D ( i , Ext i ( w , a ) , w )
has size at most t + R ( n , 2 ℓ ) = t ′ t + R(n, 2^{\ell}) = t' t + R ( n , 2 ℓ ) = t ′ . The defining indistinguishability of A i ′ A'_i A i ′ gives
∣ Pr [ D ( I , Z , L I − 1 ) = 1 ] − Pr [ D ( I , L I , L I − 1 ) = 1 ] ∣ = ∣ 1 n ∑ i = 1 n ( Pr [ D i ( L i − 1 , A i ′ ) = 1 ] − Pr [ D i ( L i − 1 , A i ) = 1 ] ) ∣ ≤ 1 n ∑ i = 1 n ∣ Pr [ D i ( L i − 1 , A i ′ ) = 1 ] − Pr [ D i ( L i − 1 , A i ) = 1 ] ∣ ≤ η ′ ≤ ϵ . \begin{aligned}
\left|\Pr[D(I,Z,L_{I-1})=1]-\Pr[D(I,L_I,L_{I-1})=1]\right| \\
&= \left|\frac{1}{n}\sum_{i=1}^{n}\left(\Pr[D_i(L_{i-1},A'_i)=1]-\Pr[D_i(L_{i-1},A_i)=1]\right)\right| \\
&\le\frac{1}{n}\sum_{i=1}^{n}\left|\Pr[D_i(L_{i-1},A'_i)=1]-\Pr[D_i(L_{i-1},A_i)=1]\right| \\
&\le\eta' \le\epsilon.
\end{aligned} ∣ Pr [ D ( I , Z , L I − 1 ) = 1 ] − Pr [ D ( I , L I , L I − 1 ) = 1 ] ∣ = n 1 i = 1 ∑ n ( Pr [ D i ( L i − 1 , A i ′ ) = 1 ] − Pr [ D i ( L i − 1 , A i ) = 1 ] ) ≤ n 1 i = 1 ∑ n ∣ Pr [ D i ( L i − 1 , A i ′ ) = 1 ] − Pr [ D i ( L i − 1 , A i ) = 1 ] ∣ ≤ η ′ ≤ ϵ .
The family ( Z 1 , … , Z n ) (Z_1,\ldots,Z_n) ( Z 1 , … , Z n ) was fixed before D D D , and Z ∈ ( { 0 , 1 } ℓ ) i Z \in(\{0,1\}^{\ell})^i Z ∈ ({ 0 , 1 } ℓ ) i when I = i I=i I = i . Thus Z Z Z satisfies the length and indistinguishability conditions for the chosen decomposition, so
∑ i = 1 n g i = ∑ i = 1 n h i − ∑ i = 1 n H ( A i ∣ L i − 1 ) = ∑ i = 1 n H ( Z i ∣ L i − 1 ) − ∑ i = 1 n H ( L i ∣ L i − 1 ) = n H ( Z ∣ I , L I − 1 ) − ∑ i = 1 n H ( L i ∣ L i − 1 ) < k ∗ − H ( L ) = δ − ϵ / 2. \begin{aligned}
\sum_{i=1}^{n}g_i=\sum_{i=1}^{n}h_i-\sum_{i=1}^{n}H(A_i\mid L_{i-1}) \\
&=\sum_{i=1}^{n}H(Z_i\mid L_{i-1})-\sum_{i=1}^{n}H(L_i\mid L_{i-1}) \\
&=nH(Z\mid I,L_{I-1})-\sum_{i=1}^{n}H(L_i\mid L_{i-1}) \\
&< k_* - H(L)=\delta-\epsilon/2.
\end{aligned} i = 1 ∑ n g i = i = 1 ∑ n h i − i = 1 ∑ n H ( A i ∣ L i − 1 ) = i = 1 ∑ n H ( Z i ∣ L i − 1 ) − i = 1 ∑ n H ( L i ∣ L i − 1 ) = n H ( Z ∣ I , L I − 1 ) − i = 1 ∑ n H ( L i ∣ L i − 1 ) < k ∗ − H ( L ) = δ − ϵ /2.
Apply item 2 of Theorem 2.23 for each i i i with X = L i − 1 X=L_{i-1} X = L i − 1 , B = A i B=A_i B = A i , m = m i = ( i − 1 ) ℓ ≥ 0 m=m_i=(i-1)\ell\ge0 m = m i = ( i − 1 ) ℓ ≥ 0 , q = K i ≥ 2 q=K_i\ge2 q = K i ≥ 2 , circuit-size parameter t ′ t' t ′ , gap bound g i g_i g i , and η = η ′ \eta=\eta' η = η ′ . It gives a randomized circuit S i : { 0 , 1 } m i → [ K i ] S_i:\{0,1\}^{m_i}\to[K_i] S i : { 0 , 1 } m i → [ K i ] satisfying
∣ S i ∣ ≤ p 0 ( t ′ , m i , K i , 1 / η ′ ) , |S_i|\le p_0(t',m_i,K_i,1/\eta'), ∣ S i ∣ ≤ p 0 ( t ′ , m i , K i , 1/ η ′ ) ,
D K L ( ( L i − 1 , A i ) ∥ ( L i − 1 , S i ( L i − 1 ) ) ) ≤ g i + 2 η ′ . D_{\mathrm{KL}}\left((L_{i-1},A_i)\mathbin{\|}(L_{i-1},S_i(L_{i-1}))\right)\le g_i+2\eta'. D KL ( ( L i − 1 , A i ) ∥ ( L i − 1 , S i ( L i − 1 )) ) ≤ g i + 2 η ′ .
Set C i ( w ) = Ext i ( w , S i ( w ) ) C_i(w)=\operatorname{Ext}_i(w,S_i(w)) C i ( w ) = Ext i ( w , S i ( w )) , with fresh independent coins at each step. Since S i ( w ) ∈ [ K i ] S_i(w)\in[K_i] S i ( w ) ∈ [ K i ] , C i ( w ) ∈ E i ( w ) C_i(w)\in E_i(w) C i ( w ) ∈ E i ( w ) for every input w ∈ ( { 0 , 1 } ℓ ) i − 1 w\in(\{0,1\}^{\ell})^{i-1} w ∈ ({ 0 , 1 } ℓ ) i − 1 . The bijection ( w , a ) ↦ ( w , Ext i ( w , a ) ) (w,a)\mapsto(w,\operatorname{Ext}_i(w,a)) ( w , a ) ↦ ( w , Ext i ( w , a )) gives
D K L ( ( L i − 1 , L i ) ∥ ( L i − 1 , C i ( L i − 1 ) ) ) = D K L ( ( L i − 1 , A i ) ∥ ( L i − 1 , S i ( L i − 1 ) ) ) ≤ g i + 2 η ′ . \begin{aligned}
D_{\mathrm{KL}}\left((L_{i-1},L_i)\mathbin{\|}(L_{i-1},C_i(L_{i-1}))\right)
=D_{\mathrm{KL}}\left((L_{i-1},A_i)\mathbin{\|}(L_{i-1},S_i(L_{i-1}))\right) \\
&\le g_i+2\eta'.
\end{aligned} D KL ( ( L i − 1 , L i ) ∥ ( L i − 1 , C i ( L i − 1 )) ) = D KL ( ( L i − 1 , A i ) ∥ ( L i − 1 , S i ( L i − 1 )) ) ≤ g i + 2 η ′ .
Hence
∑ i = 1 n D K L ( ( L i − 1 , L i ) ∥ ( L i − 1 , C i ( L i − 1 ) ) ) ≤ ∑ i = 1 n g i + 2 n η ′ < δ − ϵ / 2 + ϵ / 2 = δ . \begin{aligned}
\sum_{i=1}^{n}D_{\mathrm{KL}}\left((L_{i-1},L_i)\mathbin{\|}(L_{i-1},C_i(L_{i-1}))\right)
\le\sum_{i=1}^{n}g_i+2n\eta' \\
&<\delta-\epsilon/2+\epsilon/2=\delta.
\end{aligned} i = 1 ∑ n D KL ( ( L i − 1 , L i ) ∥ ( L i − 1 , C i ( L i − 1 )) ) ≤ i = 1 ∑ n g i + 2 n η ′ < δ − ϵ /2 + ϵ /2 = δ .
Dividing by n n n gives the stated average bound.
Finally, m i ≤ n 2 ℓ m_i\le n2^\ell m i ≤ n 2 ℓ , K i ≤ n 2 ℓ K_i\le n2^\ell K i ≤ n 2 ℓ , and 1 / η ′ = 4 n / ϵ 1/\eta'=4n/\epsilon 1/ η ′ = 4 n / ϵ . Since p 0 p_0 p 0 has nonnegative coefficients,
∣ C i ∣ ≤ ∣ S i ∣ + R ( n , 2 ℓ ) ≤ p 0 ( t + R ( n , 2 ℓ ) , n 2 ℓ , n 2 ℓ , 4 n / ϵ ) + R ( n , 2 ℓ ) . \begin{aligned}
|C_i|\le|S_i|+R(n,2^\ell) \\
&\le p_0(t+R(n,2^\ell),n2^\ell,n2^\ell,4n/\epsilon)+R(n,2^\ell).
\end{aligned} ∣ C i ∣ ≤ ∣ S i ∣ + R ( n , 2 ℓ ) ≤ p 0 ( t + R ( n , 2 ℓ ) , n 2 ℓ , n 2 ℓ , 4 n / ϵ ) + R ( n , 2 ℓ ) .
Choose the polynomial p p p in Theorem 5.6 large enough to dominate this quantity at ( t , n , 2 ℓ , 1 / ϵ ) (t,n,2^\ell,1/\epsilon) ( t , n , 2 ℓ , 1/ ϵ ) and the bound required in its first part. Then B : = max i ∣ C i ∣ ≤ p ( t , n , 2 ℓ , 1 / ϵ ) B:=\max_i|C_i|\le p(t,n,2^\ell,1/\epsilon) B := max i ∣ C i ∣ ≤ p ( t , n , 2 ℓ , 1/ ϵ ) . ∩ევნ
Proof of Theorem 5.6 . For the first part, fix a sampler C C C satisfying the size bound. Write d = D K L ( L ∥ C ( 1 n ) ) d = D_{\mathrm{KL}}(L \mathbin\Vert C(1^n)) d = D KL ( L ∥ C ( 1 n )) . If d = ∞ d = \infty d = ∞ , the claim follows. Otherwise, Lemma 5.9 gives an insertional decomposition ( L 0 , … , L n ) (L_0,\ldots,L_n) ( L 0 , … , L n ) of L L L whose sum of conditional KL-divergences from C C C equals d d d . Applying Lemma 5.10 to this decomposition gives
D K L ( L ∥ C ( 1 n ) ) = ∑ i = 1 n D K L ( ( L i − 1 , L i ) ∥ ( L i − 1 , C i ( L i − 1 ) ) ) > δ − σ − n η . \begin{aligned}
D_{\mathrm{KL}}(L \mathbin\Vert C(1^n)) = \sum_{i=1}^{n} D_{\mathrm{KL}}\left((L_{i-1},L_i) \mathbin\Vert(L_{i-1},C_i(L_{i-1}))\right) \\
&> \delta-\sigma-n\eta.
\end{aligned} D KL ( L ∥ C ( 1 n )) = i = 1 ∑ n D KL ( ( L i − 1 , L i ) ∥ ( L i − 1 , C i ( L i − 1 )) ) > δ − σ − n η .
For the second part, take the decomposition and sampler from Lemma 5.11. The sampler has the required size, and Lemma 5.9 gives
D K L ( L ∥ C ( 1 n ) ) ≤ ∑ i D K L ( ( L i − 1 , L i ) ∥ ( L i − 1 , C i ( L i − 1 ) ) ) ≤ δ . D_{\mathrm{KL}}(L \mathbin\Vert C(1^n)) \le\sum_i D_{\mathrm{KL}}\left((L_{i-1},L_i) \mathbin\Vert(L_{i-1},C_i(L_{i-1}))\right) \le\delta. D KL ( L ∥ C ( 1 n )) ≤ i ∑ D KL ( ( L i − 1 , L i ) ∥ ( L i − 1 , C i ( L i − 1 )) ) ≤ δ .
Finally, insertion does not recover all efficient sampling: Theorem 7.2 proves a separation under 2 γ λ 2^{\gamma\lambda} 2 γ λ -secure one-way functions, for constants γ > 0 \gamma> 0 γ > 0 and 1 / 2 < α < 1 1/2 < \alpha< 1 1/2 < α < 1 . This construction uses 2 t 2t 2 t tokens over an alphabet of size 2 t ⋅ 2 2 t 2t\cdot2^{2t} 2 t ⋅ 2 2 t .
Insertionally-Samplable PRGs
A pseudorandom generator (PRG) is a polynomial-time family G : { 0 , 1 } k → { 0 , 1 } m G:\{0,1\}^k\to\{0,1\}^m G : { 0 , 1 } k → { 0 , 1 } m , with m > k m>k m > k , whose output on a uniform seed is computationally indistinguishable from U m U_m U m . Here security is against nonuniform polynomial-size circuits: every such circuit has negligible distinguishing advantage. The following construction shows that an insertional sampler can generate pseudorandom bits without retaining the seed privately.
Theorem 6.1 (Insertionally samplable pseudorandom generators). Let G : { 0 , 1 } t → { 0 , 1 } 2 t G:\{0,1\}^t\to\{0,1\}^{2t} G : { 0 , 1 } t → { 0 , 1 } 2 t be a polynomial-time pseudorandom generator secure against nonuniform polynomial-size circuits. There exists a polynomial-time pseudorandom generator H : { 0 , 1 } 3 t 2 → { 0 , 1 } 4 t 2 H:\{0,1\}^{3t^2}\to\{0,1\}^{4t^2} H : { 0 , 1 } 3 t 2 → { 0 , 1 } 4 t 2 whose output distribution admits an exact polynomial-size stateless insertional bit sampler.
Proof. The sampler first generates bits from which it can recover a seed. After using this seed, it inserts additional random bits so that the final string conceals which bits were originally generated. Define H H H by the following process, with its seed consisting of the 3 t 2 3t^2 3 t 2 independent uniform bits used below.
Append t 2 t^2 t 2 independent uniform bits, obtaining X = X 1 ⋯ X t 2 X=X_1\cdots X_{t^2} X = X 1 ⋯ X t 2 . Partition X X X into t t t consecutive groups of t t t bits. Define s j s_j s j as the parity of the bits in group j j j , and put s = s 1 ⋯ s t s=s_1\cdots s_t s = s 1 ⋯ s t .
For a = 1 , … , 2 t 2 a=1,\ldots,2t^2 a = 1 , … , 2 t 2 , read X X X from the first t 2 t^2 t 2 positions, recompute s s s , and append G ( s ) a G(s)_a G ( s ) a . (Following this process, the resulting string is X ∥ G ( s ) X\mathbin\Vert G(s) X ∥ G ( s ) .)
For i = 1 , … , t 2 i=1,\ldots,t^2 i = 1 , … , t 2 , sample fresh independent uniform bits b , r b,r b , r . Insert b b b immediately before X i X_i X i if r = 0 r=0 r = 0 , and immediately after it otherwise. Denote the resulting ordered pair by Z i Z_i Z i , and put Z = Z 1 ∥ ⋯ ∥ Z t 2 Z=Z_1\mathbin\Vert\cdots\mathbin\Vert Z_{t^2} Z = Z 1 ∥ ⋯ ∥ Z t 2 . The final output is Z ∥ G ( s ) Z\mathbin\Vert G(s) Z ∥ G ( s ) .
The process uses t 2 t^2 t 2 random bits in item 1 and 2 t 2 2t^2 2 t 2 in item 3, and outputs 4 t 2 4t^2 4 t 2 bits. It is stateless: throughout item 2, X X X occupies the first t 2 t^2 t 2 positions. After processing i − 1 i-1 i − 1 bits in item 3, the current string is
Z 1 ∥ ⋯ ∥ Z i − 1 ∥ X i ⋯ X t 2 ∥ G ( s ) , Z_1 \mathbin\Vert\cdots\mathbin\Vert Z_{i-1}\mathbin\Vert X_i\cdots X_{t^2}\mathbin\Vert G(s), Z 1 ∥ ⋯ ∥ Z i − 1 ∥ X i ⋯ X t 2 ∥ G ( s ) ,
so X i X_i X i occupies position 2 i − 1 2i-1 2 i − 1 . The current length determines the phase and index. Every transition therefore uses only the current string and fresh coins, and has polynomial-size circuits.
It remains to prove pseudorandomness. The pairs Z i Z_i Z i are independent and uniform over { 00 , 01 , 10 , 11 } \{00, 01, 10, 11\} { 00 , 01 , 10 , 11 } , so Z Z Z is uniform. Conditioned on any Z = z Z=z Z = z , the original bits X i X_i X i remain independent: an equal pair determines its original bit, whereas an unequal pair leaves its original bit uniform. Hence, if a group contains an unequal pair, its parity is uniform given Z = z Z=z Z = z .
The probability that all t t t pairs of a given group are equal is 2 − t 2^{-t} 2 − t . Except on an event of probability at most t 2 − t t2^{-t} t 2 − t , every group therefore has an unequal pair, making all seed bits independent and uniform given Z Z Z . Consequently,
Δ ( ( Z , s ) , ( U 2 t 2 , U t ) ) ≤ t 2 − t , \Delta\left((Z,s),(U_{2t^2},U_t)\right)\le t2^{-t}, Δ ( ( Z , s ) , ( U 2 t 2 , U t ) ) ≤ t 2 − t ,
where the uniforms on the right are independent. Applying ( z , s ) ↦ z ∥ G ( s ) (z,s)\mapsto z\mathbin\Vert G(s) ( z , s ) ↦ z ∥ G ( s ) shows that H ( U 3 t 2 ) H(U_{3t^2}) H ( U 3 t 2 ) is statistically close to U 2 t 2 ∥ G ( U t ) U_{2t^2}\mathbin\Vert G(U_t) U 2 t 2 ∥ G ( U t ) . By security of G G G , the latter is computationally indistinguishable from U 4 t 2 U_{4t^2} U 4 t 2 , proving security of H H H . □
Separations in Sampling and Pseudoentropy
We separate insertional from sequential sampling over a binary alphabet in § 7.1 , and general from insertional sampling over a larger alphabet in § 7.2 . In § 7.3 , we derive the corresponding separations between pseudoentropy notions.
Separating Insertional Samplers from Sequential Samplers
In this section formalize the intuition described in [17 ] who described a distribution that was hard for sequential samplers to derive. Moreover, we show that the same intuition does not apply to insertional samplers, thereby showing that insertional samplers cover a larger class of distributions compared to their sequential counterparts.
Proposition 7.1 (Insertional sampling is stronger than sequential sampling). Let f : { 0 , 1 } n → { 0 , 1 } n f:\{0,1\}^n\to\{0,1\}^n f : { 0 , 1 } n → { 0 , 1 } n be a one-way function secure against polynomial-size circuits. There exists a distribution L L L over { 0 , 1 } 2 n \{0,1\}^{2n} { 0 , 1 } 2 n such that:
Every stateless sequential sampler of size poly ( n ) \operatorname{poly}(n) poly ( n ) satisfies D K L ( L ∥ C ( 1 2 n ) ) > log ( n ) D_{\mathrm{KL}}(L\mathbin\Vert C(1^{2n}))>\log(n) D KL ( L ∥ C ( 1 2 n )) > log ( n ) , and
There is a poly ( n ) \operatorname{poly}(n) poly ( n ) -size insertional sampler that samples L L L .
Proof. We set L L L to be the distribution L = ( f ( X ) , X ) L=(f(X),X) L = ( f ( X ) , X ) where X X X is uniform over { 0 , 1 } n \{0,1\}^n { 0 , 1 } n .
We now prove the first item. Suppose towards contradiction that for some constant c > 0 c>0 c > 0 and infinitely many n n n , a size-n c n^c n c stateless sequential sampler C C C satisfies D K L ( L ∥ C ( 1 2 n ) ) ≤ log n D_{\mathrm{KL}}(L\mathbin\Vert C(1^{2n}))\le\log n D KL ( L ∥ C ( 1 2 n )) ≤ log n . We show that this invalidates security of the one-way function. Given y = f ( x ) y=f(x) y = f ( x ) the inverter I I I runs C C C sequentially on prefix y y y and outputs the n n n -bit suffix generated by C C C .
For X ← U n X \leftarrow U_n X ← U n , put Y = f ( X ) Y=f(X) Y = f ( X ) and write ( V , W ) ← C ( 1 2 n ) (V,W)\leftarrow C(1^{2n}) ( V , W ) ← C ( 1 2 n ) , where V , W ∈ { 0 , 1 } n V,W\in\{0,1\}^n V , W ∈ { 0 , 1 } n . Since C C C is stateless, W ∣ V = y W\mid_{V=y} W ∣ V = y is distributed as I ( y ) I(y) I ( y ) for every y ∈ supp ( V ) y\in\operatorname{supp}(V) y ∈ supp ( V ) . The assumed finite KL-divergence ensures that supp ( Y ) ⊆ supp ( V ) \operatorname{supp}(Y)\subseteq\operatorname{supp}(V) supp ( Y ) ⊆ supp ( V ) . Applying the KL chain rule (Fact 2.7) to both pairs gives
D K L ( ( Y , X ) ∥ ( Y , I ( Y ) ) ) = E y ← Y [ D K L ( X ∣ Y = y ∥ I ( y ) ) ] = D K L ( L ∥ C ( 1 2 n ) ) − D K L ( Y ∥ V ) ≤ log n , \begin{aligned}
D_{\mathrm{KL}}\bigl((Y,X)\mathbin\Vert(Y,I(Y))\bigr)
&=\mathop{\mathbb{E}}_{y\leftarrow Y}\left[D_{\mathrm{KL}}\bigl(X\mid_{Y=y}\mathbin\Vert I(y)\bigr)\right]\\
&=D_{\mathrm{KL}}\bigl(L\mathbin\Vert C(1^{2n})\bigr)-D_{\mathrm{KL}}(Y\mathbin\Vert V)\le\log n,
\end{aligned} D KL ( ( Y , X ) ∥ ( Y , I ( Y )) ) = E y ← Y [ D KL ( X ∣ Y = y ∥ I ( y ) ) ] = D KL ( L ∥ C ( 1 2 n ) ) − D KL ( Y ∥ V ) ≤ log n ,
where the inequality uses nonnegativity of KL-divergence.
Let p = Pr [ f ( I ( Y ) ) = Y ] p=\Pr[f(I(Y))=Y] p = Pr [ f ( I ( Y )) = Y ] be the inverter’s success probability. The test T ( y , x ′ ) = 1 [ f ( x ′ ) = y ] T(y,x')=\mathbf{1}[f(x')=y] T ( y , x ′ ) = 1 [ f ( x ′ ) = y ] maps ( Y , X ) (Y,X) ( Y , X ) to the constant 1 1 1 and ( Y , I ( Y ) ) (Y,I(Y)) ( Y , I ( Y )) to a Bernoulli random variable with parameter p p p . Thus data processing (Fact 2.9 ) gives
log ( 1 / p ) = D K L ( Ber ( 1 ) ∥ Ber ( p ) ) ≤ D K L ( ( Y , X ) ∥ ( Y , I ( Y ) ) ) ≤ log n . \begin{aligned}
\log(1/p)&=D_{\mathrm{KL}}(\operatorname{Ber}(1)\mathbin\Vert\operatorname{Ber}(p))\\
&\le D_{\mathrm{KL}}\bigl((Y,X)\mathbin\Vert(Y,I(Y))\bigr)\le\log n.
\end{aligned} log ( 1/ p ) = D KL ( Ber ( 1 ) ∥ Ber ( p )) ≤ D KL ( ( Y , X ) ∥ ( Y , I ( Y )) ) ≤ log n .
Hence the polynomial-size inverter I I I succeeds with probability p ≥ 1 / n p\ge1/n p ≥ 1/ n for infinitely many n n n , contradicting one-wayness.
We now show the second item by describing an insertional sampler for L L L :
For the first n n n steps, append independent uniform bits, obtaining x ← U n x\leftarrow U_n x ← U n .
At step n + j n+j n + j , for j ∈ [ n ] j\in[n] j ∈ [ n ] , read x x x from the input, compute f ( x ) f(x) f ( x ) and output ( j , f ( x ) j ) (j,f(x)_j) ( j , f ( x ) j ) (i.e., place the j j j -th bit of f ( x ) f(x) f ( x ) at index j j j .
That this insertional sampler samples L L L exactly and is efficient is immediate by construction.
Separating General Samplers from Insertional Samplers
We construct an efficiently samplable distribution that is hard for stateless insertional samplers.
Theorem 7.2 (General sampling is stronger than insertional sampling). Let ( f λ ) λ ≥ 1 (f_\lambda)_{\lambda\ge1} ( f λ ) λ ≥ 1 be a length-preserving one-way function family with 2 γ λ α 2^{\gamma\lambda^\alpha} 2 γ λ α security against circuits, for constants γ > 0 \gamma>0 γ > 0 and 1 / 2 < α < 1 1/2<\alpha<1 1/2 < α < 1 . For t ≥ 2 t\ge2 t ≥ 2 , let ℓ = 2 t + ⌈ log ( 2 t ) ⌉ \ell=2^t+\lceil\log(2^t)\rceil ℓ = 2 t + ⌈ log ( 2 t )⌉ . There exists a distribution L = L t L=L_t L = L t over ( { 0 , 1 } ℓ ) 2 t \left(\{0,1\}^{\ell}\right)^{2^t} ( { 0 , 1 } ℓ ) 2 t such that:
For every constant c > 0 c>0 c > 0 and all sufficiently large t t t , every stateless insertional sampler C C C of size at most 2 c t 2^{ct} 2 c t satisfies D K L ( L ∥ C ( 1 2 t ) ) ≥ γ t 2 α − 2 t D_{\mathrm{KL}}(L\mathbin\Vert C(1^{2^t}))\ge\gamma t^{2\alpha}-2t D KL ( L ∥ C ( 1 2 t )) ≥ γ t 2 α − 2 t .
There is a poly ( t ) \operatorname{poly}(t) poly ( t ) -size randomized circuit that samples L L L exactly.
Proof. We first define L L L . Let q = 2 t q=2^t q = 2 t , fix distinct β 1 , … , β 2 t ∈ F q \beta_1,\ldots,\beta_{2^t}\in\mathbb{F}_q β 1 , … , β 2 t ∈ F q , and identify F q t \mathbb{F}_q^t F q t with { 0 , 1 } t 2 \{0,1\}^{t^2} { 0 , 1 } t 2 . For x , r , y ∈ F q t x,r,y\in\mathbb{F}_q^t x , r , y ∈ F q t , put P x , r ( z ) = ∑ j < t r j z j + ∑ j < t x j z t + j P_{x,r}(z)=\sum_{j<t}r_jz^j+\sum_{j<t}x_jz^{t+j} P x , r ( z ) = ∑ j < t r j z j + ∑ j < t x j z t + j and Q y ( z ) = ∑ j < t y j z j Q_y(z)=\sum_{j<t}y_jz^j Q y ( z ) = ∑ j < t y j z j . The distribution L L L is sampled as follows:
Sample independent uniform X , R ← F q t X,R\leftarrow\mathbb{F}_q^t X , R ← F q t and compute Y = f t 2 ( X ) Y=f_{t^2}(X) Y = f t 2 ( X ) .
Output ( ( i , P X , R ( β i ) , Q Y ( β i ) ) ) i = 1 2 t \left((i,P_{X,R}(\beta_i),Q_Y(\beta_i))\right)_{i=1}^{2^t} ( ( i , P X , R ( β i ) , Q Y ( β i )) ) i = 1 2 t , treating each triple as one ℓ \ell ℓ -bit token.
The evaluations of P X , R P_{X,R} P X , R form a ramp secret-sharing of X X X : any fixed t t t shares are uniform and independent of X X X , since the Vandermonde matrix acting on R R R is invertible, while all 2 t 2t 2 t shares recover X , R X,R X , R by interpolation. Intermediate numbers of shares may reveal partial information about X X X . In contrast, any t t t evaluations of Q Y Q_Y Q Y determine Y Y Y . Thus we can sample any fixed t t t tokens given only the image, but completing them to a valid output reveals a preimage.
Observe that the description of the distribution defines a circuit for sampling from it. This sampler runs in poly ( t ) \operatorname{poly}(t) poly ( t ) time, proving the second item. Its alphabet is [ 2 t ] × F q 2 [2t] \times\mathbb{F}_q^2 [ 2 t ] × F q 2 , which has size 2 t ⋅ 2 2 t 2t \cdot2^{2t} 2 t ⋅ 2 2 t .
We now prove the first item. Suppose towards contradiction that for some constant c > 0 c > 0 c > 0 and infinitely many t t t , a stateless insertional sampler C C C of size at most 2 c t 2^{ct} 2 c t has KL error d : = D K L ( L ∥ C ( 1 2 t ) ) d := D_{\mathrm{KL}}(L \mathbin\Vert C(1^{2t})) d := D KL ( L ∥ C ( 1 2 t )) smaller than γ t 2 α − 2 t \gamma t^{2\alpha} - 2t γ t 2 α − 2 t . We show that this invalidates security of the one-way function.
Let S = supp ( L ) S = \operatorname{supp}(L) S = supp ( L ) and observe that membership in S S S can be efficiently tested by interpolating to derive X X X and then checking whether the third entries in the output are consistent with f ( X ) f(X) f ( X ) . We now describe the inverter. Let b = ⌈ log ( 2 t t ) ⌉ ≤ 2 t b = \left\lceil\log\binom{2t}{t}\right\rceil\le2t b = ⌈ log ( t 2 t ) ⌉ ≤ 2 t . Given y = f t 2 ( x ) y = f_{t^2}(x) y = f t 2 ( x ) , the inverter I I I proceeds as follows:
Choose a t t t -element subset J ⊆ [ 2 t ] J \subseteq[2t] J ⊆ [ 2 t ] by reducing a uniform b b b -bit integer modulo ( 2 t t ) \binom{2t}{t} ( t 2 t ) and taking the corresponding subset in lexicographic order.
Sample independent uniform u j ← F q u_j \leftarrow\mathbb{F}_q u j ← F q for j ∈ J j \in J j ∈ J . Set W t = ( ( j , u j , Q y ( β j ) ) ) j ∈ J W_t = ((j,u_j,Q_y(\beta_j)))_{j\in J} W t = (( j , u j , Q y ( β j )) ) j ∈ J in increasing tag order.
For i = t + 1 , … , 2 t i = t+1,\ldots,2t i = t + 1 , … , 2 t , sample W i ← C i ( W i − 1 ) W_i \leftarrow C_i(W_{i-1}) W i ← C i ( W i − 1 ) using fresh coins.
If W 2 t ∈ S W_{2t} \in S W 2 t ∈ S , output the preimage recovered by interpolating the entries that encode x x x ; otherwise output ⊥ \bot ⊥ .
On acceptance, the preserved t t t evaluations of Q y Q_y Q y agree with those of Q f t 2 ( x ′ ) Q_{f_{t^2}(x')} Q f t 2 ( x ′ ) for the recovered x ′ x' x ′ . Both polynomials have degree less than t t t , so f t 2 ( x ′ ) = y f_{t^2}(x') = y f t 2 ( x ′ ) = y . The inverter has size 2 O ( t ) 2^{O(t)} 2 O ( t ) : it makes t t t calls to C C C and otherwise uses poly ( t ) \operatorname{poly}(t) poly ( t ) computation.
It remains to lower-bound its success probability. Below, the strings W t , … , W 2 t W_t,\ldots,W_{2t} W t , … , W 2 t are generated on a random challenge Y = f t 2 ( X ) Y = f_{t^2}(X) Y = f t 2 ( X ) with X ← U t 2 X \leftarrow U_{t^2} X ← U t 2 . By Lemma 5.9 , there is a Markov insertional decomposition ( L 0 , … , L 2 t ) (L_0,\ldots,L_{2t}) ( L 0 , … , L 2 t ) of L L L such that, writing d i = D K L ( ( L i − 1 , L i ) ∥ ( L i − 1 , C i ( L i − 1 ) ) ) d_i = D_{\mathrm{KL}}((L_{i-1},L_i) \mathbin\Vert(L_{i-1},C_i(L_{i-1}))) d i = D KL (( L i − 1 , L i ) ∥ ( L i − 1 , C i ( L i − 1 ))) , we have ∑ i = 1 2 t d i = d \sum_{i=1}^{2t} d_i = d ∑ i = 1 2 t d i = d .
For a fixed set J J J of t t t tags, write L ∣ J L|_J L ∣ J for the restriction of L L L to those tags. The secret-sharing property implies that W t W_t W t , conditioned on choosing J J J , is distributed as L ∣ J L|_J L ∣ J . Moreover, each J J J is chosen with probability at least 2 − b 2^{-b} 2 − b . If w w w has tag set J J J , the event L t = w L_t = w L t = w implies L ∣ J = w L|_J = w L ∣ J = w . Consequently, for every w ∈ supp ( L t ) w \in\operatorname{supp}(L_t) w ∈ supp ( L t ) ,
Pr [ L t = w ] ≤ Pr [ L ∣ J = w ] ≤ 2 b Pr [ W t = w ] , \Pr[L_t = w] \le\Pr[L|_J = w] \le2^b \Pr[W_t = w], Pr [ L t = w ] ≤ Pr [ L ∣ J = w ] ≤ 2 b Pr [ W t = w ] ,
and hence D K L ( L t ∥ W t ) ≤ b D_{\mathrm{KL}}(L_t \mathbin\Vert W_t) \le b D KL ( L t ∥ W t ) ≤ b . This comparison allows the indices in L t L_t L t to depend on the final string; it uses secrecy only for each fixed J J J .
Since C C C is stateless, the inverter continues from W t W_t W t using only the current string. The KL chain rule (Fact 2.7) and nonnegativity of the d i d_i d i therefore give
D K L ( ( L t , … , L 2 t ) ∥ ( W t , … , W 2 t ) ) = D K L ( L t ∥ W t ) + ∑ i = t + 1 2 t d i ≤ b + d . D_{\mathrm{KL}}\left((L_t,\ldots,L_{2t}) \mathbin\Vert(W_t,\ldots,W_{2t})\right)
= D_{\mathrm{KL}}(L_t \mathbin\Vert W_t) + \sum_{i=t+1}^{2t} d_i \le b+d. D KL ( ( L t , … , L 2 t ) ∥ ( W t , … , W 2 t ) ) = D KL ( L t ∥ W t ) + i = t + 1 ∑ 2 t d i ≤ b + d .
Let p = Pr [ W 2 t ∈ S ] p = \Pr[W_{2t} \in S] p = Pr [ W 2 t ∈ S ] be the inverter’s success probability. The support test accepts L 2 t L_{2t} L 2 t with probability one and W 2 t W_{2t} W 2 t with probability p p p . Thus data processing (Fact 2.9 ) gives
log ( 1 / p ) = D K L ( Ber ( 1 ) ∥ Ber ( p ) ) ≤ b + d < γ t 2 α . \log(1/p) = D_{\mathrm{KL}}\left(\operatorname{Ber}(1) \mathbin{\|} \operatorname{Ber}(p)\right) \le b + d < \gamma t 2^\alpha. log ( 1/ p ) = D KL ( Ber ( 1 ) ∥ Ber ( p ) ) ≤ b + d < γ t 2 α .
Hence p > 2 − γ t 2 α p > 2^{-\gamma t 2^\alpha} p > 2 − γ t 2 α . Since 2 α > 1 2\alpha> 1 2 α > 1 , the inverter’s size 2 O ( t ) 2^{O(t)} 2 O ( t ) is at most 2 γ t 2 α 2^{\gamma t 2^\alpha} 2 γ t 2 α for all sufficiently large t t t . This contradicts the assumed security at input length λ = t 2 \lambda= t^2 λ = t 2 for infinitely many t t t , proving the second item.
Separating Pseudoentropy Notions
We now combine the sampler separations with Theorems 3.3 and 5.6 to separate the corresponding pseudoentropy notions. For each notion, the pseudoentropy gap is its pseudoentropy minus the Shannon entropy of the distribution.
Corollary 7.3 (Separating insertional from next-block pseudoentropy gaps). Let ( f n ) n ≥ 1 (f_n)_{n \ge1} ( f n ) n ≥ 1 be a length-preserving one-way function family secure against polynomial-size circuits. For X ← U n X \leftarrow U_n X ← U n , let L = ( f n ( X ) , X ) L = (f_n(X), X) L = ( f n ( X ) , X ) , viewed as 2 n 2n 2 n binary tokens. For every sufficiently large constant c c c and all sufficiently large n n n :
The ( n c , n − c ) (n^c, n^{-c}) ( n c , n − c ) insertional pseudoentropy gap of L L L is at most 1 / n 1/n 1/ n .
The ( n c , n − c ) (n^c, n^{-c}) ( n c , n − c ) next-block pseudoentropy gap of L L L is at least 1 2 log n \frac{1}{2}\log n 2 1 log n .
Proof. Since L L L includes the uniform preimage, H ( L ) = n H(L) = n H ( L ) = n . For the first item, use the fixed insertion order from the proof of Proposition 7.1 , and let ( L 0 , … , L 2 n ) (L_0, \ldots, L_{2n}) ( L 0 , … , L 2 n ) be its intermediate strings. Write A i ( w ) A_i(w) A i ( w ) for the possible successors of w w w : for i ≤ n i \le n i ≤ n , these are w 0 , w 1 w0, w1 w 0 , w 1 ; for i > n i > n i > n , there is only the prescribed insertion of an image bit. A circuit of size T 0 ( n ) T_0(n) T 0 ( n ) checks whether z ∈ A i ( w ) z \in A_i(w) z ∈ A i ( w ) , for some polynomial T 0 T_0 T 0 . Fix c ≥ 4 c \ge4 c ≥ 4 large enough that T 0 ( n ) ≤ n c T_0(n) \le n^c T 0 ( n ) ≤ n c for all sufficiently large n n n , and set ε = n − c \varepsilon= n^{-c} ε = n − c .
Let I I I be uniform on [ 2 n ] [2n] [ 2 n ] and let Z Z Z be an auxiliary variable satisfying the ( n c , ε ) (n^c, \varepsilon) ( n c , ε ) indistinguishability condition in Definition 5.3 for this decomposition. Put a = Pr [ Z ∉ A I ( L I − 1 ) ] a = \Pr[Z \notin A_I(L_{I-1})] a = Pr [ Z ∈ / A I ( L I − 1 )] . The test above gives a ≤ ε a \le\varepsilon a ≤ ε . Conditioning on whether this event occurs gives
H ( Z ∣ I , L I − 1 ) ≤ h ( a ) + E [ log ∣ A I ( L I − 1 ) ∣ ] + 2 n a ≤ h ( ε ) + 1 2 + 2 n ε . \begin{aligned}
H(Z \mid I,L_{I-1}) &\le h(a) + \mathbb{E}[\log|A_I(L_{I-1})|] + 2na \\
&\le h(\varepsilon) + \frac{1}{2} + 2n\varepsilon.
\end{aligned} H ( Z ∣ I , L I − 1 ) ≤ h ( a ) + E [ log ∣ A I ( L I − 1 ) ∣ ] + 2 na ≤ h ( ε ) + 2 1 + 2 n ε . Since H ( L ) = n H(L) = n H ( L ) = n , the insertional pseudoentropy gap is at most 2 n h ( ε ) + 4 n 2 ε 2nh(\varepsilon) + 4n^2\varepsilon 2 nh ( ε ) + 4 n 2 ε . Since h ( ε ) = O ( ε log ( 1 / ε ) ) h(\varepsilon) = O(\varepsilon\log(1/\varepsilon)) h ( ε ) = O ( ε log ( 1/ ε )) , this is O ( n 2 − c ) ≤ 1 / n O(n^{2-c}) \le1/n O ( n 2 − c ) ≤ 1/ n for all sufficiently large n n n , proving the first item.
For the second item, suppose that for some c > 0 c > 0 c > 0 and infinitely many n n n , the ( n c , n − c ) (n^c, n^{-c}) ( n c , n − c ) next-block pseudoentropy gap is less than the claimed bound. For all sufficiently large such n n n , 1 2 log n ≤ log n − n − c \frac{1}{2}\log n \le\log n - n^{-c} 2 1 log n ≤ log n − n − c . Part 2 of Theorem 3.3 , with δ = log n \delta= \log n δ = log n and ϵ = n − c \epsilon= n^{-c} ϵ = n − c , gives a stateless sequential sampler of size poly ( n c , 2 n , 2 , n c ) = poly ( n ) \operatorname{poly}(n^c, 2n, 2, n^c) = \operatorname{poly}(n) poly ( n c , 2 n , 2 , n c ) = poly ( n ) and KL error at most log n \log n log n , contradicting Proposition 7.1 .
Corollary 7.4 (Separating insertional from ordinary pseudoentropy gaps). Let ( f λ ) λ ≥ 1 (f_\lambda)_{\lambda\ge1} ( f λ ) λ ≥ 1 be a length-preserving one-way function family with 2 γ λ α 2^{\gamma\lambda^\alpha} 2 γ λ α security against circuits, for constants γ > 0 \gamma> 0 γ > 0 and 1 / 2 < α < 1 1/2 < \alpha< 1 1/2 < α < 1 . For t ≥ 2 t \ge2 t ≥ 2 , let ℓ = 2 t + ⌈ log ( 2 t ) ⌉ \ell= 2t + \lceil\log(2t) \rceil ℓ = 2 t + ⌈ log ( 2 t )⌉ . There is a distribution L = L t L = L_t L = L t over { 0 , 1 } ℓ 2 t \{0,1\}^{\ell2t} { 0 , 1 } ℓ 2 t , samplable in poly ( t ) \operatorname{poly}(t) poly ( t ) time, such that for every sufficiently large constant c c c and all sufficiently large t t t :
The ordinary ( t c , t − c ) (t^c, t^{-c}) ( t c , t − c ) pseudoentropy gap of L L L is at most 1 / t 1/t 1/ t .
The ( t c , t − c ) (t^c, t^{-c}) ( t c , t − c ) insertional pseudoentropy gap of L L L is at least γ 2 t 2 α \frac{\gamma}{2}t^{2\alpha} 2 γ t 2 α .
Proof. Use the distribution constructed in Theorem 7.2 . Every output determines the independent uniform X X X , R R R , so L L L is uniform on its support S S S of size 2 2 t 2 2^{2t^2} 2 2 t 2 and H ( L ) = 2 t 2 H(L) = 2t^2 H ( L ) = 2 t 2 . Let T 0 ( t ) T_0(t) T 0 ( t ) be a polynomial bound on the size of the support test in that proof. Fix c ≥ 4 c \ge4 c ≥ 4 large enough that T 0 ( t ) ≤ t c T_0(t) \le t^c T 0 ( t ) ≤ t c for all sufficiently large t t t , and set ε = t − c \varepsilon= t^{-c} ε = t − c . If V V V is ( t c , ε ) (t^c, \varepsilon) ( t c , ε ) -indistinguishable from L L L , then a = Pr [ V ∉ S ] ≤ ε a = \Pr[V \notin S] \le\varepsilon a = Pr [ V ∈ / S ] ≤ ε . Conditioning on membership in S S S gives
H ( V ) ≤ h ( a ) + ( 1 − a ) 2 t 2 + a ( 2 t ℓ ) ≤ H ( L ) + h ( ε ) + 2 t ℓ ε , H(V) \le h(a) + (1-a)2t^2 + a(2t\ell) \le H(L) + h(\varepsilon) + 2t\ell\varepsilon, H ( V ) ≤ h ( a ) + ( 1 − a ) 2 t 2 + a ( 2 t ℓ ) ≤ H ( L ) + h ( ε ) + 2 t ℓ ε ,
so the ordinary pseudoentropy gap is at most h ( ε ) + 2 t ℓ ε = O ( t − c ) ≤ 1 / t h(\varepsilon) + 2t\ell\varepsilon= O(t^{-c}) \le1/t h ( ε ) + 2 t ℓ ε = O ( t − c ) ≤ 1/ t for all sufficiently large t t t , proving the first item.
For the second item, suppose towards contradiction that for some c > 0 c > 0 c > 0 and infinitely many t t t , the ( t c , t − c ) (t^c, t^{-c}) ( t c , t − c ) insertional pseudoentropy gap is less than γ 2 t 2 α \frac{\gamma}{2}t^{2\alpha} 2 γ t 2 α . Set δ = γ 2 t 2 α + t − c \delta= \frac{\gamma}{2}t^{2\alpha} + t^{-c} δ = 2 γ t 2 α + t − c , so the insertional pseudoentropy is at most H ( L ) + δ − t − c H(L) + \delta- t^{-c} H ( L ) + δ − t − c . Part 2 of Theorem 5.6 gives a stateless insertional sampler of size poly ( t c , 2 t , 2 ℓ , t c ) = 2 O ( t ) \operatorname{poly}(t^c, 2t, 2^\ell, t^c) = 2^{O(t)} poly ( t c , 2 t , 2 ℓ , t c ) = 2 O ( t ) and KL error at most δ \delta δ . Since 2 α > 1 2\alpha> 1 2 α > 1 , for all sufficiently large t t t we have δ < γ t 2 α − 2 t \delta< \gamma t^{2\alpha} - 2t δ < γ t 2 α − 2 t , contradicting Theorem 7.2 .
Consequences
This section explores consequences of our results. In § 8.1 , we derive limitations on sequential generation of cryptographic distributions with limited private state. In § 8.2 , we explain how our results motivate insertion-based models by showing the added expressive power of choosing where to generate each token.
Cryptographic hardness for sequential sampling
Our results show that small-state sequential samplers cannot do many standard cryptographic tasks. We give two examples: (1) a small-state sequential sampler cannot sample a pseudorandom generator distribution, and (2) a small-state sequential sampler cannot sampler fresh public-key ciphertexts even given the public key. This shows that, in order to compute cryptographic primitives, autoregressive models require either external mechanisms or a large state. On the flip-side, we show that sequential samplers cannot invoke public-key steganography. Thus, agents with no pre-shared secrets and a small state cannot covertly communicate with each other. This may be useful for security and alignment, in cases where an autoregressive agent is not trusted.
In order to describe consequences of our results to sequential generation of cryptographic primitives, we first derive a general consequence of Theorems 3.3 and 4.3 for negligible sampling error, allowing logarithmic private state. We use n n n as the asymptotic parameter throughout this subsection.
Corollary 8.1 (General consequence for samplers with logarithmic state). Let ( W , Y ) (W, Y) ( W , Y ) be jointly distributed and indexed by n n n . Assume:
W W W has polynomial length, and Y Y Y consists of poly ( n ) \operatorname{poly}(n) poly ( n ) items over a poly ( n ) \operatorname{poly}(n) poly ( n ) -size alphabet.
Y Y Y has a noticeable nonuniform next-block pseudoentropy gap given W W W .
Then no sequential sampler C C C with poly ( n ) \operatorname{poly}(n) poly ( n ) -size circuits and O ( log n ) O(\log n) O ( log n ) private bits satisfies
D K L ( ( W , Y ) ∥ ( W , C ( W ) ) ) = negl ( n ) , D_{\mathrm{KL}}\left((W,Y)\mathbin\Vert(W,C(W))\right)=\operatorname{negl}(n), D KL ( ( W , Y ) ∥ ( W , C ( W )) ) = negl ( n ) ,
even given W W W and the entire visible prefix at every step.
Proof. Suppose towards contradiction that such a sampler C C C exists, and write k = O ( log n ) k=O(\log n) k = O ( log n ) for its state length. Let N ≥ 1 N\ge1 N ≥ 1 be the number of tokens of Y Y Y , each of length ℓ \ell ℓ . Put P = ( W , Y ) P=(W,Y) P = ( W , Y ) , Q = ( W , C ( W ) ) Q=(W,C(W)) Q = ( W , C ( W )) , and e = D K L ( P ∥ Q ) = negl ( n ) e=D_{\mathrm{KL}}(P\mathbin\Vert Q)=\operatorname{negl}(n) e = D KL ( P ∥ Q ) = negl ( n ) . Choose d > 0 d>0 d > 0 so that the pseudoentropy gap is at least n − d n^{-d} n − d for all sufficiently large n n n , and set ρ = n − d / 8 \rho=n^{-d/8} ρ = n − d /8 . We remove the private state, control the resulting error, and then apply the stateless characterization.
Remove the private state. Apply Theorem 4.3 with accuracy ρ \rho ρ . Its construction allows visible input W W W : use the same w w w in every simulated invocation of C C C , and average the KL bound over W W W . The resulting stateless sampler D D D has polynomial size, since 2 k 2^k 2 k , 2 ℓ 2^\ell 2 ℓ , 1 / ρ 1/\rho 1/ ρ , N N N , ∣ W ∣ |W| ∣ W ∣ are polynomially bounded. Writing R = ( W , D ( W ) ) R=(W,D(W)) R = ( W , D ( W )) , we have D K L ( Q ∥ R ) ≤ ρ D_{\mathrm{KL}}(Q\mathbin\Vert R)\le\rho D KL ( Q ∥ R ) ≤ ρ .
Compare with the target distribution. Both C C C and D D D use at most r = poly ( n ) r=\operatorname{poly}(n) r = poly ( n ) fair random bits over the entire run. Thus every positive conditional output probability, given W = w W=w W = w , is at least 2 − r 2^{-r} 2 − r . Finite KL-divergence gives supp ( P ) ⊆ supp ( Q ) ⊆ supp ( R ) \operatorname{supp}(P)\subseteq\operatorname{supp}(Q)\subseteq\operatorname{supp}(R) supp ( P ) ⊆ supp ( Q ) ⊆ supp ( R ) . On supp ( Q ) \operatorname{supp}(Q) supp ( Q ) , put F ( w , y ) = log ( Pr [ C ( w ) = y ] / Pr [ D ( w ) = y ] ) F(w,y)=\log(\Pr[C(w)=y]/\Pr[D(w)=y]) F ( w , y ) = log ( Pr [ C ( w ) = y ] / Pr [ D ( w ) = y ]) , and set F = 0 F=0 F = 0 elsewhere. Then ∣ F ∣ ≤ r |F|\le r ∣ F ∣ ≤ r . By Fact 2.5 , ν : = Δ ( P , Q ) = negl ( n ) \nu:=\Delta(P,Q)=\operatorname{negl}(n) ν := Δ ( P , Q ) = negl ( n ) . Since all three distributions have the same W W W marginal,
D K L ( P ∥ R ) = e + D K L ( Q ∥ R ) + E P F − E Q F ≤ e + ρ + 2 r ν = ρ + negl ( n ) ≤ 2 ρ \begin{aligned}
D_{\mathrm{KL}}(P\mathbin\Vert R)=e+D_{\mathrm{KL}}(Q\mathbin\Vert R)+\mathbb{E}_{P}F-\mathbb{E}_{Q}F \\
&\le e+\rho+2r\nu=\rho+\operatorname{negl}(n)\le2\rho
\end{aligned} D KL ( P ∥ R ) = e + D KL ( Q ∥ R ) + E P F − E Q F ≤ e + ρ + 2 r ν = ρ + negl ( n ) ≤ 2 ρ
for all sufficiently large $n.
Apply the pseudoentropy lower bound. Part 1 of Theorem 3.3 allows visible input W W W : replace ( I , Y < I ) (I,Y_{<I}) ( I , Y < I ) by ( W , I , Y < I ) (W,I,Y_{<I}) ( W , I , Y < I ) , condition the entropies on W W W , and include ∣ W ∣ |W| ∣ W ∣ in the polynomial size bound. Set δ = 4 ρ \delta=4\rho δ = 4 ρ , σ = ρ \sigma=\rho σ = ρ , η = ρ / N \eta=\rho/N η = ρ / N , t = n c t=n^c t = n c , and ϵ = n − c \epsilon=n^{-c} ϵ = n − c . The denominator in the size bound is polynomial in n n n independently of c c c , while the numerator is min { n c 0 , ρ n c / N } \min\{n^{c_0},\rho n^c/N\} min { n c 0 , ρ n c / N } . Choose c c c large enough to cover the size of D D D and ensure n − c ≤ ρ n^{-c}\le\rho n − c ≤ ρ . The pseudoentropy hypothesis then gives ( n c , n − c ) (n^c,n^{-c}) ( n c , n − c ) next-block pseudoentropy given W W W at least H ( Y ∣ W ) + 8 ρ − n − c ≥ H ( Y ∣ W ) + 4 ρ H(Y\mid W)+8\rho-n^{-c}\ge H(Y\mid W)+4\rho H ( Y ∣ W ) + 8 ρ − n − c ≥ H ( Y ∣ W ) + 4 ρ . The theorem yields D K L ( P ∥ R ) > 4 ρ − ρ − N ( ρ / N ) = 2 ρ D_{\mathrm{KL}}(P\mathbin\Vert R)>4\rho-\rho-N(\rho/N)=2\rho D KL ( P ∥ R ) > 4 ρ − ρ − N ( ρ / N ) = 2 ρ , contradicting the preceding bound.
We now describe several corollaries for various cryptographic consequences of the above corollary.
Corollary 8.2 (Pseudorandom generation). Let G : { 0 , 1 } k ( n ) → { 0 , 1 } n G:\{0,1\}^{k(n)}\to\{0,1\}^n G : { 0 , 1 } k ( n ) → { 0 , 1 } n be a pseudorandom generator secure against nonuniform polynomial-size circuits. No sequential bit sampler C C C with polynomial-size circuits and O ( log n ) O(\log n) O ( log n ) private bits satisfies
D K L ( G ( U k ( n ) ) ∥ C ( 1 n ) ) = negl ( n ) . D_{\mathrm{KL}}\left(G(U_{k(n)})\mathbin\Vert C(1^n)\right)=\operatorname{negl}(n). D KL ( G ( U k ( n ) ) ∥ C ( 1 n ) ) = negl ( n ) . The same holds for any apriori fixed ordering, rather than just left-to-right.
A public-key encryption scheme generates a public key p k \mathrm{pk} pk and a secret key s k \mathrm{sk} sk . Anyone can encrypt a message using p k \mathrm{pk} pk ; decryption using s k \mathrm{sk} sk recovers it. IND-CPA security requires indistinguishable encryptions of any two equal-length messages chosen efficiently after seeing p k \mathrm{pk} pk . Public-key steganography additionally requires encodings to be indistinguishable from a prescribed cover distribution, such as ordinary text. The following results concern this public-key setting, without a pre-shared secret between sender and receiver.
Corollary 8.3 (Public-key encryption). Let a polynomial-time public-key encryption scheme have security parameter n n n . Assume:
IND-CPA security against nonuniform polynomial-size circuits and negligible correctness error.
Ciphertexts consist of a fixed polynomially bounded number of O ( log n ) O(\log n) O ( log n ) -bit tokens.
For any two distinct equal-length messages of polynomial length, their ciphertext distributions cannot both be sampled with negligible KL-divergence by sequential samplers with poly ( n ) \operatorname{poly}(n) poly ( n ) -size circuits and O ( log n ) O(\log n) O ( log n ) private bits. The public key, message, and visible prefix are available at every step; divergence is measured jointly with the public key.
Corollary 8.4 (Public-key steganography). Let a public-key steganography scheme run in polynomial time, with security parameter n n n . Fix two distinct messages of polynomial length. Assume:
Negligible decoding error; both encodings consist of the same fixed polynomially bounded number of O ( log n ) O(\log n) O ( log n ) -bit tokens.
Both encodings are computationally indistinguishable from the same cover distribution, jointly with the public key, against nonuniform polynomial-size circuits.
The two encoding distributions cannot both be sampled with negligible KL-divergence by sequential samplers with poly ( n ) \operatorname{poly}(n) poly ( n ) -size circuits and O ( log n ) O(\log n) O ( log n ) private bits. The public key, message, and visible prefix are available at every step; divergence is measured jointly with the public key.
Proof of the three corollaries. For the PRG, we describe it for left-to-right ordering, but the same argument holds for any fixed known ordering up to applying permutation. Put Y = G ( U k ( n ) ) Y = G(U_{k(n)}) Y = G ( U k ( n ) ) . For uniform I ∈ [ n ] I \in[n] I ∈ [ n ] and an independent uniform bit B B B , the distributions ( I , Y < I , Y I ) (I, Y_{<I}, Y_I) ( I , Y < I , Y I ) and ( I , Y < I , B ) (I, Y_{<I}, B) ( I , Y < I , B ) are computationally indistinguishable: replacing Y Y Y by U n U_n U n on both sides makes them identical. Thus Y Y Y has next-bit pseudoentropy n n n , whereas H ( Y ) ≤ k ( n ) < n H(Y) \le k(n) < n H ( Y ) ≤ k ( n ) < n . Corollary 8.1 applies with constant visible input.
For the remaining claims, let P b = ( W , Y b ) P_b = (W, Y^b) P b = ( W , Y b ) be the two encoding distributions, including their common public key or setup W W W . Write N N N for the number of tokens and u = 2 ℓ u = 2^\ell u = 2 ℓ for the alphabet size, where ℓ \ell ℓ is the token length. They are computationally indistinguishable and satisfy Δ ( P 0 , P 1 ) ≥ 1 − negl ( n ) \Delta(P_0, P_1) \ge1 - \operatorname{negl}(n) Δ ( P 0 , P 1 ) ≥ 1 − negl ( n ) . For encryption and steganography, correctness gives the distance bound: appending the secret key preserves distance, since it is independent of the encoding given the public key. Steganographic security gives indistinguishability through the common cover.
Suppose towards contradiction that both samplers exist. We distinguish P 0 P_0 P 0 from P 1 P_1 P 1 in three steps.
Remove the private state. Put α = 1 / ( 100 N ) \alpha= 1/(100N) α = 1/ ( 100 N ) . Apply Theorem 4.3 with KL error α 2 / 4 \alpha^2/4 α 2 /4 , keeping W W W visible. By Fact 2.5 and the assumed negligible sampling error, the resulting polynomial-size stateless samplers D b D^b D b satisfy Δ ( P b , R b ) ≤ α \Delta(P_b, R_b) \le\alpha Δ ( P b , R b ) ≤ α , where R b = ( W , D b ( W ) ) R_b = (W, D^b(W)) R b = ( W , D b ( W )) . Hence Δ ( R 0 , R 1 ) ≥ 1 / 3 \Delta(R_0, R_1) \ge1/3 Δ ( R 0 , R 1 ) ≥ 1/3 for all sufficiently large $n.
Find a differing transition. Replacing the circuits of D 0 D^0 D 0 by those of D 1 D^1 D 1 one at a time gives an index i i i such that, for X = ( W , D 0 ( W ) < i ) X = (W,D^0(W)_{<i}) X = ( W , D 0 ( W ) < i ) and A b ← D i b ( X ) A_b \leftarrow D_i^b(X) A b ← D i b ( X ) with fresh coins, d : = Δ ( ( X , A 0 ) , ( X , A 1 ) ) ≥ 1 / ( 3 N ) d := \Delta((X,A_0),(X,A_1)) \ge1/(3N) d := Δ (( X , A 0 ) , ( X , A 1 )) ≥ 1/ ( 3 N ) . Each hybrid uses the message-0 prefix and a common message-1 suffix, which cannot increase distance. Yet every polynomial-size test distinguishes these pairs with advantage at most 4 α + negl ( n ) 4\alpha+ \operatorname{negl}(n) 4 α + negl ( n ) : replacing the R 0 R_0 R 0 prefix by the R 1 R_1 R 1 prefix through P 0 P_0 P 0 , P 1 P_1 P 1 before invoking D i 1 D_i^1 D i 1 costs 2 α + negl ( n ) 2\alpha+ \operatorname{negl}(n) 2 α + negl ( n ) , and comparing the two honest prefixes including token i i i costs the same amount.
Test the transition probabilities. On input ( x , a ) (x,a) ( x , a ) , draw M = ⌈ 576 u N 2 ⌉ M = \lceil576uN^2\rceil M = ⌈ 576 u N 2 ⌉ samples from each D i b ( x ) D_i^b(x) D i b ( x ) , and accept if a a a occurs more often in the first batch. Write p b p_b p b for the true token distribution and p ^ b \widehat{p}_b p b for its empirical distribution. By Cauchy–Schwarz, E ∥ p ^ b − p b ∥ 1 ≤ u / M ≤ 1 / ( 24 N ) \mathbb{E}\|\widehat{p}_b-p_b\|_1 \le\sqrt{u/M} \le1/(24N) E ∥ p b − p b ∥ 1 ≤ u / M ≤ 1/ ( 24 N ) . Choosing the larger empirical probability loses at most ∥ p ^ 0 − p 0 ∥ 1 + ∥ p ^ 1 − p 1 ∥ 1 \|\widehat{p}_0-p_0\|_1 + \|\widehat{p}_1-p_1\|_1 ∥ p 0 − p 0 ∥ 1 + ∥ p 1 − p 1 ∥ 1 relative to the optimal token test. Averaging over X X X , our test therefore has advantage at least d − 1 / ( 12 N ) ≥ 1 / ( 4 N ) d - 1/(12N) \ge1/(4N) d − 1/ ( 12 N ) ≥ 1/ ( 4 N ) , contradicting the preceding upper bound.
The index i i i is nonuniform advice, and all circuits have polynomial size. The test’s random coins can be fixed by averaging.
The transition-testing argument also gives an alternative proof of the PRG claim. Take W W W constant, N = n N = n N = n , ℓ = 1 \ell= 1 ℓ = 1 , and u = 2 u = 2 u = 2 , with P 0 = G ( U k ( n ) ) P_0 = G(U_{k(n)}) P 0 = G ( U k ( n ) ) and P 1 = U n P_1 = U_n P 1 = U n . These distributions are computationally indistinguishable, while the support-size bound gives
Δ ( P 0 , P 1 ) ≥ 1 − 2 k ( n ) − n ≥ 1 / 2. \Delta(P_0,P_1) \ge1 - 2^{k(n)-n} \ge1/2. Δ ( P 0 , P 1 ) ≥ 1 − 2 k ( n ) − n ≥ 1/2.
The sampler for P 1 P_1 P 1 draws independent uniform bits exactly, so a hypothesized sampler for P 0 P_0 P 0 supplies both samplers needed above. With α = 1 / ( 100 n ) \alpha= 1/(100n) α = 1/ ( 100 n ) , the first step gives Δ ( R 0 , R 1 ) ≥ 1 / 2 − 2 α ≥ 1 / 3 \Delta(R_0,R_1) \ge1/2 - 2\alpha\ge1/3 Δ ( R 0 , R 1 ) ≥ 1/2 − 2 α ≥ 1/3 for all sufficiently large n n n . The remaining two steps, applied to this pair of distributions, yield the same contradiction. As above, any fixed known ordering is handled by permuting the coordinates.
Insertional versus Left-to-Right Token Generation
Stern et al. [15 ] introduce an insertion framework and implement it with the Insertion Transformer . Given an input sequence x x x and the current partial output w w w , called the canvas , the model assigns a joint distribution p ( a , j ∣ x , w ) p(a,j \mid x,w) p ( a , j ∣ x , w ) to the next token a a a and its insertion position j j j . The decoder’s hidden states are recomputed after each insertion, so earlier computation leaves no private state beyond the canvas [15 Section 4.5] .
To connect this framework to ours, fix the input x x x and the output length, and consider sampling one insertion per step with fresh coins. This is a sampling version of their framework; their decoding procedures choose maximum-probability actions, either serially or in parallel [15 Section 5] . Allowing arbitrary randomized circuits for these transitions gives exactly our stateless insertional samplers, up to polynomial overhead (Definition 5.1 ). Indeed, a token and position determine the next canvas; conversely, a one-token extension determines a valid insertion by locating a token whose deletion recovers the old canvas. Restricting every insertion to the rightmost position gives stateless sequential sampling.
Our separation now gives a computational motivation for insertion-based models. Assuming one-way functions secure against polynomial-size circuits exist, Proposition 7.1 shows that efficient insertional generation can exactly sample distributions over binary strings that efficient left-to-right generation cannot sample even with small KL error. The advantage already appears with one insertion per step: the generator can produce information needed for later decisions before filling in earlier output positions. Thus choosing where to write can expand what is efficiently generatable without adding private memory or requiring parallel decoding. Indeed, as we have shown in Corollary 8.2 and theorem 6.1, while PRGs are hard to sample for sequential samplers (for any fixed ordering), even with O ( log n ) O(\log n) O ( log n ) bits of state, this is not the case for insertional samplers. Moreover, the notion of insertional generation does not seem to be captured by the monotone compression notion of [13 ] . This gives further motivation to explore this model of computation (as well as models that allow deletions or substitutions).
Acknowledgements
We thank Adam Kalai for discussions that initiated this research. G.A., A.R., and P.L. are supported by the European Research Council (ERC) under the EU’s Horizon 2020 research and innovation programme (Grant agreement No. 101019547) and by a Cariplo CRYPTONOMEX grant. The majority of this work was done while G.A. was a postdoctoral fellow at Bocconi University. G.M. is supported by the European Research Council through an ERC Starting Grant (Grant agreement No. 101077455, ObfusQation) and by the Deutsche Forschungsgemeinschaft (DFG, German Research Foundation) under Germany’s Excellence Strategy - EXC 2092 CASA – 390781972. A.B. and L.T. are supported by an NSERC Discovery Grant.
AI use statement
The core research ideas are due to the authors. We used large language models, specifically Chat-GPT 6 Astra, to assist with writing and revising the manuscript, including proofs, and to help check mathematical arguments for gaps and errors. The authors take full responsibility for the final content of the paper, including its claims, proofs, and references.
Bibliography