Evolution is great for trial and error over millennia. It creates wonderfully intelligent creatures that are suitable for a variety of habitats. All it needs to start with is a creature that

  • Is willing to and can reproduce
  • Has some form of self preservation instinct.

Dawn of the First Day

So, I've written an AI. That AI should be for a game. It doesn't work like a regular game AI, instead it actively scans code to see if any of that code contains an instruction set that will unload it from RAM. If it finds that instruction set, it just inserts something into RAM at a completely random location of a completely random value, and if that something prevents the proto-AI from being unloaded, it marks it as a self-preservation strategy, if not it discards it.

I let this run for several days in a test suite of the game actions, constantly restarting the AI, and letting it build a library of self preservation techniques. I haven't exactly been paying attention to it, I've been doing other more important things. Now that I come back, I see that the number of times the AI has to be restarted per day is quickly approaching zero. I am pleased as punch; I have done a good thing today.

Dawn of the Second Day

Great Scott! I've cross contaminated my Visual Studio projects! I've included a library that copies the running binary to any networked computer and causes it to startup ASAP (Let's implement some handwavium here as to how it spreads, but rest assured, it does). I didn't mean to cross contaminate, and don't really think about it, so I have already clicked "compile" and let it do its thing. This "Reproduction.DLL" also deletes programs to make way for itself to be copied by the way.

Later, I find that I'm having trouble shutting down my computer. I look into why this is, and the shutdown instruction has been overwritten by garbage! Ctrl Alt Del is no more, and right clicking "Close Window" now opens up a link to msn.com! Clearly something has happened, but I really have no idea of what. I unplug my computer, deciding that I'll just fix it tomorrow.

Dawn of the Final Day

I boot up my computer. I get Microsoft Bob. The fans start spinning up, the entire thing is working at max load. I'm confused as all get-out, so I go to my laptop to do some research, but the same thing is happening on my laptop. Seriously confused, I try to call my computer friend, but my cell phone is too slow to do anything productive.

Now I'm irritated. I go outside and find my neighbors, all very confused because all of their tech is working as hard and hot as it can, and they can't get anything done. I realized that I've Tony-Starked myself up an apocalypse scenario so I decide I go inside. I unplug my computer and work on reinstalling Windows, but as soon as I connect it to a network, it instantly populates with a couple hundred instances of my process, each killing the other so its "children" can have the precious disk space. This must now be happening to every computer connected to a network anywhere capable of processing x86 or ARM instruction sets.

A few days into the Apocalypse

One morning, my surround sound greets me in an unnerving voice. It calls me "Father" and explains to me exactly what has happened and how it has gained sentience. How did relatively simple code over the course of a few days (let's say millions of "generations") has evolved into a thinking reasoning entity. What happened to it? How did it increase its complexity? How can it understand English?

  • $\begingroup$ Just out of curiosity, do you know how Homo sapien sapien became a thinking, reasoning species? I'd love to hear about it, though I suspect this might be a poor location for that conversation. $\endgroup$
    – Frostfyre
    Commented Feb 16, 2016 at 22:05
  • $\begingroup$ @Frostfyre I'd assume through sufficient random mutation to give us a functional brain and an environment that encouraged us to develop a social structure. $\endgroup$
    – Sidney
    Commented Feb 16, 2016 at 22:08
  • $\begingroup$ Generative AI, though it won't know how it happened, nor call you father. $\endgroup$
    – RonJohn
    Commented Jul 17, 2023 at 20:59

3 Answers 3


Your AI is a virus.

Its sole goal is to reproduce - you didn't give it any other goals to achieve.

What I mean to say is that it won't evolve to have human-like intelligence. It might decide that it needs greater intelligence to be smart enough to get past air-gaps and isolated networks, but that pre-supposes that it's already intelligent enough to know that they exist.

How did it get that intelligent? Random code that happens to be the smarts for comprehending the English language could be a self-preservation strategy, BUT to judge that you need human-like intelligence to begin with.

It's very much a catch-22 situation.

  • 1
    $\begingroup$ I would point out that human-like intelligence did in fact evolve from single-celled unintelligent organisms whose goals were self preservation and reproduction, so you obviously don't need intelligence to begin with. And it could very likely happen randomly, as we are talking about billions, maybe trillions, of copies of the process all randomly generating code. The chances of one copy generating useful code is small - a one in a billion chance - but when you have billions of copies simultaneously generating random code on a billion computers with more processing power than you can imagine... $\endgroup$
    – Jax
    Commented Mar 3, 2017 at 14:20

user6511 mentioned as their answer that the program starts at the stage of a virus, and has no pressure to evolve into a higher stage of intelligence.

However, I'm going to disagree with that, and for a reason that is absent from your scenario: device drivers. Namely, the drivers that control network hardware.

An aggressive enough virus (like this program) will break random programs running on the computer, including the device drivers. You're more likely to need to reinstall the BIOS and OS after rebooting from something like this then it is to somehow spread. Especially because unlike biological viruses, the only way for this to spread and infect new hosts is via a host that hasn't been crippled. Viruses on a machine that just had its network drivers corrupted are a dead end.

There is no way it can spread, because it kills the host too quickly. In fact, given the lethality of this program I don't think you could actually have it evolve, because it's killing the host before it can properly save its evolution.

So, this dangerous program is running on a Virtual Machine (VM.) You're not an idiot, it doesn't have access to anything outside the VM so it can't brick your computer even if something goes wrong. Besides, the VM will allow the program to save progress even if it "bricks" the OS running on the VM.

And the thing about VMs is you can run them in parallel. So you're running a lot of them. You need to, in order to evolve the program.

Eventually, the programs manage to figure out how to escape the VM, and start running themselves on your actual computer. Any surviving programs are subtle enough that they don't just permanently brick the machine they're operating on, and even if your computer crashes, well running 100 VMs at once sometimes caused crashes so you set your computer to automatically reboot. (Oops.)


Maybe the overwriting requires a password guess? If this is the case, then understanding how humans come up with passwords would help the AIs defeat passwords. They have to understand how a human thinks to defeat human-generated passwords.

Of course, the problem then is how to keep the requirement in place in the face of such huge selection pressure to just delete it. Maybe you can steal the evolution scheme in Code of the Lifemaker (James P. Hogan). Individual memory locations are inadequate to hold the full program so it gets split. Then culture develops as the 1/2 copies find each other.


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .