Evolution as an Algorithm
Copy, vary, select, repeat. The recipe from Chapter 1 does not care whether it runs on DNA, on antibodies or on numbers in a computer. Engineers now use it on purpose. Watching it run in a machine shows both how powerful it is and the one thing a computer version always adds that nature never has: a goal.
Look back at what every simulation in this book needed. Something that makes copies of itself. Copies that are slightly imperfect. Surroundings that let some copies make more copies than others. Nothing in that list mentions cells, proteins or even life. The philosopher Daniel Dennett argued that natural selection is best seen as an algorithm: a mindless, step-by-step procedure that will produce its results in any medium where the three ingredients are present.
It already runs in more places than you might expect. When you fight an infection, the immune cells that make antibodies change their antibody genes at a high rate, and the cells whose antibodies grip the invader best are favoured: a small burst of variation and selection inside your own body, over days and weeks. Chemists now do the same in test tubes. Frances Arnold shared the 2018 Nobel Prize in Chemistry for "directed evolution": making many slightly different versions of an enzyme, keeping the ones that work best at a job, and repeating.
Evolution in a computer
In the 1960s and 1970s the computer scientist John Holland developed genetic algorithms: programs that keep a population of candidate solutions, score each one, let the better ones "breed" by mixing their settings, add random changes, and repeat. Engineers have used such methods to design things that are hard to reason about directly; NASA engineers, for example, used an evolutionary algorithm to design a small, oddly bent radio antenna for a spacecraft mission in the mid-2000s.
Here is a genetic algorithm you can watch. Each rocket's "genome" is a list of 110 thrust directions, one for each moment of its flight. The first generation's lists are random, so the rockets wobble aimlessly. Each generation, rockets that end up closer to the target are more likely to be picked as parents; crashing into the barrier or the walls is heavily penalised. Children mix two parents' lists and get a few random changes.
A genetic algorithm has a fitness function chosen by a person: "get close to this target". That is a goal, written down in advance. Nature has nothing like it. In living populations, "fitness" is not a score anyone set in advance. It is a variant's expected reproductive success, which comes from how its traits interact with the conditions it actually meets: the climate, predators, rivals and mates. Nobody chose which traits should win, and the conditions keep changing, partly because other species are evolving too. The rockets share evolution's machinery, not its lack of a goal. The same caveat applied to the target-phrase demo in Chapter 7.
Hikers and herds
Most of modern machine learning trains models by a different method: gradient descent. Picture a single blindfolded hiker on a landscape of hills. At each step the hiker feels which way the ground slopes underfoot and takes a small step uphill (or downhill, if the goal is to minimise an error). It is efficient, but it only ever knows the ground at one spot, so it climbs whichever hill it happens to start on.
An evolving population is more like a herd spread over the hills. It never measures slopes at all; it only compares the heights where its members stand, and the next generation is drawn from those standing higher, with random scatter. A herd can spill over a low ridge onto a taller hill that the lone hiker would never find. But it can get stuck too, and it wastes effort on members standing in poor spots. Let them race.
Real machine learning mixes these ideas. Gradient methods need a smooth score whose slope can be calculated; evolutionary methods only need to compare scores, which makes them useful when the slope cannot be measured. Both are search procedures, and both need someone to say what counts as better. That is why the landscape picture from Chapter 8 turns up in so many fields.
Misconception spotter
You have now run evolution in a dozen forms. Time to test the instincts you have built. For each statement, decide whether it is true or false.
0 of 8 answered
A programmer writes a genetic algorithm to design a lightweight bridge. Which statement about it is accurate?
What you now see
This chapter, and the whole book, in a few lines:
- The engine (Chapters 1–3): variation, inheritance and differential reproduction make populations change, with no goal and no foresight. Mutations are random with respect to need; selection is not random.
- What counts (4–6): fitness means reproductive success in a particular environment, not strength. Breeders proved how far selection can go. Chance also moves gene frequencies, most strongly in small populations.
- Climbing without a map (7–8): small steps add up over deep time into eyes and wings; populations climb fitness landscapes blindly and can get stuck on lesser peaks.
- Life shaping life (9–10): when the environment includes other evolving species, races never end; helping evolves when it tends to aid copies of the helper's genes.
- The tree and the algorithm (11–12): isolated populations diverge into new species, all life forms one branching tree, and the same loop now runs in our machines, where, unlike in nature, someone writes down the goal.