SlowGuess/NeurIPS_2023_OCR huggingface dataset:
Computer Science Department, ENS, CNRS, PSL University
In this paper, we propose Barrier Hamiltonian Monte Carlo (BHMC), a version of the HMC algorithm which aims at sampling from a Gibbs distribution  $\pi$  on a manifold  $M$ , endowed with a Hessian metric  $\mathfrak{g}$  derived from a self-concordant barrier. Our method relies on Hamiltonian dynamics which comprises  $\mathfrak{g}$ . Therefore, it incorporates the constraints defining  $M$  and is able to exploit its underlying geometry. However, the corresponding Hamiltonian dynamics is defined via non separable Ordinary Differential Equations (ODEs) in contrast to the Euclidean case. It implies unavoidable bias in existing generalization of HMC to Riemannian manifolds. In this paper, we propose a new filter step, called "involution checking step", to address this problem. This step is implemented in two versions of BHMC, coined continuous BHMC (c-BHMC) and numerical BHMC (n-BHMC) respectively. Our main results establish that these two new algorithms generate reversible Markov chains with respect to  $\pi$  and do not suffer from any bias in comparison to previous implementations. Our conclusions are supported by numerical experiments where we consider target distributions defined on polytopes.
Markov Chain Monte Carlo (MCMC) methods is one of the primary algorithmic approaches to obtain approximate samples from a target distribution  $\pi$ . They have been successively applied over these past decades in a large panel of practical settings, (Liu & Liu, 2001). In particular, gradient-based MCMC methods have shown their efficiency and robustness in high-dimensional settings, and come nowadays with strong theoretical guarantees, (Dalalyan, 2017; Durmus & Moulines, 2017). However, they still struggle in facing the case where the target distribution is supported on a constrained subset  $M$  of  $\mathbb{R}^d$ , (Gelfand et al., 1992; Pakman & Paninski, 2014; Lan & Shahbaba, 2015). Yet, this problem appears in various fields; see e.g., (Morris, 2002; Lewis et al., 2012; Thiele et al., 2013) with some important applications in computational statistics and biology.
Drawing samples from such distributions is indeed a challenging problem that has been intensively studied in the literature, (Dyer & Frieze, 1991; Lovász & Simonovits, 1993; Lovász & Kannan, 1999; Lovász & Vempala, 2007; Brubaker et al., 2012; Cousins & Vempala, 2014; Pakman & Paninski, 2014; Lan & Shahbaba, 2015; Bubeck et al., 2015). In particular, some recent extensions of the
*Corresponding author. Contact at: maxence.noble-bourillot@polytechnique.edu
popular Metropolis-Hastings (MH) algorithm to constrained spaces consist in designing proposals based on dynamics for which  $\pi$  is invariant, (Zappa et al., 2018; Lelièvre et al., 2019, 2022). In practice, the corresponding solutions are numerically integrated based on implicit and symplectic schemes, which however come with additional difficulties. As first observed by Zappa et al. (2018), an additional "involution checking step" in the usual MH filter is necessary to ensure that the resulting Markov kernel admits  $\pi$  as a stationary distribution.
In this paper, we aim at generalizing this family of methods by taking into account the geometry of the constrained subspace, building on the Riemannian Manifold Hamiltonian Monte Carlo (RMHMC) algorithm introduced by Girolami & Calderhead (2011). Similarly to HMC, (Duane et al., 1987; Neal et al., 2011; Betancourt, 2017), RMHMC aims to target a positive distribution  $\pi$  on  $\mathbb{R}^d$  and relies on the integration of a canonical Hamiltonian equation. In contrast, RMHMC incorporates some geometrical information in the definition of the Hamiltonian via a Riemannian metric  $\mathfrak{g}$  on  $\mathbb{R}^d$ . When considering applications of RMHMC to a convex, open and bounded subset  $M$ , a natural choice for this metric is the Hessian metric associated with a self-concordant barrier on  $M$ , (Nesterov & Nemirovskii, 1994), as suggested by Kook et al. (2022a). We adopt here the same approach and now focus on a constrained subspace  $M$  which is assumed to be equipped with an appropriately designed "self-concordant" metric, (Nesterov & Nemirovskii, 1994).
Given this setting, we propose the BHMC (Barrier HMC) algorithm. To the best of our knowledge, this is the first version of RMHMC incorporating an "involution checking step" to assess the issue of asymptotic bias arising from the use of implicit integration methods to solve the Hamiltonian dynamics. In this work, we focus on the numerical version of BHMC (n-BHMC), for which we provide a numerical implementation. We refer to Appendix D for an introduction to the ideal version of BHMC, called continuous BHMC (c-BHMC), where it is assumed that we have access to the continuous Hamiltonian dynamics but which cannot be computed in practice. For each algorithm, we rigorously prove that the associated Markov chain preserves  $\pi$ .
The rest of the paper is organized as follows. In Section 2, we introduce our sampling framework and review some background on self-concordance and Riemannian geometry. In Section 3, we present n-BHMC, and derive theoretical results for this algorithm in Section 4. We review related works in Section 5 and provide numerical experiments for n-BHMC in Section 6.
Notation. For any  $f \in \mathrm{C}^3(\mathbb{R}^d, \mathbb{R})$ , we denote by  $Df$  (and  $D^2f$ ) the Jacobian (resp. the Hessian) of  $f$ . For any  $\mathrm{A} \in \mathbb{R}^{d \times d}$  and any  $(x,y) \in \mathbb{R}^d \times \mathbb{R}^d$ , we denote by  $\mathrm{A}: D^3f(x)$  the vector  $(\operatorname{Tr}(\mathrm{A}^\top\{D^3f(x)\}_i))_{i \in [d]} \in \mathbb{R}^d$ , and define  $D^3f(x)[x,y]$  as the vector  $x^\top D^3f(x)y \in \mathbb{R}^d$ . For any positive-definite matrix  $\mathrm{A} \in \mathbb{R}^{d \times d}$ ,  $\langle \cdot, \cdot \rangle_{\mathrm{A}}$  stands for the scalar product induced by  $\mathrm{A}$  on  $\mathbb{R}^d$ , defined by  $\langle x,y\rangle_{\mathrm{A}} = \langle x,\mathrm{A}y\rangle$ . The "momentum reversal" operator  $s: \mathbb{R}^d \times \mathbb{R}^d \to \mathbb{R}^d \times \mathbb{R}^d$  is defined for any  $(x,p) \in \mathbb{R}^d \times \mathbb{R}^d$  by  $s(x,p) = (x,-p)$ . Let  $\mathsf{E}, \mathsf{F}$  be two sets and  $h: \mathsf{E} \to 2^{\mathsf{F}}$ , where  $2^{\mathsf{F}}$  is the set of sets of  $\mathsf{F}$ . We say that  $h$  is a set-valued map. Note that any map  $g: \mathsf{E} \to \mathsf{F}$  can be extended to a set-valued map by identifying, for any  $x \in \mathsf{E}$ ,  $g(x)$  and  $\{g(x)\}$ . Let  $f: \mathsf{F} \to 2^{\mathsf{G}}$ . We define  $f \circ h: \mathsf{E} \to 2^{\mathsf{G}}$  for any  $x \in \mathsf{E}$  by  $f \circ h(x) = \cup_{y \in h(x)} f(y)$ , where by convention  $\cup_{\emptyset} = \emptyset$ . For any topological space  $X$ , we denote  $B(X)$  its Borel sets. For any probability measure  $\mu \in \mathcal{P}(X)$  and measurable map  $\varphi: X \to Y$ , we denote  $\varphi_{\#}\mu \in \mathcal{P}(Y)$  the pushforward of  $\mu$  by  $\varphi$ . In general, we will equivalently denote by  $z$  or  $(x,p)$  a state of the Hamiltonian system.
2 Setting and Background
In this paper, we consider an open subset  $\mathsf{M} \subset \mathbb{R}^d$ , and we aim at sampling from a target distribution  $\pi$  given for any  $x \in \mathsf{M}$  by
$$
\mathrm {d} \pi (x) / \mathrm {d} x = \exp [ - V (x) ] / Z,
$$
where  $V \in \mathrm{C}^2(\mathsf{M},\mathbb{R})$  and  $Z = \int_{\mathsf{M}} \exp[-V(x)] \, \mathrm{d}x$ . We view  $\mathsf{M}$  as an embedded  $d$ -dimensional submanifold of  $\mathbb{R}^d$ , equipped with a metric  $\mathfrak{g}$ , satisfying the following assumptions.
A1. M is an open convex bounded subset of  $\mathbb{R}^d$ .
A2. There exists  $\phi$ , a  $\alpha$ -regular and  $\nu$ -self-concordant barrier on  $\mathsf{M}$  such that  $\mathfrak{g} = D^2\phi$ .
We provide in Section 2.1 basic Riemannian facts along with the definition of the Hamiltonian dynamics of RMHMC and introduce self-concordance and  $\alpha$ -regularity in Section 2.2.
2.1 Riemannian Manifold Hamiltonian dynamics
Basics on Riemannian geometry. Let  $\mathsf{M}$  be a  $d$ -dimensional smooth manifold, endowed with a metric  $\mathfrak{g}$ . Denoting by  $\mathrm{d}x$  a dual coframe, (Lee, 2006, Lemma 3.2.), we recall that the Riemannian volume element corresponding to  $(\mathsf{M}, \mathfrak{g})$  is given in local coordinates by
$$
\mathrm {d v o l} _ {\mathsf {M}} (x) = \sqrt {\det  (\mathfrak {g})} \mathrm {d} x.
$$
We denote by  $\mathrm{T}_x^\star \mathsf{M}$  the dual of the tangent space at  $x\in \mathsf{M}$ , i.e., the cotangent space. For any  $x\in \mathsf{M}$ ,  $\mathrm{T}_x^\star \mathsf{M}$  is a vector space naturally endowed with the scalar product  $\langle \cdot ,\cdot \rangle_{\mathfrak{g}(x)^{-1}}$  (Mok, 1977). We recall that the cotangent bundle  $\mathrm{T}^{\star}\mathsf{M}$  is defined by  $\mathrm{T}^{\star}\mathsf{M} = \sqcup_{x\in \mathsf{M}}\{x\} \cup \mathrm{T}_x^\star \mathsf{M}$ . This set is a  $2d$ -dimensional manifold endowed with a Riemannian metric  $\mathfrak{g}^{\star}$  given by Mok (1977), inherited from  $\mathfrak{g}$ . With this metric, the volume form on  $\mathrm{T}^{\star}\mathsf{M}$  does not depend on  $\mathfrak{g}$  anymore, and satisfies for any  $(x,p)\in \mathrm{T}^{\star}\mathsf{M}$
$$
\mathrm {d v o l} _ {\mathrm {T} ^ {*} \mathrm {M}} (x, p) = \mathrm {d x d p},
$$
where  $\mathrm{d}x\mathrm{d}p$  is a dual coframe for  $\mathbf{T}^{\star}\mathbf{M}$
Therefore, under A1, identifying  $\mathrm{T}^{\star}\mathsf{M}$  with  $\mathsf{M}\times \mathbb{R}^{d}$ , the volume form on  $\mathrm{T}^{\star}\mathsf{M}$  induced by  $\mathfrak{g}^{\star}$  is the Lebesgue measure of  $\mathbb{R}^d\times \mathbb{R}^d$  restricted to  $\mathrm{T}^{\star}\mathsf{M}$ . Despite adopting at first a Riemannian perspective on  $\mathsf{M}$ , we actually recover the Euclidean setting on  $\mathrm{T}^{\star}\mathsf{M}$ , which motivates us to consider  $\mathrm{T}^{\star}\mathsf{M}$  as our sampling space. We refer to Appendix B for details on the cotangent bundle and its metric  $\mathfrak{g}^{\star}$ .
Hamiltonian dynamics. Note that with the previously introduced notation,  $\pi$  can be expressed as
$$
\mathrm {d} \pi / \mathrm {d v o l} _ {\mathsf {M}} (x) = \exp \left[ - V (x) - \frac {1}{2} \log (\det  (\mathfrak {g} (x))) \right] / Z.
$$
This motivates the introduction of the following Hamiltonian on  $\mathrm{T}^{\star}\mathsf{M}$
$$
H (x, p) = V (x) + \frac {1}{2} \log (\det  \mathfrak {g} (x)) + \frac {1}{2} \| p \| _ {\mathfrak {g} (x) ^ {- 1}} ^ {2}. \tag {1}
$$
In this definition, we notably take into account the scalar product  $\langle \cdot ,\cdot \rangle_{\mathfrak{g}(x)^{-1}}$  on  $\mathrm{T}_x^\star \mathsf{M}$ . Finally, we consider the joint distribution  $\bar{\pi}$  on  $\mathrm{T}^{\star}\mathsf{M}$
$$
\mathrm {d} \bar {\pi} (x, p) = (1 / \bar {Z}) \exp [ - H (x, p) ] \mathrm {d v o l} _ {\mathrm {T} ^ {*} \mathrm {M}} (x, p), \tag {2}
$$
where  $\bar{Z} = \int_{\mathbf{T}^*\mathbf{M}}\exp [-H(x,p)]\mathrm{dvol}_{\mathbf{T}^*\mathbf{M}}(x,p)$ , for which the first marginal is  $\pi$ . Indeed, for any  $\varphi \in \operatorname {C}(\mathsf{M},\mathbb{R})$ , we have
$$
\int_ {\mathrm {T} ^ {*} \mathsf {M}} \varphi (x) \mathrm {d} \bar {\pi} (x, p) = \int_ {\mathrm {T} ^ {*} \mathsf {M}} \varphi (x) \mathrm {d} \pi (x) \mathrm {N} _ {x} (p; 0, \mathrm {I d}) \mathrm {d} p = \int_ {\mathsf {M}} \varphi (x) \mathrm {d} \pi (x),
$$
where we denote by  $\mathrm{N}_x(0,\mathrm{I}_d)$  the centered standard Gaussian distribution w.r.t.  $\| \cdot \|_{\mathfrak{g}(x)^{-1}}$ . The Hamiltonian dynamics for  $H$  is given by the coupled Ordinary Differential Equations (ODEs)
$$
\dot {x} = \partial_ {p} H (x, p), \quad \dot {p} = - \partial_ {x} H (x, p), \tag {3}
$$
where the derivatives of  $H$  can be computed explicitly as
$$
\partial_ {p} H (x, p) = \mathfrak {g} (x) ^ {- 1} p, \qquad \partial_ {x} H (x, p) = - \frac {1}{2} D \mathfrak {g} (x) [ \mathfrak {g} (x) ^ {- 1} p, \mathfrak {g} (x) ^ {- 1} p ] + L (x),
$$
where  $L(x) = \nabla V(x) + \frac{1}{2}\mathfrak{g}(x)^{-1}:D\mathfrak{g}(x)$
2.2 Self-concordance and regularity
Until now, we have considered an arbitrary Riemannian metric  $\mathfrak{g}$ . In the rest of this work, we focus on metrics given by Hessian of self-concordant barriers.
Self-concordance. We first introduce self-concordant barriers, a family of smooth convex functions which are well-suited for minimization by the Newton method.
Definition 1 (Nesterov & Nemirovskii (1994)). Let  $\mathsf{U}$  be a non-empty open convex domain in  $\mathbb{R}^d$ . A function  $\phi : \mathsf{U} \to \mathbb{R}$  is said to be a  $\nu$ -self-concordant barrier (with  $\nu \geq 1$ ) on  $\mathsf{U}$  if it satisfies:
(a)  $\phi \in \mathrm{C}^3 (\mathsf{U},\mathbb{R})$  and  $\phi$  is convex,
(b)  $\phi (x)\to +\infty$  as  $x\to \partial \mathsf{U}$
(c)  $|D^3\phi(x)[h,h,h]| \leq 2 \| h \|_{\mathfrak{g}(x)}^3$ , for any  $x \in \mathsf{M}$ ,  $h \in \mathbb{R}^d$ ,
(d)  $|D\phi (x)[h]|^2\leq \nu \| h\|_{\mathfrak{g}(x)}^2$  , for any  $x\in \mathsf{M}$ $h\in \mathbb{R}^d$
where  $\mathfrak{g}(x) = D^2\phi (x)$
Balls for  $\| \cdot \|_{\mathfrak{g}(x)}$ , called Dikin ellipsoids, are key for the study of self-concordance, see Appendix C.
Regularity. The property of  $\alpha$ -regularity for some  $\alpha \geq 1$  is shared by many self-concordant barriers, including logarithmic and quadratic programming barriers. It ensures stability for interior point polynomial-time methods. Definition and properties of  $\alpha$ -regularity are recalled in Appendix C.
Example of the polytope. Let us assume that  $\mathsf{M}$  is the polytope  $\mathsf{M} = \{x : \mathrm{Ax} < b\}$ , where  $\mathrm{A} \in \mathbb{R}^{m \times d}$  and  $b \in \mathbb{R}^m$ . We endow it with the Riemannian metric  $\mathfrak{g}(x) = D^2\phi(x)$  where  $\phi : \mathsf{M} \to \mathbb{R}$  is the logarithmic barrier given for any  $x \in \mathsf{M}$  by  $\phi(x) = -\sum_{i=1}^{m}\log\left(b_i - \mathrm{A}_i^\top x\right)$ . The barrier  $\phi$  is both a  $m$ -self-concordant barrier and a 2-regular function, (Nesterov & Nemirovski, 1998, page 3). Moreover, we have for any  $x \in \mathsf{M}$ ,  $\mathfrak{g}(x) = \mathrm{A}^\top S(x)^{-2}\mathrm{A}$ , where  $S(x) = \operatorname{Diag}\left(b_i - \mathrm{A}_i^\top x\right)_{i \in [m]}$ . We provide in Figure 1 an illustration of this barrier.
Figure 1: A polytope  $\mathsf{M} \subset \mathbb{R}^2$  with three Dikin ellipsoids  $\{y \in \mathbb{R}^d : y^\top \mathfrak{g}(x)y < 1\}$  derived from its logarithmic barrier.
3 The n-BHMC algorithm
In practice, it is not possible to exactly compute the Riemannian Hamiltonian dynamics (3). We thus introduce a numerical version of BHMC (n-BHMC), in which we replace the continuous ODE integration by a symplectic numerical scheme. We first define the Hamiltonian integrators used in n-BHMC in Section 3.1 and provide details on the different steps of our algorithm in Section 3.2.
3.1 Hamiltonian integrators of n-BHMC
In the same spirit as Shahbaba et al. (2014), we first rewrite the Hamiltonian  $H$  given in (1) as  $H = H_{1} + H_{2}$ , where we highlight the non separable aspect of  $H$  in  $H_{2}$ , i.e., for any  $(x,p)\in \mathrm{T}^{\star}\mathsf{M}$
$$
H _ {1} (x, p) = V (x) + \frac {1}{2} \log (\det  \mathfrak {g} (x)), \quad H _ {2} (x, p) = \frac {1}{2} \| p \| _ {\mathfrak {g} (x) ^ {- 1}} ^ {2}.
$$
$$
\partial_ {x} H _ {1} (x, p) = \nabla V (x) + \frac {1}{2} \mathfrak {g} (x) ^ {- 1}: D \mathfrak {g} (x), \quad \partial_ {p} H _ {1} (x, p) = 0, \tag {4}
$$
$$
\partial_ {x} H _ {2} (x, p) = - \frac {1}{2} D \mathfrak {g} (x) \left[ \mathfrak {g} (x) ^ {- 1} p, \mathfrak {g} (x) ^ {- 1} p \right], \quad \partial_ {p} H _ {2} (x, p) = \mathfrak {g} (x) ^ {- 1} p. \tag {5}
$$
Leveraging the separable structure of  $H_{1}$ , we now define an implicit scheme to discretize the Hamiltonian dynamics (3) by splitting it into the Hamiltonian dynamics (4) and (5). In the rest of this section, we consider some step-size  $h \in \mathbb{R}$ .
Explicit integrator of  $H_{1}$ . We first approximate the dynamics (4) on a step-size  $h / 2$  using a first-order Euler method (Hairer et al., 2006, Theorem VI.3.3.). Since  $H_{1}$  is separable, this integrator simply reduces to the map  $S_{h / 2}: T^{\star}\mathsf{M} \to T^{\star}\mathsf{M}$  defined by
$$
\mathrm {S} _ {h / 2} (x, p) = \left(x, p - \frac {h}{2} \partial_ {x} H _ {1} (x, p)\right).
$$
We have: (i)  $\mathrm{S}_{h / 2}(\mathrm{T}^{\star}\mathsf{M})\subset \mathrm{T}^{\star}\mathsf{M}$ , (ii)  $\mathrm{S}_{h / 2}$  is symplectic (we refer to Appendix F for more details on symplecticity), (iii)  $\mathrm{S}_{-h / 2}\circ \mathrm{S}_{h / 2} = \mathrm{Id}$  and (iv)  $\mathrm{S}_{-h / 2} = s\circ \mathrm{S}_{h / 2}\circ s$ . Note that  $s\circ \mathrm{S}_{h / 2}$  is an involution on  $\mathrm{T}^{\star}\mathsf{M}$ , which inherits from properties (i) and (ii) of  $\mathrm{S}_{h / 2}$ .
Implicit integrator of  $H_{2}$ . Since  $H_{2}$  is not separable, a common discretization scheme such as the Euler method is not symplectic anymore, which requires to use an implicit method instead. We thus approximate these dynamics on a step-size  $h$  with a symplectic second-order integrator denoted by  $\mathrm{G}_h$ . For theoretical purposes, we focus on the Störmer-Verlet scheme, (Hairer et al., 2006, Theorem VI.3.4.), also known as the generalized Leapfrog integrator, which is widely used in geometric integration, (Girolami & Calderhead, 2011; Betancourt, 2013; Cobb et al., 2019; Brofos & Lederman, 2021a). We refer to Appendix F for a discussion on other numerical schemes. For any  $z^{(0)} \in \mathbf{T}^{\star}\mathsf{M}$ ,  $\mathrm{G}_h(z^{(0)}) \subset \mathrm{T}^{\star}\mathsf{M}$  consists of points  $z^{(1)} = (x^{(1)}, p^{(1)})$  which are solutions of
$$
\begin{array}{l} p ^ {(1 / 2)} = p ^ {(0)} - \frac {h}{2} \partial_ {x} H _ {2} (x ^ {(0)}, p ^ {(1 / 2)}), \\ x ^ {(1)} = x ^ {(0)} + \frac {h}{2} \left[ \partial_ {p} H _ {2} \left(x ^ {(0)}, p ^ {(1 / 2)}\right) + \partial_ {p} H _ {2} \left(x ^ {(1)}, p ^ {(1 / 2)}\right) \right], \\ p ^ {(1)} = p ^ {(1 / 2)} - \frac {h}{2} \partial_ {x} H _ {2} \left(x ^ {(1)}, p ^ {(1 / 2)}\right). \tag {6} \\ \end{array}
$$
As defined, there is no guarantee that (6) admits a (unique) solution. As a matter of fact, the integrator  $\mathrm{G}_h$  can be seen as a set-valued map. Moreover, it is easy to check that: (i)  $\mathrm{G}_h(\mathrm{T}^\star \mathsf{M}) \subset 2^{\mathrm{T}^\star \mathsf{M}}$ , (ii)  $\mathrm{G}_{-h} = s \circ \mathrm{G}_h \circ s$ , since  $\partial_p H_2(s(z)) = -\partial_p H_2(z)$  and  $\partial_x H_2(s(z)) = \partial_x H_2(z)$ , and (iii) if  $|\mathrm{G}_h(z)| > 0$  then  $z \in (\mathrm{G}_{-h} \circ \mathrm{G}_h)(z)$ .
Implicit integrator of  $H$ . Relying on the integrators  $\mathrm{S}_{h / 2}$  and  $\mathrm{G}_h$  previously defined, we now explain how we approximate the Hamiltonian dynamics (3) on a step-size  $h$ . We first define the set-valued maps  $\mathrm{F}_h: \mathrm{T}^\star \mathsf{M} \to 2^{\mathrm{T}^\star \mathsf{M}}$  and  $\mathrm{R}_h: \mathrm{T}^\star \mathsf{M} \to 2^{\mathrm{T}^\star \mathsf{M}}$  by
$$
\mathrm {F} _ {h} = \mathrm {G} _ {h} \circ s, \quad \mathrm {R} _ {h} = (s \circ \mathrm {S} _ {h / 2}) \circ \mathrm {F} _ {h} \circ (s \circ \mathrm {S} _ {h / 2}).
$$
Using properties (ii) and (iii) of  $\mathrm{G}_h$ , we have for any  $z \in \mathrm{T}^{\star}\mathsf{M}$  such that  $|\mathrm{F}_h(z)| > 0$ ,  $z \in (\mathrm{F}_h \circ \mathrm{F}_h)(z)$ , and for any  $z' \in \mathrm{T}^{\star}\mathsf{M}$  such that  $|(\mathrm{F}_h \circ s \circ \mathrm{S}_{h/2})(z')| > 0$ , we have  $z' \in (\mathrm{R}_h \circ \mathrm{R}_h)(z')$ . Thus,  $\mathrm{F}_h$  and  $\mathrm{R}_h$  are involutive in the sense of set-valued maps. Note also that  $s \circ \mathrm{R}_h = \mathrm{S}_{h/2} \circ \mathrm{G}_h \circ \mathrm{S}_{h/2}$  boils down to the Strang splitting (Strang, 1968) of the dynamics (3) and thus, is a symplectic scheme approximating the dynamics of Hamiltonian  $H$  on a step-size  $h$ .
Numerical integrators. In practice, we do not have access to  $\mathrm{F}_h$  but approximate it with a numerical map  $\Phi_h$ . For clarity's sake, we denote by  $\mathrm{dom}_{\Phi_h} \subset \mathrm{T}^\star \mathsf{M}$  the domain of this integrator with  $\Phi_h(\mathrm{dom}_{\Phi_h}) \subset \mathrm{T}^\star \mathsf{M}$ . In practice,  $\mathrm{dom}_{\Phi_h}$  corresponds to the set of points for which the numerical integration of  $\mathrm{F}_h$  outputs a solution. We also approximate  $\mathrm{R}_h$  with the numerical map  $\mathrm{R}_h^\Phi : (s \circ \mathrm{S}_{h/2})(\mathrm{dom}_{\Phi_h}) \subset \mathrm{T}^\star \mathsf{M} \to \mathrm{T}^\star \mathsf{M}$
$$
R _ {h} ^ {\Phi} = \left(s \circ S _ {h / 2}\right) \circ \Phi_ {h} \circ \left(s \circ S _ {h / 2}\right).
$$
Similarly to  $s \circ \mathrm{R}_h$ ,  $s \circ \mathrm{R}_h^{\Phi_2}$  approximates the dynamics of Hamiltonian  $H$  on a step-size  $h$ . In our experiments, we design  $\Phi_h$  using a fixed-point solver with a given number of iterations following Brofos & Lederman (2021a,b). We refer to Appendix K for details on computations of  $\Phi_h$ .
3.2 Steps of the algorithm
For any  $z = (x,p)\in \mathrm{T}^{\star}\mathsf{M}$ , we define on  $\mathrm{T}^{\star}\mathsf{M}$  the norm  $\| \cdot \| _z$  by
$$
\left\| \left(x ^ {\prime}, p ^ {\prime}\right) \right\| _ {z} = \left\| x ^ {\prime} \right\| _ {\mathfrak {g} (x)} + \left\| p ^ {\prime} \right\| _ {\mathfrak {g} (x) ^ {- 1}}, \quad \forall \left(x ^ {\prime}, p ^ {\prime}\right) \in \mathrm {T} ^ {\star} \mathrm {M}, \tag {7}
$$
where  $\| \cdot \|_{\mathfrak{g}(x)^{-1}}$  is the canonical norm on  $\mathrm{T}_x^\star \mathsf{M}$  induced by the Riemannian metric  $\mathfrak{g}$  (see Section 2.1) and  $\| \cdot \|_{\mathfrak{g}(x)}$  is the common norm used on  $\mathsf{M}$  to study properties of self-concordance (see Section 2.2). As defined, this norm will be crucial to correct the bias of the numerical integration in n-BHMC, presented in Algorithm 1, for which we are now ready to detail the steps.
Steps 1 and 5: applying a momentum update. Assume that the current state at stage  $n \geq 1$  is  $(X_{n - 1}, P_{n - 1}) \in \mathbb{T}^{\star}\mathbb{M}$ . Then, the momentum is first partially refreshed such that  $\tilde{P}_n \gets \sqrt{1 - \beta P_{n - 1}} + \sqrt{\beta} G_n$ , where  $G_n \sim \mathrm{N}_x(0, \mathrm{I}_d)$  is independent from  $P_{n - 1}$ . This update is applied both at the beginning and the end of the iteration, similarly to Lelièvre et al. (2022).
Step 2: solving a discretized version of ODE (3). Starting from  $(X_{n}^{\prime},P_{n}^{\prime}) = (X_{n - 1},\tilde{P}_{n})$  , we now approximate the dynamics of  $H$  on a step-size  $h$  with the integrators presented in Section 3.1, while ensuring that the proposal state belongs to  $\mathrm{T}^*\mathsf{M}$  . We proceed as follows:
1. We first run the explicit integrator  $\mathrm{S}_{h / 2}$  and compute  $Z_{n}^{(0)} = (s\circ \mathrm{S}_{h / 2})(X_{n - 1},\tilde{P}_{n})$ .
2. If  $Z_{n}^{(0)} \notin \mathrm{dom}_{\Phi_{h}}$ , then  $(X_{n}', P_{n}')$  is not updated and we directly go to Step 3. Otherwise, we define  $Z_{n}^{(1)} = \Phi_{h}(Z_{n}^{(0)})$ . To ensure the reversibility of this step, we then perform an "involution checking step", (Zappa et al., 2018; Lelièvre et al., 2019), highlighted in yellow in Algorithm 1, i.e., we verify (a)  $Z_{n}^{(1)} \in \mathrm{dom}_{\Phi_{h}}$  and (b)  $Z_{n}^{(0)} = \Phi_{h}(Z_{n}^{(1)})$ . In practice, we replace condition (b) by combining an explicit tolerance threshold  $\eta$  with the norm defined in (7) and accept the proposal if
$$
\left\| Z _ {n} ^ {(0)} - \Phi_ {h} \left(Z _ {n} ^ {(1)}\right) \right\| _ {Z _ {n} ^ {(0)}} + \left\| Z _ {n} ^ {(0)} - \Phi_ {h} \left(Z _ {n} ^ {(1)}\right) \right\| _ {\Phi_ {h} \left(Z _ {n} ^ {(1)}\right)} \leq \eta . \tag {8}
$$