Standard Markov Chain Monte Carlo (MCMC) algorithms, such as Langevin dynamics and Hamiltonian Monte Carlo (HMC), typically operate under the assumption that the underlying space is "flat" (Euclidean). However, many modern machine learning problems involve probability distributions that live on curved surfaces or within strictly constrained regions, such as the space of positive definite matrices, probability simplexes, or neural network loss landscapes.
Manifold-aware sampling addresses this by redefining the sampling process through the lens of Riemannian geometry. Instead of moving in straight lines and potentially "bouncing" off boundaries, these algorithms navigate along the intrinsic curvature of the space, leading to faster convergence and more robust exploration of complex distributions.
The Geometry of Probability
In a flat space, the distance between two points is a simple straight line. In a curved space, or a Riemannian manifold, distance is defined by a metric tensor $g(x)$, which acts as a local "ruler" that changes depending on your position.
Yi-An Ma et al. provide a "complete recipe" for this approach, showing that any continuous-dynamic MCMC sampler can be viewed as a combination of a diffusion term and a "curl" term, both of which can be scaled by the local geometry (often the Fisher Information matrix). This preconditioning allows the sampler to adapt to the local curvature, stretching the space in narrow regions to allow for larger, more efficient steps.
Moving Along Geodesics
The most direct way to adapt MCMC to manifolds is to replace straight-line updates with geodesics—the shortest paths on a curved surface.
Geodesic Langevin Dynamics
In standard Langevin dynamics, we take a step in the direction of the gradient and add Gaussian noise. On a manifold, this process is adapted by performing the update within the tangent space (a local flat approximation of the surface) and then using an exponential map to project the point back onto the manifold.
Xiao Wang et al. demonstrate that this Geodesic Langevin Algorithm (GLA) achieves a geometric rate of convergence, extending theoretical guarantees from flat spaces to curved ones. Furthermore, Xiang Cheng et al. provide the first non-asymptotic analysis for these methods, proving they can be as efficient as their Euclidean counterparts even in spaces with negative curvature.
Hamiltonian Motion on Surfaces
Hamiltonian Monte Carlo (HMC) simulates the motion of a particle with momentum. On a manifold, this requires accounting for how the momentum vector changes as the particle moves across the surface—a process known as parallel transport.
Shiwei Lan et al. show that by mapping constrained domains (like those in Lasso models) onto a high-dimensional sphere, one can transform difficult boundary-bouncing problems into smooth, continuous rotations. However, calculating these geometric updates can be expensive ($O(d^3)$). To solve this, Charles Sutton et al. propose using "semi-separable" Hamiltonians that capture local geometry without the cubic computational cost, enabling efficient sampling in high-dimensional hierarchical models.
Transforming Constraints into Curvature
One of the most powerful applications of manifold-aware sampling is handling hard constraints. Instead of rejecting samples that fall outside a boundary, we can define a metric that makes the boundary "infinitely far away."
Alexander Rakhlin introduces the Dikin Walk, which uses a self-concordant barrier function to define a Riemannian metric. This metric creates a "cushion" near the boundaries of a convex set, allowing the sampler to take large, anisotropic steps that stay within the valid region. Similarly, Yin Tat Lee et al. utilize these barrier functions to sample from ill-conditioned distributions in over 100,000 dimensions, achieving massive speedups on metabolic networks.
For distributions with multiple isolated modes, Bernardo Williams et al. propose the Metric-agnostic Geodesic Slice Sampler (MAGSS). By inverting the standard metric, the sampler is encouraged to accelerate through low-density regions, effectively "shrinking" the distance between distant peaks and allowing the chain to jump between modes more easily.
Applications Across Domains
The benefits of respecting geometry extend to various specialized fields:
- Robotics and Vision: Tolga Birdal et al. use the Riemannian structure of the Birkhoff Polytope to synchronize permutations across images, while Tolga Birdal et al. apply geodesic MCMC to optimize 3D poses in SLAM.
- Statistics: Mai Ngoc Bui et al. generalize Ornstein-Uhlenbeck processes to the manifold of positive definite matrices to model evolving covariance.
- Generative Modeling: Jaehyeong Jo introduces Riemannian Diffusion Mixtures, which perform generative modeling on complex surfaces by defining diffusion directions via the Logarithm map, bypassing the need for expensive heat kernel approximations.
By treating the geometry of the problem as a guide rather than a constraint, manifold-aware sampling turns the "curse" of curvature into a tool for more efficient inference.