Sampling with Riemannian Hamiltonian Monte Carlo in a Constrained Space
Anonymous Author(s)
AfﬁliationAddress email
Abstract
We demonstrate for the ﬁrst time that ill-conditioned, non-smooth, constrained distributions in very high dimension, upwards of 100,000, can be sampled efﬁcientlyin practice .
Our algorithm incorporates constraints into the Riemannian versionof Hamiltonian Monte Carlo and maintains sparsity.
This allows us to achieve amixing rate independent of condition numbers.
On benchmark data sets from systems biology and linear programming, our algorithm outperforms existing packages by orders of magnitude.
In particular, weachieve a 1,000-fold speed-up for sampling from the largest published humanmetabolic network (RECON3D).
Our package has been incorporated into a popular
Bioinformatics library.
Introduction
Sampling is Fundamental.
Sampling algorithms arise naturally in models of statistical physics,e.g., Ising, Potts models for magnetism, Gibbs model for gases, etc.
These models directly suggest
Markov chain algorithms for sampling the corresponding conﬁgurations.
In the Ising model wherethe vertices of a graph are assigned a spin, i.e., ± 1 , in each step, we pick a vertex at random and ﬂipits spin with some probability.
The probability is chosen so that the distribution of the vector of allspins approaches a target distribution where the probability exponentially decays with the numberof agreements in spin for pairs corresponding to edges of the graph.
In the Gibbs model, particlesmove randomly with collisions and their motion is often modeled as reﬂecting Brownian motion.
Sampling with Markov chains is today the primary algorithmic approach for high-dimensionalsampling.
For some fundamental problems, sampling with Markov chains is the only known efﬁcientapproach or the only approach to have guarantees of efﬁciency.
Two notable examples are samplingperfect matchings of a bipartite graph and sampling points from a convex body.
These are the coresubroutines for estimating the permanent of a nonnegative matrix and estimating the volume ofa convex body, respectively.
The solution space for these problems scales exponentially with thedimension.
In spite of this, polynomial-time algorithms have been discovered for both problems.
Thecurrent best permanent algorithm scales as n 7 (time) [2, 22], while the current best volume algorithmscales as n 3 (number of membership tests) [23].
For the latter, the ﬁrst polynomial-time algorithmhad a complexity of n 27 [15], and the current best complexity is the result of many breakthroughdiscoveries, including general-purpose algorithms and analysis tools.
Sampling is Ubiquitous.
The need for efﬁcient high-dimensional sampling arises in many ﬁelds.
A notable setting is metabolic networks in systems biology.
A constraint-based model of a metabolicnetwork consists of m metabolites and n reactions, and a set of equalities and inequalities that deﬁnea set of feasible steady state reaction rates (ﬂuxes):
[Equation]
where S is a stoichiometric matrix with coefﬁcients for each metabolite and reaction.
The linearequalities ensure that the ﬂuxes into and out of every node are balanced.
The inequalities arise fromthermodynamical and environmental constraints.
Sampling constraint-based models is a powerful toolfor evaluating the metabolic capabilities of biochemical networks [32, 47].
While the most commondistribution used is uniform over the feasible region, researchers have also argued for sampling fromthe Gaussian density restricted to the feasible region; the latter has the advantage that the feasible setdoes not have to be bounded.
A previous approach to sampling, using hit-and-run with rounding [19],has been incorporated into the COBRA package [20] for metabolic systems analysis (Bioinformatics).
A second example of mathematical interest is the problem of computing the volume of the Birkhoffpolytope.
For a given dimension n , the Birkhoff polytope is the set of all doubly stochastic n × nmatrices (or the convex hull of all permutation matrices).
This object plays a prominent role in algebraic geometry, probability, and other ﬁelds.
Computing its volume has been pursued using algebraicrepresentations; however exact computations become intractable even for n = 11 , requiring yearsof computation time.
Hit-and-run has been used to show that sampling-based volume computationcan go to higher dimension [10], with small error of estimation.
However, with existing samplingimplementations, going beyond n = 20 seems prohibitively expensive.
A third example is from machine learning, a ﬁeld that is increasingly turning to sampling modelsof data according to their performance in some objective.
One such commonly used criterion isthe logistic regression function.
The popularity of logistic regression has led to sampling beingincorporated into widely used packages such as STAN [45], PyMC3 [42], and Pyro [3].
However,those packages in general do not run on the constraint-based models we are interested in.
Problem Description.
In this paper, we consider the problem of sampling from distributions whosedensities are of the form
[Equation]
subject to Ax = b,
[Equation]
where f is a convex function and K is a convex set.
We assume that a self-concordant barrier φ for Kis given.
Note that any convex set has a self-concordant barrier [31] and there are explicit barriers forconvex sets that come up in practical applications [38], so this is a mild assumption.
We introduce anefﬁcient algorithm for the problem when K is a product of convex sets K i , each with small dimension.
Many practical instances can be written in this form.
As a special case, the algorithm can handle Kin the form of { x ∈ R n : l i ≤ x i ≤ u i for all i ∈
[ n ] } with l i ∈ R ∪ {−∞} and u i ∈
R ∪ { + ∞} ,which is the common model structure in systems biology.
Moreover, any generalized linear model [Equation] i [Equation]
i [Equation] , e.g., the logistic model, can be rewritten in the form
[Equation]
where K =
Π K i and each K i =
{ ( s i , t i ) :
f i ( s i ) ≤ t i } is a two-dimensional convex set.
The Challenges of Practical Sampling.
High dimensional sampling has been widely studied inboth the theoretical computer science and the statistics communities.
Many popular samplers areﬁrst-order methods, such as MALA [41], basic HMC [36, 13] and NUTS [21], which update the
Markov chain based on the gradient information of f .
The runtime of such methods can dependon the condition number of the function f [14, 28, 7, 8, 43].
However, the condition number ofreal-world applications can be very large.
For example, RECON1 [26], a reconstruction of the humanmetabolic network, can have condition number as large as 10 6 due to the dramatically different ordersof different chemicals’ concentrations.
Motivated by sampling from ill-conditioned distributions,another class of samplers use higher-order information such as Hessian of f to take into accountthe local structure of the problems [44, 9].
However, such samplers cannot handle non-smoothdistributions, such as hinge-loss, lasso, or uniform densities over polytopes.
For non-smooth distributions, the best polytime methods are based on discretizations of Brownianmotion, e.g., the Ball walk [24] (and its afﬁne-invariant cousin, the Dikin walk [25]), which takes arandom step in a ball of a ﬁxed size around the current point.
Hit-and-Run [33] builds on these byavoiding an explicit step size and going to a random point along a random line through the currentpoint.
Both approaches hit the same bottleneck — in a polytope that contains a unit ball, the step sizeshould be O (1 / √ n ) to avoid stepping out of the body with large probability.
This leads to quadraticbounds (in dimension) on the number of steps to “mix”.
Due to the reduction mentioned in (1.2), non-smooth distributions can be translated to the form in (1.1)with constraint K .
Both the ﬁrst and higher-order sampler and the polytime non-smooth samplers have their limitations in handling distributions with non-smooth objective function or constraint K .
Given the limitations of all previous samplers, a natural question we want to ask is the following.
Question.
Can we develop a practically efﬁcient sampler that can handle the constrained problem in(1.1) and preserve sparsity with mixing time independent of the condition number?
In some applications, smoothness and condition number can be controlled with tailor-made models.
Our goal here is to propose a general solver that can sample from any non-smooth distributions asgiven.
For traditional samplers such as the Ball walk and Hit-and-Run, as mentioned earlier, thestep size needs to be small so that the process does not step out.
An approach that gets around thisbottleneck is Hamiltonian Monte Carlo (HMC), where the next step is given by a point along a
Hamiltonian-preserving curve according to a suitably chosen Hamiltonian.
It has two advantages.
First, the steps are no longer straight lines in Euclidean space, and we no longer have the concern of“stepping out”.
Second, the process is symplectic (so measure-preserving), and hence the ﬁltering stepis easy to compute.
It was shown in [30] that signiﬁcantly longer steps can be taken and the processwith a convergence analysis in the setting of Hessian manifolds, leading to subquadratic convergencefor uniformly sampling polytopes.
To make this practical, however, is a formidable challenge.
There are two high-level difﬁculties.
Oneis that many real-world instances are highly skewed (far from isotropic) and hence it is importantto use the local geometry of the density function.
This means efﬁciently computing or maintainingsecond-order information such as a Hessian of the logarithm of the density.
This can be done inthe Riemannian HMC (RHMC) framework [16, 30], but the computation of the next step requiressolving the Hamiltonian ODE to high accuracy, which in turn needs the computation of leveragescores, a procedure that takes at least matrix-multiplication time in the worst case.
Another importantdifﬁculty is maintaining hard linear constraints.
Existing high-dimensional packages do not allowfor constraints (they must be somehow incorporated into the target density), and RHMC is usuallyconsidered with a full-dimensional feasible region such as a full-dimensional polytope.
This can alsobe done in the presence of linear equalities by working in the afﬁne subspace deﬁned by the equalities,but this has the effect of losing any sparsity inherent in the problem and turning all coefﬁcient matricesand objective coefﬁcients into dense objects, thereby potentially incurring a quadratic blow-up.
Our Solution: Constrained Riemannian Hamiltonian Monte Carlo (CRHMC).
We develop aconstrained version of RHMC, maintaining both sparsity and constraints .
Our reﬁnement of RHMCensures that the process satisﬁes the given constraints throughout, without incurring a signiﬁcantoverhead in time or sparsity.
It works even if the resulting feasible region is poorly conditioned.
Sincemany instances in practice are ill-conditioned and have degeneracies, we believe this is a crucialaspect.
Our algorithm outperforms existing packages by orders of magnitude.
In Section 2, we give the main ingredients of the algorithm and discuss how we overcome thechallenges that prevent us from sampling efﬁciently in practice.
Following that, in Section 3, wepresent empirical results on several benchmark datasets, showing that CRHMC successfully samplesmuch larger models than previously known to be possible, and is signiﬁcantly faster in terms of rateof convergence (“number of steps”) and total sampling time.
Our complete package is available atthis anonymized link.
We refer the reader to Appendix E for notations and deﬁnitions.
Algorithm: Constrained RHMC
In this section, we propose a constrained Riemannian Hamiltonian Monte Carlo (CRHMC 1 ) algorithmto sample from a distributions of the forme − f ( x ) subject to c ( x ) =where the constraint function c : R n → R m satisﬁes the property that the Jacobian Dc ( x ) has fullrank for all x such that c ( x ) = 0 .
It is useful to keep in mind the case when c ( x ) = 0 is an afﬁnesubspace
Ax = b , in which case Dc ( x ) = A , and the full-rank condition simply says that the rows of
A are independent.
We refer readers to [1, 40, 4] for preliminary versions of CRHMC called the constrained Hamiltonian
Monte Carlo (CHMC).
In particular, we note that [4] provided the same framework that can be1 pronounced “crumch”. extended to CRHMC, and in fact they mention CRHMC as a possible variant.
However, theiralgorithm for CRHMC requires eigenvalue decomposition and is not efﬁcient for large problems,which takes n 3 time and n 2 space per MCMC step in practice.
In this section, we propose analgorithm that overcomes those limitations, leading to n 1 . 5 time and n space in practice.
2.1 Basics of CRHMC
To introduce our algorithm, we ﬁrst recall the RHMC algorithm
(Algorithm 1).
In RHMC, we extendthe space x to the pair ( x, v ) , where v denotes the velocity .
Instead of sampling from e − f ( x ) , RHMCsamples from the distribution e − H ( x,v ) , where H ( x, v ) is the Hamiltonian, and then outputs x .
Tomake sure the distribution is correct, we choose the Hamiltonian such that the marginal of e − H ( x,v )along v is proportional to e − f ( x ) .
One common choice of H ( x, v ) is
[Equation]
2.1) where M ( x ) is a position-dependent positive deﬁnite matrix deﬁned on R n .
Algorithm 1:
Input: Initial point x (0) , step size h for k = 1 , 2 , · · · do // Step 1: resample v
Sample v ( k − 12 ) ∼ N (0 , M ( x ( k − 1) )) and set x ( k − 12 ) ← x ( k − 1) .
// Step 2:
Hamiltonian dynamics
Solve the ODE
[Equation]
with H deﬁned in (2.1) and the initial point given by ( x ( k − 12 ) , v ( k − 12 ) ) .
Set x ( k ) ← x ( h ) and v ( k ) ← v ( h ) .
end
To extend RHMC to the constrained case, we need to make sure both Step 1 and Step 2 satisfy theconstraints, so the Hamiltonian dynamic has to maintain c ( x ) = [-
-]0 throughout Step 2.
Note that
[Equation]
where Dc ( x ) is the Jacobian of c at x .
With H deﬁned in (2.1), Condition (2.3) becomes Dc ( x ) M ( x ) − 1 v = 0 .
However, for full rank Dc ( x ) , if M ( x ) is invertible,then Range( v ) =
Range( N (0 , M ( x )))
=
R n immediately violates this condition due todim( Null( Dc ( x ) M − 1 ( x ) ) )
= n − m .
To get around this issue, we use a non-invertible matrix
M ( x ) with its pseudo-inverse M ( x ) † to satisfy Dc ( x ) M ( x ) † v = 0 for any v ∈ Range( M ( x )) .
Since we want the step to be able to move in all directions satisfying c ( x ) = 0 , we impose thefollowing condition with Range( M ( x ))
=
Range( M ( x ) † ) in mind:
[Equation]
which can be achieved by M ( x ) proposed soon.
Under the condition (2.4), we sample v from N (0 , M ( x )) in Step 1, which is equivalent to samplingfrom e − H ( x,v ) subject to v ∈ Range( M ( x )) =
Null( Dc ( x )) .
Also, the stationary distribution of
CRHMC should be proportional toe − H ( x,v ) subject to c ( x ) = 0 and v ∈ Null
( Dc ( x )) .
Here, to maintain v ∈ Null( Dc ( x )) during Step 2 we add a Lagrangian term to H .
Without the
Lagrangian term, v t would escape from Null( Dc ( x t )) =
Range( M ( x t )) in Step 2 as seen in the proof of Lemma 1, which contradicts Range( v t ) =
Range( N (0 , M ( x t )))
=
Range( M ( x t )) .
Theconstrained Hamiltonian we propose is (See its rigorous derivation in Lemma 1)
H ( x, v ) =
H ( x, v ) + λ ( x, v ) (cid:62) c ( x ) with H ( x, v ) =
f ( x ) + 1 2 v (cid:62) M
( x ) † v + log pdet( M ( x )) (2.5) where λ ( x t , v t ) =
[Equation] 1 (cid:16) D 2 c ( x t ) [ v t , dx t dt ] − Dc ( x t ) ∂H ( x t ,v t ) ∂x (cid:17) .
Here, pdet denotes pseudo-determinant and λ ( x, v ) is picked so
that v ∈ Null( Dc ( x )) .
An algorithmic descriptionof CRHMC is the same as Algorithm 1 with the constrained H in place of the unconstrained H .
Weshow the convergence of CRHMC to the correct distribution exp( − f ( x )) in Appendix B.3.
Choice of M .
The construction of the Hamiltonian (2.5) relies on having a family of positivesemi-deﬁnite matrix M ( x ) satisfying the condition (2.4) (i.e., Range( M ( x )) =
Null( Dc ( x )) ).
Onenatural choice is the orthogonal projection to Null( Dc ( x )) :
[Equation]
[Equation]
.6) which is similar to the choice in [4].
For the problem we care about, there are often extra constraintson x . For example, let’s consider a simple constraint K = { x ≥ 0 } .
In the standard HMC algorithm,we have dxdt ∼ N (0 , M ( x ) − 1 ) .
To ensure every direction is moving towards/away from x = 0multiplicatively, a natural choice of M is M ( x ) =
diag( x − 2 ) .
To generalize this to any convexset K , we make use of some convex function φ ( x ) , a barrier function , deﬁned on K such thatφ ( x ) → + ∞ as x → ∂K .
Using the barrier function φ , we can deﬁne the corresponding familyof positive semi-deﬁnite matrices g ( x ) = ∇ 2 φ ( x ) .
For the constrained case, we need M ( x ) tohave its range match the null space of Dc ( x ) and agree with g ( x ) in its range.
We can verify M ( x ) =
Q ( x ) (cid:62) g ( x ) Q ( x ) , where Q ( x ) is the symmetric matrix deﬁned in (2.6), satisﬁes these twoconstraints.
2.2 Efﬁcient Computation of ∂H/∂x and ∂H/∂v
With M ( x ) =
Q ( x ) · g ( x ) · Q ( x ) , we have all the pieces of the algorithm.
However, using this naivealgorithm to compute ∂H/∂x and ∂H/∂v , we face several challenges.
The algorithm involves computing the pseudo-inverse and its derivatives, which takes O ( n 3 )
except for very special matrices.2.
The Lagrangian term in the constrained Hamiltonian dynamic requires additional computationsuch as the second-order derivative of c ( x ) .
A naive approach to computing leverage scores in ∂H/∂x results in a very dense matrix.
Those challenges make the algorithm hard to implement and inefﬁcient, especially when the dimensionis high.
In the following paragraphs, we give an overview of how we overcome each of the challengesabove.
We defer a more detailed discussion of our approaches and the proofs to Appendix B.2.
Avoiding Pseudo-inverse and Pseudo-determinant.
We are able to show equivalent formulas for
M ( x ) † and log pdet M ( x ) that can take advantage of sparse linear system solvers.
In particular, weshow that M ( x ) † = g ( x ) − 12 · ( I − P ( x )) · g ( x ) − 12 , where
[Equation]
As mentioned earlier, a majority of convex sets appearing in practice are of the form K = (cid:81)
i K i ,where K i are constant dimensional convex sets.
In this case, we will choose g ( x ) to be a blockdiagonal matrix with each block of size O (1) .
Hence, the bottleneck of applying P ( x ) to a vector issimply solving a linear system of the form ( Dc · g − 1 · Dc (cid:62) )
u
= b for some b .
The existing sparselinear system solvers can solve large classes of sparse linear system much faster than O ( n 3 ) time[12].
For log pdet M ( x ) , we showlog
[Equation]
This simpliﬁcation allows us to take advantage of sparse Cholesky decomposition.
We prove (2.7)and (2.8) in Lemma 2 and Lemma 3 in Appendix B.2.1,.
The formulas (2.7) and (2.8) avoidthe expensive pseudo-inverse and pseudo-determinant computations, and signiﬁcantly improve thepractical performance of our algorithm.
Simpliﬁcation for Subspace Constraints.
For the case c ( x ) =
Ax − b , the Hamiltonian is now
[Equation]
where P = g − 12 A (cid:62)
( Ag − 1 A (cid:62) ) − 1 Ag − 12 .
The key observation is that the algorithm only needs toknow x ( h ) in the HMC dynamic, and not v ( h ) .
Thus, we can replace H by any other that producesthe same x ( h ) .
We show in Lemma 4 (Appendix B.2.2) that the dynamic corresponding to H aboveis equivalent to the dynamic that corresponds to a much simpler Hamiltonian:
[Equation]
Furthermore, we have
[Equation]
Efﬁcient Computation of Leverage Score.
Even after simplifying the Hamiltonian as above, westill have a term for the leverage scores, Tr( g − 12 ( I − P ) g − 12 Dg ) in dvdt so that we need to computethe diagonal entries of P = g
− 12 A (cid:62) (
Ag − 1 A (cid:62) )
− 1 Ag − 12 to compute dvdt .
Since ( Ag − 1 A (cid:62) ) − 1 canbe extremely dense even when A is very sparse, a naive approach such as direct computation of theinverse can lead to a dense-matrix multiplication.
To avoid dense-matrix multiplication, our approachis based on the fact that certain entries of ( Ag − 1 A (cid:62) ) − 1 can be computed as fast as computingsparse Cholesky decomposition of Ag − 1 A (cid:62) [46, 5], which can be O ( n ) time faster than computing( Ag − 1 A (cid:62) ) − 1 in many settings.
We ﬁrst compute the Cholesky decomposition to obtain a sparsetriangular matrix L such that LL (cid:62) =
Ag − 1 A (cid:62) .
Then, we show that only entries of Ag − 1 A (cid:62) insp ( L ) ∪ sp ( L (cid:62) ) matter in computing diag( A (cid:62) (
Ag − 1 A (cid:62) )
− 1 A ) , where sp ( L ) is the sparsity patternof L .
We give the details of our approach in Appendix B.2.3.
2.3 Discretization
Our algorithm uses the implicit midpoint method (Algorithm 3) to discretize the Hamiltonian processinto steps of step size h and run the process for T iterations.
We write H ( x, v ) =
H 1 ( x, v )+ H 2 ( x, v ) ,where
[Equation]
Starting from ( x 0 , v 0 ) , in the ﬁrst step of the integrator, we run the process on the Hamiltonian H 1with step size h 2 to get ( x 1 / 3 , v 1 / 3 ) .
In the second step of the integrator, we run the process on H 2with step size h by solving
[Equation]
13 − h∂H 2 ∂x (cid:18) x 13 + x , v 13 + v (cid:19) , iteratively using the Newton’s method.
This step involves computing the Cholesky decomposition of( Ag − 1 A (cid:62) )
− 1 using the Cholesky decomposition of Ag − 1 A (cid:62) .
In the third step, we run the process onthe Hamiltonian H 1 with step size h 2 again to get ( x 1 , v 1 ) .
This integrator is symplectic (so measurepreserving) [18], which allows us to use a Metropolis ﬁlter to ensure the distribution is correct so thatwe no longer need to solve ODE to accuracy to maintain the correct stationary distribution.
We state the complete algorithm (Algorithm 2 and Algorithm 3) in Appendix C.1 and give thetheoretical guarantees in Appendix C.2 (convergence of implicit midpoint method), and Appendix D(independence of condition number).
Experiments
In this section, we demonstrate the efﬁciency of our sampler using experiments on real-world datasetsand compare our sampler with existing samplers.
We demonstrate that CRHMC is able to samplelarger models than previously known to be possible, and is signiﬁcantly faster in terms of rate ofconvergence and sampling time in Section 3.2, along with convergence test in Section 3.4.
Weexamine its behavior on benchmark instances such as simplices and Birkhoff polytopes in Section 3.3. [Figure] [Figure]
least inde up to of beneﬁt of speed-up straightfor could not obtain with more until it ran out of time.
3.1 Experimental Setting
Settings.
We performed experiments on the Standard DS12 v2 model from MS Azure cloud, whichhas a 2.1GHz Intel Xeon Platinum 8171M CPU and 28GB memory.
In the experiments, we used our
MATLAB and C++ implementation of CRHMC 2 , which is available at this repository and has beenintegrated into a popular Bioinformatics library.
We used twelve constraint-based metabolic models from molecular systems biology in the COBRA
Toolbox v3.0 [20] and ten real-world LP examples randomly chosen from NETLIB LP test sets.
Apolytope from each model is deﬁned by { x ∈ R n : Ax = b, l ≤ x ≤ u } for A ∈ R m × n , b ∈ R m ,and l, u ∈ R n , which is input to CRHMC for uniform sampling.
We describe in Appendix A how wepreprocessed these dataset, along with full information about the datasets in Table 2.
Comparison.
We used as a baseline the Coordinate Hit-and-Run (CHAR) implemented in twodifferent languages.
The former is Coordinate Hit-and-Run with Rounding (CHRR) written in
MATLAB [10, 19] and the latter is the same algorithm (CDHR) with an R interface and a C++ library,
VolEsti [6].
We refer readers to Appendix A for the details of these algorithms and our comparisonsetup.
We note that popular sampling packages such as STAN and Pyro were not included in theexperiments as they do not support constrained-based models.
Even after transforming our dataset totheir formats, the transformed dataset were too ill-conditioned for those algorithms to run.
CHMC in[4] works only for a region deﬁned by { c ( x ) = 0 } , so we could not use it for comparison.
Measurements.
To evaluate the quality of sampling methods, we measured two quantities, thenumber of steps per effective sample N s (i.e., mixing rate) and the sampling time per effective sample,
T s .
The effective sample size (ESS) can be thought of as the number of actual independent samples,taking into account correlation of samples from a target distribution.
Thus the number of steps pereffective sample N s is estimated by the total number of steps divided by the ESS, and the samplingtime T s is estimated as the total sampling time until termination divided by the ESS.
Each algorithm attempted to draw 1000 uniform samples, with limits on running time set to 1 day(3 days for the largest instance ken_18 ) and memory usage to 6GB.
If an algorithm passes eitherthe time or the memory limit, we stop the algorithm and measure the quantities of interest based onsamples drawn until that moment.
After getting uniform samples, we thinned the samples twice toensure independence of samples; ﬁrst we computed the ESS of the samples, only kept ESS manysamples, and repeated this again.
We estimated the above quantities only if the ESS is more than 10and an algorithm does not run into any error while running 3 .
3. Mixing Rate and Sampling Time
Sub-linear Mixing Rate.
We examined how the number of steps per effective sample N s growswith the number of nonzeros (nnz) of matrix A (after preprocessing) and the number of variables(dimension in the plots).
To this end, we counted the total number of steps taken until termination ofalgorithms and divided it by the effective sample size of drawn samples.
Note that we thinned twiceto ensure independence of samples used.
The mixing rate of CRHMC was sub-linear in both dimension and nnz, whereas previous implementations based on CHAR required at least n 2 steps per sample as seen in Figure 3.1.[-On the dataset,
 Our [Table]-]
On the dataset,mixing rate attained was up to 6 orders of magnitude faster for CRHMC compared to CHAR, implying that CRHMC converged to uniform distribution substantially faster than the other competitors.
This gap in mixing rate increased super-linearly in dimension, enabling CRHMC to run on largeinstances of dimension up to 100000.
[Table]
Sub-quadratic Sampling Time.
We next examined the sampling time T s in terms of both thennz of A and the dimension of the instance.
We computed the runtime of algorithms until theirtermination divided by the effective sample size of drawn samples, where we ignored the time it takesfor preprocessing.
Note that the sampling time T s is essentially multiplication of the mixing rate andthe per-step complexity (i.e., how much time each step takes).
As shown in Figure 3.2 and Table 1, we found that the per-step complexity of CRHMC was smallenough to make the sampling time sub-quadratic in both dimension and nnz, whereas CHAR had atleast a cubic dependency on dimension, despite of a low per-step complexity.
On our dataset, thesampling time of CRHMC was up to 4 orders of magnitude less than that of CHRR and CDHR.
While CHRR can be used on dimension only up to a few thousands, increasing beneﬁts of samplingtime in higher dimension allows CRHMC to run on dimension up to 0.1 million. [Figure]
3.3 CRHMC on Structured Instances
To see the behavior of CRHMC on very large instances, we ran the algorithm on three families ofstructured polytopes – hypercube, simplex, and Birkhoff polytope – up to dimension half-million.
Weattempted to draw 500 uniform samples with a 1 day time limit (except for 2 days for half-milliondimensional Birkhoff polytope).
The deﬁnitions of these polytopes are shown in Appendix A.1.
To the best of our knowledge, this is the ﬁrst demonstration that it is possible to sample such alarge model.
As seen in Figure 3.3, CRHMC can scale smoothly up to half-million dimension onhypercubes and simplices and up to dimension 10 5 for Birkhoff polytopes (we could not obtaina reliable estimate of mixing rate and sampling time on the half-million dimensional Birkhoffpolytope, as the ESS is only 16 after 2 days).
However, we believe that one can ﬁnd room for furtherimprovement of CRHMC by tuning parameters or leveraging engineering techniques.
We also expectthat CRHMC enables us to estimate the volume of B n for n ≥ 20 , going well beyond the previouslybest possible dimension. [Figure]
3.4 Uniformity Test
[Figure]
We used the following uniformity test to check whether samples from CRHMC form the uniformdistribution over a polytope P : check that the fraction of the samples in the scaled set x · P isproportional to x dim .
As seen in Figure 3.4, the empirical CDFs of the radial distribution to the powerof (1/dim) are close to the CDFs of the uniform distribution over those polytopes.
[Figure]
Checklist
For all authors...
(a) Do the main claims made in the abstract and introduction accurately reﬂect the paper’s
contributions and scope?
[Yes]
(b) Did you describe the limitations of your work?
[Yes] In Section 3.3, we mention thatwe could not obtain a reliable estimates of measures in dimension higher than 10 5 andwe believe there is room for further improvement of our algorithm.
(c) Did you discuss any potential negative societal impacts of your work?
[N/A]
Our work
has no negative societal impacts.
(d) Have you read the ethics review guidelines and ensured that your paper conforms to them?
[Yes]
If you are including theoretical results...
(a) Did you state the full set of assumptions of all theoretical results?
[Yes] In Appendix(to which we defer our proofs), we clearly state any assumption if needed.(b)
Did you include complete proofs of all theoretical results?
[Yes] We include all proofsin Appendix.3.
If you ran experiments...
(a) Did you include the code, data, and instructions needed to reproduce the main experi-
mental results (either in the supplemental material or as a URL)?
[Yes] See Section 3and Appendix A.
(b) Did you specify all the training details (e.g., data splits, hyperparameters, how theywere chosen)?
[N/A]
Our algorithm does not require training.
(c) Did you report error bars (e.g., with respect to the random seed after running experiments multiple times)?
[N/A]
(d) Did you include the total amount of compute and the type of resources used (e.g., typeof GPUs, internal cluster, or cloud provider)?
[Yes] We speciﬁed our experimentalsetting in Section 3.
If you are using existing assets (e.g., code, data, models) or curating/releasing new assets...
(a) If your work uses existing assets, did you cite the creators?
[Yes] We made clear
reference to existing packages in Section 3.
(b) Did you mention the license of the assets?
[Yes] See Section 3.
(c) Did you include any new assets either in the supplemental material or as a URL?
[Yes]
We provide an anonymized link to our algorithm package in Section 3.1.
(d) Did you discuss whether and how consent was obtained from people whose data you’re
using/curating?
[N/A] All existing packages we used in the experiment are publicly
available for academic purpose.
(e) Did you discuss whether the data you are using/curating contains personally identiﬁable
information or offensive content?
[N/A] Our datasets consist of metabolic models
from molecular system biology and LP examples, which have no personally identiﬁable
information or offensive content.
If you used crowdsourcing or conducted research with human subjects...
(a) Did you include the full text of instructions given to participants and screenshots, if
applicable?
[N/A]
(b) Did you describe any potential participant risks, with links to Institutional Review
Board (IRB) approvals, if applicable?
[N/A]
(c) Did you include the estimated hourly wage paid to participants and the total amount
spent on participant compensation?
[N/A]
[Table]