← BONABEAU APPS

Parasites that teach networks to sort

In 1990 Danny Hillis let a population of test cases evolve against the sorting networks they were testing. Seven parts follow: that experiment, running live; four more co-evolutionary systems to run and break; the history of the idea to 2026; and its counterpart in the generator and discriminator of a GAN.

The 32 exchanges Hillis seeded into every genome. The 28 that evolution had to find. Shown is Green's 1969 network, 60 exchanges, still the smallest known for 16 inputs. Each horizontal line is a value; each vertical link compares two values and swaps them if they are out of order.
Part 1

Reproduce the 1990 experiment, then change it

Hillis evolved 16-input sorting networks on a Connection Machine with 65,536 processors. Each host carries 15 pairs of chromosomes and each chromosome encodes 4 exchanges. Where the two copies agree the network gets one exchange, where they differ it gets both, so a network has between 60 and 120 exchanges. Hosts live on a wrap-around grid, the better-scoring half survives each generation, and neighbors mate.

Scored on a sample of test inputs, his best network had 65 exchanges and the population stopped improving after a few hundred generations. He then put a second population on the same grid: parasites, each a set of 10 to 20 test inputs, scored by how many of their tests the host in the same cell fails. With parasites the best network had 61 exchanges, one more than Green's.

Network
More settings
Press Start. Every network that passes all of its tests is then checked against all 65,536 possible inputs.
Generation
0
 
Smallest verified sorter
none yet
 
Same, unused exchanges removed
none yet
 
Mean network size
0
 
Hosts passing all their tests
0%
 

Network size by cell

60120

Tests failed by cell

04+

Pale patches in the left map are groups of related hosts with few doubled exchanges. With parasites on, the right map shows where tests are currently beating their hosts; the patches move as hosts and parasites replace each other.

Exchanges per network

Shares, 0 to 100%

The smallest verified sorter will be drawn here.

No network has passed the full check yet.

Everything in the panel is computed on this device. "Verified" means the network sorted all 2n inputs of zeros and ones, which by the zero-one principle means it sorts any input. With 16 inputs and co-evolving parasites, expect the first verified sorter after 500 to 850 generations, as in the reference runs; smaller networks get there in seconds.

Runs compared

Each paused or replaced run is added here, next to reference runs of 8,000 generations.

ShowRunTests come fromInputsHostsGenerationsSmallest verified sorterUnused removedMean size at end

What the reference runs show

What comes from the paper and what is interpretation
  • From the paper: 15 chromosome pairs of 8 four-bit codons; one exchange where the copies agree and two where they differ; the first 32 exchanges seeded identically in both copies; fitness as the share of tests sorted; the better half survives; one crossover per chromosome pair when forming a gamete; a wrap-around grid with mates chosen nearby and offspring placed locally; parasites as sets of 10 to 20 tests scored by the failures of the host in the same cell.
  • Choices made where the paper is silent: an exchange always sends the smaller value to the lower line, and a codon pair naming the same line twice is skipped; survival is decided within each 3 × 3 neighborhood by default (the whole-grid rule is in the settings); parents are drawn from survivors at an offset of -2 to 2 cells per axis, binomially distributed; a parasite is diploid with 10 test loci and one crossover; the random-test baseline uses 256 tests per host per generation.
  • Departures from the paper: the default host mutation rate for 16 inputs is 0.0002 per codon. The paper gives one mutation per thousand sites; at 0.001, populations of 4,096 carried too many broken recombinants to improve. The default grid is 64 × 64, not 256 × 256.
  • Added: the paper does not say how networks were certified. Here every host that passes all of its tests is first run against an archive of earlier counterexamples and then against all 2n inputs. The check also records which exchanges never swap anything; removing those gives the second headline number.

Generalizing the setup

Sorting networks since 1990

No method has produced a 16-input network with fewer than 60 exchanges. Green's network remains the smallest known, and the lower bound in Bert Dobbelaere's list stands at 57. Evolutionary search did set records elsewhere: Juillé found a 13-input network with 45 exchanges in 1995, and Valsalam and Miikkulainen's symmetry-based method improved the best known sizes for several input counts above 16. Minimum depth for 11 to 16 inputs was settled by SAT solving (Bundala and Závodný, 2014), and minimum size is proven only up to 12 inputs.

Part 2

When an arms race works, and five ways it fails

Hillis's result was not guaranteed. Two populations that are scored only against each other can stop improving in several distinct ways, and the scores they see give no warning. The smallest setting that shows all of them is a number game in the style of Watson and Pollack: each individual is a pair of non-negative numbers, two populations A and B play each other, and "skill" is simply how large the numbers are. Four rules for who wins a contest are enough.

Scenario

Both populations in trait space

Population A. Population B. Up and to the right is more skill.

Each champion against the other side's past champions

A's champion wins. B's champion wins. Rows are A's champions, oldest at the top; columns are B's, oldest at the left. Solid blue below the diagonal and solid orange above it means every champion beats all older opponents.

Skill on each dimension, population means

What selection sees, 0 to 100%

The grid on the right is the "current individual against ancestral opponents" plot that Cliff and Miller proposed in 1995 for telling progress from running in place.

DisengagementOne side wins every contest. All scores inside a population are then equal and selection cannot tell individuals apart. With A starting at 40 and B at 2, A did not lose a single contest in 800 generations in any of 30 test runs: win rate 100%, score spread zero, a solid blue grid.
Stalling and driftWith no selection signal, traits change only by mutation, so the skill lines wander without direction. Switch mutation to "biased downward" and the wandering becomes decay: A's skill falls toward B's, and the race starts only when they meet, after roughly 350 generations.
CyclingWhen superiority is intransitive, each side keeps finding a counter to the other's latest move and the populations circle. In 20 test runs champions beat older opponents 53% of the time, which is a coin flip. The grid is a patchwork.
OverspecializationIf opponents examine only one dimension, only that dimension improves. After 800 generations the examined dimension averaged 208 and the other 6. The grid stays clean, so nothing looks wrong from the inside.
ForgettingThe attacker occasionally moves its whole effort to the other dimension. By then the defender's skill there has decayed, and it is rebuilt from the bottom each time: a sawtooth. In 20 test runs the defender ended at about 8 and 2, against 83 and 71 in the working arms race, and its champions beat only 47% of older attackers.
What the Hall of Fame repairsForgetting, and only forgetting. With A also playing B's past champions, the same 20 runs ended at 32 and 27, and champions beat 89% of older attackers. It did nothing for cycling (53% to 55%) or overspecialization (the neglected dimension stayed at 6). Part 3 has the remedy for that one.
Part 3

Dominance and Pareto fronts

Summing an individual's wins hides which opponents it beat. Pareto co-evolution keeps that information: every test is treated as a separate objective, and learner a dominates learner b if a passes every test b passes and at least one more. The learners that nobody dominates form the Pareto front. Tests are judged in the same spirit, by the distinctions they make between learners, not by how many learners they defeat.

The game below is De Jong and Pollack's compare-on-one. Learners and tests are pairs of numbers. A test examines only its own larger dimension, and a learner passes if it is at least as large there. Each test is drawn as a threshold line: a learner passes a vertical line by being on or to the right of it and a horizontal line by being on or above it. The plot zooms to wherever the populations currently are.

Selection
Generation
0
24 learners, 24 tests
Learners on the Pareto front
0
dominated by no other learner
Stronger dimension, mean
0
 
Weaker dimension, mean
0
 

Learners and test thresholds

Learner on the front (filled) or dominated (hollow). Test threshold. Select a learner to see what it dominates.

No learner selected.

Outcome table: learners by tests

One row per learner, front first. One column per test, ordered by the dimension it examines and then by difficulty. A filled cell is a pass. One row dominates another if its filled cells include all of the other's.

Learner skill by dimension, population means

With summed scores the tests crowd onto one dimension, the learners follow, and the other dimension is abandoned: in 30 test runs of 300 generations only 1 kept the weaker dimension above half the stronger one. With Pareto selection of learners and tests kept for the distinctions they add, 16 of 30 did, and the weaker dimension averaged 33 against 5. Pareto selection is not a guarantee. Once no surviving test examines a dimension, that dimension is as invisible as before, which is why archive methods such as IPCA keep tests explicitly.

Part 4

A Red Queen race: camouflage

Van Valen's Red Queen runs to stay in the same place. In co-evolution that looks like a score that barely moves while both sides change underneath it. Camouflage is the textbook case, and Craig Reynolds's 2023 simulation of evolving prey textures against evolving predator vision is its modern form. The model here is much smaller. A patch of habitat is six texture features. Prey carry six numbers of their own. A predator carries an expectation of what habitat looks like and a limited budget of attention across the six features; shown one prey among several habitat patches, it attacks whichever patch looks most out of place.

Hunt for yourself: six of these tiles are prey

Select a tile to attack it.

Share of hunts that end in a catch

How far prey are from the habitat

In units of the habitat's own patch-to-patch variation. A value near 1 means prey are as similar to the habitat as habitat patches are to each other.

Feature by feature

Habitat range. Average prey. Predator attention, which always sums to 100%.

A typical run has three phases. Prey start with random textures and predators catch more than 80% of them once they have learned the habitat. Prey then converge on the habitat and the catch rate falls to roughly twice chance. After that the contemporary catch rate hardly moves, and the two comparison lines say why. Predators frozen at the reference generation catch far fewer of today's prey than they caught of their own, so prey have made lasting progress. Today's predators, however, do worse against the reference prey than the reference predators did: they have tuned their attention to the small flaws of current prey and lost some of their general ability. Ten test runs averaged a 34% contemporary catch rate, 74% for current predators against generation-8 prey, and 42% for generation-8 predators against current prey.

Changing the habitat restarts the race. For a few generations the catch rate drops below chance, because the predators' picture of the habitat is out of date and real habitat looks stranger to them than the prey do. Then they relearn it, prey are exposed, and the convergence repeats.

Part 5

Genetic programming: co-evolving intertwined spirals

The two intertwined spirals, 194 points to be separated into two classes, were a standard hard case for neural networks and for Koza's genetic programming. In 1996 Juillé and Pollack turned it into a co-evolutionary problem. Programs are expression trees over x and y. Instead of counting correct points, a program is scored in contests against other programs, earning one unit for every point it classifies correctly that its opponent gets wrong. A program that only repeats what its opponents already solve earns nothing. The solutions reported in 1996 were modular: they divide the plane into regions and solve each one.

Generation
0
 
Best program so far
0 of 194
 
Points solved by at least one program
0
of 194, current generation
Mean program size
0
nodes; limit 160

What the best program computes

Shaded regions are the best program's two answers. Dots are the 194 spiral points in their true class color; a ring marks a point the program gets wrong.

Points classified correctly, of 194

Best program

Not started.
Part 6

From one experiment to a paradigm, 1959 to 2026

The 1990 paper already contains the parts later work had to make precise: two populations with opposed fitness, a rule for who meets whom, and the observation that an adapting opponent supplies both diversity and a cheap, informative test set. Select an entry to read what it added.

    Where the theory stands in 2026

    Per Kristian Lehre's GECCO 2026 tutorial frames the field as adversarial optimization: both strategy spaces are too large to enumerate, the payoff can only be queried, and the goal is a Nash equilibrium or a maximin solution. Sorting networks against test cases are its standard example of a test-based game, where the payoff is 1 if design x passes test y and 0 otherwise.

    Limits

    • A No Free Lunch theorem for adversarial optimization: averaged over a class of games closed under permutation, every black-box algorithm has the same expected runtime (Lehre and Lin, NeurIPS 2024).
    • Query-complexity bounds say any algorithm must inspect a constant fraction of the strategies of an unstructured game. The tutorial concludes that co-evolution has a niche only where strategies are exponentially many and the payoff has structure.
    • Four recurring failures: cycling, disengagement, overspecialization, and forgetting.

    Guarantees

    • Archive methods such as IPCA (De Jong, 2004) give monotone progress, with no bound on archive size or time.
    • The alternative is positive drift: select the right individual more than half the time. The first runtime bound for a competitive co-evolutionary algorithm used this idea (Lehre, 2022).
    • How scores are aggregated decides the outcome. On the Bilinear game a (1,λ) algorithm that scores by average payoff is inefficient, and the same algorithm scoring by worst case finishes in polynomial time with high probability (Hevia Fajardo and Lehre, 2023). Part 7 runs this comparison.
    • On the Diagonal game a plain (1,λ) evolutionary algorithm needs exponential time, while a (1,λ) co-evolutionary algorithm with restarts finds an approximate equilibrium in expected time O(λn) (Lehre and Lin, 2024).
    Part 7

    The same game a GAN plays

    A generative adversarial network trains a generator against a discriminator; Goodfellow and colleagues described it in 2014 as a two-player minimax game. Hillis's hosts and parasites have the same structure. In both, one side is the product and the other exists to find its current weaknesses, and in both the adversary is discarded at the end.

    Hillis, 1990GAN, 2014Lehre's framework, 2026
    ProductHost: a sorting networkGenerator GDesign x in X
    AdversaryParasite: 10 to 20 test inputsDiscriminator DTest y in Y
    PayoffTests failed. Host and parasite scores are complementaryV(D, G), minimized by G and maximized by Dg(x, y), zero-sum
    Fixed referee"Is the output sorted?" Always correctThe real data. D must learn the boundary and can be wrongThe payoff oracle
    What the adversary buysTests concentrate on what current hosts get wrong, so few are neededA learned loss that concentrates on what current samples get wrongInformative interactions without evaluating all of Y
    UpdateSelection, recombination and mutation over two populations. A host receives a score onlyGradient steps on one pair. G receives a gradient through DBlack-box: payoff queries only
    Solved whenThe host passes every possible testGenerated and real data are indistinguishable, D outputs 1/2Maximin or Nash equilibrium
    Who meets whomSame cell of a gridThe single current opponentThe interaction scheme: all pairs, k random opponents, or spatial

    Shared failures, different names

    Co-evolutionWhat happensGAN trainingRemedies on each side
    CyclingThe players chase each other around the equilibrium and revisit old statesOscillation and non-convergence of simultaneous gradient stepsWorst-case scoring, archives. Gradient penalties, instance noise
    DisengagementOne side wins every encounter, so scores stop distinguishing anythingVanishing generator gradient when D separates real from fake perfectlyKeep opponents "worth beating" (Rosin and Belew). Non-saturating and Wasserstein losses
    OverspecializationSkill against the current opponents onlyMode collapse: G produces the few outputs that fool the current DFitness sharing, spatial demes. Several generators or discriminators
    ForgettingTraits that beat past opponents are lost once those opponents are goneD forgets earlier generator behavior, G returns to itHall of Fame. Replay of past generated samples

    The correspondence is close enough that the two fields merged in practice. Lipizzaner (2018) places generator and discriminator pairs on a wrap-around grid, trains each with gradient steps against its neighbors, and applies selection between adjacent cells. Its authors cite Hillis, and Lehre's tutorial lists Hillis's sorting networks and spatial GAN training side by side as examples of the same interaction scheme.

    One game, two optimizers

    Both panels play g(u, v) = (u − 0.6)(v − 0.4), whose only equilibrium is the marked point. On the left are gradient steps, as in GAN training; with a point-mass generator, a linear discriminator and a linear loss this is the Dirac-GAN of Mescheder, Geiger and Nowozin (2018), shifted. On the right is the (1,λ) co-evolutionary algorithm from the tutorial on the Bilinear game, which is the same payoff over bit strings of length 200, with u and v the fractions of one-bits.

    Gradient steps (GAN style)

    Two co-evolving populations

    With the default settings both orbit the equilibrium without settling: simultaneous gradient steps spiral outward, and average-payoff co-evolution wanders around the point. Each side has a fix that works in this game. A gradient penalty on one player damps the rotation. Scoring by worst case pulls each population toward the strategy that is safe against every opponent present, and the run settles on the equilibrium.

    Where the analogy stops

    • Gradients. A generator is told in which direction to change each parameter. A host is told a number. Co-evolution therefore works on discrete and non-differentiable designs such as networks of exchanges, programs, or prompts, and pays for it in evaluations.
    • The referee. A failed sort is a fact. A discriminator's verdict is an estimate that can be wrong, and it has to be trained along with everything else.
    • Populations. Hillis credits the grid of many slightly different hosts and parasites for avoiding local optima. A standard GAN has one of each, which is why population and league methods were later added to adversarial training.
    • The solution. A sorting network is a single design that must pass every test. A trained generator is a distribution, and the matching equilibrium is defined over distributions.

    Sources