Probabilistic Interpretation of Linear Solvers
Philipp Hennig
Introduction
Solving the unconstrained linear problem of finding in
It will turn out that a family of quasi-Newton methods (§1.2), more widely used to solve nonlinear optimization problems, can help answer this question, because classic derivations of these methods can be re-formulated and extended into a probabilistic interpretation of these methods as maxima of Gaussian posterior probability distributions (§2). The covariance of these Gaussians offers a new object of interest and provides error estimates (§3). Because there are entire linear spaces of Gaussian distributions with the same posterior mean but differing posterior error estimates, selecting one error measure consistent with the algorithm is a new statistical estimation task (§4).
2 The Dennis family of secant methods
This ensures the secant relation , sometimes called ‘the quasi-Newton Equation’ . Convergence of the sequence of iterates for various members of this class (and the classes of Broyden and Davidon) are well-understood . The rules named above can be found in the Dennis class as :
Because the update of Equation (2) is of rank 2, the corresponding estimate for the inverse (assuming it exists) can be constructed using the matrix inversion lemma. Alternatively, all Dennis rules can also be used as inverse updates , i.e. estimates for itself, by exchanging and , above (corresponding to the secant relation ). Interestingly, the DFP and BFGS updates are duals of each other under this exchange : The inverse of as constructed by the DFP rule (6) equals the arising from the inverse BFGS rule (7). This does not mean BFGS and DFP are the same, but only that they fill opposing roles in the inverse and direct formulation. To avoid confusion, in this text the DFP rule will always be used in the sense of a direct update (estimating , with ), and the BFGS rule in the inverse sense (i.e. estimating , with ). The first parts of this text will focus on direct updates and thus mostly talk about the DFP method instead of the BFGS rule. All results extend to the inverse models (and thus BFGS) under the exchange of variables mentioned above. Sections 3.2 and 4 will make some specific choices geared to inverse updates. They will then talk explicitly about BFGS, always in the sense of an inverse update.
This text gives a probabilistic interpretation of the Dennis family, for the linear problems of Eq. (1). We will interpret the secant methods as estimators of (inverse) Hessians of an objective function, and ask what kind of prior assumptions would give rise to these specific estimators. This results in a self-contained derivation of inference rules for symmetric matrices. Some of the rules quoted above can be motivated as ‘natural’ from the inference perspective.
Another major strand of nonlinear optimization methods extends from the conjugate gradient algorithm of Hestenes & Stiefel for linear problems, nonlinearly extended by Fletcher and Reeves and others. On linear problems, the CG and quasi-Newton ideas are closely linked: Nazareth showed that CG is equivalent to BFGS for linear problems (with exact line searches, when the initial estimate ). More generally, Dixon showed for quasi-Newton methods in the Broyden class (which also contains the methods listed above) that, under exact line searches and the same starting point, all methods in Broyden’s class generate a sequence of points identical to CG, if the starting matrix is taken as a preconditioner of CG. In this sense, this text also provides a novel derivation for conjugate gradients, and will use several well-known properties of that method. Implications of the results presented herein to nonlinear variants of conjugate gradients will be left for future work.
3 Numerical methods perform inference — The value of a statistical interpretation
The defining aspect of quasi-Newton methods is that they approximate—estimate—the Hessian matrix of the objective function, or its inverse, based on evaluations—observations—of the objective’s gradient and certain prior structural restrictions on the estimate. They can therefore be interpreted as inferring the latent quantity or from the observed quantities . This creates a connection to statistics and probability theory, in particular the probabilistic framework of encoding prior assumptions in a probability measure over a hypothesis space, and describing observations using a likelihood function, which combines with the prior according to Bayes’ theorem into a posterior measure over the hypothesis space (§2).
On the one hand, this elucidates prior assumptions of quasi-Newton methods (§3). On the other, it suggests new functionality for the existing methods, in particular error estimates on and (§4). In future work, it may also allow for algorithms robust to ‘noisy’ linear maps, such as they arise in physical inverse problems.
The interpretation of numerical problems as estimation was pointed out by statisticians like Diaconis in 1988 , and O’Hagan in 1992 , well after the introduction of quasi-Newton methods. To the author’s knowledge, the idea has rarely attracted interest in numerical mathematics, and has not been studied in the context of quasi-Newton methods before recent work by Hennig & Kiefel . An argument sometimes raised against analysing numerical methods probabilistically is that numerical problems do not generally feature an aspect of randomness. But probability theory makes no formal distinction between epistemic uncertainty, arising from lack of knowledge, and aleatoric uncertainty, arising from ‘randomness’, whatever the latter may be taken to mean precisely. Randomness is not a prerequisite for the use of probabilities. Those who do feel uneasy about applying probability theory to unknown deterministic quantities, however, may prefer another, perhaps more subjective argument: From the point of view of a numerical algorithm’s designer, the ‘population’ of problems that practitioners will apply the algorithm to does in fact form a probability distribution from which tasks are ‘sampled’.
Numerical algorithms running on a finite computational budget make numerical errors. A notion of the imprecision of this answers is helpful, in particular when the method is used within a larger computational framework. Explicit error estimates can be propagated through the computational pipeline, helping identify points of instability, and to distribute or save computational resources. Needless to say, it makes no sense to ask for the exact error (if the exact difference between the true and estimated answer where known, the exact answer would be known, too). But it is meaningful to ask for the remaining volume of hypotheses consistent with the computations so far. This paper attempts to construct such an answer for linear problems.
4 Overview of main results
As pointed out above, although quasi-Newton methods are most popular for nonlinear optimization, here the focus will be on linear problems. Extending the probabilistic interpretation constructed here to the nonlinear setting of inferring the (inverse) Hessian of a function will be left for future work (see for pointers). The present aim is an iterative linear solver iterating through posterior beliefs for and the solution of the linear problem. These beliefs will be constructed as Gaussian densities over the elementsFor notational convenience, the elements of will be treated as the elements of a vector of length , see more at the beginning of §2.2. of , with mean and covariance matrix .
The results in this paper significantly clarify and extend previous results by Hennig & Kiefel and Hennig . Here is a brief outlook of the main results:
As a probabilistic interpretation of results by Dennis & Moré and Dennis & Schnabel , Hennig provided a derivation of rank-2 secant methods in terms of two independent observations of two separate parts of the Hessian. This viewpoint affords a nonparametric extension to nonlinear optimization, but is not particularly elegant. This paper provides a cleaner derivation: the Dennis family can in fact be derived naturally from a prior over only symmetric matrices. This extends the results of Dennis & Schnabel , from statements about the maximum of a Frobenius norm in the space of symmetric matrices to the entire structure of that norm in that space.
The choice of prior parameters distinguishes between the members of the Dennis family. An analysis shows that DFP and BFGS are ‘more correct’ than other members of the family in the sense that they are consistent with exact probabilistic inference for the entire run of the algorithm, while general Dennis rules are only consistent after the first step (Lemmas 6 and 7). Further, SR1, Greenstadt, DFP and BFGS all use different prior measures that, although all ‘scale-free’, give imperfect notions of calibration for the prior measure. Finally, because BFGS is equivalent to CG ( and Lemma 8), its set of evaluated gradients is orthogonal. This allows a computationally convenient parameterization of posterior uncertainty. Overall, the picture arising is that, from the probabilistic perspective, the DFP and particularly BFGS methods have convenient numerical properties, but their posterior measure can be calibrated better.
It will transpire that the decision for a specific member of the Dennis family still leaves a space of possible choices of prior covariances consistent with this update rule. Constructing a meaningful posterior uncertainty estimate (covariance) on after finitely many steps requires a choice in this unidentified space, which, as in other estimation problems, needs to be motivated based on some notion of regularity in . Several possible choices are discussed in Section 3, all of which add very low overhead to the standard conjugate gradient algorithm.
Gaussian inference from matrix-vector multiplications
then, by Bayes’ theorem and a simple linear computation (see e.g. [38, §2.1.2]), the posterior, the unique distribution over consistent with both prior and likelihood, is
This derivation also works in the limit of perfect information, i.e. for a well-defined limit of , in which caseIf is not of maximal rank, a precise formulation requires a projection of into the preimage of . This is merely a technical complication. It is circumvented here by assuming, later on, that line-search directions are linearly independent. This amounts to a maximal-rank . the likelihood converges to the Dirac distribution . The crucial point is that constructing the posterior after linear observations involves only linear algebraic operations, with the posterior covariance (the ‘error bar’) using many of the computations also required to compute the mean (the ‘best guess’).
Gaussian inference is closely linked to least-squares estimation: Because the logarithm is concave, the maximum of the posterior (10) (which equals the mean) is also the minimizer of the quadratic norm (using )
The added value of the probabilistic interpretation is embodied in the posterior covariance, which quantifies remaining degrees of freedom of the estimator, and can thus also be interpreted as a measure of uncertainty, or estimated error.
2 Inference on asymmetric matrices from matrix vector multiplications
An important observation is that Broyden’s method ceases to be a direct match to this update after the first line search, because matrix is not a diagonal matrix. This matrix will come to play a central role; we will call it the Gram matrix, because it is an inner product of weighted by the positive definite .
It is well known that, because the posterior mean of Eq. (12) is not in general a symmetric matrix, it is a suboptimal learning rule for the Hessian of an objective function. Which is why this class was quickly abandoned in favour of the rank-2 updates in the Dennis family mentioned above. Dennis & Moré and Dennis & Schnabel showed that the minimizer of weighted Frobenius regularizers (the maximizer of the Gaussian posterior) within the linear subspace of symmetric matrices is given by the Dennis class of update rules. Hennig & Kiefel constructed a probabilistic interpretation based on this derivation, which involves doubling the input domain of the objective function and introducing two separate, independent observations. This has the advantage of allowing for relatively straightforward nonparametric extensions, and a broad class of noise models for cases in which gradients can not be evaluated without error . But artificially doubling the input dimensionality is dissatisfying.
We now introduce a cleaner derivation of the same updates, by explicitly restricting the hypothesis class to symmetric matrices. This gives the covariance matrix a more involved structure than the Kronecker product, and makes derivations more challenging. It results in a new interpretation for the Dennis class, fully consistent with the probabilistic framework. Since the identity of the posterior mean was known from and , the interesting novel aspect here is the structure of the posterior covariance. In essence, it provides insight into the structure of the loss function around the previously known estimates.
We begin by building a Gaussian prior over the symmetric matrices, using the symmetrization operator , the linear operator acting on vectorized matrices defined implicitly through its effect (explicit definition in Appendix A.1).
Here, W\mathchoice{{\ooalign{\displaystyle\otimes\displaystyle\ominus\hfil\cr}}}{{\ooalign{\textstyle\otimes\textstyle\ominus\hfil\cr}}}{{\ooalign{\scriptstyle\otimes\scriptstyle\ominus\hfil\cr}}}{{\ooalign{\scriptscriptstyle\otimes\scriptscriptstyle\ominus\hfil\cr}}}W=\Gamma(W\otimes W)\Gamma^{\intercal} is the symmetric Kronecker product of with itself (see e.g. for an earlier mention). It is the matrix containing elements
The Dennis family of quasi-Newton methods is the posterior mean after one step () of Gaussian regression on matrix elements.
2.2 Remark on the structure of the prior covariance
The fact that symmetric Kronecker product covariance matrices give rise to some of the most popular secant methods may be reason enough to be interested in these structured Gaussian priors. This section provides two additional arguments in their favor.
The first argument, applicable to the entire family of Gaussian inference rules, is that they give consistent estimates, and thus convergent solvers: The priors of Lemma 1 and Theorem 3 assign nonzero mass to all square, and all symmetric matrices, respectively. It thus follows, from standard theorems about the consistency of parametric Bayesian priors (e.g. ), that linear solvers based on the mean estimate arising from either of these two Gaussian priors, applied to linear problems of general, or symmetric structure, respectively, are guaranteed (assuming perfect arithmetic precision) to converge to the correct (and , where it exists) after linearly independent line searches (i.e. ). This is because the Schur complement is of rank [41, Eq. 0.9.2], so the remaining belief after is a point-mass at the unique . By a generalization of the same argument, it also follows that these linear solvers are always exact within the vector space spanned by the line-search directions. This holds for all choices of prior parameters and , as long as is strictly positive definite. Of course, good convergence rates do depend crucially on these two choices. And the aim in this paper is to also identify choices for these parameters such that the posterior uncertainty around the mean estimate is meaningful, too.
Since we know to be positive definite, it would be desirable to restrict the prior explicitly to the positive definite cone. Unfortunately, this is not straightforward within the Gaussian family, because normal distributions have full support. A seemingly more natural prior over this cone is the Wishart distribution popular in statistics,
(the symbol suppresses an irrelevant normalization constant). Using this prior in conjunction with linear observations, however, causes various complications, because the Wishart is not conjugate to one-sided linear observations of the form discussed above. So one may be interested in finding a ‘linearization’ (a Gaussian approximation of some form) for the Wishart, for example through moment matching. And indeed, the second moment (covariance) of the Wishart is \nu^{-1}(W\mathchoice{{\ooalign{\displaystyle\otimes\displaystyle\ominus\hfil\cr}}}{{\ooalign{\textstyle\otimes\textstyle\ominus\hfil\cr}}}{{\ooalign{\scriptstyle\otimes\scriptstyle\ominus\hfil\cr}}}{{\ooalign{\scriptscriptstyle\otimes\scriptscriptstyle\ominus\hfil\cr}}}W) (see e.g. ).
Choice of parameters
The Powell symmetric Broyden update rule is the one-step posterior mean for a Gaussian regression model with .
The Symmetric Rank-1 rule is the one-step posterior mean for a Gaussian regression model with the implicit choice . (For a specific rank- observation, there is a linear subspace of choices which give , but is the only globally consistent such choice).
The Greenstadt update rule is the one-step posterior mean for a Gaussian regression model with .
The DFP update is the one-step posterior mean for the implicit choice . (This choice is unique in a manner analogous to the above for SR1).
The BFGS rule is the one-step posterior mean for the implicit choice . (This, too, is unique in a manner analogous to the above).
It may seem circular for an inference algorithm trying to infer the matrix to use that very matrix as part of its computations (SR1, DFP, BFGS). But computation of the mean in Equation (15) only requires the projections of , which are accessible because . However, the posterior uncertainty (Eq. 16), which is not part of the optimizers in their contemporary form, can not be computed this way.
Hence, with the exception of PSB, the popular secant rules all involve what would be called empirical Bayesian estimation in statistics, i.e. parameter adaptation from observed data. We also note again that the connection between probabilistic maximum-a-posterior estimates and Dennis-class updates only applies in the first of steps. As such, the Dennis updates ignore the dependence between information collected in older and newer search directions that leads to the matrix inverse of in Equations (15) and (16) (obviously, including this information explicitly requires solving linear problems, at additional cost). As will be shown in Lemma 7 below, though, for some members of the Dennis family, and for their use within linear problems, this simplification is in fact exact.
Because directions where chosen randomly, these results say little about these algorithms as optimizers. What they do offer is an intuition for the difference between the exact rank- posterior and repeated application of rank- Dennis-class update rules. A first observation is that, in this setup, keeping track of the dependence between consecutive search directions through makes a big difference: For both pairs of ‘related’ algorithms PSB and , as well as DFP and , the full posterior mean dominates the simpler ‘independent’ update rule. In fact, the classic secant rules do not converge to the true Hessian in this setup. The consistency argument in Section 2.2.2 only applies to estimators constructed by exact inference. The experiment shows how crucial tracking the full Gram matrix is after .
A second, not surprising observation is that, although both probabilistic algorithms are consistent—they converge to the correct after steps—the quality of the inferred point estimate after steps depends on the choice of parameters. The simpler (PSB) choice performs qualitatively worse than the (DFP) choice.
The posterior covariances were used to compute posterior uncertainty estimates for (gray lines in Figure 1): The Frobenius norm can be written as ; thus the expected value of this quadratic form is
with . (To be clear: for , computing this uncertainty required the unrealistic step of giving the algorithm access to , which only makes sense for this conceptual experiment). The uncertainty estimate for (dashed gray lines) is all but invisible in the right hand plot because its values are very close to 0—this algorithm has a badly calibrated uncertainty measure that has no practical use as an estimate of error. The uncertainty under (solid gray lines), on the other hand, scales qualitatively with the size of . This is because scaling by a scalar factor automatically also scales the covariance by the same factor. This has been noted before as a ‘non-dimensional’ property of BFGS/DFP [34, Eq. 6.11]. However, it is also apparent that the uncertainty estimate is too large in both plots—here by about a factor of 5. To understand why, we consider the individual terms in the sum of Equation (18) at the beginning of the inference: The ratio between the true estimation error on element and the estimated error is
One may argue that a ‘well-calibrated’ algorithm should achieve . A problem with the choice becomes apparent considering diagonal elements and :
This means the DFP prior is well-calibrated only for large diagonal elements . For diagonal elements , it is under-confident (, estimating too large an error), and for very small diagonal elements , it can be severely over-confident ( estimating too small an error). For off-diagonal elements and unit prior mean, the error estimate is
For positive definite , off the diagonal holds because, for such matrices, (see e.g. [28, Corollary 7.1.5]), but of course can still be very small or even vanish, e.g. for diagonal matrices. It is possible to at least fix the over-confidence problem, using the degree of freedom in Corollary 5 to scale the prior covariance to with , using , the smallest eigenvalue of . This at least ensures .
Interestingly, setting (which gives the SR1 rule after the first observation, but not after subsequent ones) gives , and for . It also has the property that norm of the true under this prior is
so the true is exactly one standard deviation away from the mean under this prior. These properties suggest this covariance, which will be called standardized norm covariance, for further investigation in §4, which addresses the question: Is it possible to construct a linear solver that, without ‘cheating’ (using or explicitly in the covariance), has a well-calibrated uncertainty measure, and can thus meaningfully estimate the error of its computation; ideally, without major cost increase?
2 Structure of the Gram matrix
The above established that, treated as inference rules for matrices, general Dennis rules are probabilistically exact only after one rank-1 observation . How strong is the error thus introduced? In fact, as the following lemma shows, there are choices of search directions for which the existing algorithms do become exact probabilistic inference.
For linear problems with symmetric positive definite and exact line searches, under the DFP covariance , and linesearches along the inverse of the posterior mean of the Gaussian belief, the Gram matrix is diagonal. Analogously for inverse updates: For inference on under the BFGS covariance on the same linear optimization problem and linesearches along the posterior mean over , the Gram matrix is diagonal.
The following result by Nazareth establishes that, for linear problems, the inference interpretation for BFGS transfers directly to the conjugate gradient (CG) method of Hestenes & Stiefel .
The connection between BFGS and CG is intuitive within the probabilistic framework: BFGS uses , so its mean estimate is the ‘best guess’ for under (the minimizer of) the norm \overrightarrow{(H-H_{M})}^{\intercal}(H\mathchoice{{\ooalign{\displaystyle\otimes\displaystyle\ominus\hfil\cr}}}{{\ooalign{\textstyle\otimes\textstyle\ominus\hfil\cr}}}{{\ooalign{\scriptstyle\otimes\scriptstyle\ominus\hfil\cr}}}{{\ooalign{\scriptscriptstyle\otimes\scriptscriptstyle\ominus\hfil\cr}}}H)^{-1}\overrightarrow{(H-H_{M})}, and its iterated estimate is the best rank- estimate for when the error is measured as . Minimizing this quantity after steps is a well-known characterisation of CG [34, Eq. 5.27].
Theorem 8 implies that, describing BFGS in terms of Gaussian inference also gives a Gaussian interpretation for CG ‘for free’. From the probabilistic perspective, and exclusively for linear problems, CG is ‘just’ a compact implementation of iterated Gaussian inference on from p(H)=\mathcal{N}(H;\boldsymbol{I},H\mathchoice{{\ooalign{\displaystyle\otimes\displaystyle\ominus\hfil\cr}}}{{\ooalign{\textstyle\otimes\textstyle\ominus\hfil\cr}}}{{\ooalign{\scriptstyle\otimes\scriptstyle\ominus\hfil\cr}}}{{\ooalign{\scriptscriptstyle\otimes\scriptscriptstyle\ominus\hfil\cr}}}H), with search directions along . This observation has conceptual value in itself (the natural question, left open here, is what it implies for the nonparametric extensions of CG). But Theorem 8, among other things, also implies the following helpful properties for the search directions chosen by, and gradients ‘observed’ by the (scalar prior mean) BFGS algorithm. They are all well-known properties of the conjugate gradient method (e.g. [34, Thm. 5.3]). In the following, generally assume that the algorithm has not converged at step , and remember that the are the residuals (gradients of ) after steps, which form .
the set of evaluated gradients / residuals is orthogonal:
the gradients (and thus ) span the Krylov subspaces generated by :
line searches and gradients span the same vector space:
3 Discussion
We have established a probabilistic interpretation of the Dennis class of quasi-Newton methods, and the CG algorithm, as Gaussian inference: The Dennis class can be seen as Gaussian posterior means after the first line search (Corollary 4), but this connection extends to multiple search directions only if the search directions are conjugate under prior covariance (Lemma 6). For linear problems, this is the case for the DFP, BFGS update rules (Lemma 7). Since BFGS is equivalent to CG on linear problems (Lemma 8), this also establishes a probabilistic interpretation for linear CG. These results offer new ways of thinking about linear solvers, in terms of solving an inference problem by collecting information and building a model, rather than by designing a dynamic process converging to the minimum of a function. It is intriguing that, from this vantage point, the extremely popular CG / BFGS methods look less well-calibrated than one may have expected (§3.1).
The obvious next question is, can one design explicitly uncertain linear solvers with a reasonably well-calibrated posterior? In addition to the scaling issues, a challenge is that, for BFGS / CG, the prior covariance is only an implicit object. After steps, there exists a -dimensional cone of positive definite covariance matrices fulfilling (and, additionally, a scalar degree of freedom inherent to the Dennis class). How do we pick a point in this space?
Constructing explicit posteriors
Considering the structure of , one can write in terms of block matrices
A primary goal in designing a probabilistic linear solver is thus, at step , to (1) identify the span of , ideally without incurring additional cost, and to (2) fix the entries in the remaining free dimensions in , by using some regularity assumptionsA probabilistically more appealing approach would be to use a hyper-prior on the elements of , marginalized over the unidentified degrees of freedom. It is currently unclear to the author how to do this in a computationally efficient way. about . The equivalence between BFGS and CG offers an elegant way of solving problem (1), with no additional computational cost: Recall from Theorem 3 and Lemma 6 that the covariance after steps under is W_{M}\mathchoice{{\ooalign{\displaystyle\otimes\displaystyle\ominus\hfil\cr}}}{{\ooalign{\textstyle\otimes\textstyle\ominus\hfil\cr}}}{{\ooalign{\scriptstyle\otimes\scriptstyle\ominus\hfil\cr}}}{{\ooalign{\scriptscriptstyle\otimes\scriptscriptstyle\ominus\hfil\cr}}}W_{M} with
Because, by Equation (25) the vector-space spanned by is identical to that spanned by the orthogonal gradients, we can write the space of all symmetric positive semidefinite matrices with the property as
Eq. (30) parametrises posterior covariances of the BFGS family. In light of the scaling issues of these priors discussed in §3.1, one would prefer, from the probabilistic standpoint, to use the standardized norm priors p(H)=\mathcal{N}(H;\alpha\boldsymbol{I},(H-H_{0})\mathchoice{{\ooalign{\displaystyle\otimes\displaystyle\ominus\hfil\cr}}}{{\ooalign{\textstyle\otimes\textstyle\ominus\hfil\cr}}}{{\ooalign{\scriptstyle\otimes\scriptstyle\ominus\hfil\cr}}}{{\ooalign{\scriptscriptstyle\otimes\scriptscriptstyle\ominus\hfil\cr}}}(H-H_{0})), but these priors do not share BFGS/CG’s other good numerical properties. Instead, a hybrid algorithm can be constructed as follows:
Solve the linear problem using the conjugate gradient method. While the algorithm runs, collect . This has storage cost of floats: Because consists of differences between subsequent columns of , it does not need to be stored explicitly, the column norms required to compute require extra floats. The computation cost of the standard conjugate gradient algorithm is matrix-vector multiplications (that is, assuming a dense matrix), plus operations for the algorithm itself (including computation of ).
Using the constructed by CG, compute the standardized-norm posterior on , i.e. use the prior defined above, which yields a Gaussian posterior with mean and covariance
A prerequisite for this is to choose , less than the smallest eigenvalue of , to ensure that is positive definite. But , which can be estimated efficiently (and without additional cost) from the . Another minor hurdle is that Equations (32) & (34) require the inverse of . The columns of are , so, because conjugate gradient constructs orthogonal gradients, is a symmetric tridiagonal matrix, , and is diagonal because the are conjugate under . So the entire Gram matrix is tridiagonal, and the linear problems in can be solved in , e.g. using the Thomas algorithm [7, Alg. 4.3]
estimate according to some rule. §4.2 proposes several rules of cost.
While there is a vague connection between the standardized norm prior and the SR1 algorithm by Corollary 5, the algorithm described above is quite different from the SR1 method. It uses search directions constructed by BFGS/CG, and its update rule uses the exact Gram matrix, not the repeated rank-1 updates that give SR1 its name.
The computation overhead of constructing this posterior mean and covariance, after running the conjugate gradient algorithm, is , which is small compared even to the internal cost of CG, let alone the for the matrix-vector multiplications in CG. Storing the posterior mean and covariance requires space, which is feasible even for relatively large problems. Crucially, retaining the covariance adds almost no overhead to storing the mean alone.
2 Estimation rules
The remaining step is to find estimates for . It is clear that there are myriad options for fixing such rules. For an initial evaluation, we adopt the perhaps simplistic, but straightforward approach of estimating to a scalar matrix (one way to motivate this is to argue that, at step , future line searches will point in an unknown direction in the span of , so it makes sense to not prefer any direction in the choice of ).
A natural idea is to use regularity structure on quantities already computed during the run of the conjugate gradient algorithm: Assume the algorithm is currently at step . If, at step we had tried to predict the Gram matrix diagonal element using the structure for described above, we would have predicted, because is known to be in the span of , and orthogonal to ,
can be estimated from the norm of preceding gradients. The second term on the right hand side of Equation (37) is known at step . The first term of the right hand side can be estimated by regression, in ways further explored below.
A simple baseline is a stationary model for the . This was used to construct error estimates in Figures 3 to 5 (in gray for the middle and bottom row, black for the top row). Of course, if the eigenvalues of are uniformly distributed in the top row, the eigenvalues of (their inverses) are not.
A slightly more elaborate model is a linear trend with noise: (with ). Linear regression on the values of can be performed in . We can then set with the expected largest value of (i.e. a noisy upper bound). This approach was used to construct the (black) error estimates in the middle rows of Figures 3 to 5.
Finally, if structural knowledge is available, e.g. that the first eigenvalues of are times larger than the later ones, on may use the stationary rule from above, but explicitly multiply the estimate by for the first steps. This may seem contrived, but in fact it is not uncommon in applications to know an effective number of degrees of freedom in . For example, in nonparametric least-squares regression with a very large number of data points distributed approximately uniformly over a range of width , using an RBF kernel of length scale , the model’s number of degrees of freedom is [38, Eq. 4.3]. This rule was used to construct (black) error estimates in the bottom rows of Figures 3 to 5.
3 Estimating quantities of interest
This final part demonstrates a few example uses of the Gaussian posterior p(H)=\mathcal{N}(\overrightarrow{H};\overrightarrow{H}_{M},W_{M}\mathchoice{{\ooalign{\displaystyle\otimes\displaystyle\ominus\hfil\cr}}}{{\ooalign{\textstyle\otimes\textstyle\ominus\hfil\cr}}}{{\ooalign{\scriptstyle\otimes\scriptstyle\ominus\hfil\cr}}}{{\ooalign{\scriptscriptstyle\otimes\scriptscriptstyle\ominus\hfil\cr}}}W_{M}) on constructed by the BFGS / CG method. Figures 3 to 5 show three such uses, explained below. Each row of this figure uses data from one of the experiments shown in the corresponding row of Figure 2.
The most obvious question is how far the estimate for after steps is from the true . This distance is estimated directly by the Gaussian posterior of Equation (26). The marginal distribution on any linear projection is \mathcal{N}(A\overrightarrow{H};A\overrightarrow{H}_{M},A(W_{M}\mathchoice{{\ooalign{\displaystyle\otimes\displaystyle\ominus\hfil\cr}}}{{\ooalign{\textstyle\otimes\textstyle\ominus\hfil\cr}}}{{\ooalign{\scriptstyle\otimes\scriptstyle\ominus\hfil\cr}}}{{\ooalign{\scriptscriptstyle\otimes\scriptscriptstyle\ominus\hfil\cr}}}W_{M})A^{\intercal}). In particular, the marginal distribution on each element is a scalar Gaussian
Figure 3 shows this error estimate for 40 elements of one particular (drawn uniformly at random from the elements of the matrix). The estimate arising from the uniform estimation rule for from Section 4.2 is shown in gray in each panel (black for the top panel). The same quantity, estimated with the linear regression and structured estimation rules from Section 4.2 are shown in black in the middle and bottom row, respectively. The left column of the figure shows results from the BFGS/CG prior, the right column shows results using the standardized norm prior on data constructed with the CG algorithm as described in §4.1.1. As expected from the argument in §3.1, the BFGS estimates are regularly considerably too small, while the standardized-norm estimates have a meaningful width. The error estimators have varying behaviour. For the exponential eigenvalue spectrum, the estimator fluctuates strongly in the first few steps before settling to a good value (this could be corrected using a regularizer, left out here to not bias the results). For the structured-eigenvalues problems, the region around the step from small to large eigenvalues is problematic. But overall, they do provide a meaningful notion of error. In particular, they are rarely too small. For most uses of statistical error estimators, it is better to be too conservative (too large) than to be too confident. Of course, it would be great if future research would find better calibrated error estimates.
As explained in Equation (18), the same error estimates can also be collapsed into an error estimate on the norm . Figure 4 shows results from such an experiment, for the 20 different ’s from Figure 2. The quantitative results are similar to the previous figure, but this figure more clearly shows the difference between the baseline (gray) and exponential, structured error estimates (black), and the behaviour of the estimated errors relative to the varying norms of the drawn ’s.
3.2 Estimating solutions for new linear problems
An obvious use for the estimate for found by CG / BFGS when solving one linear problem is as an instantaneous solution estimate for other linear problems . The left and middle columns of Figure 5 shows this use. In each case, an was drawn from , and the corresponding presented to the algorithm. Since is a linear projection of , the posterior marginal on is also Gaussian , and has covariance matrix elements
Figure 4 shows the true errors on the elements of in blue, and the estimated marginal errors (the diagonal elements of ) in black for the stationary, linear, structured models, respectively (and, as in previous figures, the stationary model in gray in the two non-stationary cases). More drastically than the previous ones, these figures show that the BFGS posterior can severely underestimate the error on elements of , while the standardized norm prior at least provides outer bounds (albeit sometimes quite loose ones).
The error on does not always collapse over the course of finding . This says more about CG as such than about its probabilistic interpretation: CG does not aim to construct , but only to find . For simplicity of exposition, we have assumed that exists, and CG requires the full steps to converge, thus identifying and . In general, CG regularly converges much earlier. For an intuition, consider the special case where and consists of consecutive ones and zeros. The CG/BFGS algorithm will never explore the lower block of , which may contain arbitrary numbers. If the primary aim is not but itself, a more elaborate course is needed; e.g. choosing several to span a space of interest over . It is an interesting open question whether the probabilistic interpretation can be used to actively collapse the uncertainty on in a typically more efficient way than established matrix inversion methods like Gauss-Jordan (which is also a conjugate direction method ).
Conclusion & outlook
This text developed a probabilistic interpretation of iterative solvers for linear problems with symmetric . The Dennis family of secant updates can be derived as the posterior mean of a parametric Gaussian model after one rank-1 observation. For rank observations, the match between these updates and Gaussian inference only holds if the search directions are conjugate under the prior covariance. This is the case for the DFP direct and BFGS inverse updates rules. Their equivalence to CG in the linear case makes them particularly interesting. However, it also became apparent that, from a inference perspective, the BFGS rule does not yield a well-scaled error measure.
As a first step toward a better scaled Gaussian belief, the standardized norm covariance, was proposed. It is inspired by the SR1 rule, but leads to probabilistic corrections in the form of off-diagonal terms, and can be used with data produced by the CG algorithm, thus retaining the good numerical properties of that method. The space of possible covariance matrices consistent with the resulting mean is a sub-space of the positive definite cone, which collapses during the run of the algorithm (the same holds for the BFGS / CG method). Several possible estimation rules for choosing elements in this space of covariances where proposed, arising from different structural assumptions over . The resulting Gaussian posterior provides joint uncertainty estimates on the elements of , and all linear projections of , in particular of other linear problems . This adds functionality to the conjugate gradient method, at a computational overhead much smaller than the cost of CG itself.
The implications for nonlinear optimization methods of both the quasi-Newton and CG families remain interesting open questions. For example, clearly the conjugacy assumption implicit in the Dennis class members is inconsistent with the probabilistic interpretation. This was already noted by Hennig & Kiefel , who also proposed using a nonparametric Gaussian formulation to give a more explicit inference interpretation to nonlinear optimization. This left questions regarding the choice of prior covariance, which are only made more pressing by the results presented here. Another direction is inference from noisy evaluations, in which case the posterior covariance does not collapse to zero after finitely many steps of optimization, not even in the linear case. Some related results where previously discussed in , but the study of probabilistic numerical optimization remains at an early stage.
Appendix A Proofs for results from main text
Throughout the appendix, the notation will be used to represent the residual.
A.2 Proof for Theorem 3
We begin with the posterior mean (43). From Equation (10), it has the form (with the prior covariance V=W\mathchoice{{\ooalign{\displaystyle\otimes\displaystyle\ominus\hfil\cr}}}{{\ooalign{\textstyle\otimes\textstyle\ominus\hfil\cr}}}{{\ooalign{\scriptstyle\otimes\scriptstyle\ominus\hfil\cr}}}{{\ooalign{\scriptscriptstyle\otimes\scriptscriptstyle\ominus\hfil\cr}}}W)
A few straightforward steps establish that the matrix to be inverted is indeed invertible for linearly independent columns of , and has elements
Also, the elements of are
which then gives the posterior as . (Because is rectangular, Equation (56) is a generalization of a Lyapunov equation. Standard solutions for such Equations do not apply directly). Instead of just presenting a solution, the following lines show a constructive proof. We first re-write Eq. (56) ( is invertible because is positive definite, and is assumed to be of rank ) as
which identifies . Noting that , we can write
Plugging back into Equation (60), using , we get
We see directly that this is a symmetric matrix, because . Now, noting that , we find
From Equation (55), the posterior mean can be written as
which is clearly equal to Equation (43). To establish the form of the posterior covariance, we make use of the structural similarities between the posterior mean and covariance (Equation (10)), and notice that we have just established
A.3 Proof for Lemma 6
To be shown: If the Gram matrix is diagonal, then the exact posterior mean after steps, which is
is equal to the rank-2 update of using the Dennis update
We first harmonize the notation between the two formulations by writing the elements of the diagonal Gram matrix as . With this notation, the posterior mean , Equation (72), can be written as
On the other hand, the expression from Equation (73) can be written using Equation (74) as
But since, by assumption, for , this expression simplifies to
Similarly, the expression from Equation (73) simplifies to
Reinserting these expressions into Equation (73), we see that it equals Equation (76), which completes the proof.
A.4 Proof for Lemma 7
The DFP update is the direct update with the choice ; and the BFGS update is the inverse update with the choice . So the Gram matrix, in both cases, is . The -th element of this symmetric matrix is . The statement to be shown is that this matrix is diagonal if the line search directions are chosen as
with the residual (the gradient of the equivalent quadratic optimization objective) . We also assume perfect line searches. First, consider the special case where (i.e. subsequent line searches). Because they are in the Dennis class, the estimates for (irrespective of whether they were constructed by inverting a direct estimate or using an inverse estimate directly) fulfill the ‘quasi-Newton equation’ . Thus
The exact line search along ended when , so
(the last line follows again because, by the quasi-Newton equation, for all ). By symmetry of the Gram matrix, Eq. (82) also implies . We complete the proof inductively: Let or , and assume . Also, can be written with a telescoping sum as
This also implies for : Assume w.l.o.g. that . Then use the telescoping sum of Equation (83) to get
Acknowledgments
The author would like to thank Maren Mahsereci and Martin Kiefel for helpful discussions both prior to and during the preparation of this manuscript. He is particularly grateful to Maren Mahsereci for helpful discussions about details of the symmetric basis in Theorem 3. In addition, the author is thankful for comments from two anonymous reviewers, particularly for pointing out relevant previous work.