SlowGuess/NeurIPS_2023_OCR huggingface dataset:
Maxence Noble*
CMAP, CNRS, École polytechnique,
Institut Polytechnique de Paris,
91120 Palaiseau, France
Department of Statistics,
Computer Science Department,
ENS, CNRS, PSL University
Alain Oliviero Durmus
Multi-marginal Optimal Transport (mOT), a generalization of OT, aims at minimizing the integral of a cost function with respect to a distribution with some prescribed marginals. In this paper, we consider an entropic version of mOT with a tree-structured quadratic cost, i.e., a function that can be written as a sum of pairwise cost functions between the nodes of a tree. To address this problem, we develop Tree-based Diffusion Schrödinger Bridge (TreeDSB), an extension of the Diffusion Schrödinger Bridge (DSB) algorithm. TreeDSB corresponds to a dynamic and continuous state-space counterpart of the multi-marginal Sinkhorn algorithm. A notable use case of our methodology is to compute Wasserstein barycenters which can be recast as the solution of a mOT problem on a star-shaped tree. We demonstrate that our methodology can be applied in high-dimensional settings such as image interpolation and Bayesian fusion.
In the last decade, computational Optimal Transport (OT) has shown great success with applications in various fields such as biology (Schiebinger et al., 2019; Bunne et al., 2022), shape correspondence (Su et al., 2015; Feydy et al., 2017; Eisenberger et al., 2020), control theory (Bayraktar et al., 2018; Acciaio et al., 2019) and computer vision (Schmitz et al., 2018; Carion et al., 2020). While OT commonly seeks at computing the transport plan that minimizes the cost of moving between two distributions, it can naturally be extended to the multi-marginal setting (mOT) when considering several distributions. This extension of OT has notably been studied in quantum chemistry (Cotar et al., 2013), clustering (Cuturi & Doucet, 2014) and statistical inference (Srivastava et al., 2018). In particular, a popular application in unsupervised learning of mOT with Euclidean cost consists in computing the Wasserstein barycenter of a set of probability distributions (Agueh & Carlier, 2011; Benamou et al., 2015; Alvarez-Esteban et al., 2016; Peyre et al., 2019).
Interior point methods can be used to solve OT and mOT problems but they come with computational challenges (Pele & Werman, 2009). In order to mitigate these limitations, one often considers an entropic regularization of OT, known as Entropic OT (EOT). This regularized formulation can be efficiently solved in discrete state-spaces using the celebrated Sinkhorn algorithm (Cuturi, 2013; Knight, 2008; Sinkhorn & Knopp, 1967), which admits a continuous state-space counterpart referred
*Corresponding author. Contact at: maxence.noble-bourillot@polytechnique.edu.
to as the Iterative Proportional Fitting (IPF) procedure (Fortet, 1940; Kullback, 1968; Ruschendorf, 1995). In the case of a quadratic cost, EOT is equivalent to the static formulation of the Schrödinger Bridge (SB) problem (Schrödinger, 1932). Given a reference diffusion with finite time horizon  $T$  and two probability measures, solving SB amounts to finding the closest diffusion to the reference (in terms of Kullback-Leibler divergence on path spaces) with the given marginals at times  $t = 0$  and  $t = T$ . This framework naturally arises in stochastic control (Dai Pra, 1991) where one aims at controlling the marginal distribution of a stochastic process at a fixed time. Recently, De Bortoli et al. (2021) introduced Diffusion Schrödinger Bridge (DSB), an approximation of a dynamic version of the IPF scheme on path spaces, see also Vargas et al. (2021); Chen et al. (2022). This methodology leverages advances in the field of denoising diffusion models (Song et al., 2021; Ho et al., 2020) in order to derive a scalable and efficient scheme to solve SB, and thus EOT.
Similarly to OT, mOT admits an entropic regularization (EmOT), which can be solved via a multi-marginal generalization of Sinkhorn/IPF algorithm (Benamou et al., 2015; Marino & Gerolin, 2020). Recently, Haasler et al. (2021) proposed an extension of the static SB problem in discrete state-space to any multi-marginal tree-based setting. They notably made the correspondence between this formulation and EmOT, when the cost function writes as the sum of interaction energies onto the given tree structure, and introduced an efficient version of Sinkhorn algorithm to solve it.
Motivations and contributions. In this work, we investigate the continuous and dynamic counterpart of the tree-based framework from Haasler et al. (2021). To be more specific, we present an extension of the static SB formulation in continuous state-space to any multi-marginal tree-based setting, referred to as TreeSB. Then, we establish the equivalence between TreeSB and a formulation of EmOT relying on a (quadratic) tree-structured cost function, analogously to Haasler et al. (2021). Inspired by DSB, we develop TreeDSB, a dynamic counterpart of the multi-marginal IPF (mIPF) to solve it, by operating on path spaces and using score-based diffusion techniques. To bridge gaps in literature, we prove the convergence of mIPF iterations in a non-compact setting under mild assumptions, by extending results on IPF convergence (Ruschendorf, 1995). Finally, we illustrate our approach on examples of Wasserstein barycenters from statistical inference and image processing.
Although our approach can be applied to any tree, we focus on star-shaped trees. In this setting, we show that TreeSB reduces to a regularized Wasserstein barycenter problem. Our method comes with several benefits compared to existing works. First, it is out-of-sample, i.e., it does not require re-running the full procedure when given a new data point. Second, our formulation of the Wasserstein barycenter problem obtained from TreeSB allows us to avoid numerical issues of having to choose the regularization too small, see Section 5. Finally, to the best of our knowledge, this is the first methodology to extend ideas from diffusion-based models to the computation of Wasserstein barycenters. In particular, we believe that the idea of iterative refinement, i.e., solving the dynamic counterpart of a static problem, plays a key role in the efficiency and scalability of the method.
Notation. For any measurable space  $(\mathsf{X},\mathcal{X})$ , we denote by  $\mathcal{P}(\mathsf{X})$  the space of probability measures defined on  $(\mathsf{X},\mathcal{X})$ . Unless specified,  $\mathcal{X}$  is defined as the Borel sets on  $\mathsf{X}$ . For any  $\ell \in \mathbb{N}$ , let  $\mathcal{P}^{(\ell)} = \mathcal{P}((\mathbb{R}^d)^{\ell})$ ; we denote  $\mathcal{P}^{(1)}$  by  $\mathcal{P}$ . Assume that  $\mathsf{X} = (\mathbb{R}^d)^{\ell}$  for some  $\ell \in \mathbb{N}$ . For any  $x \in \mathsf{X}$  and any  $m, n \in \{0,\dots,\ell\}$  such that  $m \leq n$ , let  $x_{m:n} = (x_m, x_{m+1},\ldots,x_n)$ . Let  $\operatorname{Leb}$  be the Lebesgue measure. For any non-negative function  $f: \mathsf{X} \to \mathbb{R}_+$ , such that  $\int_{\mathsf{X}} f \, \mathrm{dLeb} < +\infty$ , define  $\mathrm{H}(f) = -\int_{\mathsf{X}} f \log f \, \mathrm{dLeb} \in (-\infty, +\infty]$ . For any distribution  $\mu \in \mathcal{P}(\mathsf{X})$ , we define the entropy of  $\mu$  as  $\mathrm{H}(\mu) = \mathrm{H}(\mathrm{d}\mu/\mathrm{dLeb})$  if  $\mu \ll \operatorname{Leb}$  and  $\mathrm{H}(\mu) = +\infty$  otherwise. For any two arbitrary measures  $\mu$  and  $\nu$  defined on  $(\mathsf{X},\mathcal{X})$ , define the Kullback-Leibler divergence between  $\mu$  and  $\nu$  as  $\mathrm{KL}(\mu|\nu) = \int_{\mathsf{X}} \log (\mathrm{d}\mu/\mathrm{d}\nu) \, \mathrm{d}\mu - \int_{\mathsf{X}} \mathrm{d}\mu + \int_{\mathsf{X}} \mathrm{d}\nu$  if  $\mu \ll \nu$  and  $\mathrm{KL}(\mu|\nu) = +\infty$  otherwise. For any  $T > 0$ , we denote by  $\mathrm{C}([0,T],\mathbb{R}^d)$  the space of continuous functions from  $[0,T]$  to  $\mathbb{R}^d$ . For any path measure  $\mathbb{P} \in \mathcal{P}(\mathrm{C}([0,T],\mathbb{R}^d))$ , we denote by  $\mathrm{Ext}(\mathbb{P}) \in \mathcal{P}^{(2)}$  the coupling between the extremal distributions of  $\mathbb{P}$ , i.e.,  $\mathrm{Ext}(\mathbb{P}) = \mathbb{P}_{0,T}$ . Note that, for a given coupling  $\pi_{0,T} \in \mathcal{P}^{(2)}$ , there may exist several path measures  $\mathbb{P}$  verifying  $\mathrm{Ext}(\mathbb{P}) = \pi_{0,T}$ . For any undirected tree  $\mathsf{T} = (\mathsf{V},\mathsf{E})$  with vertices  $\mathsf{V}$  and edges  $\mathsf{E}$ , we denote by  $\{v,v'\}$  (or  $\{v',v\}$ ) the undirected edge between  $v \in V$  and  $v' \in V$ , if it exists. Given  $r \in V$ , we denote by  $\mathrm{T}_r = (\mathrm{V},\mathrm{E}_r)$  the directed version of  $\mathsf{T}$  rooted in  $r$ , where the directed edges  $\mathrm{E}_r$  are uniquely defined from the edges  $\mathsf{E}$ , see Appendix B for further details. In this case, the edge linking  $v \in V$  to  $v' \in V$  in  $\mathrm{T}_r$  is denoted by  $(v,v')$ . Finally, for any integers  $(n,K) \in \mathbb{N} \times \mathbb{N}^*$ , we define  $n \bmod(K)$  as the remainder of the Euclidean division of  $n$  by  $K$ .
2 Background and setting
Multi-marginal optimal transport. Let  $\ell \in \mathbb{N}^*$ . Given a cost function  $c: (\mathbb{R}^d)^{\ell+1} \to \mathbb{R}$ , a subset  $S \subset \{0, \dots, \ell\}$  and a family of probability measures  $\{\mu_i\}_{i \in S} \in \mathcal{P}^{|S|}$ , mOT consists in solving
$$
\pi^ {\star} = \arg \min  \left\{\int c \left(x _ {0: \ell}\right) \mathrm {d} \pi \left(x _ {0: \ell}\right): \pi \in \mathscr {P} ^ {(\ell + 1)}, \pi_ {i} = \mu_ {i}, \forall i \in \mathsf {S} \right\}, \quad (\text {m O T})
$$
where  $\pi_{i}$  is the  $i$ -th marginal of  $\pi$ , i.e.,  $\pi_{i}(\mathsf{A}) = \pi (\mathrm{proj}_{i}^{-1}(\mathsf{A}))$  for any  $\mathsf{A} \in \mathcal{B}(\mathbb{R}^d)$ , with  $\mathrm{proj}_i: x_{0:\ell} \mapsto x_i$ . Given some weights  $(w_{i})_{i \in \{1, \ldots, \ell\}} \in (\mathbb{R}_{+})^{\ell}$ , the Wasserstein barycenter between the measures  $\{\mu_i\}_{i \in \mathsf{S}}$  is given by  $\pi_0^\star$  in (mOT), in the case where  $\mathsf{S} = \{1, \ldots, \ell\}$  and  $c(x_{0:\ell}) = \sum_{i=1}^{\ell} w_i \|x_0 - x_i\|^2$  (Peyre et al., 2019). In particular, when  $w_i = 1/\ell$ , the distribution  $\pi_0^\star$  can be regarded as the Fréchet mean (Karcher, 2014) of the measures  $\{\mu_i\}_{i \in \mathsf{S}}$  for the Wasserstein distance of order 2. Similarly to OT, (mOT) can be relaxed using the following entropic regularization
$$
\pi^ {\star} = \arg \min  \left\{\int c \left(x _ {0: \ell}\right) \mathrm {d} \pi \left(x _ {0: \ell}\right) + \varepsilon \operatorname {K L} (\pi | \nu): \pi \in \mathscr {P} ^ {(\ell + 1)}, \pi_ {i} = \mu_ {i}, \forall i \in S \right\}, \quad (\text {E m O T})
$$
where  $\varepsilon > 0$  is a hyperparameter and  $\nu$  is an arbitrary measure defined on  $((\mathbb{R}^d)^{\ell + 1}, \mathcal{B}((\mathbb{R}^d)^{\ell + 1}))$ .
Link with Schrödinger Bridge. We first recall the relationship between Schrödinger Bridge and EOT. Given  $T > 0$ ,  $\mathbb{Q}$  a (reference) path measure, i.e.,  $\mathbb{Q} \in \mathcal{P}(C([0,T],\mathbb{R}^d))$  and two measures  $\mu_0, \mu_1 \in \mathcal{P}(\mathbb{R}^d)$ , solving the SB problem amounts to finding the path measure  $\mathbb{P}^\star$  defined by
$$
\mathbb {P} ^ {\star} = \operatorname {a r g m i n} \left\{\mathrm {K L} (\mathbb {P} | \mathbb {Q}): \mathbb {P} \in \mathcal {P} \left(\mathrm {C} ([ 0, T ], \mathbb {R} ^ {d})\right), \mathbb {P} _ {0} = \mu_ {0}, \mathbb {P} _ {T} = \mu_ {1} \right\}. \tag {SB}
$$
If  $\mathbb{Q}$  is associated with a Stochastic Differential Equation (SDE) $^2$ , of the form  $\mathrm{d}\mathbf{X}_t = -a\mathbf{X}_t\mathrm{d}t + \mathrm{d}\mathbf{B}_t$  with  $a \geq 0$ , then it can be shown, see (Léonard, 2014, Proposition 1) that  $\mathbb{P}_{0,T}^{\star}$  verifies
$$
\mathbb {P} _ {0, T} ^ {\star} = \operatorname {a r g m i n} \left\{\mathrm {K L} \left(\pi | \mathbb {Q} _ {0, T}\right): \pi \in \mathcal {P} ^ {(2)}, \pi_ {0} = \mu_ {0}, \pi_ {1} = \mu_ {1} \right\}. \quad (\text {s t a t i c - S B})
$$
This is called the static formulation of SB. It can be shown that solving (static-SB) is equivalent to solving EOT with quadratic cost and regularization  $\varepsilon = 2\sinh(aT)/a$  if  $a > 0$ ,  $\varepsilon = 2T$  if  $a = 0$ . Moreover, since  $\mathbb{P}^{\star} = \mathbb{P}_{0,T}^{\star} \otimes \mathbb{Q}_{|0,T}$ , where  $\mathbb{Q}_{|0,T}$  is the measure  $\mathbb{Q}$  conditioned on initial and terminal conditions, solving the dynamic problem (SB) is equivalent to solving (static-SB).
Similarly, (EmOT) can be easily rewritten in a static multi-marginal SB fashion
$$
\pi^ {\star} = \operatorname {a r g m i n} \left\{\mathrm {K L} \left(\pi \mid \pi^ {0}\right): \pi \in \mathcal {P} ^ {(\ell + 1)}, \pi_ {i} = \mu_ {i}, \forall i \in \mathrm {S} \right\}, \quad (\mathrm {m S B - l i k e})
$$
with  $(\mathrm{d}\pi^{0} / \mathrm{d}\mathrm{Leb})(x_{0:\ell})\propto \exp [-c(x_{0:\ell}) / \varepsilon ](\mathrm{d}\nu /\mathrm{d}\mathrm{Leb})(x_{0:\ell})$  , where  $\pi^0$  is the reference measure.
Diffusion Schrödinger Bridge. Recently, De Bortoli et al. (2021) introduced Diffusion Schrödinger Bridge (DSB), a numerical scheme to solve (SB). It approximates the iterates of a dynamic version of the Iterative Proportional Fitting (IPF) scheme (Sinkhorn & Knopp, 1967; Knight, 2008; Peyré et al., 2019; Cuturi & Doucet, 2014), which can be described as follows: consider a sequence of path measures  $(\mathbb{P}^n)_{n \in \mathbb{N}}$  such that  $\mathbb{P}^0 = \mathbb{Q}$  and for any  $n \in \mathbb{N}$
$$
\mathbb {P} ^ {2 n + 1} = \operatorname {a r g m i n} \{\mathrm {K L} (\mathbb {P} | \mathbb {P} ^ {2 n}): \mathbb {P} _ {T} = \mu_ {1} \}, \qquad \mathbb {P} ^ {2 n + 2} = \operatorname {a r g m i n} \{\mathrm {K L} (\mathbb {P} | \mathbb {P} ^ {2 n + 1}): \mathbb {P} _ {0} = \mu_ {0} \}.
$$
This procedure alternatively projects between the measures with fixed initial distribution and the ones with fixed terminal distribution. For the first iteration, we get that  $\mathbb{P}^1 = \mu_1\otimes \mathbb{Q}_{|T}$ . Assuming that  $\mathbb{Q}$  is given by  $\mathrm{d}\mathbf{X}_t = f_t(\mathbf{X}_t)\mathrm{d}t + \mathrm{d}\mathbf{B}_t$ , with  $f:[0,T]\times \mathbb{R}^d\to \mathbb{R}^d$ , then  $\mathbb{P}^1$  is associated with the time-reversal of this SDE initialized at  $\mu_{1}$ . The time-reversal of an SDE has been derived under mild assumptions on the drift and diffusion coefficients (Haussmann & Pardoux, 1986; Cattiaux et al., 2021). In this case, we have  $(\mathbf{Y}_{T - t})_{t\in [0,T]}\sim \mathbb{P}^1$ , with  $\mathbf{Y}_0\sim \mu_1$  and
$$
\mathrm {d} \mathbf {Y} _ {t} = \left\{- f _ {T - t} (\mathbf {Y} _ {t}) + \nabla \log p _ {T - t} (\mathbf {Y} _ {t}) \right\} \mathrm {d} t + \mathrm {d} \mathbf {B} _ {t},
$$
where  $p_t$  is the density of  $\mathbb{P}_t^0$  w.r.t. the Lebesgue measure. The score  $\nabla \log p_t$  is estimated using score matching techniques (Hyvarinen, 2005; Vincent, 2011). The first iterate of DSB,  $\mathbb{P}^1$ , corresponds to a denoising diffusion model (Ho et al., 2020; Song et al., 2021). DSB iterates further and not only parameterizes the backward process but also the forward process. It can therefore be seen as a refinement of diffusion models drawing a bridge between generative modeling and optimal transport.
2We refer to Appendix C for details on solutions of SDEs and associated measures.
Tree-based framework. Consider an undirected tree  $\mathsf{T} = (\mathsf{V},\mathsf{E})$ , with vertices  $\mathsf{V}$  and edges  $\mathsf{E}$  such that  $\mathsf{V}$  is identified with  $\{0,\dots ,\ell \}$ . Inspired by Haasler et al. (2021), we restrict our study of (EmOT), to the case where the cost function  $c$  is the tree-structured quadratic cost derived from  $\mathsf{T}$
$$
c \left(x _ {0: \ell}\right) = \sum_ {\left\{v, v ^ {\prime} \right\} \in E} w _ {v, v ^ {\prime}} \| x _ {v} - x _ {v ^ {\prime}} \| _ {2} ^ {2}, \tag {1}
$$
where  $w_{v,v'}$  is a weight on the edge  $\{v, v'\}$ , which links  $v$  to  $v'$  (and  $v'$  to  $v$ ). Furthermore, as in Haasler et al. (2021), we choose S, i.e., the set of vertices of  $\mathsf{T}$  with constrained marginals, to coincide with the leaves of  $\mathsf{T}$ . This framework recovers important applications, from Wasserstein barycenters to Wasserstein propagation, see Solomon et al. (2014, 2015). We emphasize that it differs from an OT problem defined on the space of graphs (Chen et al., 2016). Here, each node represents a probability measure (observed or to be inferred) and each edge represents a coupling between two distributions.
We consider an arbitrary vertex  $r \in \mathsf{V}$  and choose  $\nu$  in (EmOT) such that  $(\mathrm{d}\nu / \mathrm{d}\mathrm{Leb})(x_{0:\ell}) = \varphi_r(x_r)$ , where  $\varphi_r$  is a density defined on  $\mathbb{R}^d$ . Due to the form of  $\nu$  and  $c$ , the reference measure  $\pi^0$  in (mSB-like) is therefore a probability distribution which factorizes along  $T_r = (\mathsf{V}, \mathsf{E}_r)$ , the directed version of  $T$  rooted in  $r$ . We refer to Appendix B for more details on the notion of directed trees. In this setting, (EmOT) is equivalent to the tree-based problem
$$
\pi^ {\star} = \operatorname {a r g m i n} \left\{\mathrm {K L} \left(\pi \mid \pi^ {0}\right): \pi \in \mathcal {P} ^ {\left(| \mathrm {V} |\right)}, \pi_ {i} = \mu_ {i}, \forall i \in \mathrm {S} \right\}, \quad (\text {T r e e S B})
$$
$$
\text {w i t h} \quad \pi^ {0} = \pi_ {r} ^ {0} \bigotimes_ {\left(v, v ^ {\prime}\right) \in \mathbb {E} _ {r}} \pi_ {v ^ {\prime} | v} ^ {0}, \tag {2}
$$
where  $\pi_{v^{\prime}|v}^{0}(\cdot \mid x_{v}) = \mathrm{N}(x_{v},\varepsilon /(2w_{v,v^{\prime}})\mathrm{I}_{d})$  and  $\pi_r^0\ll$  Leb with density  $\varphi_r$ . In a manner akin to Haasler et al. (2021), we thus establish, in continuous state-space, the correspondence between (TreeSB), a static tree-based version of SB, and a version of EmOT with tree-structured cost (1). In our work, we make the following assumption on the constrained marginals  $\{\mu_i\}_{i\in S}$
A0. For any  $i\in \mathbb{S}$ $\mu_i\ll \mathrm{Leb}$  and  $\mathrm{H}(\mu_i) <   \infty$
In what follows, we define  $K$  as the number of leaves of  $\mathsf{T}$ , denoting  $\mathsf{S} = \{i_0,\dots ,i_{K - 1}\}$ , and define the horizon times  $T_{v,v^{\prime}} = \varepsilon /(2w_{v,v^{\prime}})$  for any  $\{v,v^{\prime}\} \in \mathsf{E}$ . For any  $i_k\in \mathsf{S}$ , we will denote by  $\mathsf{T}_k = (\mathsf{V},\mathsf{E}_k)$  the directed version of  $\mathsf{T}$  rooted in the leaf  $i_k$ . In the next section, we present our dynamic method to solve (TreeSB), called Tree-based Diffusion Schrödinger Bridge.
3 Tree-based Diffusion Schrödinger Bridge
In this section, we present a method to solve (TreeSB) in the case where  $r \in S$ , i.e.,  $r$  is a leaf of  $T$ . We refer to Appendix E for the extension to the case where  $r \in V \backslash S$ . Without loss of generality, see Appendix E, we assume that  $r = i_{K-1}$  and choose  $\varphi_r = \mathrm{d}\mu_{i_{K-1}} / \mathrm{dLeb}$ , such that  $\pi_{i_{K-1}}^0 = \mu_{i_{K-1}}$ .
Dynamic approach to mIPF. In order to approximate solutions of (TreeSB), we consider the multi-marginal extension of the IPF algorithm, denoted by mIPF. Namely, we define a sequence of probability distributions  $(\pi^n)_{n\in \mathbb{N}}$  such that for any  $n\in \mathbb{N}$
$$
\pi^ {n + 1} = \operatorname {a r g m i n} \left\{\mathrm {K L} \left(\pi \mid \pi^ {n}\right): \pi \in \mathcal {P} ^ {\left(| V |\right)}, \pi_ {i _ {k _ {n} + 1}} = \mu_ {i _ {k _ {n} + 1}} \right\}, \quad (\mathrm {m I P F})
$$
where  $k_{n} = (n - 1) \bmod (K)$  and  $(k_{n} + 1)$  is identified with  $n \bmod (K)$ . We define a mIPF cycle as a sequence of  $K$  consecutive mIPF updates. In particular, each marginal constraint is considered exactly once during one mIPF cycle. In a practical setting, our main aim is to sample from the (mIPF) iterates at the lowest cost. Although these updates can be made explicit, see Marino & Gerolin (2020) for instance, direct sampling is unfeasible in practice when  $d$  is large. To overcome this limitation, we suggest to compute these iterates in a dynamic fashion with equivalent path measures.
Since  $\pi^0$  factorizes along  $\mathsf{T}$ , see (2), one can show that the iterates of (mIPF) also factorize along  $\mathsf{T}$ , see Section 4. Since these iterates all have a constrained marginal, we obtain the following decomposition for any  $n\in \mathbb{N}$ :  $\pi^n = \mu_{i_{k_n}}\otimes_{(v,v')\in \mathsf{E}_{k_n}}\pi_{v'|v}^n$  where  $\mathsf{E}_{k_n}$  denotes the set of edges of the directed tree  $\mathsf{T}_{k_n}$ . Then, our approach consists in computing dynamic iterates, i.e., path measures, along the edges of  $\mathsf{T}$  that coincide on their extremal times with the static iterates  $(\pi^n)_{n\in \mathbb{N}}$ . Namely, for any  $n\in \mathbb{N}$ , for any edge  $(v,v')\in \mathsf{E}_{k_n}$ , we define a path measure  $\mathbb{P}_{(v,v')}^n\in \mathcal{P}(\mathrm{C}([0,T_{v,v'},\mathbb{R}^d))$  such that  $\mathrm{Ext}(\mathbb{P}_{(v,v')}^n) = \pi_{v,v'}^n$ , where  $\mathrm{Ext}(\mathbb{P}_{(v,v')}^n)$  stands for the joint distribution of  $\mathbb{P}_{(v,v')}^n$  at times 0 and  $T_{v,v'}$ . In particular, it comes that  $\pi_{v'|v}^n = \mathbb{P}_{(v,v'),T_{v,v'}|0}^n$ . Using the tree-based form of the (mIPF) iterates, we can thus sample from  $\pi^n$  by (i) following the directed edges of  $\mathsf{T}_{k_n}$ , (ii) diffusing along them the corresponding path measures  $(\mathbb{P}_{(v,v')}^n)_{(v,v')\in \mathsf{E}_{k_n}}$  and (iii) picking the samples on the vertices. When  $\mathsf{T}$  is a bridge-shaped tree (2 vertices, 1 edge), it simply reduces to the dynamic reformulation of the IPF scheme. In what follows, we explain how to obtain our dynamic sequence.
Definition of the dynamic iterates. We first compute the iterate  $\mathbb{P}^0$ , corresponding to the dynamic version of  $\pi^0$  defined (2), in Proposition 1. Then, we build the following iterates by recursion on  $n \in \mathbb{N}$  and prove their well-posedness in Proposition 2.
Proposition 1. Let  $\mathsf{T}_{K - 1} = (\mathsf{V},\mathsf{E}_{K - 1})$ , the directed tree associated with  $\mathsf{T} = (\mathsf{V},\mathsf{E})$  and root  $i_{K - 1}$ . Then, for any  $(v,v^{\prime})\in \mathsf{E}_{K - 1}$ , there exists  $\mathbb{P}_{(v,v^{\prime})}^{0}\in \mathcal{P}(\mathrm{C}([0,T_{v,v^{\prime}}],\mathbb{R}^{d}))$  with  $\mathrm{Ext}(\mathbb{P}_{(v,v^{\prime})}^{0}) = \pi_{(v,v^{\prime})}^{0}$  and such that  $\mathbb{P}_{(v,v^{\prime})|0}^{0}$  is the distribution of  $(\mathbf{B}_t)_{t\in [0,T_{v,v^{\prime}}]}$ , recalling that  $T_{v,v^{\prime}} = \varepsilon /(2w_{v,v^{\prime}})$ .
Before deriving the dynamic counterpart of the (mIPF) iterates, we introduce several definitions. For any path measure  $\mathbb{P}$ , we denote by  $\mathbb{P}^R$  the time-reversal of  $\mathbb{P}$ . For any directed tree and any vertex  $v$  of this tree,  $p(v)$  refers to the (unique) parent of  $v$ , and  $c(v)$  to the unique child of  $v$  when it exists, see Appendix B for more details.
Let  $n \in \mathbb{N}$ . Assume that we have defined the sequence of our dynamic iterates  $(\mathbb{P}_{(v,v')}^m)_{(v,v') \in E_{k_m}, m \leq n}$  up to stage  $n$ .
Consider the path  $\mathsf{P}_n = \{(v_j,v_{j + 1})\}_{j = 1}^J$  in the directed tree  $\mathsf{T}_{k_n}$  such that  $v_{1} = i_{k_{n}}$  and  $v_{J + 1} = i_{k_{n} + 1}$ . In particular, for any  $(v,v^{\prime})\in \mathsf{E}_{k_{n} + 1}$ , either  $(v^{\prime},v)\in \mathsf{P}_{n}$  or  $(v,v^{\prime})\in \mathsf{E}_{k_{n}}\backslash \mathsf{P}_{n}$ . This is illustrated in Figure 1 when  $\mathsf{V} = \{0,1,2,3,4\}$ ,  $S = \{2,3,4\}$ ,  $i_k = 3$  and  $i_{k + 1} = 4$ : in this case,  $\mathsf{P} = \{(3,1),(1,0),(0,4)\}$  and  $(1,2)$  is the only edge common to  $\mathsf{E}_k$  and  $\mathsf{E}_{k + 1}$ .
Figure 1: Illustration of the change of root in a toy tree with 5 vertices.