Paper commentary
The CMA Evolution Strategy: A Tutorial
CMA-ES learns the search distribution's covariance to handle elongated objectives
- Problem Fixed search distributions struggle on elongated, non-separable objectives. A distribution that ignores the ellipsoid shape spends many samples in directions that barely help.
- Method CMA-ES keeps a normal search distribution and re-learns its mean, step-size and covariance from the ranked samples each generation. The covariance comes from selected steps and an evolution path.
- Results The authors argue that CMA-ES turns convex-quadratic ellipsoid objectives into a sphere. They argue this can cut evaluations by orders of magnitude on ill-conditioned problems.
Why fixed search distributions get stuck
A randomized search samples points from a distribution and keeps what works, which suits rugged landscapes with discontinuities, ridges and local optima. Ill-conditioned and non-separable problems are harder, because the good search directions are not the coordinate axes. Level sets of such objectives are stretched ellipsoids, so a search distribution that ignores this shape spends many samples in directions that barely help.
Covariance matrix adaptation tries to fix this by learning the shape of the sampling distribution from the samples it has already seen. On convex-quadratic functions the ideal covariance is the inverse Hessian up to a constant factor, which the authors assume without a rigorous proof. The condition number, the ratio of the largest to the smallest eigenvalue, measures how stretched that ellipsoid is.
Sampling from an adapted normal distribution
The key idea is to keep a normal search distribution and to re-learn its mean, step-size and covariance matrix from the ranked samples in every generation. Each offspring is drawn as the current mean plus the step-size times a draw from a normal distribution with covariance C, written as \(x^{(g+1)}_k \sim m^{(g)} + \sigma^{(g)}\mathcal{N}(0, C^{(g)})\).
The covariance is factored as \(C = B D^2 B^T\), with B orthogonal and D diagonal, so the same sample can be written as \(BD\,\mathcal{N}(0, I)\).
This factorization matters because the algorithm only needs independent standard normal numbers, which are easy to generate, and then rotates and stretches them. The mean, the step-size and the covariance matrix are the three quantities that the rest of the update has to refresh.
Moving the mean by recombination
The new mean is a weighted average of the µ best of the λ sampled points, ranked by objective value. The weights are positive and decrease with rank, and they sum to one, so better samples pull the mean harder. With equal weights this reduces to a plain average, and truncation selection is what discards the other λ minus µ points.
The variance effective selection mass \(\mu_{\mathrm{eff}} = 1/\sum_i w_i^2\) measures how many independent samples the weights effectively use. Equal weights give \(\mu_{\mathrm{eff}} = \mu\), and unequal weights always give a smaller value, so µeff is the better count of used information. A setting with µeff around λ/4 is called reasonable, and the mean update is written as a learning-rate scaled step toward the weighted average.
Which reference mean gives a better covariance estimate
A covariance estimate can use the sample mean as reference, or the true sampling mean, or the selected steps relative to the sampling mean. The selected-step estimator is the one the authors keep, because sampling from it reproduces successful steps, which gives a meaning to a better covariance. EMNAglobal instead uses the mean of the selected points as reference, so it measures variance within the selected population.
On a linear objective with λ = 150 and µ = 50, the authors compare the two estimators with equal weights. The selected-step estimator increases the expected variance along the gradient direction, while EMNAglobal decreases it geometrically fast. The authors warn that the EMNAglobal-style estimate is prone to premature convergence, especially with small parent populations.
A reliable estimate from one generation needs a large effective selection mass, and on the sphere function the condition number stays below ten only when µeff is about 10n. Small populations, which the authors want for fast search, cannot reach that size, so the next step pools information across generations.
Pooling generations with the rank-µ update
Averaging the single-generation estimates over all generations is reliable, but it weights old generations equally. Exponential smoothing with a learning rate \(c_\mu \le 1\) gives recent generations more weight, so the covariance follows the recent selected steps. Each selected step is rescaled by the step-size before it enters the outer product, and the sum is called the rank-µ update.
The horizon \(1/c_\mu\) generations holds about 63% of the overall weight, and roughly 37% of the information is older than that. So a small \(c_\mu\) gives slow learning, and a large one lets the covariance degenerate.
Allowing weights that are negative, as active covariance matrix adaptation does, lets worse samples push the covariance away from their directions. The authors rescale vectors linked to negative weights to a constant length, which keeps the updated covariance positive definite.
Steering the covariance with the evolution path
With a single selected step \(y\), the rank-one update adds \(y y^T\) to the covariance, which makes the sample more likely in the next generation. A sign is lost in \(yy^T\), so the authors add an evolution path that cumulates consecutive steps and keeps their order and sign. The path is updated as \(p_c^{(g+1)} = (1-c_c)p_c^{(g)} + \sqrt{c_c(2-c_c)\mu_{\mathrm{eff}}}\,(m^{(g+1)}-m^{(g)})/(c_m\sigma^{(g)})\), and the square root normalizes its length.
Correlated steps make the path longer than single steps, by a factor of up to about \(1/\sqrt{c_c}\), which acts like a larger learning rate. For \(\sqrt{n} \le 1/c_c \le n/2\), the authors say the number of evaluations on cigar-like functions is O(n), even with \(c_1 \approx 2/n^2\).
Combining the rank-µ and rank-one parts
The final covariance update keeps the old covariance, adds the rank-one term from the evolution path, and adds the rank-µ term from the selected steps. The learning rates are set to \(c_1 \approx 2/n^2\) and \(c_\mu \approx \min(\mu_{\mathrm{eff}}/n^2, 1-c_1)\). The rank-µ term uses information from the whole population, while the evolution path exploits correlations between generations.
The rank-µ term matters most in large populations, and the path term matters most in small populations, which is why the two are combined. The sum of the weights can then be close to zero, so the decay on the old covariance nearly disappears.
Step-size control with a conjugate path
Covariance adaptation does not set the overall scale directly, and the optimal step-size depends on µ or µeff in a way the covariance rule cannot represent. Covariance learning is also too slow for the step length: the optimal step length on the sphere must shrink by about exp(0.25), or 1.28, within n evaluations. Covariance adaptation is too slow to be competitive whenever µeff is much smaller than n.
The method compares the length of an evolution path with its expected length under random selection, where consecutive steps are uncorrelated. A short path means steps cancel out and σ should shrink, while a long path means steps point the same way and σ should grow. The path is conjugate, because the whitening \(C^{-1/2}\) makes its expected length independent of direction, so it is compared with \(E\|\mathcal{N}(0,I)\|\).
The log step-size is updated by the normalized excess length of the path, with a damping parameter \(d_\sigma\) that scales the change. Equivalently, σ is multiplied by an exponential of that excess, which keeps σ positive. An alternative compares the squared norm with n, which the authors expect to give faster increases and slower decreases.
Invariance and design principles
Learning the covariance is analogous to learning the inverse Hessian in a quasi-Newton method, and it transforms an ellipsoid objective into the sphere. The authors argue this can cut the number of function evaluations by orders of magnitude on ill-conditioned and non-separable problems.
The algorithm is invariant to order-preserving transformations of the objective, to rigid transformations of the search space, and to affine transformations when the initial covariance is chosen accordingly. Translation invariance is taken for granted, and scale invariance holds when the initial step-size and mean are scaled accordingly.
The three parameters have separate change rates: the mean through \(c_m\), the covariance through \(c_1\) and \(c_\mu\), and the step-size through \(d_\sigma\) and \(c_\sigma\). Under random selection the mean and covariance stay unbiased, while the expected step-size grows, because unbiasedness of ln σ does not imply unbiasedness of σ.
Limitations
The assumption that the optimal covariance equals the inverse Hessian up to a constant rests on intuition and empirical evidence, with no rigorous proof.
The tutorial covers only single-objective optimization with non-elitistic truncation selection. The excerpt reports no benchmark tables, and the broader performance claims rest on the cited applications.
Paper info
- Authors
- Nikolaus Hansen
- Venue
- arXiv · Preprint
- First published
- 2016-4-4
- Added
- 2026-11-12
- Updated
- 2023-3-10
- Version
- v2
- arXiv
- 1604.00772
- Category
- cs.LG · stat.ML
- Original paper terms
- arXiv non-exclusive 1.0
- What we show
- Paper info and commentary
AI commentary is a separate explanation from the original paper and may contain errors. The original paper and figures follow each source's terms of use and any rights noted separately.
Quote from the paper
Nikolaus Hansen (2016). The CMA Evolution Strategy: A Tutorial. arXiv:1604.00772v2. https://arxiv.org/abs/1604.00772v2
BibTeX
@misc{hansen2016evolution,
title = {{The CMA Evolution Strategy: A Tutorial}},
author = {Nikolaus Hansen},
year = {2016},
eprint = {1604.00772},
archivePrefix = {arXiv},
url = {https://arxiv.org/abs/1604.00772v2}
}