Skip to main content

12. Coordinate Descent and Conjugate Gradient — Coordinates and Conjugate Directions

// CORE 6/7 — coordinate descent, conjugate gradient, preconditioning

Not every algorithm uses the full gradient or Hessian at once. Coordinate descent moves one coordinate at a time, while conjugate gradient quickly solves linear systems along special directions.

Coordinate descent

Coordinate descent optimizes one coordinate or one coordinate block at a time:

xiargminzf(x1,,xi1,z,xi+1,,xn).x_i\leftarrow \arg\min_z f(x_1,\dots,x_{i-1},z,x_{i+1},\dots,x_n).

It is highly efficient when each coordinate subproblem is cheap to solve. It is useful for Lasso, matrix factorization, and some large-scale ML problems.

Coordinate-selection methods

MethodDescription
CyclicVisit coordinates in a fixed order
RandomizedSelect a random coordinate
GreedyChoose the coordinate expected to reduce the objective most
BlockUpdate a group of coordinates together

It is fast when the coordinate axes align well with the problem structure, but may be slow when variables are strongly coupled.

Conjugate gradient

Conjugate gradient is an iterative method for solving a symmetric positive-definite linear system:

Ax=b.Ax=b.

It can simultaneously be viewed as minimizing the quadratic function

minx12xAxbx.\min_x \frac{1}{2}x^\top Ax-b^\top x.

The gradient is AxbAx-b, and it is zero at the solution.

Conjugate directions

CG does not simply follow the gradient. It constructs directions that are mutually AA-conjugate:

piApj=0(ij).p_i^\top A p_j=0\quad (i\ne j).

As a result, the next direction does not undo what was already optimized in a previous direction. In exact arithmetic, an nn-dimensional problem is solved within at most nn iterations. With actual floating-point arithmetic, errors make preconditioning important.

Preconditioning

Preconditioning transforms a difficult system into a better-conditioned system.

Original problem:

Ax=b.Ax=b.

With a preconditioner MM, solve approximately the following form:

M1Ax=M1b.M^{-1}Ax=M^{-1}b.

The goal is to reduce the condition number of M1AM^{-1}A. A good preconditioner satisfies two conditions:

  1. It approximates AA well.
  2. Solving Mz=rMz=r is cheap.

When to use each method

MethodGood fit
Coordinate descentCoordinatewise optimization is cheap and the structure separates
Conjugate gradientLarge SPD linear system; Hessian-vector products are available
Preconditioned CGA large condition number makes CG slow

Newton-CG reduces cost on large-scale problems by approximating the Newton step with CG instead of solving it exactly.

Next: Expensive Optimization