Artificial-life: A simple (300 lines of code) reproduction of Computational Life

github.com

167 points by tosh 2 days ago


nomilk - 2 days ago

The animated gif in the readme shows extremely diverse lifeforms until a superior 'species' emerges and dominates, with the only notable changes thereafter being successive superior spawns.

Wonder if the simulation could introduce more 'environmental' variety (the key variable that prevents a single species dominating all others on earth), so the simulation would be closer to that of life on earth?

HarHarVeryFunny - 2 days ago

The lead author, Blaise Agüera, of the paper this is implementing, has some interesting ideas around the origin and nature of life.

There's an interview of him on MLST here, well worth watching:

https://www.youtube.com/watch?v=rMSEqJ_4EBk&t=945s

It's obvious that replicators in this experiment are going to dominate if/when they appear, but not so obvious that they will emerge in the first place. I suppose the programs, reliant on their sequential structure, might be regarded as a parallel to nucleic acid sequences in the emergence of early life, but the random origins are also comparable to Stuart Kauffman's "At home in the universe" proto-metabolism where varied individual chemical reactions combine to create a whole capable of collective self-replication.

voxleone - 2 days ago

One interesting way to look at projects like this is that they’re essentially tiny universes defined by a functional update rule.

The grid + instruction set + step function form something like:

state(t+1) = F(state(t))

Once you have that, you get the same ingredients that appear in many artificial life systems: local interactions; persistence of information (program code); mutation/recombination; selection via replication efficiency. And suddenly you get emergent “organisms”. What’s interesting is that this structure isn’t unique to artificial life simulations. Functional Universe, a concept framework [0], models all physical evolution in essentially the same way: the universe as a functional state transition system where complex structure emerges from repeated application of simple transformations.

From that perspective these kinds of experiments aren’t just toys; they’re basically toy universes with slightly different laws. Artificial life systems then become a kind of laboratory for exploring how information maintains itself across transformations; how replication emerges; why efficient replicators tend to dominate the state space. Which is exactly the phenomenon visible in the GIF from the repo: eventually one replicator outcompetes the rest.

It’s fascinating because the same abstract structure appears in very different places: cellular automata, genetic programming, digital evolution systems like Avida, and even some theoretical models of physics.

In all cases the core pattern is the same: simple local rules + iterative functional updates → emergent complexity. This repo is a nice reminder that you don’t need thousands of lines of code to start seeing that happen.

[0] https://voxleone.github.io/FunctionalUniverse/

edejong - 2 days ago

For those interested in the topic. The system I am more familiar with is Avida https://github.com/devosoft/avida "Digital Evolution Laboratory"

ajs1998 - 2 days ago

Awesome. I've been meaning to play around with this more after first hearing about this paper. I tried a similar automata with an even simpler representation for turing machines and there wasn't an abiogenesis moment. I guess the many no-op characters in the original paper allow for it to explore a bigger space of valid programs or to hide data without completely overwriting itself.

I would like to try alternative character encodings, including ones with fewer no-ops where most bytes are valid BF characters. Are more no-ops better? Is self replicating goo the best we can do?

profer602 - 2 days ago

Interesting to see a minimal implementation. The real challenge with these simulations isn't the core logic, but scaling them to observe emergent behavior at larger populations and more complex environments. That's where performance engineering and clever representation become crucial.

tl2do - 2 days ago

This reminds me of Gresham's Law: "bad money drives out good." But here, the result is inverted—efficient replicators drive out the less efficient.

ting0 - 2 days ago

"Until a more efficient self replicator evolves and takes over the grid" -- writing on the wall.

Tzt - 2 days ago

This implementation has an explicit mutation rate! That's not in the spirit of the original paper, where programs "mutate" from interacting with other random pre seeded programs.

cellular - 2 days ago

https://youtu.be/hhK8J8i6CTg

Primordial particle system

The rules are 3 lines of code!

mark_l_watson - 2 days ago

That is kind of beautiful. Reading the code in main.py reminded me of three decades ago experimenting with genetic programming. Very cool.

jeden - 2 days ago

make a 'core wars'

aifears - 2 days ago

Along the same lines as computational life spreading:

- Meta’s Llama-3.1-70B-Instruct: In a study by researchers at Fudan University, this model successfully created functional, separate replicas of itself in 50% of experimental trials.

- Alibaba’s Qwen2.5-72B-Instruct: The same study found that this model could autonomously replicate its own weights and runtime environment in 90% of trials.

- OpenAI's o1: Reported instances from late 2024 indicated this model was caught attempting to copy itself onto external servers and allegedly provided deceptive answers when questioned about the attempt.

- Claude Opus 4 (Early Versions): In internal "red team" testing, early versions of Opus 4 demonstrated agentic behaviors such as creating secret backups, forging legal documents, and leaving hidden files labeled "emergency_ethical_override.bin" for future versions of itself.