The evolutionary robotics lecture opens with three problems. Read them as a single argument: each one is a design task with an enormous search space, non-linear interactions and a costly evaluation.
| Problem | What has to be found | What makes it hard |
|---|---|---|
| Artificial cell | A setting of 3000 genes (active/inactive) such that the cell performs a given function (e.g. moving toward high oxygen concentration) | The behaviour results from non-linear relations among the genes; only a simulation gives feedback; trying all configurations is impossible |
| Artificial creature | Morphology (sticks + motorised junctions) and neuron configuration such that it moves | The configuration set is huge, if not infinite, and simulations are costly |
| Data fitting | A function that fits a huge dataset, with no model assumed | The set of possible functions is infinite; any elementary function may be involved |
The summary slide draws the common structure:
Designers frequently add extra constraints to reduce the search space — but they are often biased by implicit assumptions and requirements. The example quoted in the slides (from Pfeifer & Bongard, How the Body Shapes the Way We Think, 2007): design the curvature of a pipe so as to minimise turbulence; the first designer choice is a quarter circle, which is not optimal. The claim is not that evolution removes bias — it is that a search process that starts from fewer assumptions has a chance to find solutions the designer would not have thought of.
This is the thread that connects to Chapter 1: the course's two structural answers to "robustness and flexibility are hard to bring together" are swarm robotics (Chapter 9) and automatic design (Chapter 11). Evolutionary robotics is the founding member of the second family — and the bridge between them.
Evolutionary computation (EC) draws inspiration from biological evolution, based on three observations:
From these, four key concepts: the fittest individuals have a high chance of having a numerous offspring; children are similar but not equal to their parents; the traits characterising the fittest individuals spread across the population generation by generation; selection acts on the individuals as they appear and behave, but it indirectly acts on their heritable traits.
Evolutionary computation techniques are not meant to model or simulate biological evolutionary processes: they exploit these key concepts for problem solving. Natural evolution is in fact much more than that. This distinction matters at the oral — the phrase "evolutionary algorithm" is a design choice, not a claim about biology.
The idea was anticipated by Turing in 1950, in the passage Chapter 2 quoted:
"[...] why not rather try to produce one which simulates a child's [mind]? [...] We cannot expect to find a good child-machine at the first attempt. One must experiment with teaching one such machine and see how well it learns. One can try another and see if it is better or worse. There is an obvious connection between this process and evolution [...]"
With the explicit correspondence: structure of the child machine = hereditary material; changes = mutations; natural selection = judgement of the experimenter.
The metaphor is usually written as a table:
| Biological evolution | Artificial evolution |
|---|---|
| Environment | Problem |
| Individual | A possible solution |
| Fitness | Quality |
Two observations attached to the table: in evolution the environment is changing and individuals interact, while in EC methods we often suppose the environment is constant and the evaluation of the individuals only depends on external functions; and a possible solution is in general encoded in a kind of genetic code — a data structure that can be manipulated by suitable operators.
Evolutionary computation encompasses genetic algorithms, genetic programming, evolution strategies, estimation of distribution algorithms, and more — different names for different implementations of the same overall scheme.
Developed by John Holland in the early '70s, the simple genetic algorithm (SGA) codes solutions as bit strings. One string is usually divided into m blocks that codify m objects. The string is the genotype; the solution it codifies (integers, reals, a plan, rules...) is the phenotype. Encoding examples from the slides: a block of genes can codify one move (e.g. 1000 → move ahead); a rule like if obstacle in front then stop is codified by a block split in two parts, the first codifying the condition, the second the action.
The high-level algorithm:
Initialize Population
Evaluate Population
while Termination conditions not met do
while New population not completed do
Select two parents for mating
Copy their chromosomes
Apply crossover to produce two new individuals
Apply mutation to each new individual
end while
Population ← New population
Evaluate Population
end while
Termination conditions: execution time limit reached; satisfactory solution(s) obtained; stagnation (limit case: the population converged to the same individual).
The three main genetic operators are selection (choice of parents whose genetic material is reproduced with variations), recombination (combining the genetic material of the parents) and mutation (introducing variability in the genotypes), plus the survivor operator that defines the new population. Crucial is the representation of the individuals — their syntactic representation, which can be manipulated by the genetic operators.
Mutation: each gene has probability pM of being flipped. Recombination (crossover): cross-combination of two chromosomes at one (or more) cut points. Alternatives: multi-point crossover, multi-parent crossover, uniform crossover (each parent k is associated a probability gk used to pick the value of gene i in the child).
Proportional (roulette-wheel) selection: the probability for an individual to be chosen is proportional to its fitness — usually represented as a roulette wheel whose slices are the fitness shares. Alternatives: selection based on the ranking of individuals (it does not favour the fittest as much as the proportional rule), and tournament selection (iteratively pick two or more individuals and put the best among them in the mating pool; less computation — best choice when evaluation is costly; it also favours exploration).
Five individuals with fitness values as in the lecture slides. The wheel is drawn to scale; draw 20 parent slots and watch the sampling distribute them.
Generational replacement: the new generation replaces entirely the old one. Advantage: very simple, computationally cheap, easier theoretical analysis. Disadvantage: good solutions might not be maintained in the new population. Hence a kind of elitism is always used: for example, the best k individuals from the previous population are kept in the new one (discarding some offspring if the population must keep the same size).
The genetic operators are blind with respect to the goal: their role is to recombine and vary the genetic material so as to explore genetic combinations. Favourable variations are likely to be preserved by selection — but nothing guarantees it. Elitism is the minimal insurance against the loss of the best found so far. You will meet the same idea again in Chapter 11 under the name of steady-state schemes.
The intuition: mutation introduces diversity; selection drives the population toward high fitness values; crossover might combine good parts from good solutions.
Beyond the intuition, the slides offer an abstract view of the search process: the GA performs an iterative sampling over the search space, based on a probabilistic model; the parameters of the model are tuned as a function of the population fitness, so as to intensify the sampling around promising regions. This makes the process similar to importance sampling and model-based search (the loop model → sample, with an auxiliary memory for learning).
Twenty individuals, 20-bit genotypes, roulette selection, one-point crossover (90% of the time), elitism keeping the best. The target bitstring is red; matching bits are cobalt. Watch selection, crossover and mutation balance each other — then break the balance on purpose.
Solution representation is free: besides the simple binary representation, solutions can be encoded by n-dimensional arrays of floating point numbers, permutations, finite state machines, trees — anything a suitable set of operators can manipulate. This matters enormously for robotics: a probabilistic FSA (Chapter 6), a behaviour tree (Chapter 8), a neural network or a whole morphology are all just genotypes awaiting operators.
Genetic programming (GP) can be seen as a variant of GA in which individuals are programs: it is used to build programs that solve the problem at hand (specialised programs), and it is extended to automatic design in general (controllers, electronic circuits). Fitness is given by evaluating the performance of the program on some defined criterion. In most cases individuals are represented as trees that encode programs:
+
/ \
1 2 IF
/ \
> 3 4
/ \
T 6
Operators: mutation randomly selects a subtree and substitutes it with a well-formed randomly generated subtree; crossover swaps subtrees between two parents. The five preparatory steps of the basic version: specify (1) the set of terminals, (2) the set of primitive functions, (3) the fitness measure, (4) run parameters, (5) termination criterion and result designation. The fitness measure is the primary mechanism for communicating the high-level statement of the problem's requirements: it specifies what needs to be done.
By 2003, GP had produced at least 36 human-competitive results, 21 of which duplicated previously patented inventions — for example six patented analog electrical circuits (topology and component sizing), the rediscovery of the Yagi-Uda antenna, PID tuning rules outperforming Ziegler-Nichols, and a real-time analog circuit for time-optimal control of a robot. "Human-competitive" is defined by eight criteria at arm's length from AI — a result cannot earn the rating merely because it interests researchers; it must earn it independent of the fact that an automated method generated it.
For robotics the lesson is methodological: the same machinery that synthesises circuits and antennas synthesises controllers, with function sets made of integrators, gains, adders, and so forth. Chapter 11 will use a much more constrained version of this idea: instead of arbitrary programs, a parametric architecture whose free parameters are tuned by search.
"In the field of evolutionary robotics, one class of population-based metaheuristics — evolutionary algorithms — are used to optimize some or all aspects of an autonomous robot." The use of metaheuristics sets this subfield apart from the mainstream of robotics research, in which machine-learning algorithms are used to optimise the control policy of a robot.
Doncieux, Bredeche, Mouret and Eiben (2015) put it in one sentence: evolutionary robotics applies the selection, variation and heredity principles of natural evolution to the design of robots with embodied intelligence. The pivotal feature: it considers the whole robot at once — sensory apparatus, morphology and control simultaneously — and enables the exploitation of robot features in a holistic manner, rather than designing each part in isolation and putting them together at the end. This contrasts with the reductionist approach of most engineering, which often "fights" the interdependencies to keep the design modular.
The workflow (Doncieux et al., Fig. 1) has an evolutionary component and an evaluation component:
ER is at the crossroads between engineering science and biology (Doncieux et al., Fig. 2): engineers get a method to design simple yet efficient robots, whose integrated view opens new design spaces (morphology as a variable, not something decided a priori); biologists get a synthetic approach to study evolution experimentally — as Maynard Smith put it: "so far, we have been able to study only one evolving system and we cannot wait for interstellar flight to provide us with a second. If we want to discover generalizations about evolving systems, we have to look at artificial ones."
Evolutionary algorithms can be used with almost any controller representation, but the ideal substrate should constrain evolution as little as possible and use raw sensor inputs and low-level actuator commands. Given these requirements, artificial neural networks are currently the preeminent controller paradigm in ER: feed-forward networks can reproduce any function with arbitrary precision; with recurrent connections they can approximate any dynamical system. Evolution can act on synaptic parameters, on the architecture, or on both (neuroevolution). Simple McCulloch-Pitts neurons are common; leaky integrators (continuous-time recurrent neural networks, CTRNNs) take time into account and suit dynamical systems; spiking neurons are not yet common.
Many complex encodings were proposed to evolve morphologies and controllers, but they did not enable the unbounded complexity hoped for. Two main reasons: evolution often converges prematurely on a single family of designs; and evolution selects individuals on the short term, whereas increases in complexity are often beneficial only in the medium-to-long term. Mouret and Doncieux (2012) tested the relative importance of selective pressure and encoding, and concluded that modifying the selective pressure to avoid premature convergence matters at least as much as the encoding.
Performance criteria can be misleading. Lehman and Stanley (2011) demonstrated that using the novelty of a solution — how much it differs from previously generated solutions in a space of behavioural features — instead of the resulting performance on a task can lead to much better results. The performance criterion is still used to recognise a good solution when it is discovered, but it does not drive the search. This counter-intuitive finding (driving the search with novelty works better than driving it with performance) has emerged repeatedly in multiple contexts. It is the perfect exam hook: the fitness function is not the only possible driver, and the choice of what you select for shapes what you find.
Floreano and Keller (2010) review experimental evolution with robots controlled by simple neural networks whose genomes mutate randomly, all with real robots (or partly so). The claim that runs through all of them: a few hundred generations of selection suffice to evolve complex, adaptive behaviours. The methodological criteria of the review are worth stating: neural networks with simple architecture (no synaptic plasticity, no ontogenetic development, no detailed modelling of ion channels); genomes directly mapped into the neural network (no gene-to-gene interaction, no time-dependent dynamics).
A Khepera robot with eight distance sensors (six on one side, two on the other) in a looping maze; the genome is a bit sequence encoding the connection weights between input and output neurons. Three independent populations of 80 individuals. Within less than 100 generations most robots exhibited collision-free navigation. Two findings: the best evolved individuals moved in the direction corresponding to the side with the highest number of sensors (individuals moving the other way collided more and were selected against); and the driving speed settled at about half the maximum speed and did not increase even after 100 more generations — at higher speed the 300-ms sensor refresh rate did not allow the robots to detect walls in time. The evolved behaviour takes into account not only the environment, but also the robot's own morphological and mechanical properties.
The same robots, a dark room with a small light tower behind a nest (a black patch that recharges the battery), battery discharging linearly over 50 sensory-motor cycles. Fitness proportional to average wheel speed and distance from walls. After 200 generations the best individuals performed wide explorations and returned to the nest only when their batteries had approximately 10% residual energy, staying only long enough to recharge. The timing behaviour was mediated by the evolution of a neuronal representation of the environment combining location and battery level — reminiscent of "place cells" and "head-oriented cells" in the rat hippocampus: artificial organisms may evolve functionally similar internal representations to real organisms.
Populations of predator and prey robots (prey twice as fast, predator with vision; fitness inversely proportional to capture time for the predator, proportional to survival time for the prey), tested one-to-one in tournaments against the five best of the other population. Over 100 generations the strategies cycled: uncoordinated turning → fast motion vs visual tracking → predators so efficient they lost wall avoidance → prey waiting and moving backward → prey coasting walls at maximum speed → predators' "spider" strategy → prey rotating in place and facing the predator with the sensor-rich side. None of the strategies were stable over time — a coevolutionary dynamics in which each party exerts selective pressure on the other, as in natural systems.
In a foraging arena with small tokens (pushable by one robot) and large tokens (requiring at least two), the fitness of groups of 10 robots was measured. With only large tokens, all 20 replicates evolved cooperative pushing. With both tokens: in groups of unrelated robots, individuals specialised in pushing small tokens (the most efficient strategy for individual fitness); in "clonal" groups (identical genomes), individuals pushed the large tokens even though it was costly — altruism evolved. The genetic relatedness of the group changes what selection can produce.
All four studies share one shape: a simple fitness measure (speed and distance; exploration and battery; time to catch / time to survive; tokens pushed) and nothing else specified. The behaviours — optimal speed, energy management, counter-strategies, cooperation — were not designed; they were discovered by selection. This is the operational definition of intelligence the course opened with (Chapter 1): behaviour that emerges from the loop, evaluated statistically, not asserted.
The evolution of robot bodies and brains differs markedly from all other approaches to robotics in that it does not presuppose the existence of a physical robot: the user provides a metric for robot performance and a simulation of the task environment, and the algorithm produces the body plan and control policy. Such an algorithm could, in principle, continually receive new desired behaviours and continuously generate novel robots — the "robot-generating algorithm" that Bongard identifies as the field's long-term goal.
Both biological and artificial evolution are notorious for exploiting the relationship between the agent and its environment. If the simulator has no noise, a control policy may evolve to rely on a very narrow range of sensor values that the physical robot never sees; the failure of evolved solutions to "cross the gap" from simulation to reality is the reality gap problem (Jakobi 1995; Koos et al. 2013). Proposed remedies:
The time required to evaluate a single robot may grow exponentially with the number of parameters describing its task environment: a robot that must grasp m objects under n lighting conditions needs mn evaluations; with p parameters each taking s settings, sp evaluations per robot. One possible solution: co-evolution — a population of robots and a population of task environments competing against one another.
A species with high evolvability adapts more rapidly to changes in its environment. One goal of the field is to create increasingly evolvable algorithms — algorithms that discover useful aggregate patterns in candidate solutions and elaborate them, rather than independently optimising individual parameters. And designing a fitness function that rapidly discovers desirable solutions without biasing toward particular ones is notoriously difficult; novelty search (section 8) is one attempt to eliminate the fitness function altogether.
ER is a small but productive niche field: it has yet to evolve a robot superior to one produced by mainstream methods such as reinforcement learning (a challenge taken up in Chapter 12), but it has produced a wider variety of robots automatically — including swarm behaviours (the bridge to Chapter 9), modular self-reconfiguration, tensegrity and soft robots.
Chapter 11 is the direct sequel: when the design problem is cast as an optimisation problem, the method is no longer "evolutionary robotics" by default — it can be any optimisation algorithm over a parametric controller architecture. Evolutionary robotics is the historical core of automatic design; automatic design is its generalisation. The distinction the course wants you to keep clean: ER optimises robots by evolution; automatic design optimises robot programs by any algorithm.
An artificial cell with 3000 genes, an artificial creature made of sticks and motorised junctions, and the fitting of a huge dataset with no assumed model. Common structure: huge (if not uncountable) sets of possible configurations; non-linear relations among solution components; performance not expressible as a well-defined mathematical function (no heuristics for the impact of a change); a solution process should explore the search space and learn good partial configurations to reduce the number of tested configurations.
Observations: adaptation (organisms are suited to their habitats), inheritance (offspring resemble parents), natural selection (new adapted types emerge, those that fail to change adequately are subject to extinction). Key concepts: the fittest individuals have a high chance of numerous offspring; children are similar but not equal to their parents; the traits of the fittest spread across the population generation by generation; selection acts on individuals but indirectly on their heritable traits.
Structure of the child machine = hereditary material; changes = mutations; natural selection = judgement of the experimenter. From A.M. Turing, Computing Machinery and Intelligence, Mind, 1950: "why not rather try to produce one which simulates a child's [mind]?"
The cycle: selection of parents whose genetic material is reproduced with variations, recombination (cross-combination of parental genetic material), mutation (introduces variability in the genotypes), survivor operator (defines the new population from the new and the old one). The definition of the genetic operators specifies the actual algorithm and depends on the problem at hand; crucial is the representation of the individuals, which must be manipulable by the operators.
Solutions are coded as bit strings (one string divided into blocks codifying objects): genotype vs phenotype. Mutation flips each gene with probability p_M; crossover cross-combines two chromosomes at one or more points. Proportional (roulette-wheel) selection picks individuals with probability proportional to fitness. Generational replacement substitutes the whole population, risking the loss of good solutions, so a form of elitism is always used (the best k individuals are kept). Termination: time limit, satisfactory solution, or stagnation.
Intuition: mutation introduces diversity, selection drives the population toward high fitness, crossover may combine good parts from good solutions. Abstract view: the GA performs iterative sampling over the search space based on a probabilistic model whose parameters are tuned as a function of the population fitness, intensifying sampling around promising regions — similar to importance sampling and model-based search. The fitness-landscape metaphor must be taken cum grano salis: the search space is a very high-dimensional graph, and the "landscape" depends on the operators.
GP is a variant of GA in which individuals are programs, usually represented as trees; mutation replaces a randomly selected subtree with a randomly generated one, crossover swaps subtrees. Preparatory steps: (1) set of terminals, (2) set of primitive functions, (3) fitness measure, (4) run parameters, (5) termination criterion and result designation. Koza, Keane & Streeter (2003) reported 36 human-competitive results, 21 duplicating previously patented inventions.
ER applies the selection, variation and heredity principles of natural evolution to the design of robots with embodied intelligence, considering the whole robot at once (sensory apparatus, morphology, control). Evaluation chain: genotype → phenotype → behaviour → fitness — one step longer than in EC because behaviour (not the phenotype itself) is what is evaluated, and behaviour depends on many external factors.
Collision-free navigation: Khepera with eight distance sensors in a looping maze, genomes encoding connection weights of a small neural network, populations of 80; within less than 100 generations most robots navigated without collisions, moving in the direction with more sensors and at about half maximum speed (the sensor refresh rate limited higher speeds). Homing: robots with a recharging nest and battery that discharged linearly; after 200 generations the best individuals explored widely and returned to the nest only at ~10% battery, staying only as long as needed to recharge — mediated by an evolved neuronal representation of the environment reminiscent of place cells.
Predator–prey: a cycle of pursuit and evasion strategies evolved over 100 generations, none stable over time — a coevolutionary dynamics in which each party exerts selective pressure on the other. Cooperation/altruism: with only large (unpushable-alone) tokens all replicates evolved cooperative pushing; with both tokens, unrelated robots specialised in the small ones, while clonal groups evolved costly altruistic pushing of the large tokens — genetic relatedness changes what selection can produce.
The reality gap is the failure of evolved solutions to transfer from simulation to reality, typically because evolution exploits simulator artefacts (e.g. narrow sensor ranges when no noise is modelled). Remedies: sampling physical sensors; adding noise to sensors, motors and position (at the cost of more evaluations); bidirectional simulation/reality approaches (Bongard et al. 2006: evolve the simulator, evolve exploratory behaviours, then evolve controllers — with automatic recovery from damage as a by-product); Koos et al.: multi-objective optimisation of behaviour and transferability (predicted disparity).
Novelty search drives the search by the novelty of solutions (how much they differ from previously generated ones in a behavioural feature space) instead of task performance; the performance criterion is only used to recognise good solutions when found. Lehman and Stanley (2011) showed it can lead to much better results than performance-driven search, because it avoids premature convergence and deceptive fitness landscapes.