Evolving Neural Network Weights

Neuroevolution with the network's structure fixed and only its weights evolved. Encoding a network as a vector of weights, a seeded genetic algorithm on a 2-2-1 XOR network compared with mutation alone and with random search, the competing conventions problem shown by crossing a network with a permuted copy of itself, the cooperative neuron-level methods SANE and ESP, and the recent evidence on when weight evolution competes with gradient-based training.

With the topology fixed, neuroevolution is ordinary parameter search: a 2-2-1 network is a point in $\mathbb{R}^9$, and the search needs a score, not a gradient. On XOR, with 30 seeds, a population of 150 and at most 45,000 evaluations, a genetic algorithm solved every run (median 840 evaluations), mutation alone solved 24 (the six failures stuck at fitness 9), and random search over $[-2, 2]^9$ solved all 30 (median 1,050). Crossover suffers from competing conventions: permuting and sign-flipping hidden units gives $n! \times 2^n$ genomes computing the same function, 8 for two units, and only 5 of the 16 one-point children of a solution and its permuted copy solve XOR. ESP's fixed neuron slots sidestep this, and on Atari gradient-free genetic algorithms were competitive with DQN and A3C.

A neural network with two inputs, two hidden units and one output has nine adjustable numbers. Each hidden unit has two incoming weights and a bias, and the output has two weights and a bias. Fix that structure, and choosing the network is the same as choosing a point in nine-dimensional real space. A genetic algorithm can search that space like any other. It treats the nine numbers as a chromosome, scores each chromosome by how well its network performs, and breeds the better ones. Such a search never computes a gradient, and it still finds a network that computes XOR: in the experiment below it does so in all 30 seeded runs. Its weak point is crossover. Two good networks can compute the same function with their hidden units in a different order, and crossing them can destroy what both had.

This is the oldest and simplest form of neuroevolution: a person chooses the network's topology, and evolution searches only its connection weights. In the traditional setup that Stanley and Miikkulainen (2002) describe, the topology is a single hidden layer, with every hidden unit connected to every input and every output. Evolution explores the weights through crossover of weight vectors and mutation of single networks. No gradient is needed, so the score can be anything measurable: how long a controller keeps a pole balanced, or how many points an agent earns in a game. Later articles in this unit build on two results from this one: the XOR task and its fitness trap, and the competing conventions problem.

First we ask why anyone would evolve weights instead of training them by gradient descent. Then we run a seeded genetic algorithm on the smallest interesting problem, XOR, and compare it with mutation alone and with random search. Next comes the problem that dominated the early literature: two networks can compute the same function with their hidden units in a different order, and crossing them can destroy what both had. We then look at the cooperative methods that worked around it. Finally we review the evidence, from 2017 on, that weight evolution can compete with gradient-based training on some reinforcement learning tasks. The article assumes the genetic algorithm's operators, described in crossover and mutation operators.

Why evolve weights

Gradient descent with backpropagation needs two things: a differentiable loss, and a target for every output. Many problems supply neither. A controller for a robot or a simulated cart receives a single score at the end of an episode. There is no correct action to compare against at each time step. Neuroevolution needs only that score. The Multilayer Perceptron derives backpropagation and shows what it requires: a loss to differentiate and a target for every training example.

Montana and Davis (1989) gave two more reasons. Backpropagation cannot handle discontinuous transfer functions or discontinuous error criteria, and an evolutionary search does not care about either. They also argued that gradient search tends to become trapped in local minima of the error surface.

Their own network had four inputs, two hidden layers of seven and ten units, and one output, 126 weights in all. It classified features of passive sonar images. Their genetic algorithm encoded the weights and biases as a list of real numbers. The evaluation was the sum of squared errors over 236 training examples, and they experimented with a range of operators. A version with node-level mutation and crossover outperformed backpropagation on their data. In that comparison, two genetic algorithm iterations counted as equivalent in computation to one pass of backpropagation.

Whitley, Starkweather and Bogart (1990) applied genetic algorithms both to the weights of feed-forward networks and to their connectivity. Yao's (1999) review organizes the field by what is evolved:

  • connection weights;
  • architectures;
  • learning rules;
  • input features.

This article covers the first. NEAT and architecture search cover the second. To see what weight evolution does in practice, we need a problem small enough to follow by hand.

A seeded experiment: XOR with a fixed 2-2-1 network

XOR is the classic test because a network without hidden units cannot compute it. No single weighted sum of $x_1$ and $x_2$ separates the inputs $(0,1)$ and $(1,0)$ from $(0,0)$ and $(1,1)$.

Why no single unit computes XOR. Suppose a unit that is on when its weighted sum $w_1 x_1 + w_2 x_2 + b$ is positive, and off otherwise, computed XOR. Being off at $(0,0)$ requires $b \le 0$. Being on at $(1,0)$ and at $(0,1)$ requires $w_1 + b > 0$ and $w_2 + b > 0$. Being off at $(1,1)$ requires $w_1 + w_2 + b \le 0$. Adding the two middle inequalities gives $w_1 + w_2 + 2b > 0$, so $w_1 + w_2 + b > -b \ge 0$, which contradicts the last requirement. The sigmoid used below is above 0.5 exactly when its weighted sum is positive, so the argument covers a network whose output unit reads the inputs directly. The Single-Layer Perceptron gives the same argument for Rosenblatt's perceptron and shows its learning rule cycling forever on XOR.

With two hidden units a network can compute XOR. The network here computes

$$h_1 = s(a_1 x_1 + b_1 x_2 + c_1), \quad h_2 = s(a_2 x_1 + b_2 x_2 + c_2), \quad y = s(v_1 h_1 + v_2 h_2 + d).$$

Here $h_1$ and $h_2$ are the hidden units' outputs and $y$ is the network's output. Each $a_i$, $b_i$ is a weight from an input into hidden unit $i$, $c_i$ is that unit's bias, $v_1$ and $v_2$ are the weights into the output, and $d$ is the output's bias. The activation $s(z) = 1 / (1 + e^{-4.9 z})$ is the steepened sigmoid that Stanley and Miikkulainen (2002) used. With it, the task matches the NEAT experiment in the companion article. Its slope of 4.9 makes it a steeper version of the standard sigmoid, whose properties, including $\sigma(-z) = 1 - \sigma(z)$, are set out in Nonlinear Activation Functions; the sign-flip symmetry below rests on that identity. The genome lists the weights grouped by hidden unit:

$$[a_1, b_1, c_1, \; a_2, b_2, c_2, \; v_1, v_2, d].$$

The 2-2-1 network and its genome. Notice that each of the nine weights and biases has a fixed position in the genome, numbered 1 to 9: the first three genes all feed hidden unit h1, the next three feed h2, and the last three feed the output. The values in the bottom row are genome A, the hand-built XOR solution worked through below.
The 2-2-1 network and its genome. Notice that each of the nine weights and biases has a fixed position in the genome, numbered 1 to 9: the first three genes all feed hidden unit h1, the next three feed h2, and the last three feed the output. The values in the bottom row are genome A, the hand-built XOR solution worked through below.

The mapping from genome to network is fixed. Position 1 is always the weight from $x_1$ into the first hidden unit, and position 7 is always the weight from the first hidden unit into the output. That fixity lets a standard crossover operator work on the genome without knowing that it describes a network. As the section on competing conventions shows, it is also the source of the method's main weakness.

Fitness is NEAT's XOR fitness. The absolute errors on the four input patterns are summed, the sum is subtracted from 4, and the result is squared, so a perfect network scores 16. A network counts as solving XOR when every output is on the correct side of 0.5.

One solution worked through

How does a 2-2-1 network compute XOR at all? A hand-built genome shows one way. Take

$$A = [4, 4, -2, \; -3, -3, 5, \; 4, 6, -8].$$

Genome $A$ is the running example of this article. Each of its units computes a familiar logic gate:

  • The first hidden unit computes $h_1 = s(4x_1 + 4x_2 - 2)$. Its weighted sum is $-2$ when both inputs are 0 and at least $2$ otherwise. The steep sigmoid turns those into values near 0 and near 1, so $h_1$ acts as OR.
  • The second computes $h_2 = s(-3x_1 - 3x_2 + 5)$. Its sum is positive unless both inputs are 1, so it acts as NAND.
  • The output $y = s(4h_1 + 6h_2 - 8)$ is near 1 only when both hidden units are near 1. That makes it an AND of the two, and OR AND NAND is XOR.

Every value below comes from tools/experiments/evolution/fixed_topology_worked.py, rounded to four decimals:

$x_1$ $x_2$ $4x_1 + 4x_2 - 2$ $h_1$ $-3x_1 - 3x_2 + 5$ $h_2$ $4h_1 + 6h_2 - 8$ $y$ target
0 0 $-2$ 0.0001 5 1.0000 $-1.9998$ 0.0001 0
0 1 2 0.9999 2 0.9999 1.9994 0.9999 1
1 0 2 0.9999 2 0.9999 1.9994 0.9999 1
1 1 6 1.0000 $-1$ 0.0074 $-3.9557$ 0.0000 0

With the slope of 4.9, $s(2) = 0.99994$, so a weighted sum of 2 is already effectively "on". The NAND unit is the least saturated of the hidden values. At $(1,1)$ its sum is only $-1$, and $h_2 = 0.0074$. The output still has a margin of almost 4 there, because its bias of $-8$ needs both hidden units near 1 to be overcome. The four absolute errors are 0.000056, 0.000056, 0.000056 and essentially 0. They sum to 0.000167, and the fitness is $(4 - 0.000167)^2 = 15.9987$.

The same fitness formula explains a trap that the experiment below runs into. Suppose a network's outputs are exactly right on three patterns and exactly wrong on the fourth. Its summed error is 1, and its fitness is $(4 - 1)^2 = 9$. OR, with outputs $0, 1, 1, 1$, is such a network, and so is any network that outputs 1 on a single pattern. Saturated outputs move very little under small weight changes. So a network at 9 has few neighbors that score better, a local optimum in the sense of escaping local optima.

The genetic algorithm

The genetic algorithm is implemented in tools/experiments/evolution/weight_evolution.py in the site repository. It is fully specified, so each run is reproducible from its seed:

  • a population of 150 genomes, with initial weights drawn uniformly from $[-2, 2]$;
  • generational replacement with elitism: the best genome is copied unchanged and 149 children replace the rest;
  • each child gets two parents by binary tournament (draw two genomes at random, keep the fitter);
  • with probability 0.75 the parents undergo one-point crossover at a cut drawn uniformly from the eight positions between genes, otherwise the child copies the first parent;
  • each gene then mutates with probability 0.2 by adding Gaussian noise with standard deviation 0.5;
  • a run stops at the first genome that solves XOR, or after 300 generations (45,000 evaluations).

Two baselines run on the same seeds. One is the same algorithm with crossover switched off. The other is random search: draw genomes uniformly from $[-2, 2]^9$ until one solves XOR.

Example (the genetic algorithm against random search). The genetic algorithm does not need far fewer evaluations than random search on this problem, although it uses selection, crossover and elitism and random search uses none of them. Over 30 seeds:

Search Runs solved Evaluations to solve, median [Q1, Q3]
GA with crossover 30 of 30 840 [508, 1,320]
GA, mutation only 24 of 30 796 [120, 1,238]
Random search over $[-2, 2]^9$ 30 of 30 1,050 [235, 1,852]
Runs solved against evaluations, for each of the three searches over the same 30 seeds. Notice that the three curves coincide for the seven runs that finished within the first 150 evaluations, because the genetic algorithm's initial population and random search's first 150 draws are the same samples. After that the genetic algorithm with crossover finishes all its runs by about 2,500 evaluations, random search trails it with a longer tail, and the mutation-only version stops climbing at 24 runs.
Runs solved against evaluations, for each of the three searches over the same 30 seeds. Notice that the three curves coincide for the seven runs that finished within the first 150 evaluations, because the genetic algorithm's initial population and random search's first 150 draws are the same samples. After that the genetic algorithm with crossover finishes all its runs by about 2,500 evaluations, random search trails it with a longer tail, and the mutation-only version stops climbing at 24 runs.

The numbers are a warning about XOR as a benchmark. In 7 of the 30 seeds, the initial random population of 150 already contained a solution. Pure random sampling from the same initial distribution found one after a median of 1,050 draws.

The medians hide part of the comparison, and the curves show it in full. The genetic algorithm with crossover solved every run within 2,470 evaluations. Random search needed 4,750 and 10,341 evaluations in its two slowest runs. With the right topology given and a steep sigmoid, XOR is easy enough that the genetic algorithm's advantage over random search is small.

The mutation-only variant failed in 6 runs, and all six ended on the same kind of trap: a best network with fitness 9.0. Its saturated outputs are right on three patterns and fully wrong on the fourth. Three of them compute OR, and the other three output 1 on a single pattern. Such a network computes a different Boolean function exactly, and small mutations of it score no better. In these runs, a population without crossover, under tournament selection and elitism, settled on the trap and stayed there. Random search never concentrates its samples, so it did not get stuck.

Larger networks and harder tasks change these proportions, and random search does not scale to them. The comparison is still worth running whenever a new method is reported on a small problem. Crossover, then, helped on this task. It does not always help, even when both parents are good networks, as the next section shows.

The competing conventions problem

Swap the two hidden units of a network: exchange their incoming weights and biases, and exchange their outgoing weights. The new network computes exactly the same function, but its genome is different.

Montana and Davis (1989) made this observation. They designed a crossover operator around it, which tried to match up hidden units that played the same role in the two parents before exchanging them. In their experiments it performed about as well as their two simpler crossover operators. Stanley and Miikkulainen (2002) trace the difficulty, under the name competing conventions, to Montana and Davis and to Schaffer, Whitley and Eshelman (1992). They note that it is also known as the permutations problem, citing Radcliffe (1993). A network with $n$ hidden units in one layer has $n!$ orderings of those units, all computing the same function.

This is a case of the redundancy described in genetic programming beyond trees: many genotypes map to the same phenotype. There, redundancy made many mutations neutral. Here it works against crossover.

Crossing a network with its own mirror image

When two parents follow different conventions, crossover can give a child two copies of one hidden unit and none of the other. The experiment makes this concrete with genome $A$ and its permuted copy $B$. Recall that $A$'s first hidden unit acts as OR, its second as NAND, and its output takes the AND of the two:

$$A = [4, 4, -2, \; -3, -3, 5, \; 4, 6, -8], \qquad B = [-3, -3, 5, \; 4, 4, -2, \; 6, 4, -8].$$

$B$ is $A$ with its hidden units swapped. Both produce the outputs 0.0001, 0.9999, 0.9999 and 0.0000 on the four patterns, which round to the correct 0, 1, 1, 0.

Example (crossing $A$ with $B$). Only 5 of the 16 children of $A$ and $B$ solve XOR, although both parents are perfect and compute the same function. The 16 children come from one-point crossover at each of the eight cuts, in both orders:

Cut after gene Child $A \mid B$ Solves XOR Child $B \mid A$ Solves XOR
1 $[4, -3, 5, 4, 4, -2, 6, 4, -8]$ no $[-3, 4, -2, -3, -3, 5, 4, 6, -8]$ no
2 $[4, 4, 5, 4, 4, -2, 6, 4, -8]$ no $[-3, -3, -2, -3, -3, 5, 4, 6, -8]$ no
3 $[4, 4, -2, 4, 4, -2, 6, 4, -8]$ no $[-3, -3, 5, -3, -3, 5, 4, 6, -8]$ no
4 $[4, 4, -2, -3, 4, -2, 6, 4, -8]$ no $[-3, -3, 5, 4, -3, 5, 4, 6, -8]$ no
5 $[4, 4, -2, -3, -3, -2, 6, 4, -8]$ no $[-3, -3, 5, 4, 4, 5, 4, 6, -8]$ no
6 $[4, 4, -2, -3, -3, 5, 6, 4, -8]$ yes $[-3, -3, 5, 4, 4, -2, 4, 6, -8]$ yes
7 $[4, 4, -2, -3, -3, 5, 4, 4, -8]$ no $[-3, -3, 5, 4, 4, -2, 6, 6, -8]$ yes
8 $[4, 4, -2, -3, -3, 5, 4, 6, -8]$ yes $[-3, -3, 5, 4, 4, -2, 6, 4, -8]$ yes

The cut after gene 3 is the clearest case. It exchanges whole hidden units, which is the kind of crossover that should preserve building blocks. Yet the child $A \mid B$ has two OR units and no NAND unit, so it computes OR and is wrong on $(1,1)$. Its sibling $B \mid A$ has two NAND units and computes NAND. Every child that solves XOR keeps both hidden units of one parent. It differs from that parent at most in the output weights, and this output unit tolerates some of those changes and not others. The two children of the cut after gene 7 show both cases. Child $B \mid A$ has output weights 6 and 6. Its output sums on the four patterns are about $-2$, $4$, $4$ and $-2$, all on the correct side of 0. Child $A \mid B$ has output weights 4 and 4. At $(0,1)$ its sum is $4h_1 + 4h_2 - 8$ with both hidden outputs just below 1, so the sum is just below 0, the output is just under 0.5, and the child fails.

The output of each network over the whole unit square of inputs, dark for 0 and light for 1, with the outputs at the four XOR patterns printed in the corners. Notice that A and B are pixel for pixel the same function, while the two children of the cut after gene 3 are not: A|B has two OR units and outputs 1 at (1, 1), and B|A has two NAND units and outputs 1 at (0, 0). The dashed red corners are the patterns each child gets wrong.
The output of each network over the whole unit square of inputs, dark for 0 and light for 1, with the outputs at the four XOR patterns printed in the corners. Notice that A and B are pixel for pixel the same function, while the two children of the cut after gene 3 are not: A|B has two OR units and outputs 1 at (1, 1), and B|A has two NAND units and outputs 1 at (0, 0). The dashed red corners are the patterns each child gets wrong.

The child's genome shows why the cut after gene 3 fails: $[4, 4, -2, \; 4, 4, -2, \; 6, 4, -8]$. Both hidden units are now OR units. At $(1,1)$ both are on, and the output sum is $6 + 4 - 8 = 2$. The sigmoid turns that into 1, where XOR needs 0. In $A$ the NAND unit was the one that switched off at $(1,1)$, and the child inherited no copy of it. Nothing in the child's fitness can tell selection that it is one gene block away from a perfect network.

Sign flips: a second symmetry

Permutation is not the only symmetry. Here is the idea in one sentence: a hidden unit can be turned upside down, and the output unit can undo the flip.

The formal version. The sigmoid satisfies $s(-z) = 1 - s(z)$, because

$$1 - s(z) = 1 - \frac{1}{1 + e^{-4.9z}} = \frac{e^{-4.9z}}{1 + e^{-4.9z}} = \frac{1}{e^{4.9z} + 1} = s(-z).$$

So negating a hidden unit's incoming weights and bias turns its output $h$ into $1 - h$. Now change the sign of its outgoing weight $v$ and add $v$ to the output bias. The output unit received $v h$ from the original unit. From the negated unit it now receives $-v(1 - h) + v = v h$, the same contribution, so the function is unchanged.

Each hidden unit can be flipped or not, and the units can be put in any order. So every genome of a two-hidden-unit network has $2! \times 2^2 = 8$ versions that compute exactly the same function. The count is of the versions these two symmetries produce. In degenerate cases some of them coincide, as with two identical hidden units, and a network can have further equivalents, as when the output ignores a hidden unit, whose incoming weights are then free. For $A$ the eight are different genomes. They are, from fixed_topology_worked.py:

Transformation of $A$ Genome Viable children of $A$ and it (of 16)
none $[4, 4, -2, \; -3, -3, 5, \; 4, 6, -8]$ 16
negate $h_2$ $[4, 4, -2, \; 3, 3, -5, \; 4, -6, -2]$ 6
negate $h_1$ $[-4, -4, 2, \; -3, -3, 5, \; -4, 6, -4]$ 0
negate both $[-4, -4, 2, \; 3, 3, -5, \; -4, -6, 2]$ 0
swap $[-3, -3, 5, \; 4, 4, -2, \; 6, 4, -8]$ 5
swap, negate new $h_2$ $[-3, -3, 5, \; -4, -4, 2, \; 6, -4, -4]$ 0
swap, negate new $h_1$ $[3, 3, -5, \; 4, 4, -2, \; -6, 4, -2]$ 4
swap, negate both $[3, 3, -5, \; -4, -4, 2, \; -6, -4, 2]$ 4

The check on genome $A$ confirms the algebra. All eight genomes compute the same outputs to within $10^{-18}$, so all eight have the same fitness, and selection treats them as the same network. Crossed with $A$ by one-point crossover, three of them produce no child that solves XOR at all. Negating a unit turns OR into NOR. A child that mixes the two halves of a unit, or that takes $A$'s output weights with the other genome's hidden units, receives a signal of the wrong sign.

Example (wider layers). In a network with one hidden layer of three units, each genome has 48 versions that compute exactly the same function, and with five units 3,840. With $n$ units there are $n!$ orderings and $2^n$ choices of which units to flip, so the count is $n! \times 2^n$: $3! \times 2^3 = 6 \times 8 = 48$ for three units and $5! \times 2^5 = 120 \times 32 = 3{,}840$ for five (Part 4 of the script). For a random genome with three hidden units, the script confirms that the 48 versions are 48 different genomes with identical outputs. The redundancy grows faster than exponentially with the width of the layer.

How much it matters among evolved networks

Hand-built mirror images are an extreme case. To measure how often independently evolved solutions follow different conventions, and what that costs, the experiment took the 30 solutions found by the genetic algorithm with crossover. For each of the 435 pairs, it evaluated all 16 one-point children twice:

  • first with the parents as evolved;
  • then after reordering the second parent's hidden units to match the first as closely as possible (the order with the smaller squared distance between corresponding weights).
Crossing Children that solve XOR
Independent solutions, as evolved 869 of 6,960 (12.5%)
Independent solutions, hidden units aligned 1,120 of 6,960 (16.1%)
Each solution with its own permuted copy 143 of 480 (29.8%)

Alignment swapped the hidden units in 233 of the 435 pairs. It raised the share of viable children by more than a quarter, from 12.5% to 16.1%. That share stays low because independent solutions also differ by sign symmetries and by the scale and pattern of their weights, which no reordering can fix. The last row isolates the permutation alone. Crossing a network with a reordered copy of itself, which differs from it only in convention, still loses 70% of the children.

A common reading is that the problem is rare, because inside a converged population it fades. Once one convention takes over, all parents share it. That is exactly why it matters. Crossover is most useful early, when the population is diverse, and early is when the conventions compete. Some systems avoided the problem by dropping crossover altogether. Stanley and Miikkulainen (2002, §2.1.3) review examples among the methods that also evolve topology. Such et al. (2017) also left crossover out of their deep genetic algorithm, for simplicity. Others changed what a genome describes.

Cooperative approaches: SANE and ESP

Another route evolves neurons instead of whole networks. In SANE (Symbiotic, Adaptive Neuro-Evolution), Moriarty and Miikkulainen (1996) evolved a population of hidden neurons, each a partial solution. Networks are formed by combining neurons for evaluation. A neuron's fitness reflects how well the networks it takes part in perform.

The authors argue that this symbiotic arrangement encourages both cooperation and specialization. In their account, that speeds the search and helps it avoid converging on poor solutions. On the inverted pendulum task, SANE formed effective networks 9 to 16 times faster than the Adaptive Heuristic Critic and 2 times faster than Q-learning and the GENITOR neuroevolution system.

Enforced Sub-Populations (ESP), introduced by Gomez and Miikkulainen (1997), keeps SANE's population of neurons but splits it:

  • there is a separate subpopulation for each of the $u$ hidden-unit positions in the network;
  • a network is formed by drawing one neuron from each subpopulation;
  • a neuron recombines only with members of its own subpopulation.

Gomez and Miikkulainen give two reasons this speeds up SANE. First, the specialized groups that have to organize themselves out of SANE's single population are fixed by design in ESP. Second, recombination no longer mixes neurons that fill different roles in the network. Cooperative coevolution places both methods in Potter and De Jong's general architecture, in which separate populations evolve the parts of a solution and are scored together.

Example (conventions in ESP). Two ESP networks cannot follow different conventions between subpopulations, in the sense of genome $A$ and its swapped copy $B$. A neuron's role is tied to its slot, so the reorderings behind competing conventions cannot arise there. This is a consequence of the design, which the authors do not list among its reasons. Gomez and Miikkulainen describe ESP's main contribution differently: it made it possible to evolve recurrent networks. Their prey-capture task needed them, because the agent has to remember where it last saw the prey.

Published results show how much the neuron-level methods gained. Stanley and Miikkulainen (2002, Table 1) collected them for double pole balancing with velocity inputs. In this standard control benchmark, two poles of different lengths on one cart must be kept upright:

Method Evaluations to solve (average)
Evolutionary programming (Saravanan and Fogel) 307,200
Conventional neuroevolution (Wieland) 80,000
SANE 12,600
ESP 3,800
NEAT 3,600

The neuron-level methods needed 6 to 21 times fewer evaluations than conventional whole-network neuroevolution on this task. NEAT, which also evolves the topology, matched ESP. Stanley and Miikkulainen report that the difference between NEAT and ESP was not statistically significant. On the harder variant without velocity inputs, ESP still solved the task with a fixed topology, restarting with a random number of hidden units when it became stuck, and NEAT was about five times faster. The NEAT article takes up that comparison.

When weight evolution competes with gradient descent

So far the comparisons have been among evolutionary methods. This section compares weight evolution with gradient-based training. For supervised learning on large networks, where every example supplies a target and the loss is differentiable, backpropagation is the standard method. The comparisons below are all in reinforcement learning, where the gradient has to be estimated from rewards.

Salimans, Ho, Chen, Sidor and Sutskever (2017) used an evolution strategy to train policy networks on the MuJoCo locomotion tasks and on Atari games. Each worker perturbs the network's parameters with Gaussian noise, runs an episode and reports a single number, its return. The updates combine the returns into an estimate of the gradient of expected return. The authors point out that this is a finite-difference derivative estimate in a randomly chosen direction.

Workers need to exchange only returns and random seeds, so the method parallelized well. With 1,440 workers it solved the 3D humanoid walking task in under 10 minutes. On Atari, with 720 CPUs and about an hour per game, it did better than published A3C results on 23 of 51 games and worse on 28.

Example (no backpropagation, but still a gradient). The evolution strategy of Salimans et al. never runs backpropagation, yet it does not avoid gradients altogether. It estimates the gradient of expected return from sampled perturbations, as the authors themselves note. It avoids backpropagation, not the gradient. The next study removed the gradient estimate too.

Such, Madhavan, Conti, Lehman, Stanley and Clune (2017) asked whether an algorithm that does not estimate a gradient at all could work at that scale. Their genetic algorithm is about as simple as one can be:

  • truncation selection of the top $T$ networks;
  • a parent drawn uniformly from them;
  • Gaussian noise added to every parameter;
  • one elite copied unchanged;
  • no crossover.

It evolved networks with over four million parameters. On Atari it was competitive overall with DQN, A3C and evolution strategies, better on some games and worse on others. It also always beat random search. But random search alone outperformed DQN on 3 of the 13 games tested, A3C on 6, and evolution strategies on 3. The authors read this as evidence that on some of these problems, local optima, saddle points or noisy gradient estimates impede gradient-based methods. Following the gradient, they conclude, is not always the best choice.

What we have learned

A fixed network turns neuroevolution into ordinary parameter search, over nine numbers for the 2-2-1 XOR network and four million for an Atari policy. It needs only a score. On XOR the genetic algorithm solved all 30 runs, but random search came close, and mutation alone stalled on the fitness-9 trap. The large studies share that pattern. A search with no gradient can be competitive when the reward is sparse or deceptive and good solutions are plentiful. A random-search baseline tells whether the evolutionary machinery is doing the work.

Crossover is where the fixed encoding shows its limit. Genome $A$ and its swapped copy compute the same function, yet only 5 of their 16 children do. ESP sidestepped the problem by fixing each neuron's slot. In every method here, though, a person chose the network, and evolution chose only its weights. When evolution must also choose the structure, two parents may not even have the same number of genes. That is the harder form of the competing conventions problem, and NEAT: NeuroEvolution of Augmenting Topologies answers it with historical markings.

References

  • Gomez, F., and Miikkulainen, R. (1997). Incremental evolution of complex general behavior. Adaptive Behavior, 5(3–4), 317–342. record · 2 pages
  • Montana, D. J., and Davis, L. (1989). Training feedforward neural networks using genetic algorithms. In Proceedings of the Eleventh International Joint Conference on Artificial Intelligence (IJCAI-89), 762–767. record
  • Moriarty, D. E., and Miikkulainen, R. (1996). Efficient reinforcement learning through symbiotic evolution. Machine Learning, 22(1–3), 11–32. record · 2 pages
  • Radcliffe, N. J. (1993). Genetic set recombination and its application to neural network topology optimisation. Neural Computing and Applications, 1(1), 67–90. record
  • Salimans, T., Ho, J., Chen, X., Sidor, S., and Sutskever, I. (2017). Evolution strategies as a scalable alternative to reinforcement learning. arXiv:1703.03864. record · 4 pages
  • Schaffer, J. D., Whitley, D., and Eshelman, L. J. (1992). Combinations of genetic algorithms and neural networks: a survey of the state of the art. In COGANN-92: International Workshop on Combinations of Genetic Algorithms and Neural Networks, 1–37. IEEE. record
  • Stanley, K. O., and Miikkulainen, R. (2002). Evolving neural networks through augmenting topologies. Evolutionary Computation, 10(2), 99–127. record · 5 pages
  • Such, F. P., Madhavan, V., Conti, E., Lehman, J., Stanley, K. O., and Clune, J. (2017). Deep neuroevolution: genetic algorithms are a competitive alternative for training deep neural networks for reinforcement learning. arXiv:1712.06567. record · 2 pages
  • Whitley, D., Starkweather, T., and Bogart, C. (1990). Genetic algorithms and neural networks: optimizing connections and connectivity. Parallel Computing, 14(3), 347–361. record
  • Yao, X. (1999). Evolving artificial neural networks. Proceedings of the IEEE, 87(9), 1423–1447. record · 2 pages

Reviewed: verified, 16 Nov 2026 · citations checked, 16 Nov 2026 · editorial review, 23 Nov 2026 · 8 revisions