Quality diversity

Also known as: quality-diversity algorithms

On this page 7

Quality diversity (QD) is a class of optimization methods that aims to find a large collection of solutions that are each high-performing and collectively diverse, rather than one single optimum. In evolutionary computation, quality-diversity algorithms keep an archive of elites, one of the best solutions for every distinct kind of behavior, and fill it in as completely as possible.

The idea grew out of novelty search and became established with MAP-Elites in the mid-2010s. Its central insight is that diversity is a goal in its own right: a repertoire of good but different solutions supports adaptation, design exploration and robustness, and the varied solutions often serve as stepping stones toward results that greedy optimization never reaches.

How quality-diversity algorithms work

A QD algorithm needs two functions. The fitness function scores how good a solution is, and the behavior descriptor, also called measures or features, describes what kind of solution it is, for example where a walking robot ends up or how tall a generated building is. The descriptor space is divided into niches, and the algorithm tries to place the best possible solution in each one.

The basic MAP-Elites loop is short. It selects parents from the archive, applies mutation or crossover, evaluates the offspring for fitness and descriptor, and inserts each offspring into its niche if that niche is empty or if the newcomer is fitter than the current elite. Over many iterations, the archive turns into an illuminated map of the search space.

ComponentRoleTypical choice
Fitness functionMeasures performanceTask reward, efficiency or accuracy
Behavior descriptorCharacterizes the type of solutionTwo to six hand-chosen measures
ArchiveStores one elite per nicheGrid or centroidal Voronoi tessellation
SelectionChooses parents from the archiveUniform or curiosity-weighted sampling
Variation operatorCreates offspringGaussian mutation, line crossover, gradients
Building blocks of a quality-diversity algorithm

Main algorithm families

Two lineages define the field. Novelty Search with Local Competition rewards solutions for being novel relative to an archive while competing only with behavioral neighbors. MAP-Elites uses an explicit grid of niches and became the reference algorithm because it is simple, parallel and easy to analyze.

Later variants improve sample efficiency and scaling. Centroidal Voronoi tessellation MAP-Elites handles higher-dimensional descriptors, CMA-ME and CMA-MAE borrow covariance adaptation from CMA-ES, and policy-gradient hybrids add reinforcement learning updates for neural network controllers with many parameters.

AlgorithmKey ideaTypical use
MAP-ElitesGrid of niches with one elite eachBaseline for low-dimensional descriptors
NSLCNovelty score plus local competitionOpen-ended morphology search
CVT-MAP-ElitesVoronoi niches instead of a gridDescriptors beyond about four dimensions
CMA-ME and CMA-MAECovariance-adapted emittersContinuous parameter spaces
PGA-MAP-ElitesPolicy gradients as a variation operatorNeuroevolution of large controllers
Representative quality-diversity algorithms

Quality diversity is often confused with multi-objective optimization and niching. All three keep several solutions, but they differ in what diversity means: QD measures diversity in a user-defined behavior space, whereas a multi-objective algorithm such as NSGA-II looks for trade-offs between objectives, and niching preserves distinct peaks of a single fitness landscape.

MethodWhat it returnsNotion of diversity
Single-objective optimizationOne best solutionNone
NichingSeveral optima of one landscapeDistance in genotype or fitness peaks
Multi-objective optimizationA Pareto front of trade-offsSpread across objective values
Novelty searchBehaviorally novel solutionsBehavior only, fitness ignored
Quality diversityBest solution for each behavior nicheCoverage of a behavior space
Quality diversity compared with neighboring methods

Measuring results and choosing settings

QD runs are judged on the archive as a whole. The standard metric is the QD-score, the sum of the fitness values of all elites, usually after shifting fitness to be non-negative. It is reported together with coverage, the share of niches filled, and the maximum fitness found, because a run can fill many niches with mediocre solutions.

  • Choose descriptors carefully: they encode what the user means by different, and poor choices produce diverse but useless archives.
  • Keep descriptor dimensionality low: grids grow exponentially, so CVT archives are preferable above about four dimensions.
  • Budget evaluations generously: runs often need from hundreds of thousands to millions of evaluations.
  • Account for noise: in stochastic tasks, re-evaluate elites to avoid lucky solutions occupying niches.

Limitations and open problems

The strongest limitation is the reliance on hand-designed behavior descriptors. Research on learned descriptors, using autoencoders or other unsupervised representations, aims to discover meaningful dimensions automatically, but the resulting archives can be hard to interpret. Computation is the second constraint, since each evaluation may require a full simulation.

QD can also be misapplied when only one solution is ever needed and the task is not deceptive. In that case, a focused optimizer such as CMA-ES usually reaches a comparable optimum with far fewer evaluations.

Several further questions remain open. Archives in high-dimensional descriptor spaces fill slowly, and uniform parent selection wastes evaluations on niches that have stopped improving. Theoretical understanding is also limited: unlike classical evolution strategies, QD methods have few convergence guarantees, so practitioners rely on empirical comparisons across benchmark domains such as robot locomotion, maze navigation and arm reaching. Open-source libraries such as pyribs and QDax have made these comparisons easier, and accelerator-based implementations now run thousands of evaluations in parallel on a single machine.

Stripped to the essentials

Most search methods hunt for one best answer. Quality diversity looks for the best answer of every kind.

Think of a sports team. A coach does not want eleven copies of the fastest runner. The coach wants the best goalkeeper, the best defender and the best striker. Quality diversity builds a similar roster of solutions. Each one is good, and each one does something different. When conditions change, there is already a strong alternative ready to use.

Where it is applied

A robotics team developing a six-legged walking robot uses MAP-Elites in simulation before deployment. The behavior descriptor records how often each leg touches the ground, which yields a grid of several thousand gait types, and fitness is walking speed. After a few million simulated evaluations, the archive holds a fast gait for almost every pattern of leg use.

In the field, one leg is damaged by a rock. Instead of retraining from scratch, the robot tests a handful of promising gaits from the archive, updating its expectations after each trial, and finds one that avoids the broken leg. The robot recovers useful walking within minutes, a result that a single optimized gait could not provide.

The same pattern appears in game level generation, aerodynamic shape design and the testing of autonomous systems, where engineers value a map of diverse, high-quality options more than one optimum.