SlowGuess/NeurIPS_2023_OCR huggingface dataset:
$$
\varepsilon (r (x)) \stackrel {\text {d e f}} {=} \mathbb {E} _ {\tilde {T} \sim P _ {\tilde {T} | \tilde {X} = x}} \left[ \Gamma (n, \tilde {T} - \tilde {\mu} (\tilde {T})) \right] = \frac {1}{r (x)} \int_ {0} ^ {\sigma (r (x))} \Gamma (n, t - \tilde {\mu} (t)) \left(\sigma^ {- 1}\right) ^ {\prime} (t) d t. \tag {89}
$$
Substituting  $h = r(x)$ , we now show that  $\epsilon$  is a decreasing function, which proves the lemma. To this end, regardless of the image of the density ratio  $r(\Omega)$ , extend the definition of  $\epsilon$  to the entirety of  $(0, \operatorname{ess} \sup r(x))$ . Now, observe, that
$$
\frac {d \varepsilon}{d h} = \frac {1}{h ^ {2}} \left(h \cdot \Gamma (n, \sigma (h) - \tilde {\mu} (\sigma (h))) \cdot \overbrace {\left(\sigma^ {- 1}\right) ^ {\prime} (\sigma (h)) \cdot \sigma^ {\prime} (h)} ^ {= 1 \text {b y i n v e r s e f u n c t i o n t h e o r e m}} - \int_ {0} ^ {\sigma (h)} \Gamma (n, t - \tilde {\mu} (t)) (\sigma^ {- 1}) ^ {\prime} (t) d t\right). \tag {90}
$$
Focussing on the integral, via integration by parts we find
$$
\int_ {0} ^ {\sigma (h)} \Gamma (n, t - \tilde {\mu} (t)) (\sigma^ {- 1}) ^ {\prime} (t) d t = \tag {91}
$$
$$
h \cdot \Gamma (n, \sigma (h) - \tilde {\mu} (\sigma (h))) + \int_ {0} ^ {\sigma (h)} (t - \tilde {\mu} (t)) ^ {(n - 1)} e ^ {- (t - \tilde {\mu} (t))} (1 - w _ {P} (\sigma^ {- 1} (t))) \sigma^ {- 1} (t) d t. \tag {92}
$$
Plugging this back into the above calculation, we get
$$
\frac {d \varepsilon}{d h} = - \frac {1}{h ^ {2}} \int_ {0} ^ {\sigma (h)} (t - \tilde {\mu} (t)) ^ {(n - 1)} e ^ {- (t - \tilde {\mu} (t))} (1 - w _ {P} (\sigma^ {- 1} (t))) \sigma^ {- 1} (t) d t. \tag {93}
$$
Note, that since the integrand is positive and  $h$  was arbitrary,  $\frac{d\epsilon}{dh}$  is negative for every  $h$  in its domain, which proves the lemma.
Returning to Equation (83), we now examine the two cases  $M < N$  and  $M = N$  separately.
Case  $M < N$ : In this case, we have the following inequalities:
-  $r(x) \leq r(X_M)$  by the definition of  $M$ . Applying  $\sigma$  to both sides we find  $\varphi(x) \leq \varphi(X_M)$ .
-  $\varphi(X_M) < T_M$ , since  $M < N$  and by definition  $N$  is the index of the first arrival of  $\Pi$  under the graph of  $\varphi$ .
Now, note that since  $M < N$  conditioned on  $T_{M}$ , the first  $M - 1$  points of  $\Pi$  are all rejected and hence are all in  $\tilde{\Pi}^{C} = \Pi \setminus \tilde{\Pi}$ . Thus,  $M - 1 \mid (M < N, T_{M})$  is Poisson distributed with mean  $T_{M} - \tilde{\mu}(T_{M})$ . Hence,
$$
\begin{array}{l} \mathbb {E} [ M \mid M <   N ] = 1 + \mathbb {E} [ M - 1 \mid M <   N ] (94) \\ = 1 + \mathbb {E} _ {T _ {M} \sim P _ {T _ {M} \mid M <   N}} \left[ \mathbb {E} [ M - 1 \mid M <   N, T _ {M} ] \right] (95) \\ = 1 + \mathbb {E} _ {T _ {M} \sim P _ {T _ {M} \mid M <   N}} \left[ T _ {M} - \tilde {\mu} \left(T _ {M}\right) \right] (96) \\ \geq 1 + \mathbb {E} _ {T _ {M} \sim P _ {T _ {M} | M <   N}} [ \varphi (x) - \tilde {\mu} (\varphi (x)) ] (97) \\ = 1 + \varphi (x) - \tilde {\mu} (\varphi (x)). (98) \\ \end{array}
$$
On the other hand, since the  $N$ -th point is the index of first arrival of  $\Pi$  under the graph of  $\varphi$ , hence  $\tilde{T} \leq \varphi(\tilde{X})$ . Furthermore, conditioning on  $\tilde{X} = x$  we get  $\tilde{T} \leq \varphi(x)$ . Similarly to the above case  $N - 1 \mid \tilde{T}$  is Poisson distributed with mean  $\tilde{T} - \tilde{\mu}(\tilde{T})$ . Hence, we get
$$
\begin{array}{l} \mathbb {E} [ N \mid \tilde {X} = x ] = 1 + \mathbb {E} _ {\tilde {T} | \tilde {X} = x} \left[ \mathbb {E} [ N - 1 \mid \tilde {X} = x, \tilde {T} ] \right] (99) \\ = 1 + \mathbb {E} _ {\tilde {T} | \tilde {X} = x} \left[ \tilde {T} - \tilde {\mu} (\tilde {T}) \right] (100) \\ \geq 1 + \mathbb {E} _ {\tilde {T} | \tilde {X} = x} [ \varphi (x) - \tilde {\mu} (\varphi (x)) ] (101) \\ = 1 + \varphi (x) - \tilde {\mu} (\varphi (x)). (102) \\ \end{array}
$$
Putting the above two inequalities, we find
$$
\mathbb {E} [ N \mid \tilde {X} = x ] \leq 1 + \varphi (x) - \tilde {\mu} (\varphi (x)) \leq \mathbb {E} [ M \mid M <   N ]. \tag {103}
$$
Case  $M = N$ : In this case, we have
$$
\mathbb {E} [ M \mid N = M ] = \mathbb {E} [ N \mid r (X _ {N}) \geq r (x) ] \tag {104}
$$
$$
\geq \mathbb {E} [ N \mid X _ {N} = \tilde {X} = x ], \tag {105}
$$
where Equation (105) follows by applying Lemma B.1.
Finally, putting these two cases together we find
$$
\frac {1}{w _ {P} (r (x))} = \mathbb {E} [ M ] \tag {106}
$$
$$
\geq \mathbb {E} [ M \mid N \geq M ] \tag {107}
$$
$$
\geq \mathbb {E} [ N \mid \tilde {X} = x ], \tag {108}
$$
which establishes Equation (77). Now, taking expectation over  $\tilde{X}$ , we get
$$
\mathbb {E} \left[ N ^ {\alpha} \right] \leq \int_ {\Omega} \frac {d Q (x)}{w _ {P} (r (x)) ^ {\alpha}} \tag {109}
$$
$$
= \int_ {\Omega} \frac {r (x)}{w _ {P} (r (x)) ^ {\alpha}} d P (x) \tag {110}
$$
$$
= \int_ {0} ^ {\infty} \frac {y}{w _ {P} (y) ^ {\alpha}} \int_ {\Omega} \delta (y - r (x)) d P (x) d y \tag {111}
$$
$$
= \int_ {0} ^ {\infty} \frac {y}{w _ {P} (y) ^ {\alpha}} \int_ {\Omega} \delta (y - r (x)) d P (x) d y \tag {112}
$$
$$
= \left[ - \frac {y \cdot w _ {P} (y) ^ {1 - \alpha}}{1 - \alpha} \right] _ {0} ^ {\infty} + \frac {1}{1 - \alpha} \int_ {0} ^ {\infty} w _ {P} (y) ^ {1 - \alpha} d y \tag {113}
$$
$$
= \frac {1}{1 - \alpha} \int_ {0} ^ {\infty} w _ {P} (y) ^ {1 - \alpha} d y. \tag {114}
$$
In the above, Equation (113) follows by integration by parts and from the fact that
$$
w _ {P} (h) = \int_ {\Omega} \mathbf {1} [ r (x) \geq h ] d P (x) \tag {115}
$$
$$
= 1 - \int_ {0} ^ {h} \int_ {\Omega} \delta (\eta - r (x)) d P (x) d \eta . \tag {116}
$$
We now note that we can bound  $w_{P}$  using Markov's inequality:
$$
\begin{array}{l} w _ {P} (h) = \mathbb {P} _ {Z \sim P} [ r (Z) \geq h ] (117) \\ = \mathbb {P} _ {Z \sim P} \left[ r (Z) ^ {\frac {1}{1 - \alpha}} \geq h ^ {\frac {1}{1 - \alpha}} \right] (118) \\ \leq h ^ {- \frac {1}{1 - \alpha}} \cdot \mathbb {E} _ {Z \sim P} \left[ r (Z) ^ {\frac {1}{1 - \alpha}} \right] (119) \\ = h ^ {- \frac {1}{1 - \alpha}} \cdot \mathbb {E} _ {Z \sim Q} \left[ r (Z) ^ {\frac {1}{1 - \alpha} - 1} \right] (120) \\ = h ^ {- \frac {1}{1 - \alpha}} \cdot \exp_ {2} \left(\frac {\alpha}{1 - \alpha} D _ {\frac {1}{1 - \alpha}} [ Q \| P ]\right). (121) \\ \end{array}
$$
Putting the above in Equation (114), we get
$$
\begin{array}{l} \mathbb {E} \left[ N ^ {\alpha} \right] \leq \frac {1}{1 - \alpha} \int_ {0} ^ {\infty} w _ {P} (y) ^ {1 - \alpha} d y (122) \\ \leq \frac {1}{1 - \alpha} \left(1 + \int_ {1} ^ {\exp_ {2} \left(D _ {\infty} [ Q \| P ]\right)} w _ {P} (y) ^ {1 - \alpha} d y\right) (123) \\ \leq \frac {1}{1 - \alpha} \left(1 + \int_ {1} ^ {\exp_ {2} \left(D _ {\infty} [ Q \| P ]\right)} \frac {1}{y} d y \cdot \exp_ {2} \left(\alpha D _ {\frac {1}{1 - \alpha}} [ Q \| P ]\right)\right) (124) \\ \leq \frac {1}{1 - \alpha} \left(1 + \frac {D _ {\infty} [ Q \| P ]}{\log_ {2} e}\right) \cdot \exp_ {2} \left(\alpha D _ {\frac {1}{1 - \alpha}} [ Q \| P ]\right). (125) \\ \end{array}
$$
B.4 The Codelength of the Index
As discussed in Section 3, Alice and Bob can realize a one-shot channel simulation protocol using GPRS for a pair of correlated random variables  $\mathbf{x},\mathbf{y}\sim P_{\mathbf{x},\mathbf{y}}$  if they have access to shared randomness and can simulate samples from  $P_{\mathbf{x}}$ . In particular, after receiving  $\mathbf{y}\sim P_{\mathbf{y}}$ , Alice runs GPRS with proposal distribution  $P_{\mathbf{x}}$  and target  $P_{\mathbf{x}|\mathbf{y}}$ , and the shared randomness to simulate the Poisson process  $\Pi$ . She then encodes the index  $N$  of the first arrival of  $\Pi$  under the graph of  $\varphi$ . Bob can decode Alice's sample  $\mathbf{x}\sim P_{\mathbf{x}|\mathbf{y}}$  by simulating the same  $N$  samples from  $\Pi$  using the shared randomness. The question is, how efficiently can Alice encode  $N$ ? We answer this question by following the approach of Li & El Gamal (2018). Namely, we first bound the conditional expectation  $\mathbb{E}[\log_2N\mid \mathbf{y} = \mathbf{y}]$  after which we average over  $\mathbf{y}$  to bound  $\mathbb{E}[\log_2N]$ . Then, we use the maximum entropy distribution subject to the constraint of fixed  $\mathbb{E}[\log_2N]$  to bound  $\mathbb{H}[N]$ . Finally, noting that  $\mathbf{x}$  is a function of  $\Pi$  and  $N$ , we get
$$
\begin{array}{l} \mathbb {H} [ \mathbf {x}, N \mid \Pi ] = \underbrace {\mathbb {H} [ \mathbf {x} \mid N , \Pi ]} _ {= 0} + \mathbb {H} [ N \mid \Pi ] (126) \\ = \underbrace {\mathbb {H} [ N \mid \mathbf {x} , \Pi ]} _ {= 0} + \mathbb {H} [ \mathbf {x} \mid \Pi ], (127) \\ \end{array}
$$
$$
\mathbb {H} [ \mathbf {x} \mid \Pi ] = \mathbb {H} [ N \mid \Pi ] \leq \mathbb {H} [ N ], \tag {128}
$$
which will finish the proof.
Bound on the conditional expectation: Fix  $\mathbf{y}$  and set  $Q = P_{\mathbf{x}|\mathbf{y}}$  and  $P = P_{\mathbf{x}}$  as GPRS's target and proposal distribution, respectively. Let  $(t,x)\in \mathbb{R}^{+}\times \Omega$  be a point under the graph of  $\varphi$ , i.e.  $\sigma^{-1}(t)\leq r(x)$ . Then,
$$
\begin{array}{l} r (x) \geq \sigma^ {- 1} (t) (129) \\ \stackrel {\text {e q .} (3 0)} {=} \int_ {0} ^ {t} \mathbb {P} [ \tilde {T} \geq \tau ] d \tau (130) \\ \geq t \cdot \inf  _ {\tau \in [ 0, t ]} \left\{\mathbb {P} [ \tilde {T} \geq \tau ] \right\} (131) \\ = t \cdot \mathbb {P} [ \tilde {T} \geq t ]. (132) \\ \end{array}
$$
From this, we get
$$
t + 1 \leq \frac {r (x)}{\mathbb {P} [ \tilde {T} \geq t ]} + 1 \leq \frac {r (x) + 1}{\mathbb {P} [ \tilde {T} \geq t ]}. \tag {133}
$$
Next, conditioning on the first arrival  $(\tilde{T},\tilde{X})$  we get
$$
\mathbb {E} \left[ \log_ {2} N \mid \tilde {T} = t, \tilde {X} = x \right] \leq \log_ {2} \left(\mathbb {E} [ N - 1 \mid \tilde {T} = t, \tilde {X} = x ] + 1\right) \tag {134}
$$
$$
\begin{array}{l} \stackrel {\text {e q .} (6 0)} {=} \log_ {2} (t - \tilde {\mu} (t) + 1) (135) \\ \leq \log_ {2} (t + 1) (136) \\ \end{array}
$$
$$
\begin{array}{l} \leq \log_ {2} (r (x) + 1) - \log_ {2} \mathbb {P} [ \tilde {T} \geq t ] (137) \\ = \log_ {2} (r (x) + 1) + \tilde {\mu} (t) \cdot \log_ {2} e, (138) \\ \end{array}
$$
where the first inequality follows by Jensen's inequality.
Now, by the law of iterated expectations, we find
$$
\begin{array}{l} \mathbb {E} \left[ \log_ {2} N \right] = \mathbb {E} _ {\tilde {X}} \left[ \mathbb {E} _ {\tilde {T} | \tilde {X}} \left[ \mathbb {E} \left[ \log_ {2} N \mid \tilde {T}, \tilde {X} \right] \right] \right] (139) \\ \leq \mathbb {E} _ {\tilde {X}} \left[ \log_ {2} \left(r (\tilde {X}) + 1\right) \right] + \underbrace {\mathbb {E} _ {\tilde {T}} \left[ \tilde {\mu} (\tilde {T}) \right]} _ {= 1 \text {b y e q . (6 5)}} \cdot \log_ {2} e (140) \\ = D _ {\mathrm {K L}} [ Q \| P ] + \mathbb {E} _ {\tilde {X}} \left[ \log_ {2} \left(1 + \frac {1}{r (\tilde {X})}\right) \right] + \log_ {2} e (141) \\ \leq D _ {\mathrm {K L}} [ Q \| P ] + \mathbb {E} _ {\tilde {X}} \left[ \log_ {e} \left(e ^ {\frac {1}{r (\tilde {X})}}\right) \right] \cdot \log_ {2} e + \log_ {2} e (142) \\ = D _ {\mathrm {K L}} [ Q \| P ] + 2 \cdot \log_ {2} e, (143) \\ \end{array}
$$
where the second inequality follows from switching to the natural base and using a first-order Taylor approximation for  $e^{\frac{1}{x}}$ .
Bound on the marginal expectation and entropy: Equation (143) is a one-shot bound, which yields
$$
\mathbb {E} \left[ \log_ {2} N \mid \mathbf {y} \right] \leq D _ {\mathrm {K L}} \left[ P _ {\mathbf {x} \mid \mathbf {y}} \| P _ {\mathbf {x}} \right] + 2 \cdot \log_ {2} e. \tag {144}
$$
Taking expectation over  $\mathbf{y} \sim P_{\mathbf{y}}$ , we get
$$
\mathbb {E} \left[ \log_ {2} N \right] \leq I [ \mathbf {x}; \mathbf {y} ] + 2 \cdot \log_ {2} e. \tag {145}
$$
Finally, following Proposition 4 in Li & El Gamal (2018), the maximum entropy distribution for  $N$  subject to a constraint on  $\mathbb{E}[\log_2N]$  obeys
$$
\mathbb {H} [ N ] \leq \mathbb {E} \left[ \log_ {2} N \right] + \log \left(\mathbb {E} \left[ \log_ {2} N \right] + 1\right) + 1. \tag {146}
$$
Plugging in Equation (145) into the above, we get
$$
\begin{array}{l} \mathbb {H} [ N ] \leq I [ \mathbf {x}; \mathbf {y} ] + \log_ {2} (I [ \mathbf {x}; \mathbf {y} ] + 2 \log_ {2} e + 1) + 2 \log_ {2} e + 1 (147) \\ \leq I [ \mathbf {x}; \mathbf {y} ] + \log_ {2} (I [ \mathbf {x}; \mathbf {y} ] + 1) + 2 \log_ {2} e + 1 + \log_ {2} (2 \log_ {2} e + 1) (148) \\ \approx I [ \mathbf {x}; \mathbf {y} ] + \log_ {2} (I [ \mathbf {x}; \mathbf {y} ] + 1) + 5. 8 4 (149) \\ <   I [ \mathbf {x}; \mathbf {y} ] + \log_ {2} (I [ \mathbf {x}; \mathbf {y} ] + 1) + 6. (150) \\ \end{array}
$$
Similarly to Li & El Gamal (2018), we can encode  $N$  using a Zeta distribution  $\zeta(n|s) \propto n^{-s}$  with
$$
s \stackrel {\text {d e f}} {=} \frac {1}{I [ \mathbf {x} ; \mathbf {y} ] + 2 \log_ {2} e}. \tag {151}
$$
With this choice of the coding distribution, the expected codelength of  $N$  is upper bounded by  $I[\mathbf{x};\mathbf{y}] + \log_2(I[\mathbf{x};\mathbf{y}] + 1) + 7$  bits.
C Analysis of Parallel GPRS
Parallel GPRS (PGPRS) is a general technique to accelerate GPRS when parallel computing power is available and is presented in Section 3.1. Assuming that  $J$  parallel threads are available, for target distribution  $Q$  and proposal  $P$ , PGPRS simulates  $J$  Poisson processes  $\Pi_1, \ldots, \Pi_J$  in parallel, all of them with mean measure  $\mu_i \stackrel{\text{def}}{=} \frac{\lambda}{J} \times P$ . Assuming  $\left\{\left(T_{N_1}^{(1)}, X_{N_1}^{(1)}\right), \ldots, \left(T_{N_J}^{(J)}, X_{N_J}^{(J)}\right)\right\}$  are the first arrivals of  $\Pi_1, \ldots, \Pi_J$  under  $\varphi$ , respectively, PGPRS selects the arrival with the overall smallest arrival time  $J^* = \arg \min_{j \in \{1, \ldots, J\}} \left\{T_{N_j}^{(j)}\right\}$ . By the superposition theorem (Kingman, 1992),  $\cup_{j=1}^{J} \Pi_j = \Pi$  is a Poisson process with mean measure  $\mu = \lambda \times P$ , hence  $\left(T_{N_{J^*}}^{(J^*)}, X_{N_{J^*}}^{(J^*)}\right)$  will be the first arrival of  $\Pi$  under the graph of  $\varphi$  and the theoretic construction in Appendix A therefore guarantees the correctness of PGPRS.
Expected runtime: We will proceed similarly to the analysis in Appendix B.2. Concretely, let  $\tilde{T} = T_{N_{J^*}}^{(J^*)}$  be the first arrival time of  $\Pi$  under the graph of  $\varphi$ . Let
$$
\left. \nu_ {j} \stackrel {\text {d e f}} {=} \left| \left\{(T, X) \in \Pi_ {j} \mid T <   \tilde {T}, T > \varphi (X) \right\} \right| \right. \tag {152}
$$
be the number of points in  $\Pi_j$  that are rejected before the global first arrival occurs. By an independence argument analogous to the one given in Appendix B.2, the  $\nu_1,\ldots ,\nu_J$  are independent Poisson random variables, each distributed with mean
$$
\mathbb {E} \left[ \nu_ {j} \mid \tilde {T} \right] = \frac {1}{J} \left(\tilde {T} - \tilde {\mu} (\tilde {T})\right). \tag {153}
$$
Hence, by the law of iterated expectations, we find that we get
$$
\mathbb {E} \left[ \nu_ {j} \right] \stackrel {\text {e q . (6 2)}} {=} \frac {r ^ {*} - 1}{J} \tag {154}
$$
rejections in each of the  $J$  threads on average before the global first arrival occurs. Now, a thread  $j$  terminates either when the global first arrival occurs in it or when the thread's current arrival time  $T_{n_j}^{(j)}$  provably exceeds the global first arrival time. Thus, on average, each thread will have one more rejection compared to Equation (154). Hence the average runtime of a thread is
$$
\mathbb {E} [ \nu_ {j} + 1 ] = \frac {r ^ {*} - 1}{J} + 1, \tag {155}
$$
and the average number of samples simulated by PGPRS across all its threads is
$$
J \cdot \left(\frac {r ^ {*} - 1}{J} + 1\right) = r ^ {*} + J - 1. \tag {156}
$$
Variance of Runtime: Once again, similarly to Appendix B.2, we find by the law of iterated variances that the variance of the runtime in each of the  $j$  threads is
$$
\mathbb {V} [ \nu_ {j} + 1 ] = \mathbb {V} [ \nu_ {j} ] = \frac {r ^ {*} - 1}{J} + \frac {1}{J ^ {2}} (\mathbb {V} [ \tilde {T} ] + 1), \tag {157}
$$
meaning that we make an  $\mathcal{O}(1 / J)$  reduction in the variance of the runtime compared to regular GPRS.
**Codelength:** PGPRS can also realize a one-shot channel simulation protocol for a pair of correlated random variables  $\mathbf{x}, \mathbf{y} \sim P_{\mathbf{x}, \mathbf{y}}$ . For a fixed  $\mathbf{y} \sim P_{\mathbf{y}}$ , Alice applies PGPRS to the target  $Q = P_{\mathbf{x}|\mathbf{y}}$  and proposal  $P = P_{\mathbf{x}}$ , and encodes the two-part code  $(J^{*}, N_{J^{*}})$ . Bob can then simulate  $N_{J^{*}}$  samples from  $\Pi_{J^{*}}$  and recover Alice's sample.
Encoding  $J^{*}$ : By the symmetry of the setup, the global first arrival will occur with equal probability in each subprocess  $\Pi_{j}$ . Hence  $J^{*}$  follows a uniform distribution on  $\{1, \dots, J\}$ . Therefore, Alice can encode  $J^{*}$  optimally using  $\lceil \log_2 J \rceil$  bits.
Encoding  $N_{J^{*}}$ : We can develop a bound using an almost identical argument to the one in Appendix B.4. In particular, by adapting the conditional bound in Equation (138) appropriately using Equation (155), we get
$$
\mathbb {E} \left[ \log_ {2} N _ {J ^ {*}} \mid \tilde {T} = t, \tilde {X} = x, J ^ {*} \right] \leq \log_ {2} (r (x) + 1) + \tilde {\mu} (t) \cdot \log_ {2} e - \log_ {2} J. \tag {158}
$$
Then, using this conditional bound and adapting Equation (143), we find
$$
\mathbb {E} \left[ \log_ {2} N _ {J ^ {*}} | \mathbf {y}, J ^ {*} \right] \leq D _ {\mathrm {K L}} \left[ P _ {\mathbf {x} | \mathbf {y}} \| P _ {\mathbf {x}} \right] + 2 \cdot \log_ {2} e - \log_ {2} J \tag {159}
$$
to obtain a one-shot bound. Taking expectation over  $\mathbf{y} \sim P_{\mathbf{y}}$ , we get
$$
\mathbb {E} \left[ \log_ {2} N _ {J ^ {*}} \mid J ^ {*} \right] \leq I [ \mathbf {x}; \mathbf {y} ] + 2 \cdot \log_ {2} e - \log_ {2} J, \tag {160}
$$
hence, by adapting the maximum entropy bound in Equation (150), we find
$$
\mathbb {H} \left[ N _ {J ^ {*}} \mid J ^ {*} \right] <   I [ \mathbf {x}; \mathbf {y} ] - \log_ {2} J + \log_ {2} \left(I [ \mathbf {x}; \mathbf {y} ] - \log_ {2} J + 1\right) + 6. \tag {161}
$$
Thus, we finally find that the entropy of the two-part code  $(J^{*},N_{J^{*}})$  is upper bounded by
$$
\mathbb {H} \left[ J ^ {*}, N _ {J ^ {*}} \right] <   I [ \mathbf {x}; \mathbf {y} ] + \log_ {2} \left(I [ \mathbf {x}; \mathbf {y} ] - \log_ {2} J + 1\right) + 7. \tag {162}
$$
Using a Zeta distribution  $\zeta (n\mid s)\propto n^{-s}$  to encode  $N_{J^{*}}\mid J^{*}$  with
$$
s \stackrel {\text {d e f}} {=} \frac {1}{I [ \mathbf {x} ; \mathbf {y} ] + 2 \cdot \log_ {2} e - \log_ {2} J}, \tag {163}
$$
we find that the expected codelength of the two-part code is upper bounded by
$$
\mathbb {H} \left[ J ^ {*}, N _ {J ^ {*}} \right] <   I [ \mathbf {x}; \mathbf {y} ] + \log_ {2} \left(I [ \mathbf {x}; \mathbf {y} ] - \log_ {2} J + 1\right) + 8 \text {b i t s}. \tag {164}
$$
D Simulating Poisson Processes Using Tree-Structured Partitions
Algorithm 7: Simulating a tree construction with another
Input: Proposal distribution  $P$  Target splitting function splittarget, Simulating splitting function splitsim, Target heap index  $H_{\mathrm{target}}$    
Output: Arrival  $(T,X)$  with heap index  $H_{\mathrm{target}}$  in  $\mathcal{T}_{\mathrm{target}}$  , and heap index  $H_{\mathrm{sim}}$  of the arrival in  $\mathcal{T}_{\mathrm{sim}}$ $\mathcal{P}\gets$  PriorityQueue   
 $B\gets \Omega$ $K\gets \lfloor \log_2H_{\mathrm{target}}\rfloor$ $X\sim P$ $T\sim \operatorname {Exp}(1)$ $\mathcal{P}.\mathrm{push}(T,X,\Omega ,1)$    
for  $k = 0,\ldots ,K$  do repeat T,X,C,H←P.pop() L,R← splitsim(C) if  $B\cap L\neq \emptyset$  then  $\Delta_L\sim \mathrm{Exp}(P(L))$ $T_{L}\leftarrow T + \Delta_{L}$ $X_{L}\sim P|_{L}$ $\mathcal{P}.\mathrm{push}(T_L,X_L,L,2H)$  end if  $B\cap R\neq \emptyset$  then  $\Delta_R\sim \mathrm{Exp}(P(R))$ $T_{R}\leftarrow T + \Delta_{R}$ $X_{R}\sim P|_{R}$ $\mathcal{P}.\mathrm{push}(T_R,X_R,R,2H + 1)$  end until  $X\in B$  /\*Exit loop when we find first arrival in  $B$  /\* if  $k <   K$  then  $\{B_0,B_1\} \gets \mathrm{split}_{\mathrm{target}}(B)$  d← [Htarget] mod 2  $B\gets B_d$  end   
end return  $T,X,H$
In this section, we examine an advanced simulation technique for Poisson processes, which is required to formulate the binary search-based variants of GPRS. We first recapitulate the tree-based simulation technique from (Flamich et al., 2022) and some important results from their work. Then, we present Algorithm 7, using which we can finally formulate the optimally efficient variant of GPRS in Appendix E. Note: For simplicity, we present the ideas for Poisson processes whose spatial measure  $P$  is non-atomic. These ideas can also be extended to atomic spatial measures with appropriate modifications.
Splitting functions: Let  $\Pi$  be a spatiotemporal Poisson process on some space  $\Omega$  with non-atomic spatial measure  $P$ . In this paragraph, we will not deal with  $\Pi$  itself yet, but the space on which it is defined and the measure  $P$ . Now, assume that there is a function split, which for any given Borel set  $B \subseteq \Omega$ , produces a (possibly random)  $P$ -essential partition of  $B$  consisting of two Borel sets, i.e.
$$
\operatorname {s p l i t} (B) = \{L, R \}, \text {s u c h t h a t} L \cap R = \emptyset \text {a n d} P (L \cup R) = P (B). \tag {165}
$$
The last condition simply allows split to discard some points from  $B$  that will not be included in either the left or right split. For example, if we wish to design a splitting function for a subset of
$B \subseteq \mathbb{R}^d$  to split  $B$  along some hyperplane, we do not need to include the points on the hyperplane in either set. The splitting function that always exists is the trivial splitting function, which just returns the original set and the empty set:
$$
\operatorname {s p l i t} _ {\text {t r i v i a l}} (B) = \{B, \emptyset \}. \tag {166}
$$
A more interesting example when  $\Omega = \mathbb{R}$  is the on-sample splitting function, where for a  $\mathbb{R}$ -valued random variable  $X\sim P|_{B}$  it splits  $B$  as
$$
\operatorname {s p l i t} _ {\text {o n - s a m p}} (B) = \left\{(- \infty , X) \cap B, (X, \infty) \cap B \right\}. \tag {167}
$$
This function is used by Algorithm 5 and AS* coding (Flamich et al., 2022). Another example is the dyadic splitting function operating on a bounded interval  $(a,b)$ , splitting as
$$
\operatorname {s p l i t} _ {\mathrm {d y a d}} ((a, b)) = \left\{\left(a, \frac {a + b}{2}\right), \left(\frac {a + b}{2}, b\right) \right\}. \tag {168}
$$
We call this dyadic because when we apply this splitting function to  $(0,1)$  and subsets produced by applying it, we get the set of all intervals with dyadic endpoints on  $(0,1)$ , i.e.  $\{(0,1),(0,1/2),(1/2,1),(0,1/4),\ldots\}$ . This splitting function is used by Algorithm 6 and AD* coding. As one might imagine, there might be many more possible splitting functions than the two examples we give above, all of which might be more or less useful in practice.
Split-induced binary space partitioning tree: Every splitting function on a space  $\Omega$  induces an infinite set of subsets by repeatedly applying the splitting function to the splits it produces. These sets can be organised into an infinite binary space partitioning tree (BSP-tree), where each node in the tree is represented by a set produced by split and an unique index. Concretely, let the root of the tree be represented by the whole space  $\Omega$  and the index  $H_{\mathrm{root}} = 1$ . Now we recursively construct the rest of the tree as follows: Let  $(B,H)$  be a node in the tree, with  $B$  a Borel set and  $H$  its index, and let  $\{L,R\} = \mathrm{split}(B)$  be the left and right splits of  $B$ . Then, we set  $(L,2H)$  as the node's left child and  $(R,2H + 1)$  as its right child. We refer to each node's associated index as their heap index.