Coordinate descent is an iterative optimization algorithm that minimizes an objective function by updating one coordinate, or one block of coordinates, at a time while holding all other variables fixed. In optimization for artificial intelligence, it is the workhorse behind Lasso and elastic net solvers, linear support vector machines and many matrix factorization methods, because each one-dimensional subproblem is often cheap or even solvable in closed form.
The method trades the global view of a full gradient step for many inexpensive, exact or nearly exact moves along single axes. On smooth convex problems and on convex problems with a separable nonsmooth penalty, this simple idea converges reliably and frequently outperforms gradient-based alternatives in wall-clock time.
How coordinate descent updates one variable at a time
Coordinate descent reduces a multivariate problem to a sequence of one-dimensional problems. Given an objective f(x) over x in R^n, each step selects an index i and replaces x_i with the value that minimizes f, or decreases it sufficiently, while every other component keeps its current value. One pass over all n coordinates is called an epoch or a cycle.
The update can be an exact minimization along the coordinate, a single gradient step with a coordinate-specific step size such as 1/L_i, where L_i is the coordinate-wise Lipschitz constant, or a proximal step when the objective contains a nonsmooth term. For the Lasso, the exact update is a soft-thresholding operation applied to a partial residual correlation, which costs only O(m) operations for m training samples, or less when the data matrix is sparse.
The following table summarizes the main update rules and when each one is appropriate.
| Update rule | What it computes | Typical use |
|---|---|---|
| Exact minimization | Closed-form minimizer along one axis | Lasso, ridge, quadratic objectives |
| Coordinate gradient step | x_i minus partial derivative divided by L_i | Smooth objectives without closed form |
| Proximal coordinate step | Gradient step followed by a proximal map | L1 or group penalties, box constraints |
| Block update | Joint minimization over a variable group | Matrix factorization, group Lasso |
| Newton coordinate step | Uses the second partial derivative | Logistic regression with L1 penalty |
Coordinate selection strategies
The order in which coordinates are visited affects both theory and practice. Cyclic coordinate descent sweeps indices in a fixed order, randomized coordinate descent samples them uniformly or in proportion to L_i, and greedy rules such as the Gauss-Southwell rule pick the coordinate with the largest gradient magnitude.
Randomized variants have the cleanest guarantees: for smooth convex functions, the expected suboptimality decreases at a rate of O(n/k) after k coordinate steps, and the rate becomes linear under strong convexity. Cyclic order often performs as well in practice, yet its worst-case bounds are weaker. Greedy selection can make far more progress per step but requires knowing all partial derivatives, which is affordable only when they can be maintained cheaply.
The table below compares the common selection strategies.
| Strategy | Strength | Weakness |
|---|---|---|
| Cyclic | Simple, cache-friendly, deterministic | Weaker worst-case convergence bounds |
| Uniform random | Clean expected convergence rates | Random memory access can be slower |
| Importance sampling | Faster when L_i values differ widely | Requires estimates of L_i |
| Gauss-Southwell (greedy) | Largest progress per step | Needs the full gradient or a priority queue |
| Active set with screening | Skips coordinates that stay at zero | Needs safe screening rules |
Convergence conditions and known failure cases
Coordinate descent converges to a global minimum when the objective is convex and either smooth or composed of a smooth part plus a separable nonsmooth part, such as the L1 norm. Separability is the crucial condition: each nonsmooth term must depend on a single coordinate or a single block.
When the nonsmooth part is not separable, the method can stall. A classic counterexample is a convex function with a ridge whose minimum lies diagonally, so that no single-axis move decreases the objective even though the point is not optimal. On non-convex objectives, coordinate descent may cycle without converging, as shown by Powell’s well-known example, unless exact minimizers are unique or a proximal regularization term is added. Strong coupling between variables, visible as a poorly conditioned Hessian, also slows convergence because each axis move undoes part of the previous one.
Coordinate descent compared with related methods
Coordinate descent sits between full gradient methods and second-order methods in its use of problem structure. It is most competitive when partial derivatives are much cheaper than the full gradient divided by n, which holds for generalized linear models with sparse features.
The next table places it against neighboring algorithms from the same optimization family.
| Method | Cost per iteration | Best suited for |
|---|---|---|
| Coordinate descent | One partial derivative or closed-form update | Sparse models, separable penalties |
| Gradient descent | Full gradient over all variables | Smooth problems with dense coupling |
| Stochastic gradient descent | Gradient on a sample subset | Large datasets, deep networks |
| Proximal gradient method | Full gradient plus a proximal map | Composite problems with any proximable penalty |
| L-BFGS | Gradient plus a low-rank curvature update | Smooth, moderately sized problems |
| ADMM | Alternating subproblem solves and dual update | Coupled constraints, distributed data |
Coordinate descent is the dual counterpart of stochastic methods in a precise sense: stochastic dual coordinate ascent (SDCA) updates one dual variable per training example, which corresponds to processing one sample in the primal problem. Alternating least squares for matrix factorization is block coordinate descent with two blocks.
Practical use in machine learning
Coordinate descent is the default solver for L1-regularized linear models in widely used libraries, including glmnet and the Lasso and elastic net estimators in scikit-learn. LIBLINEAR uses dual coordinate descent for linear support vector machines and logistic regression, and many recommender systems train factorization models with block coordinate updates.
Several implementation techniques make the method fast in production. Warm starts along a regularization path reuse the solution for one penalty value as the starting point for the next. Residual updating keeps the prediction vector current so each coordinate costs only the number of nonzeros in its feature column. Strong and safe screening rules discard features that are guaranteed to remain zero, and the duality gap provides a reliable stopping criterion.
The decision table below indicates when coordinate descent is a sound choice.
| Situation | Recommendation | Reason |
|---|---|---|
| Lasso or elastic net on sparse data | Use coordinate descent | Closed-form updates and cheap residual tracking |
| Linear SVM with millions of samples | Use dual coordinate descent | One dual variable per sample, no step size |
| Deep neural network training | Avoid it | Coupled parameters and costly partial derivatives |
| Non-separable nonsmooth penalty | Prefer proximal gradient or ADMM | Coordinate moves may stall |
| Highly correlated features | Use with caution | Convergence slows due to strong coupling |
Limitations and common mistakes
- Ignoring feature scaling distorts the coordinate-wise Lipschitz constants and slows convergence; standardize features or use per-coordinate step sizes.
- Stopping on small parameter changes alone can end too early; a duality gap tolerance is more reliable for convex problems.
- Applying it to non-separable penalties, such as total variation in its standard form, can leave the solver stuck at a nonoptimal point.
- Parallelizing naively across coordinates that share data causes conflicting updates; asynchronous variants require bounded delay or sparsity assumptions.
- Expecting a global optimum on non-convex problems is unjustified; the method then provides only stationary points, and sometimes not even those.
A non-technical view
Imagine tuning an old radio with several knobs. You turn one knob until the sound is best. Then you leave it and turn the next knob. You repeat this round after round. Each move is easy, and the sound keeps improving.
Coordinate descent works the same way. A model has many settings. The method improves one setting at a time and keeps the rest fixed. This works very well when the knobs barely affect each other. It works poorly when knobs are tightly linked, because fixing one keeps undoing the others.
A concrete example
A credit risk team builds a default prediction model from 200,000 loan applications and about 50,000 sparse features, most of them one-hot encoded categories. They want a model that uses only a few hundred features, so they fit an L1-regularized logistic regression and need to compare 100 values of the penalty strength.
The team runs a coordinate descent solver with warm starts along the regularization path and strong screening rules. Each coordinate update touches only the rows where that feature is nonzero, and screening removes most features at the strongest penalties. The whole path finishes in a few minutes on a single workstation, and the selected model keeps about 300 active features, which the risk committee can review line by line.