Title: Optimal Preconditioning and Fisher Adaptive Langevin Sampling
Venue: NeurIPS 2023
Accepted: yes
Keywords: MCMC

Langevin diffusion

preconditioning

Fisher information

adaptive MCMC

score function
Abstract: We define  an optimal preconditioning for the Langevin diffusion by analytically optimizing the expected squared jumped distance. This yields as the optimal preconditioning an inverse Fisher information covariance matrix, where the covariance matrix is computed as the outer product of log target gradients averaged under the target.  We apply this result to the Metropolis adjusted Langevin algorithm (MALA)  and derive a computationally efficient adaptive MCMC scheme that learns the preconditioning from the history of gradients produced as the algorithm runs. We show in several experiments that the proposed algorithm is very robust in high dimensions and significantly outperforms other methods, including a closely related adaptive MALA scheme that learns the preconditioning with standard adaptive MCMC as well as the position-dependent  Riemannian manifold MALA sampler.

Optimal Preconditioning and Fisher Adaptive Langevin Sampling

Abstract

We define an optimal preconditioning for the Langevin diffusion by analytically optimizing the expected squared jumped distance. This yields as the optimal preconditioning an inverse Fisher information covariance matrix, where the covariance matrix is computed as the outer product of log target gradients averaged under the target. We apply this result to the Metropolis adjusted Langevin algorithm (MALA) and derive a computationally efficient adaptive MCMC scheme that learns the preconditioning from the history of gradients produced as the algorithm runs. We show in several experiments that the proposed algorithm is very robust in high dimensions and significantly outperforms other methods, including a closely related adaptive MALA scheme that learns the preconditioning with standard adaptive MCMCas well as the position-dependent Riemannian manifold MALA sampler.

1 Introduction

Markov chain Monte Carlo (MCMC) is a general framework for simulating from arbitrarily complex distributions, and it has shown to be useful for statistical inference in a wide range of problems [18, 11]. The main idea of an MCMC algorithm is quite simple. Given a complex target π ( x ) , a Markov chain is constructed using a π -invariant transition kernel that allows to simulate dependent realizations x 1 , x 2 , . . . that eventually converge to samples from π . These samples can be used for Monte Carlo integration by forming ergodic averages. A general way to define π -invariant transition kernels is the Metropolis-Hastings accept-reject mechanism in which the chain moves from state x n to the next state x n +1 by first generating a candidate state y n from a proposal distribution q ( y n | x n ) and then it sets x n +1 = y n with probability α ( x n , y n ) :

or otherwise rejects y n and sets x n +1 = x n . The choice of the proposal distribution q ( y n | x n ) is crucial because it determines the mixing of the chain, i.e. the dependence of samples across time. For example, a "slowly mixing" chain even after convergence may not be useful for Monte Carlo integration since it will output a highly dependent set of samples producing ergodic estimates of very high variance. Different ways of defining q ( y n | x n ) lead to common algorithms such as random walk Metropolis (RWM), Metropolis-adjusted Langevin algorithm (MALA) [40, 35] and Hamiltonian Monte Carlo (HMC) [15, 28]. Within each class of these algorithms adaptation of parameters of the proposal distribution, such as a step size, is also important and this has been widely studied in the literature by producing optimal scaling results [34, 35, 36, 22, 6, 8, 38, 7, 39, 9], and also by developing adaptive MCMC algorithms [21, 5, 37, 19, 2, 1, 4, 24]. The standard adaptive MCMC procedure in [21] uses the history of the chain to recursively compute an empirical covariance of the target π and build a multivariate Gaussian proposal distribution. However, this type of covariance adaptation can be too slow and not so robust in high dimensional settings [38, 3].

In this paper, we derive a fast and very robust adaptive MCMC technique in high dimensions that learns a preconditioning matrix for the MALA method, which is the standard gradient-based MCMC algorithm obtained by a first-order discretization of the continuous-time Langevin diffusion. Our first contribution is to define an optimal preconditioning by analytically optimizing a criterion on the Langevin diffusion. The criterion is the well-known expected squared jumped distance [30] which at optimum yields as a preconditioner the inverse matrix I -1 of the following Fisher information covariance matrix I = E π ( x ) [ ∇ log π ( x ) ∇ log π ( x ) ⊤ ] . This contradicts the common belief in adaptive MCMC that the covariance of π is the best preconditioner. While this is a surprising result we show that I -1 connects with a certain quantity appearing in optimal scaling of RWM [34, 36].

Having recognized I -1 as the optimal preconditioning we derive an easy to implement and computationally efficient adaptive MCMC algorithm that learns from the history of gradients produced as MALA runs. This method sequentially updates an empirical inverse Fisher estimate ˆ I -1 n using a recursion having quadratic cost O ( d 2 ) ( d is the dimension of x ) per iteration. In practice, since for sampling we need a square root matrix of ˆ I -1 n we implement the recursions over a square root matrix by adopting classical results from Kalman filtering [31, 10]. We compare our method against MALA that learns the preconditioning with standard adaptive MCMC [21], a position-dependent Riemannian manifold MALA [20] as well as simple MALA (without preconditioning) and HMC. In several experiments we show that the proposed algorithm significantly outperforms all other methods.

2 Background

We consider an intractable target distribution π ( x ) with x ∈ R d , known up to some normalizing constant, and we assume that ∇ log π ( x ) := ∇ x log π ( x ) is well defined. A continuous time process with stationary distribution π is the overdamped Langevin diffusion

where B t denotes d -dimensional Brownian motion. This is a stochastic differential equation (SDE) that generates sample paths such that for large t , x t ∼ π . Wealso incorporate a preconditioning matrix A , which is a symmetric positive definite covariance matrix, while √ A is such that √ A √ A ⊤ = A .

Simulating from the SDE in (2) is intractable and the standard approach is to use a first-order EulerMaruyama discretization combined with a Metropolis-Hastings adjustment. This leads to the so called preconditioned Metropolis-adjusted Langevin algorithm (MALA) where at each iteration given the current state x n (where n = 1 , 2 , . . . ) we sample y n from the proposal distribution

where the step size σ 2 > 0 appears due to time discretization. We accept y n with probability α ( x n , y n ) = min (1 , a n ) where a n follows the form in (1). The obvious way to compute a n is

where || z || 2 A -1 = z ⊤ A -1 z . However, in some cases that involve high dimensional targets, this can be costly since in the ratio of proposal densities both the preconditioning matrix A and its inverse A -1 appear. In turns out that we can avoid A -1 and simplify the computation as stated below.

Proposition 1. For preconditioned MALA with proposal density given by (3) the ratio of proposals in the M-H acceptance probability can be written as

This expression does not depend on the inverse A -1 , and this leads to computational gains and simplified implementation that we exploit in the adaptive MCMC algorithm presented in Section 4.

The motivation behind the use of preconditioned MALA is that with a suitable preconditioner A the mixing of the chain can be drastically improved, especially for very anisotropic target distributions.

A very general way to specify A is by applying an adaptive MCMC algorithm, which learns A online. To design such an algorithm it is useful to first specify a notion of optimality. A common argument in the literature, that is used for both RWM and MALA, is that a suitable A is the unknown covariance matrix Σ [21, 38, 24] of the target π . This means that we should learn A so that to approximate Σ . However, this argument is rather heuristic since it is not based on an optimality criterion. One of our contributions is to specify an optimal A ∗ based on an optimization procedure, that we describe in Section 3. This A ∗ will turn out to be not the covariance matrix of the target but an inverse Fisher information matrix.

3 Optimal preconditioning using expected squared jumped distance

Preconditioning aims to improve sampling when different directions (or individual variables x i ) in the state space can have different scalings under the target π . Here, we develop a method for selecting the preconditioning through the optimization of an objective function. This method uses the observation that an effective preconditioning correlates with large values of the global step size σ 2 in MALA, i.e. σ 2 is allowed to increase when preconditioning becomes effective as shown in the sampling efficiency scores in Table 1 and the corresponding estimated step sizes reported in Appendix E.1.

In our analysis we consider the rejection-free or unadjusted Langevin sampler where we discretize the time continuous Langevin diffusion in (2) with a small finite δ := σ 2 > 0 so that

We will use the expected squared jumped distance J ( δ, A ) = E [ || x t + δ -x t || 2 ] computed as follows. Proposition 2. If x t ∼ π ( x t ) the vector x t + δ -x t defined by (4) has zero mean and covariance

Further, tr ( E [( x t + δ -x t )( x t + δ -x t ) ⊤ ] ) = E [ tr ( ( x t + δ -x t )( x t + δ -x t ) ⊤ ) ] = E [ || x t + δ -x t || 2 ] , which shows that J ( δ, A ) is the trace of the covariance matrix in (5) .

To control discretization error we impose an upper bound constraint J ( δ, A ) ≤ ϵ for a small ϵ > 0 . A preconditioning that "symmetrizes" the target can be obtained by maximizing the discretization step size δ subject to J ( δ, A ) ≤ ϵ . Since J ( δ, A ) monotonically increases with δ , the maximum δ ∗ satisfies min A J ( δ ∗ , A ) = ϵ . This means that the optimal preconditioning A ∗ is obtained by minimizing J ( δ, A ) under some global scale constraint on A , as stated next.

Proposition 3. Suppose A is a symmetric positive definite matrix satisfying tr ( A ) = c , with c > 0 a constant. Then the objective J ( δ, A ) , for any δ > 0 , is miminized for A ∗ given by

where µ i s are the eigenvalues of I assumed to satisfy 0 < µ i < ∞ .

The positive multiplicative scalar k in (6) is not important since the specific value c > 0 is arbitrary, e.g. if we choose c = ∑ d i =1 1 µ i then k = 1 and A ∗ = I -1 . In other words, what matters is that the optimal A ∗ is proportional to the inverse matrix I -1 , so it follows the curvature of I -1 . For a multivariate Gaussian π ( x ) = N ( x | µ, Σ) it holds I -1 = Σ , so the optimal preconditioner coincides with the covariance matrix of x . More generally though, for non-Gaussian targets this will not hold.

Connection with classical Fisher information matrix. The matrix I is positive definite since it is the covariance of the gradient ∇ log π ( x ) := ∇ x log π ( x ) where E π ( x ) [ ∇ log π ( x )] = 0 . Also, I is similar to the classical Fisher information matrix. To illustrate some differences suppose that the target π ( x ) is a Bayesian posterior π ( θ | Y ) ∝ p ( Y | θ ) p ( θ ) = p ( Y, θ ) where Y are the observations and θ := x are the random parameters. The classical Fisher information is a frequentist quantity where we fix some parameters θ and compute G ( θ ) = E p ( Y | θ ) [ ∇ θ log p ( Y | θ ) ∇ θ log p ( Y | θ ) ⊤ ] by averaging over data. In contrast, I = E p ( θ | Y ) [ ∇ θ log p ( Y, θ ) ∇ θ log p ( Y, θ ) ⊤ ] is more like a Bayesian quantity where we fix the data Y and average over the parameters θ . Importantly, I is not a function of θ while G ( θ ) is. Similarly to the classical Fisher information, I also satisfies the following standard property: Given that log π ( x ) is twice differentiable and ∇ 2 x log π ( x ) is the Hessian matrix, I from (6) is also written as I = -E π ( x ) [ ∇ 2 x log π ( x )] . Next, we refer to I as the Fisher matrix.

Connection with optimal scaling. The Fisher matrix I connects also with the optimal scaling result for the RWM algorithm [34, 36]. Specifically, for targets of the form π ( x ) = ∏ d i =1 f ( x i ) , the RWM proposal q ( y n | x n ) = N ( y n | x n , ( σ 2 /d ) I d ) and as d → ∞ the optimal parameter σ 2 is σ 2 = 2 . 38 J where J = E f ( x ) [( d log f ( x ) dx ) 2 ] is the (univariate) Fisher information for the univariate density f ( x ) , and the preconditioning involves as in our case the inverse Fisher I -1 = 1 J I d . This result has been generalized also for heterogeneous targets in [36] where again the inverse Fisher information matrix (having now a more general diagonal form) appears as the optimal preconditioner.

4 Fisher information adaptive MALA

Armed with the previous optimality result, we wish to develop an adaptive MCMC algorithm to optimize the proposal in (3) by learning online the global variance σ 2 and the preconditioner A . For σ 2 we follow the standard practice to tune this parameter in order to reach an average acceptance rate around 0 . 574 as suggested by optimal scaling results [35, 36]. For the matrix A we want to adapt it so that approximately it becomes proportional to the inverse Fisher I -1 from (6). We also incorporate a parametrization that helps the adaptation of σ 2 to be more independent from the one of A . Specifically, we remove the global scale from A by defining the overall proposal as

where σ 2 is normalized by 1 d tr ( A ) , i.e. the average eigenvalue of A . Another way to view this is that the effective preconditioner is A/ ( 1 d tr ( A )) which has an average eigenvalue equal to one. The proposal in (7) is invariant to any scaling of A , i.e. if A is replaced by kA (with k > 0 ) the proposal remains the same. Also, note that when A is the identity matrix I d (or a multiple of identity) then 1 d tr ( I d ) = 1 and the above proposal reduces to standard MALA with isotropic step size σ 2 .

It is straightforward to adapt σ 2 towards an average acceptance rate 0 . 574 ; see pseudocode in Algorithm 1. Thus our main focus next is to describe the learning update for A , in fact eventually not for A itself but for a square root matrix √ A which is what we need to sample from the proposal in (7).

To start with, let us simplify notation by writing the score function at the n -th MCMC iteration as s n := ∇ x n log π ( x n ) . We introduce the n -sample empirical Fisher estimate

where λ > 0 is a fixed damping parameter. Given that certain conditions apply [21, 38] so that the chain converges and ergodic averages converge to exact expected values, ˆ I n is a consistent estimator satisfying lim n →∞ ˆ I n = I since as n →∞ the damping part λ n I d vanishes. Including the damping is very important since it offers a Tikhonov-like regularization, similar to ridge regression, and it ensures that for any finite n the eigenvalues of ˆ I n are strictly positive. An estimate then for the preconditioner A n can be set to be proportional to the inverse of the empirical Fisher ˆ I n , i.e.

Since any positive multiplicative scalar in front of A n plays no role, we can ignore the scalar n and define A n = ( ∑ n i =1 s i s ⊤ i + λI d ) -1 . Then, as MCMC iterates we can adapt A n in O ( d 2 ) cost per iteration based on the recursion

where we applied Woodbury matrix identity. This estimation in the limit can give the optimal preconditioning in the sense that under the ergodicity assumption, lim n →∞ A n tr ( A n ) = I -1 tr ( I -1 ) . In

practice we do not need to compute directly the matrix A n but a square root matrix R n := √ A n , such that R n R ⊤ n = A n , since we need a square root matrix to draw samples from the proposal in (7). To express the corresponding recursion for R n we will rely on a technique that dates back to the early days of Kalman filtering [31, 10], which applied to our case gives the following result.

Proposition 4. A square root matrix R n , such that R n R ⊤ n = A n , can be computed recursively in O ( d 2 ) time per iteration as follows:

A way to generalize the above recursive estimation of a square root for the inverse Fisher matrix is to consider the stochastic approximation framework [33]. This requires to write an online learning update for the empirical Fisher of the form

where the learning rates γ n satisfy the standard conditions ∑ ∞ n =1 γ n = ∞ , ∑ ∞ n =1 γ 2 n < ∞ . Then, it is straightforward to generalize the recursion for the square root matrix in Proposition 4 to account for this more general case; see Appendix B. The recursion in Proposition 4 is a special case when γ n = 1 n . In our simulations we did not observe significant improvement by using more general learning rate sequences, and therefore in all our experiments in Section 5 we use the standard learning rate γ n = 1 n . Note that this learning rate is also used by other adaptive MCMC methods [21].

̸

An adaptive algorithm that learns online from the score function vectors s n can work well in some cases, but still it can be unstable in general. One reason is that s n = ∇ log π ( x n ) will not have zero expectation when the chain is transient and states x n are not yet draws from the stationary distribution π . To analyze this, note that the learning signal s n enters in the empirical Fisher estimator ¯ I n through the outer product s n s ⊤ n as shown by Eqs. (8) and (14). However, in the transient phase s n s ⊤ n will be biased since the expectation E [ s n s ⊤ n ] = E [( s n -E [ s n ])( s n -E [ s n ]) ⊤ ] + E [ s n ] E [ s n ] ⊤ = I , where the expectations are taken under the marginal distribution of the chain at time n . In practice the mean vector E [ s n ] can take large absolute values, which can introduce significant bias through the additive term E [ s n ] E [ s n ] ⊤ . Thus, to reduce some bias we could track the empirical mean ¯ s n = 1 n ∑ n i =1 s i and center the signal s n -¯ s n so that the Fisher matrix is estimated by the empirical covariance 1 n -1 ∑ n i =1 ( s i -¯ s n )( s i -¯ s n ) ⊤ . The recursive estimation becomes similar to standard adaptive MCMC [21] where we recursively propagate an online empirical estimate for the mean of s n and incorporate it into the online empirical estimate of the covariance matrix (in our case the inverse Fisher matrix); see Eq. (17) in Section 5 for the standard adaptive MCMC recursion [21] and Appendix C for our Fisher method. While this can make learning quite stable we experimentally discovered that there is another scheme, presented next in Section 4.1, that is significantly better and stable especially for very anisotropic high dimensional targets; see detailed results in Appendix E.3.

4.1 Adapting to score function increments

An MCMC algorithm updates at each iteration its state according to x n +1 = x n + I ( u n < α ( x n , y n ))( y n -x n ) where α ( x n , y n ) is the M-H probability, u n ∼ U (0 , 1) is an uniform random number and I ( · ) is the indicator function. This sets x n +1 to either the proposal y n or the previous state x n based on the binary value I ( u n < α ( x n , y n )) . Similarly, we can consider the update of the score function s ( x ) = ∇ log π ( x ) and conveniently re-arrange it as an increment,

While both s n and s δ n have zero expectation when x n is from stationarity, i.e. x n ∼ π , the increment s δ n (unlike s n ) tends in practice to be more centered and close to zero even when the chain is transient, e.g. note that s δ n is zero when y n is rejected. Further, since the difference s δ n = s ( x n +1 ) -s ( x n ) conveys information about the covariance of the score function we can use it in the recursion of

Algorithm 1 Fisher adaptive MALA (blue lines are ommitted when not adapting ( R,σ 2 ) )

end for

Proposition 4 to learn the preconditioner A , where we simply replace s n by s δ n . As shown in the experiments this leads to a remarkably fast and effective adaptation of the inverse Fisher matrix I -1 without observable bias, or at least no observable for Gaussian targets where the true I -1 is known. We can further apply Rao-Blackwellization to reduce some variance of s δ n . Since s δ n enters into the estimation of the empirical Fisher, see Eq. (8) or (14), through the outer product s δ n ( s δ n ) ⊤ = I ( u n < α ( x n , y n ))( s ( y n ) -s ( x n ))( s ( y n ) -s ( x n )) ⊤ we can marginalize out the r.v. u n which yields E u n [ s δ n ( s δ n ) ⊤ ] = α ( x n , y n )( s ( y n ) -s ( x n ))( s ( y n ) -s ( x n )) ⊤ . After this RaoBlackwellization an alternative vector to use for adaptation is

which depends on the square root √ α ( x n , y n ) of the M-H probability. As long as α ( x n , y n ) > 0 , the learning signal in (16) depends on the proposed sample y n even when it is rejected.

Finally, we can express the full algorithm for Fisher information adaptive MALA as outlined by Algorithm 1, which adapts by using the Rao-Blackwellized score function increments from Eq. (16). Note that, while Algorithm 1 uses s δ n from Eq. (16), the initial signal from Eq. (15) works equally well; see Appendix E.3. Also, the algorithm includes an initialization phase where simple MALA runs for few iterations to move away from the initial state, as discussed further in Section 5.

5 Experiments

5.1 Methods and experimental setup

We apply the Fisher information adaptive MALA algorithm (FisherMALA) to high dimensional problems and we compare it with the following other samplers. (i) The simple MALA sampler with proposal N ( y n | x n +( σ 2 / 2) ∇ log π ( x n ) , σ 2 I ) , which adapts only a step size σ 2 without having a preconditioner. (ii) A preconditioned adaptive MALA (AdaMALA) where the proposal follows exactly the from in (7) but where the preconditioning matrix is learned using standard adaptive MCMCbased on the well-known recursion from [21]:

where the recursion is initialized at µ 1 = x 1 and Σ 2 = 1 2 ( x 2 -µ 1 )( x 2 -µ 1 ) ⊤ + λI , and λ > 0 is the damping parameter that plays the same role as in FisherMALA. (iii) The Riemannian manifold MALA (mMALA) [20] which uses position-dependent preconditioning matrix A ( x ) . mMALAin high dimensions runs slower than other schemes since the computation of A ( x ) may involve second derivatives and requires matrix decomposition that costs O ( d 3 ) per iteration. (iv) Finally, we include in the comparison the Hamiltonian Monte Carlo (HMC) sampler with a fixed number of 10 leap frog steps and identity mass matrix. We leave the possibility to learn with our method a preconditioner in HMCfor future work since this is more involved; see discussion at Section 7.

For all experiments and samplers we consider 2 × 10 4 burn-in iterations and 2 × 10 4 iterations for collecting samples. We set λ = 10 in FisherMALA and AdaMALA. Adaptation of the proposal distributions, i.e. the parameter σ 2 , the preconditioning or the step size of HMC, occurs only during burn-in and at collection of samples stage the proposal parameters are kept fixed. For all three MALA schemes the global step size σ 2 is adapted to achieve an acceptance rate around 0 . 574 (see Algorithm 1) while the corresponding parameter for HMC is adapted towards 0 . 651 rate [9]. In FisherMALA from the 2 × 10 4 burn-in iterations the first 500 iterations are used as the initialization phase in Algorithm 1 where samples are generated by just MALA with adaptable σ 2 . Thus, only the last 1 . 95 × 10 4 burn-in iterations are used to adapt the preconditioner. For AdaMALA this initialization scheme proved to be unstable and we used a more elaborate scheme, as described in Appendix D.

We compute effective sample size (ESS) scores for each method by using the 2 × 10 4 samples from the collection phase. We estimate ESS across each dimension of the state vector x , and we report maximum, median and minimum values, by using the built-in method in TensorFlow Probability Python package. Also, we show visualizations that indicate sampling efficiency or effectiveness in estimating the preconditioner (when the ground truth preconditioner is known).

5.2 Gaussian targets

We consider three examples of multivariate Gaussian targets of the form π ( x ) = N ( x | µ, Σ) , where the optimal preconditioner (up to any positive scaling) is the covariance matrix Σ since the inverse Fisher is I -1 = Σ . For such case the Riemannian manifold sampler mMALA [20] is the optimal MALA sampler since it uses precisely Σ as the preconditioning. In contrast to mMALA which somehow has access to the ground-truth oracle, both FisherMALA and AdaMALA use adaptive recursive estimates of the preconditioner that should converge to the optimal Σ , and thus the question is which of them learns faster. To quantify this we compute the Frobenius norm || ˜ A n -˜ Σ || F across adaptation iterations n , where ˜ B denotes the matrix normalized by the average trace, i.e. ˜ B = B/ ( tr ( B ) d ) , for either A n given by FisherMALA or A n := Σ n given by AdaMALA and where ˜ Σ is the optimal normalized preconditioner. The faster the Frobenius norm goes to zero the more effective is the corresponding adaptive scheme. For all three Gaussian targets the mean vector µ was taken to be the vector of ones and samplers were initialized by drawing from standard normal. The first example is a two-dimensional Gaussian target with covariance matrix Σ = [1 0 . 995; 0 . 995 1] . Both FisherMALA and AdaMALA perform almost the same (FisherMALA has faster convergence) in this low dimensional example as shown by Frobenius norm in Figure 1a; see also Figure 5 in the Appendix for visualizations of the adapted preconditioners. The following two examples involve 100-dimensional targets.

Gaussian process correlated target. We consider a Gaussian process to construct a 100dimensional Gaussian where the covariance matrix is obtained by a non-stationary covariance function comprising the product of linear and squared exponential kernels plus small white noise, i.e. [Σ] i,j = s i s j exp {-1 2 ( s i -s j ) 2 0 . 09 } + 0 . 001 δ i,j where the scalar inputs s i form a regular grid in the range [1 , 2] . Figure 1b shows the evolution of the Frobenius norms and panels d,c depict as 100 × 100 images the true covariance matrix and the preconditioner estimated by FisherMALA. For AdaMALA see Figure 6 in the Appendix. Clearly, FisherMALA learns much faster and achieves more accurate estimates of the optimal preconditioner. Further Table 1 shows that FisherMALA achieves significantly better ESS than AdaMALA and reaches the same performance with mMALA.

Inhomogeneous Gaussian target. In the last example we follow [28, 39] and we consider a Gaussian target with diagonal covariance matrix Σ = diag ( σ 2 1 , . . . , σ 2 100 ) where the standard deviation values σ i take values in the grid { 0 . 01 , 0 . 02 , . . . , 1 } . This target is challenging because the different scaling across dimensions means that samplers with a single step size, i.e. without preconditioning, will adapt to the smallest dimension x 1 of the state while the chain at the higher dimensions, such as x 100 , will be moving slowly exhibiting high autocorrelation. Note that FisherMALA and AdaMALA run without knowing that the optimal preconditioner is a diagonal matrix, i.e. they learn a full covariance matrix. Figure 2a shows the ESS scores for all 100 dimensions of x for four samplers (except mMALA which has the same performance with FisherMALA), where we can observe that only FisherMALA is able to achieve high ESS uniformly well across all dimensions. In contrast, MALA and HMC that use a single step size cannot achieve high sampling efficiency and their

(a)

(b)

(c)

(d)

60

True

FisherMALA

FisherMALA

FisherMALA

1.0

40

0.5

20

0.0

0

0

5000

10000

15000

20000

0

5000

10000

15000

20000

Iterations

Iterations

(a)

(b)

(c)

104

1.0

60

0.8

FisherMALA

Norm

103

values

40

S

0.6

S

m

102

FisherMALA

0.4

20

FisherMALA

101

MALA

0.2

HMC

0.0

0

0

20

40

60

80

100

0

20

40

60

80

100

0

5000

10000

15000

20000

Dimension

Dimension

Iterations

ESS for dimensions close to x 100 drops significantly. The same holds for AdaMALA due to its inability to learn fast the preconditioner, as shown by the Frobenius norm values in Figure 2c and the estimated standard deviations in Figure 2b. AdaMALA can eventually get very close to the optimal precondtioner but it requires hundred of thousands of adaptive steps, while FisherMALA learns it with only few thousand steps.

5.3 Bayesian logistic regression

We consider Bayesian logistic regression distributions of the form π ( θ | Y, Z ) ∝ p ( Y | θ, Z ) p ( θ ) with data ( Y, Z ) = { y i , z i } i m =1 , where z i ∈ R d is the input vector and y i the binary label. The likelihood is p ( Y | θ, Z ) = ∏ m i =1 σ ( θ ⊤ z i ) y i (1 -σ ( θ ⊤ z i )) 1 -y i , where θ ∈ R d are the random parameters assigned the prior p ( θ ) = N ( θ | 0 , I d ) . We consider six binary classification datasets (Australian Credit, Heart, Pima Indian, Ripley, German Credit and Caravan) with a number of data ranging from n = 250 to n = 5822 and dimensionality of the θ ranging from 3 to 87 . We also consider a much higher 785 -dimensional example on MNIST for classifying the digits 5 and 6 , that has 11339 training examples. To make the inference problems more challenging, in the first six examples we do not standardize the inputs z i which creates very anisotropic posteriors over θ . For the MNIST data, which initially are grey-scale images in [0, 255], we simply divide by the maximum pixel value, i.e. 255, to bring the images in [0 , 1] . In Table 1 we report the ESS for the low 7 -dimensional Pima Indians dataset, the medium 87 -dimensional Caravan dataset and the higher 785 -dimensional MNIST dataset, while the results for the remaining datasets are shown in Appendix E. Further, Figure 3 shows the evolution of the unnormalized log target density log { p ( Y | θ, Z ) p ( θ ) } for the best four samplers in

HMC

mMALA

FisherMALA

-1240

-1260

g-targe

6

-1280

-1300

-1320

0

20000

40000

20000

40000

0

20000

40000

20000

40000

Iterations

Iterations

Iterations

Iterations

Caravan dataset which visualizes chain autocorrelation. From all these results we can conclude that FisherMALA is better than all other samplers, and remarkably it outperforms significantly the position-dependent mMALA, especially in the high dimensional Caravan and MNIST datasets.

6 Related Work

There exist works that use some form of global preconditioning in gradient-based samplers for specialized targets such as latent Gaussian models [13, 44], which make use of the tractable Gaussian prior. Our method differs, since it is more agnostic to the target and learns a preconditioning from the history of gradients, analogously to how traditional adaptive MCMC learns from states [21, 38].

Several research works use position-dependent preconditioning A ( x ) within gradient-based samplers, such as MALA. This is for example the idea behind Riemannian manifold MALA [20] and extensions [45]. Similar to Riemannian manifold methods there are approaches inspired by second order optimization that use the Hessian matrix, or some estimate of the Hessian, for sampling in a MALAstyle manner [32, 17, 27]. Recently, such samplers and their time-continuous diffusion limits have been theoretically analyzed by obtaining convergence guarantees [12, 26]. All such methods form a position-dependent preconditioning and not the preconditioning we use in this paper, e.g. note that I -1 we consider here requires an expectation under the target and thus it is always a global preconditioner rather than a position-dependent one. Another difference is that our method has quadratic cost, while position-dependent preconditioning methods have cubic cost and they require computationally demanding quantities like the Hessian matrix. Therefore, in order for these methods to run faster some approximation may be needed, e.g. low rank [27] or quasi-Newton type [46, 24]. Furthermore, the Bayesian logistic results in Table 1 (see also Figure 3) show that the proposed FisherMALA method significantly outperforms manifold MALA [20] in Caravan and MNIST examples, despite the fact that manifold MALA preconditions with the exact negative inverse Hessian matrix of the log target. This could suggest that position-dependent preconditioning may be less effective in certain type of high-dimensional and log-concave problems.

Finally, there is recent work for learning flexible MCMC proposals by using neural networks [42, 25, 23, 41] and by adapting parameters using differentiable objectives [25, 29, 43, 14]. Our method differs, since it does not use objective functions (which have extra cost because they require an optimization to run in parallel with the MCMC chain), but instead it adapts similarly to traditionally MCMCmethods by accumulating information from the observed history of the chain.

7 Conclusion

We derived an optimal preconditioning for the Langevin diffusion by optimizing the expected squared jumped distance, and subsequently we developed an adaptive MCMC algorithm that approximates the optimal preconditioning by applying an efficient quadratic cost recursion. Some possible topics for future research are: Firstly, it would be useful to investigate whether the score function differences that we use as the adaptation signal introduce any bias in the estimation of the inverse Fisher matrix. Secondly, it would be interesting to extend our method to learn the preconditioning for other gradientbased samplers such as Hamiltonian Monte Carlo (HMC), where such a matrix there is referred to as the inverse mass matrix. For HMC this is more complex since both the mass matrix and its inverse are needed in the iteration. Finally, it could be interesting to investigate adaptive schemes of the inverse Fisher matrix by using multiple parallel and interacting chains, similarly to ensemble covariance matrix estimation for Langevin diffusions [16].

Acknowledgments and Disclosure of Funding

We are grateful to the reviewers for their comments. Also, we wish to thank Arnaud Doucet, Sam Power, Francisco Ruiz, Jiaxin Shi, Yee Whye Teh, Siran Liu, Kazuki Osawa and James Martens for useful discussions.

References

Christophe Andrieu and Yves Atchade. On the efficiency of adaptive mcmc algorithms. Electronic Communications in Probability , 12:336-349, 2007.

Christophe Andrieu and Éric Moulines. On the ergodicity properties of some adaptive mcmc algorithms. The Annals of Applied Probability , 16(3):1462-1505, 2006.

Christophe Andrieu and Johannes Thoms. A tutorial on adaptive mcmc. Statistics and computing , 18(4):343-373, 2008.

Yves Atchade, Gersende Fort, Eric Moulines, and Pierre Priouret. Adaptive markov chain monte carlo: theory and methods. Preprint , 2009.

Yves F Atchadé and Jeffrey S Rosenthal. On adaptive markov chain monte carlo algorithms. Bernoulli , 11(5):815-828, 2005.

Mylène Bédard. Weak convergence of metropolis algorithms for non-iid target distributions. The Annals of Applied Probability , pages 1222-1244, 2007.

Mylène Bédard. Efficient sampling using metropolis algorithms: Applications of optimal scaling results. Journal of Computational and Graphical Statistics , 17(2):312-332, 2008.

Mylene Bedard. Optimal acceptance rates for metropolis algorithms: Moving beyond 0.234. Stochastic Processes and their Applications , 118(12):2198-2222, 2008.

Alexandros Beskos, Natesh Pillai, Gareth Roberts, Jesus-Maria Sanz-Serna, and Andrew Stuart. Optimal tuning of the hybrid monte carlo algorithm. Bernoulli , 19(5A):1501-1534, 2013.

Gerald J. Bierman. Factorization Methods for Discrete Sequential Estimation , volume 128. 1977.

Steve Brooks, Andrew Gelman, Galin Jones, and Xiao-Li Meng. Handbook of Markov Chain Monte Carlo . CRC press, 2011.

Sinho Chewi, Thibaut Le Gouic, Chen Lu, Tyler Maunu, Philippe Rigollet, and Austin Stromme. Exponential ergodicity of mirror-langevin diffusions. In Proceedings of the 34th International Conference on Neural Information Processing Systems , 2020.

S. L. Cotter, G. O. Roberts, A. M. Stuart, and D. White. MCMC methods for functions: modifying old algorithms to make them faster. Statistical Science , 28(3):424-446, 2013.

Ameer Dharamshi, Vivian Ngo, and Jeffrey S. Rosenthal. Sampling by divergence minimization. Communications in Statistics - Simulation and Computation , 2023.

Simon Duane, A. D. Kennedy, Brian J. Pendleton, and Duncan Roweth. Hybrid monte carlo. Physics Letters B , 195(2):216 - 222, 1987.

Alfredo Garbuno-Inigo, Franca Hoffmann, Wuchen Li, and Andrew M. Stuart. Interacting langevin diffusions: Gradient structure and ensemble kalman sampler. SIAM Journal on Applied Dynamical Systems , 19(1):412-441, 2020.

John Geweke and Hisashi Tanizaki. Note on the sampling distribution for the metropolishastings algorithm. Communications in Statistics - Theory and Methods , 32(4):775-789, 2003.

W.R. Gilks, S. Richardson, and D. Spiegelhalter. Markov Chain Monte Carlo in Practice . Chapman & Hall/CRC Interdisciplinary Statistics. Taylor & Francis, 1995.

Paolo Giordani and Robert Kohn. Adaptive independent metropolis-hastings by fast estimation of mixtures of normals. Journal of Computational and Graphical Statistics , 19(2):243-259, 2010.

Mark Girolami and Ben Calderhead. Riemann manifold Langevin and Hamiltonian Monte Carlo methods. Journal of the Royal Statistical Society: Series B (Statistical Methodology) , 73(2):123-214, 2011.

Heikki Haario, Eero Saksman, and Johanna Tamminen. An adaptive metropolis algorithm. Bernoulli , 7(2):223-242, 2001.

Heikki Haario, Eero Saksman, and Johanna Tamminen. Componentwise adaptation for high dimensional mcmc. Computational Statistics , 20(2):265-273, 2005.

Raza Habib and David Barber. Auxiliary variational mcmc. To appear at ICLR 2019 , 2019.

Benedict Leimkuhler, Charles Matthews, and Jonathan Weare. Ensemble preconditioning for markov chain monte carlo simulation. Statistics and Computing , 28, 03 2018.

Daniel Levy, Matt D. Hoffman, and Jascha Sohl-Dickstein. Generalizing hamiltonian monte carlo with neural networks. In International Conference on Learning Representations , 2018.

Ruilin Li, Molei Tao, Santosh S. Vempala, and Andre Wibisono. The mirror langevin algorithm converges with vanishing bias. In Sanjoy Dasgupta and Nika Haghtalab, editors, Proceedings of The 33rd International Conference on Algorithmic Learning Theory , volume 167 of Proceedings of Machine Learning Research , pages 718-742. PMLR, 29 Mar-01 Apr 2022.

James Martin, Lucas C. Wilcox, Carsten Burstedde, and Omar Ghattas. A stochastic newton mcmc method for large-scale statistical inverse problems with application to seismic inversion. SIAM Journal on Scientific Computing , 34(3):A1460-A1487, 2012.

Radford M. Neal. MCMC using Hamiltonian dynamics. Handbook of Markov Chain Monte Carlo , 54:113-162, 2010.

Kirill Neklyudov, Pavel Shvechikov, and Dmitry Vetrov. Metropolis-hastings view on variational inference and adversarial training. arXiv preprint arXiv:1810.07151 , 2018.

Cristian Pasarica and Andrew Gelman. Adaptively scaling the metropolis algorithm using expected squared jumped distance. Statistica Sinica , pages 343-364, 2010.

James E. Potter and Robert G. Stern. Statistical filtering of space navigation measurements. 1963.

Yuan Qi and Thomas P. Minka. Hessian-based Markov Chain Monte-carlo Algorithms. In First Cape Cod Workshop on Monte Carlo Methods, Cape Cod, Mass, 2002.

H. Robbins and S. Monro. A stochastic approximation method. Annals of Mathematical Statistics , 22:400-407, 1951.

Gareth O Roberts, Andrew Gelman, and Walter R Gilks. Weak convergence and optimal scaling of random walk metropolis algorithms. The annals of applied probability , 7(1):110-120, 1997.

Gareth O Roberts and Jeffrey S Rosenthal. Optimal scaling of discrete approximations to langevin diffusions. Journal of the Royal Statistical Society: Series B (Statistical Methodology) , 60(1):255-268, 1998.

Gareth O Roberts and Jeffrey S Rosenthal. Optimal scaling for various metropolis-hastings algorithms. Statistical Science , pages 351-367, 2001.

Gareth O Roberts and Jeffrey S Rosenthal. Coupling and ergodicity of adaptive markov chain monte carlo algorithms. Journal of applied probability , 44(2):458-475, 2007.

Gareth O Roberts and Jeffrey S Rosenthal. Examples of adaptive mcmc. Journal of Computational and Graphical Statistics , 18(2):349-367, 2009.

Jeffrey S Rosenthal. Optimal proposal distributions and adaptive mcmc. In Handbook of Markov Chain Monte Carlo , pages 114-132. Chapman and Hall/CRC, 2011.

P. J. Rossky, J. D. Doll, and H. L. Friedman. Brownian dynamics as smart Monte Carlo simulation. The Journal of Chemical Physics , 69(10):4628-4633, November 1978.

T. Salimans, D. P. Kingma, and M. Welling. Markov chain Monte Carlo and variational inference: Bridging the gap. In International Conference on Machine Learning , 2015.

Jiaming Song, Shengjia Zhao, and Stefano Ermon. A-nice-mc: Adversarial training for mcmc. In Advances in Neural Information Processing Systems , pages 5140-5150, 2017.

Michalis Titsias and Petros Dellaportas. Gradient-based adaptive markov chain monte carlo. In H. Wallach, H. Larochelle, A. Beygelzimer, F. d Alché-Buc, E. Fox, and R. Garnett, editors, Advances in Neural Information Processing Systems , volume 32. Curran Associates, Inc., 2019.

Michalis Titsias and Omiros Papaspiliopoulos. Auxiliary gradient-based sampling algorithms. Journal of the Royal Statistical Society: Series B (Statistical Methodology) , 80, 10 2016.

Tatiana Xifara, Chris Sherlock, Samuel Livingstone, Simon Byrne, and Mark Girolami. Langevin diffusions and the metropolis-adjusted langevin algorithm. Statistics & Probability Letters , 04 2014.

Yichuan Zhang and Charles A. Sutton. Quasi-newton methods for markov chain monte carlo. In Advances in Neural Information Processing Systems 24: 25th Annual Conference on Neural Information Processing Systems 2011. Proceedings of a meeting held 12-14 December 2011, Granada, Spain. , pages 2393-2401, 2011.

Peer reviews:
{"IS_META_REVIEW": false, "comments": "SUMMARY:\nThe paper presents an “optimal” preconditioning for the Langevin diffusion by analytically maximizing the expected squared jumped distance. The authors have identified the optimal preconditioning as an inverse Fisher information covariance matrix. They apply this result to the Metropolis adjusted Langevin algorithm (MALA) and derive an efficient adaptive MCMC scheme that learns the preconditioning from the gradient history produced during the algorithm's execution. The authors show through experiments that their proposed algorithm can outperform other standard methods.\n\nSTRENGTHS:\nThe paper introduces an innovative approach with the use of the inverse Fisher information covariance matrix as a preconditioner for MALA; to my knowledge this has not been previously proposed. The preconditioner is shown to maximize the expected squared jump distance, which could potentially improve the convergence of the algorithm.\n\nThe adaptive learning of the preconditioning from the history of gradients generated during the algorithm execution is a useful idea.\n\nThe experiments presented demonstrate the algorithm’s promise.\n\nWEAKNESSES:\nThe paper lacks theoretical justification to support the empirical findings, which might raise questions about the universality and optimal applicability of the proposed method.\n\nQUESTIONS:\nThe Fisher information preconditioner, which is the expectation of the negative Hessian of the log-density, is very reminiscent of the Newton–Langevin diffusion which uses the same but without the expectation; see S. Chewi, T. Le Gouic, C. Lu, T. Maunu, P. Rigollet, A. J. Stromme, \"Exponential ergodicity of mirror-Langevin diffusion,\" and Appendix A.4 of R. Li, M. Tao, S. S. Vempala, A. Wibisono's work, \"The mirror Langevin algorithm converges with vanishing bias.\" Please provide a comparison with this method, both in theory and practice.\n\nThe Newton–Langevin diffusion in particular enjoys convergence guarantees in continuous time that attest to its affine-invariant nature. Can anything be proven regarding convergence rates with this choice of preconditioner?\n\nI did not see any claim that $\\pi$ is the stationary distribution of Algorithm 1. Can the authors provide justification or proof for this?\n\nLIMITATIONS:\nYes.", "TITLE": "Official Review", "RECOMMENDATION": 6, "REVIEWER_CONFIDENCE": 5, "SOUNDNESS_CORRECTNESS": 2, "DATE": "2023-06-14"}

{"IS_META_REVIEW": false, "comments": "SUMMARY:\nThe authors study a preconditioning matrix for the Langevin diffusion. It is given by maximizing the expected squared jumped distance. It turns out that the preconditioning is an inverse Fisher information covariance matrix for the target distribution. The authors apply the MALA scheme with this preconditioner to compute the MCMC algorithms. It is shown that in the Gaussian target distribution, this preconditioner performs as the Newton-type method. Numerical examples demonstrate the effectiveness of this method. The authors compared it with different methods, such as the position-dependent Riemannian manifold MALA sampler.\n\nSTRENGTHS:\n1. The authors present an important example of preconditioners, namely Fisher information matrix for Langevin dynamics. \nIt is motivated by the Gaussian target distribution or the expected squared jumped distance. The method is similar to Newton's method in the Gaussian case.  \n\n2. The numerical examples demonstrate the method's effectiveness for the Gaussian target distributions.\n\nWEAKNESSES:\n1. The computation of the inverse of Fisher-information may not be simple. The authors propose some modification methods to approximate it. Some computational complexity analysis is needed. \n\n2. There is no theory supporting the convergence speed for non-Gaussian settings. Suppose the target distribution is a mixed Gaussian or a distribution that is non-log concave. Can the authors provide some numerical examples for these non-Gaussian target distributions to test the algorithm's performance?  It would be curious to know how Fisher information preconditioners behave. \n\n3.  There is some related literature in this direction. One picks different choices of preconditioners motivated by the Gaussian target distributions.  \n\nAlfredo Garbuno-Inigo, et al. Interacting Langevin Diffusions: Gradient Structure And Ensemble Kalman Sampler, SIAM Journal on applied dynamical sysetm, 2019. \nYifei Wang, et.al. Projected Wasserstein gradient descent for high-dimensional Bayesian inference, SIAM/ASA Journal on Uncertainty Quantification, 2022.\nYifei Wang, et.al. Accelerated Information Gradient Flow, Journal of Scientific computing, 2021\n\nQUESTIONS:\nThe authors also discuss the Hamiltonian Monte-Carlo methods with Fisher information preconditioners. Can authors briefly discuss the motivation why the Hamiltonian Monte-Carlo with preconditioners will behave better than the overdamped Langevin dynamics? Would you explain any potential advantages for the Hamiltonian Monte-Carlo methods, in terms of convergence analysis?\n\nLIMITATIONS:\nThere are no limitations.", "TITLE": "Official Review", "RECOMMENDATION": 7, "REVIEWER_CONFIDENCE": 5, "SOUNDNESS_CORRECTNESS": 3, "DATE": "2023-06-28"}

{"IS_META_REVIEW": false, "comments": "SUMMARY:\nPreconditioned Metropolis-adjusted Langevin Algorithm is considered. Optimality of the preconditioning matrix, with respect to expected squared jump distance, is found to be proportional to an object related to the inverse Fisher information. In contrast to the Fisher, the expectation is taken with respect to model parameters, giving an object that is not position dependent (in contrast to related Riemannian manifold MALA, and RMHMC). An online algorithm, based on classical tools from Kalman filtering, is given for efficiently computing the inverse of a Monte Carlo approximation to the Fisher Information, leading to a novel adaptive preconditioned MALA method. Debiasing in the transient phase is discussed, and a Rao-Blackwellization scheme is given to reduce variance of the estimator. Experiments are conducted on a range of standard testbed tasks.\n\nSTRENGTHS:\nThis paper provides a well principled approach to preconditioning MALA that shows improvements over both adaptive and Riemannian MCMC methods. In particular, it provides a quadratic approach to a Fisher-informed preconditioner that does not require cubic inversion/decomposition at every step, instead only needing quadratic updates. This approach outperforms the more expensive mMALA on nontrivial tasks.\n\nThe paper is communicated in an accessible way, and the experimental section covers a reasonable range of problems for samplers of this type.\n\nWEAKNESSES:\nThe main body of the text claims that the Rao-Blackwellized version is significantly better, but this is not reflected in the numerics in Appendix E. This is not a weakness of the method itself, but appears misleading. When appendix E is mentioned, maybe \"detailed comparison between the proposed methods\" is clearer than \"detailed results\".\n\nThere are numerous grammatical errors and awkward phrasings, and the document would benefit from another read through with this in mind.\n\nQUESTIONS:\nNumerical performance of the non-centred version of FisherMALA are not reported, yet there is a burn-in period before the Fisher is computed that is usually used to mitigate the influence of the transient phase. How much effect does centering the scores have on performance, and how do the empirical means change throughout sampling?\n\nThe RB vs no-RB versions of your method appear to have performed very similarly, however with an acceptance rate tuned to <0.6, it seems natural to ask - how do they compare in terms of ESS/s? If the quadratic step is only being computed less than 60% of the time, does this negate the perceived/marginal benefits of using RB? This may also help demonstrate your performance advantage over mMALA.\n\nLIMITATIONS:\nLimitations are addressed in weaknesses/questions. There is little view for negative societal impact in this type of work.", "TITLE": "Official Review", "RECOMMENDATION": 7, "REVIEWER_CONFIDENCE": 4, "SOUNDNESS_CORRECTNESS": 3, "DATE": "2023-07-04"}

comments: SUMMARY:
This is a nice paper that develops a preconditioner for improved sampling of complex target distributions using gradient history.  The algorithm is well presented and is placed in context of other recent proposals from the literature.   There are several numerical experiments presented on small to medium sized examples that support the idea.  

A nice feature is that the paper is very readable which will enhance the uptake of the idea.

The numerical experimentation is good but not exhaustive, nonetheless convincing to this reader.

STRENGTHS:
Reasonable overview of literature.   Careful presentation.  Readable style.

WEAKNESSES:
Limited experimentation in high dimensional settings.     Limited ablation study.

QUESTIONS:
What were wall clock times for all the different computations?  In particular they should be reported for the larger models.

You give many results in the table for Bayesian logistic regression.  How did you parameterize the various methods?

How does the performance of the method presented in the paper scale up in a parallel computing setting?

LIMITATIONS:
The authors miss the chance to introduce the work by indicating the importance of sampling in large scale data science in providing improved robustness and the potential for uncertainty quantification.  I would suggest that the introduction be modified to develop this theme.   By its very nature, this work has potential to strengthen the foundations of AI and this should at least be mentioned.
TITLE: Official Review
SOUNDNESS_CORRECTNESS: 4
DATE: 2023-07-07