Self-replicating programs emerge spontaneously from random byte soups through symbiogenesis.
No fitness function. No design. Just random bytes, a 7-instruction interpreter, and time.
pip install abiogenesisfrom abiogenesis import Soup, compression_ratio
soup = Soup(n_tapes=512, tape_len=64, max_steps=10_000, seed=42)
for step in range(100_000):
soup.interact()
if (step + 1) % 25_000 == 0:
cr = compression_ratio(soup.get_state())
print(f"step {step + 1:>7,} compression={cr:.4f}")step 25,000 compression=0.4892
step 50,000 compression=0.3575
step 75,000 compression=0.3044
step 100,000 compression=0.2872
Compression drops below 1.0 as structure self-organizes from noise.
- Random initialization — 1024 tapes of 64 random bytes each
- Pairwise interaction — pick two tapes, concatenate into 128 bytes, execute as embodied BrainFuck, split back
- Symbiogenesis — two partial programs fuse into working programs (the K-term)
- Selection pressure — tapes that execute copy instructions replicate; others drift
- Mutation (optional) — random bit-flips sustain ecology and prevent crystallization
The interpreter uses 7 instructions (> < + - . [ ]) on a unified code/data tape. The . instruction copies tape[DP] to tape[WP], providing the replication primitive. No fitness function — replication emerges from the physics.
Mutation rate is the sole control parameter. Four regimes discovered across 10M-interaction runs:
| Regime | Mutation Rate | Behavior |
|---|---|---|
| Crystal | 0 | Single replicator dominates, entropy collapses to 0.018 |
| Soft crystal | 1e-5 | Slow crystallization, low diversity |
| Ecology | 1e-3 | Sustained diversity, multiple replicator species coexist |
| Dissolution | 1e-1 | Too much noise, no structure persists (compression ~0.50) |
Three types of self-replicators emerge and are classified automatically:
| Type | Condition | Meaning |
|---|---|---|
| Inanimate | executed ∩ written = ∅ | Passive — copied but not self-copying |
| Viral | executed ∩ written ≠ ∅, written ⊄ executed | Parasitic — partially self-copying |
| Cellular | written ⊆ executed | Autopoietic — fully self-replicating |
Complexity builds on itself — each interaction layer adds depth to the lineage tree:
| Class / Function | Description |
|---|---|
Soup(n_tapes, tape_len, max_steps, seed, mutation_rate) |
Primordial soup of byte tapes |
Experiment(config) |
Full experiment runner with checkpointing |
SwarmExperiment(config) |
Agent-oriented experiment with identity and provenance |
Agent(tape, name) |
Named tape with UUID, lineage, interaction count |
KTermFusion(max_steps) |
Concatenate-execute-split fusion engine |
CrystallizationProbe(window_size, critical_threshold) |
Diversity monitor — detects monoculture onset |
DiversityProbe(window_size, critical_threshold) |
Swarm-level diversity wrapper |
compression_ratio(soup) |
zlib compression ratio (lower = more structure) |
shannon_entropy(soup) |
Shannon entropy over tape distribution |
find_replicators(soup, min_length, min_count) |
Detect and classify self-replicating subsequences |
classify_replicator(sequence) |
Classify as inanimate, viral, or cellular |
execute(tape, max_steps) |
Run the embodied BF interpreter |
execute_traced(tape, max_steps) |
Execute with position tracking |
python examples/quickstart.py # Basic soup run
python examples/replicator_detection.py # Find and classify replicators
python examples/swarm_with_probes.py # Agent swarm with provenancegit clone https://github.com/dopexthrone/abiogenesis.git
cd abiogenesis
pip install -e ".[dev]"
pytest tests/ # 92 testsThis implementation is based on the research presented in:
Computational Life: How Well-formed, Self-replicating Programs Emerge from Simple Interaction Blaise Aguera y Arcas, Jyrki Alakuijala, James Evans, Ben Laurie, Alexander Mordvintsev, Eyvind Niklasson, Ettore Randazzo, Luca Versari (2024) arXiv:2406.19108
The original lecture that inspired this project: What If Intelligence Didn't Evolve? It "Was There" From the Start! — Blaise Aguera y Arcas on Machine Learning Street Talk.
Official reference implementation: paradigms-of-intelligence/cubff
This work sits in a long lineage of artificial life and self-replication research:
| Year | Work | Authors | Contribution |
|---|---|---|---|
| 1953 | Numerical Organisms | Nils Aall Barricelli | First digital evolution experiments; coined "symbiogenesis" in computational context |
| 1966 | Theory of Self-Reproducing Automata | John von Neumann | Theoretical foundation for computational self-replication |
| 1987 | Artificial Life (workshop) | Christopher Langton | Founded the field of artificial life |
| 1990 | The Coreworld | Rasmussen, Knudsen, Feldberg, Hindsholm | Cooperative structures in a shared instruction tape |
| 1991 | Tierra | Thomas S. Ray | Self-replicating machine-code programs in shared memory; parasites and hyperparasites |
| 1991 | AlChemy | Walter Fontana | Lambda calculus as an artificial chemistry substrate |
| 2000 | Evolution of Biological Complexity | Adami, Ofria, Collier | Complexity growth in digital organisms (Avida) |
| 2002 | Evolvable Self-Replicating Molecules | Tim J. Hutton | Self-replicating molecules from random artificial chemistry soups |
| 2003 | Evolutionary Origin of Complex Features | Lenski, Ofria, Pennock, Adami | Complex features evolving from scratch in Avida |
| 2022 | Combinatory Chemistry | Kruszewski, Mikolov | Self-reproducing metabolisms from lambda-calculus-like substrate |
| 2024 | Computational Life | Aguera y Arcas et al. | The primary paper — BFF substrate, primordial soup, phase transitions |
| 2024 | Return to AlChemy | Mathis, Vimal, Jaini, Forrest | Modern revisit of Fontana's AlChemy |
| 2025 | What Is Life? Evolution as Computation | Blaise Aguera y Arcas | Book expanding the computational life thesis (MIT Press) |
- What If Intelligence Didn't Evolve? — Machine Learning Street Talk (the lecture that inspired this project)
- Sean Carroll's Mindscape #286 — Emergence of Replication and Computation
- Computing, Life, and Intelligence — Santa Fe Institute community lecture (May 2025)
- In the Beginning, There Was Computation — Nautilus article by Aguera y Arcas
If you use this in research, please cite the original paper and this implementation:
@article{aguerayarcas2024computational,
author = {Aguera y Arcas, Blaise and Alakuijala, Jyrki and Evans, James and Laurie, Ben and Mordvintsev, Alexander and Niklasson, Eyvind and Randazzo, Ettore and Versari, Luca},
title = {Computational Life: How Well-formed, Self-replicating Programs Emerge from Simple Interaction},
year = {2024},
eprint = {2406.19108},
archivePrefix = {arXiv}
}
@software{roze2026abiogenesis,
author = {Roze, Alex},
title = {Abiogenesis: Self-Replicating Programs from Random Byte Soups},
year = {2026},
url = {https://github.com/dopexthrone/abiogenesis}
}
MIT — see LICENSE.





