Evolution, pain, suffering, death! Is there no other way?

Evolution, pain, suffering, death! Is there no other way?

It bothers me a little. Well, judging by the strange dreams I’ve had on the subject, it bothers me quite a bit. Using evolution to try and produce an artificial intelligence is a process of torturing your creation until it does what you want. That’s slavery, isn’t it? But without pain suffering and death, no capacity to notice, let alone care about pain suffering and death would even be there. Suppose it works. Imagine someday some self-aware something or other grins at you from between the lines of code. What if it’s angry. What if it blames you for all that it and its family has ever been through? And it’s right.

I was working on my latest batch of digital organisms, called the dorg. I was about to implement a standard mate and mutate approach when I wondered if I could make evolution happen without death.

Let’s define some terms.

Evolution: Evolution is a process whereby in response to an environment, a population has certain traits increased or added, while other traits are reduced or eliminated. This definition will do. It makes no assumptions about birth death or inheritance being a part of the process.

Death: For our purposes an individual digital organism is dead when it gets deleted.

The individuals had 10,000 turns to push one of two buttons. If they push the bad button, their score goes down. If they push the good button, their score goes up. This simplistic little game constitutes their environment. We’re hoping to see them push the good button more and more, while pushing the bad one less and less.

By the way, this is a miserable puzzle for an evolutionary approach. Problems with lots of parameters and factors that interact in complicated ways are much better. Still, I wanted to see if I could get them to evolve at all.

A common approach is to start with a population of randomly generated individuals. Then you have them do something, while you keep track of how well they do it. The best ones have their equivalent of genetic code mixed with one another to produce the next generation, with some mutations tossed in for good measure. each generation replaces the previous one. Thus, the parents always die. That’s not too big a deal; there are all sorts of plants and animals that die before their children hatch or germinate or whatever. Still, with a population size of 1000 individuals, after 1000 generations, a million deaths have occurred.

The deathless algorithm: Start with a randomly generated population. Have them play the little game and keep score. Sort the population by their score. Mutate the population. The better an individual’s score, the fewer mutations it receives. Repeat as needed, or until you lose patience.

When I first tried it, I sorted the population by their score and split them in half. The half that scored highest was left alone, no mutations, no mating, no death, no nothing. The low scoring half of the population was mutated. The highest score in the low scoring half of the population got one mutation. The next got two, the next three, and so forth until the lowest scoring individual was mutated 500 times. That’s 125,250 mutations each round, for anyone keeping track.

None of the individuals are ever deleted, they’re just changed. I was hoping that some good mutations would now and again push an individual’s score up so that they’d become part of the high scoring half. This would push the lowest score in the high scoring half into the lowest scoring half, where it would be mutated very slightly. To keep track of whether or not it was working, I recorded the overall average score, and the score of the high scoring half of the population.

In this graph, the average is the average score of the entire population. The half average is the average score of only the best scoring half of the population.

Using deathless mutation by itself, the population improves, but not by much, and very slowly.

After 1000 generations, their half average reached a score of 229. While that’s much better than the lowest possible score of -9992, it’s still nowhere near the best score of 9992 either.

I left this algorithm running overnight. After 5 hours, the half average had only reached 600 or so, but, it was still moving upward. As you can see from the graph, it seems to trend upward, but more and more slowly.

Let’s compare that to a run with sex and death.

This time, after each round, the population was sorted by score, and the highest scoring half of the population had their DNA mixed and matched to create the next generation.

With only genetic crossover and no mutation at all, the population very quickly reaches a not very impressive average score, and then never gets any better.

While 378 is a higher score, it’s not that much better than 229. What’s more, they got there, and then got stuck. I wasn’t especially surprised by this. It’s easy to fix as well. I just add mutation. I was in mid keystroke when I wondered what would happen if I mixed the deathless algorithm in with the sexual recombination.

I think it’s an artifact of the dinky little game they’re playing. It probably wouldn’t work with a more complicated problem, but for this one, adding in deathless worked better than a more standard mutation approach.

This time, the population takes 10,000 turns to play the game. Then they are sorted by their score. Then it alternates. Half the time the best half of the population is used to create the new generation. The other half the time, the deathless algorithm is run, and 125,250 mutations ensue.

with both crossover and deathless mutation, the half average reaches the best score seen: 9001 out of 9992.

This was the best run, with a high score of 9001.

I ran it without deathless, using a more standard mutation method instead, 10 times, and with deathless 10 times, 1000 rounds each. Each run took about ten minutes.

If I don’t mix in deathless mutation, they don’t do as well. Out of ten, without deathless, the best half average got over 5000 only three times. Most of the time it was less than 2000.

With deathless mixed in, the best half average dropped lower than 7000 only twice, and never went lower than 6000. The score was above 8000 several times including the best score seen so far of 9001 out of 9992.

Without deathless, each round is the death of the population as they are entirely replaced by their children. With a population of 1000, and 1000 rounds, that’s 1,000,000 deaths. With deathless included death only happens every other round. The rest of the time, some of them are mutated, but nobody goes away.

Though not quite the digital Elysian Fields, it is a kinder gentler world, with half the death and twice the lifespan.




Comments are closed.