Least-squares is a workhorse of optimization, machine learning, statistics, signal processing, and many other scientific fields. I find it particularly appealing (too much, according to some of my students and colleagues…), because all algorithms, such as stochastic gradient [1], and analyses, such as for kernel ridge regression [2], are much simpler and rely on reasonably simple linear algebra.
Despite the unique appeal of least-squares, most interesting optimization or machine problems go beyond quadratic functions. While there are many algorithms and analyses dedicated to more general situations, it is tempting to use least-squares for analysis or algorithms by considering the functions at hand to be approximately quadratic.
Using bounds on the third-order derivatives and Taylor expansions are the usual ways to go, but they are not ideal for sharp non-asymptotic results where the deviation from quadratic functions has to be precisely quantified. In many situations, more finer structures can be used. In a series of posts, I will describe self-concordance properties, that relate the third order derivatives to second order ones.
There are many great books that cover this topic where the material below is taken from [3, 4, 5, 6].
Self-concordance
A function f:C⊂R→R is said self-concordant on the open interval C if and only if it is convex, three-times differentiable on C, and
∀x∈C,∣f′′′(x)∣⩽2f′′(x)3/2.(1)
You may wonder why the power 3/2 or why the constant 2. The constant is just a convention (multiplying the function f by c would replace 2 by 2/c), while the power 3/2 is fundamental, as it makes the definition “affine-invariant”, that is, if f is self-concordant, so is y↦f(ay) for any a∈R.
For a convex function defined on a convex subset C of R, this has to be true along all rays, or equivalently, if f′′′(x)[h,h,h]=∑i,j,k=1dhihjhk∂xi∂xj∂xk∂3f(x) is the symmetric third-order tensor and f′′(x)[h,h]=∑i,j=1dhihj∂xi∂xj∂2f(x) the second-order one, then
∀x∈C,∀h∈Rd,∣f′′′(x)[h,h,h]∣⩽2f′′(x)3/2[h,h].(2)
Examples. One can check that if f and g are self-concordant, then so is f+g (but not their average). Moreover, if f is self-concordant, so is y↦f(Ay) for any matrix A. The property is also preserved by Fenchel conjugation. Classical examples are all linear and quadratic functions, the negative logarithm, the negative log-determinant, or the negative logarithm of quadratic functions. The three previous examples are particularly important because they are “barrier functions”, with non-full domains, and are instrumental to interior-point methods (see below).
Properties in one dimension. A nice reformulation of Eq. (1) (which is one-dimensional) is
dxd(f′′(x)−1/2)=21f′′′(x)f′′(x)−3/2⩽1,
which allows to define upper and lower bounds on f′′(x) by integration, as, for x>0,
–x⩽f′′(x)−1/2–f′′(0)−1/2⩽x,
which can be transformed into (by isolating f′′(x)):
with ρ(u)=–log(1−u)–u∼2u2 when u→0, that is, the second-order expansion is tight at x=0, but leads to global lower and upper bounds. This upper-bound is valid as long as δ=f′′(0)1/2x∈[0,1], while the lower-bound on f is always true. The function ρ is plotted below.
Properties in multiple dimensions. The properties above in Eq. (3) and (4) directly extend to multiple dimensions. For any x∈C, then for any Δ∈Rd such that δ2=Δ⊤f′′(x)Δ<1, we have upper and lower bounds for the Hessian, the gradient and the functions value at x+Δ, that is, denoting by ∥⋅∥ the standard Euclidean norm (see detailed proofs at the end of the post)
(1−δ)2f′′(x)≼f′′(x+Δ)≼(1−δ)21f′′(x),(5)
f′′(x)−1/2(f′(x+Δ)−f′(x)−f′′(x)Δ)⩽1−δδ2,(6)
and
ρ(−δ)⩽f(x+Δ)−f(x)–f′(x)⊤Δ⩽ρ(δ).(7)
A nice consequence is that if δ<1, then x+Δ∈C, that is, we get “for free” a feasible point. Moreover, these approximations are “second-order tight” at Δ=0, that is, the term in f′′(x) in Taylor expansion around x is exact.
Dikin ellipsoid. The condition that δ2=Δ⊤f′′(x)Δ<1 defines an ellipsoid around x which is always strictly inside the domain of f (see example in the plot below). The results above essentially state that when inside the Dikin ellipsoid, the locally quadratic approximation can be used.
Dikin ellipsoids for the function f(x)=∑i=1klog(bi–ai⊤x), which is self-concordant with a domain which is a polytope.
In this post, I will focus primarily on the use self-concordant functions in optimization through the analysis of Newton method.
Why should you care about Newton method?
For fun: Newton method is one of the classics of optimization!
For high precisions: as we will see, it is quadratically convergent and attains machine precision after solving a few linear systems.
Even in high dimensions where the linear system can be expensive, Newton method may still be the method of choice for severely ill-conditioned problems where even accelerated first-order methods are too slow to obtain low precision solutions.
It sometimes comes for free in situations where gradients are expensive to evaluate compared to d.
Classical analysis of Newton method
Given a function f:Rd→R, Newton method is an iterative optimization algorithm consisting in locally approximating the function f around the iterate xt by a second-order Taylor expansion
Quadratic approximation and Newton step (in green) for varying starting points (in red). When the starting point is far from the global minimizer (in 0), the Newton step totally overshoots the global minimizer.
Newton method is classically analyzed for three times differentiable convex functions with bounded Hessians and third-order derivatives. The method is only locally convergent, that is, far away from the global minimizer x∗ (even for very regular convex function), the method may diverge. In the non-convex setting, this leads to nice fractal plots, but even for convex functions, the method can be unstable (see plot above).
Locally, it is quadratically convergent, that is, there exists c>0, such that if ∥xt–x∗∥⩽c, then ∥xt+1–x∗∥/c⩽(∥xt–x∗∥/c)2. Roughly, the number of significant digits doubles at every iteration.
This leads to
∥xt–x∗∥⩽c(∥xt0–x∗∥/c)2t−t0,
for t⩾t0 and t0 an index for which ∥xt0–x∗∥⩽c. It is less than ε, as soon as 2t−t0log(c/∥xt0–x∗∥)⩾log(c/ε), that is,
That is, once we enter the quadratic phase, we obtain a number of iterations in loglog(1/ε), that is, only very few iterations. For example, for ε=10−16, loglog(1/ε)⩽4.
Two major issues may be solved elegantly using self-concordant analysis:
Dealing with the two phases of Newton method, the quadratically convergent final phase, as well as the initial phase.
Obtaining convergence rates which are affine-invariant, that is, minimizing f(x) of f(Ax+b) for A an invertible matrix should lead to exactly the same convergence rate (this is not the case for the classical analysis, where for example the constant c depends on non affine-invariant quantities).
Self-concordant analysis of Newton method
Consider f:C→R which is self-concordant. Since Newton method in Eq. (8) is not globally convergent, we need to study a version where the Newton step is performed partially. There are several possible strategies. Here I present the so-called “damped Newton” iteration and thus study the iteration
x+=x–1+λ(x)1f′′(x)−1f′(x),
where we define the “Newton decrement” λ(x) at x∈C, as
λ2=λ(x)2=f′(x)⊤f′′(x)−1f′(x)=∥f′′(x)−1/2f′(x)∥2.
The Newton decrement is a key quantity in the analysis of Newton method, as 21λ(x)2 is exactly the decrease in the quadratic approximation obtained by a full Newton step. Moreover,
If λ(x)<1, then x+ is in the Dikin ellipsoid where we can expect the local quadratic approximation to be relevant.
If λ(x)<1, then one can show that f(x)–f(x∗)⩽ρ(λ(x))∼21λ(x)2 when λ(x) is close to zero, that is, the Newton decrement provides an upper bound on the distance to optimum.
The update corresponds to Δ=–1+λ(x)1f′′(x)−1f′(x), and δ=1+λ(x)λ(x)∈[0,1], thus x+ is automatically feasible (which is important for constrained case, see below).
which leads to quadratic convergence if λ(x) is small enough.
We can then divide the analysis in two phases: before λ(x)⩽1/4 and after. The first integer t0 such that λ(x)⩽1/4 is less than 0.0268f(x0)–f(x∗)⩽38[f(x0)–f(x∗)]. Then, for the second phase, 2λ(xt)⩽(1/2)2t−t0. Given that for λ⩽1/4, ρ(λ)⩽2λ, we reach precision ε as soon as 2t−t0log2⩾logε1, that is, t⩾t0+log21loglogε1−1. This leads to number of iterations to reach a precision ε which is less than
38[f(x0)–f(x∗)]+2loglogε1.
Interior point methods
Self-concordant functions are also key in the analysis of interior point methods. Consider a function f defined on Rd and the constrained optimization problem
x∈Cminf(x),
where C is a convex set. Barrier methods are appending a so-called “barrier function” g(x) to the objective function. A function g is a barrier function if g is convex and with domain containing the relative interior of C, with gradients that explode when reaching the boundary of C. We then solve instead
x∈Rdminε−1f(x)+g(x),(9)
where ε>0. Typically, the minimizer xε is in the relative interior of C (hence the name interior point method), and, when ε tends to zero, xε tends to the minimizer of f on C.
When both the original function f and the barrier function g are self-concordant, the (damped) Newton method is particularly useful as it ensures feasibility of the iterates. Moreover, the interplay between the progressive reduction of ε towards zero and the approximate resolution of Eq. (9) can be completely characterized (see [3, 4, 5]). This applies directly to linear programming, second-order cone programming and semidefinite programming.
Applications in machine learning
If you have reached this point, you are probably a big fan of self-concordance. While this property is crucial in optimization, is it really relevant for machine learning or statistics? The sad truth is that most of the non-quadratic functions within machine learning are not self-concordant in the sense of Eq. (1) or Eq. (2). In particular, log-sum-exp functions, such that the logistic loss f(t)=log(1+exp(−t)), do satisfy a relationship between third and second-order derivatives, but of the form
∣f′′′(t)∣⩽f′′(t),
without the power 3/2. This seemingly small difference leads to several variations [7] which will the topic of next month blog post. Meanwhile, it is worth mentioning two applications in machine learning of classical self-concordance.
Maximum likelihood estimation for covariance matrices. Beyond its use in interior point methods, self-concordant functions arise naturally when estimating the covariance matrix using maximum likelihood estimation with a Gaussian model. Indeed, the negative log-likelihood can be written as
which leads to a negative log-determinant of the inverse Σ−1 of the covariance matrix Σ, which is a self-concordant function, on which the guarantees discussed above apply.
Self-concordant losses. One can also design losses which are self-concordant. For example, a self-concordant version of the Huber loss is
f(t)=1+t2–1–log21+t2+1.
It can be seen as the Fenchel-conjugate of –log(1−t2), and the proximity with a quadratic problem can be leveraged to obtain generalization performances using this loss function which are essentially the same as for the square loss. It can also be used for binary classification (see [8] for details, and the two nice blog posts of Dmitrii Ostrovskii).
One-step-estimation. Given the focus of this post on Newton method, I cannot resist mentioning a great technique coming from statistics that relies on a single Newton step. We consider a classical empirical risk minimization problem (statisticians would call it an M-estimation problem), with empirical risk R(θ)=n1i=1∑nℓ(yi,fθ(xi)). Given an estimator θ^, obtained by any means, then if θ^ is n1 away from the optimal parameter (with optimal performance on unseen data), then one Newton step on the function R started from θ^ will lead to an estimator achieving asymptotically the usual Cramer-Rao lower bound. In a nutshell, a single Newton step on the empirical risk transforms a good estimator into a very good estimator. See [9, Section 5.7] for more details.
Acknowledgements. I would like to thank Adrien Taylor and Dmitrii Ostrovskii for proofreading this blog post and making good clarifying suggestions.
We first show Eq. (7), by considering the function a(t)=f(x+tΔ), which is a one-dimensional self-concordant function, for which a′(t)=Δ⊤f′(x+tΔ), and a′′(t)=Δ⊤f′′(x+tΔ)Δ. Then a′′(0)=δ2, and Eq. (4) for x=1 and a exactly leads to Eq. (7).
In order to show Eq. (5), we consider h∈Rd, and the function b(t)=h⊤f′′(x+tΔ)h. We have, b′(t)=f′′′(x+tΔ)[h,h,Δ], which can be bounded using Eq. (2) as
which implies b(t)⩽(1−δt)2b(0)=(1−δt)2h⊤f′′(x)h, which leads to the right-hand side of Eq. (5) since this is true for all h∈Rd. The left-hand side is proved similarly.
In order to show Eq. (6), we consider the function g(t)=h⊤f′(x+tΔ), for which, g′(t)=h⊤f′′(x+tΔ)Δ, and g′′(t)=f′′′(x+tΔ)[h,Δ,Δ], which satisfies: