littlepond (Replicated Soup, Graded Transformers)

Role: Solo, end-to-end. Engine, sweep harness, experiment design, dataset, model training, probing and the write-up.
Tech Stack: TypeScript (engine, harness, browser page), Python and PyTorch (models, probes), Vitest, pytest
Repository: Private for now, MIT licensed. Demo available on request

Overview

littlepond is a replication of a digital origin-of-life experiment, plus a small AI trained on it, in a setting where the AI’s understanding can be graded against the actual physics.

The experiment is not mine. In “Computational Life: How Well-formed, Self-replicating Programs Emerge from Simple Interaction” (arXiv 2406.19108), Agüera y Arcas, Alakuijala et al. (2024) fill a “soup” with 131,072 random 64-byte programs in a ten-instruction language called BFF. Each epoch the programs are paired, each pair is glued into one 128-byte program, run, and split apart again. Nothing rewards copying, and in about 40% of their runs a program that copies itself appears and fills the soup anyway. I wanted to know what that result depends on, and I could not ask until I had an engine I trusted, so phase one is a rebuild in TypeScript that I checked against the authors’ public reference code, cubff, followed by six experiments over about 1,100 soups.

Phase two exists because the soup comes with an answer key. Every interaction has an exact result: run it and see. So I drew a million labelled interactions from the phase-one soups, trained two small transformers on them, and then checked what probes, patching and ablations said about the models against the interpreter itself, including a second model trained on a deliberately altered interpreter.

Both phases are finished (run 2026-11-06 to 2026-11-11, release v0.2-phase-two on 2026-11-12, 171 commits). At commit 4a0367e the repo holds about 5,300 non-blank lines of engine, harness and page code, 5,100 of model and analysis code, and 9,500 of tests (roughly 600 Vitest cases and 370 pytest functions, counted by grep, not by a collector run).

What Is Replication and What Is Mine

This line matters, so here it is in one place.

  • The paper’s: the BFF language, the soup setup, the high-order entropy measure, the replicator test (CheckSelfRep), the replicator I implant in the seeded experiments, and the headline finding that self-copying programs emerge. cubff is the authors’ code. I ported parts of it and ran its binary for comparison; I did not write it.
  • Replicated here: the takeover rate (E0), and the same soup with mutation off, which Dušek et al. (ALIFE 2026) ran first.
  • Mine: the TypeScript engine and resumable sweep harness, the browser page, experiments E1 to E5 (soup size, head start positions, mutation rate, a cost on running time, removing instructions), and all of phase two.

The repo keeps a prior-art table with one row per claim, the nearest earlier work, what was actually read, and a verdict of precedent, neighbour or not found. “Not found” there means not found by the listed searches, and the table says which papers were read only as abstracts or summaries.

Engineering Details

1. Proving the Rebuild Is the Same System

A rebuild only counts if it is the same physics, so I checked two parts directly against cubff instead of trusting my reading of the paper.

  • The interpreter. On 2,000 seeded program pairs, my interpreter and a line-by-line CPU port of cubff’s bff.inc.h give the same final bytes and the same read counts. This runs as a fixture test.
  • The replicator test. I ported CheckSelfRep, then ran cubff’s own binary on the same tapes: zero score mismatches on all 28,672 tapes from four soups (2026-11-09).
  • The rate. At 131,072 tapes, 6 of 10 runs took over (Wilson 95% interval 31% to 83%) against the paper’s roughly 40%. Under the rule cubff’s analysis scripts use, the engine gives 0.38 takeovers per billion interactions (0.25 to 0.56) against the 0.49 the paper implies. Ten seeds cannot tell 40% from 60%, so I call this consistent, not equal.

I did the second check late, and it mattered. My first replicator detector was a placeholder I wrote myself, and it compared the copy at one alignment only. It missed a whole kind of replicator whose copy lands one byte off, and I had written those soups up as “fragments”. cubff’s test found about 250 of 256 sampled tapes heritable in them. No takeover decision changed, but the label and the counts did, and from 2026-11-09 the cubff test decides.

2. Six Experiments, Counted With Intervals

Each setting runs 10 to 40 independent seeds, and every count carries a Wilson 95% interval. The harness checkpoints per run, so rerunning the same command skips finished runs and restarts an unfinished one from its last snapshot.

  • Size. At equal interactions, 8,192 tapes produced a confirmed takeover in 2 of 40 runs against 12 of 40 at 65,536 (p = 0.005), about 7 times less often per interaction. Replicators are born at a similar rate there (0.30 against 0.72 per billion interactions, not a significant difference) but win less often: 2 of 6 births against 12 of 13. Separating emergence from spread is prior work (Dušek et al.; Knierim et al. 2026); varying the soup size is what I added. The 8,192 result rests on two events.
  • Head start. Moving the second head’s start from byte 0 to byte 64 took takeovers at 16,384 tapes from 2 of 20 to 20 of 20. I wrote a rule to explain it, tested the rule at an offset where it predicted no replicators, and got 8 of 20. The winners move a head back four bytes before copying. The rule was wrong and the note says so.
  • Mutation. No sharp error threshold. Seeded with the paper’s replicator at 4,096 tapes, 8 of 10 runs keep replicators to 10,000 epochs at a mutation rate of 0.002 per byte and 0 of 10 at 0.005.
  • Time cost. The project spec expected a cost on running time to favour programs that halt. It did the opposite: the full cost wiped out the replicator (0 of 10 against 9 of 10), and a small cost kept replicators that run to the step limit. Why the small cost favours the one-byte-shifted form is open; my one proposed mechanism was tested with a traced run and failed.
  • Ablation. Without head wrap-around, or without the + and - instructions, 0 of 20 runs each at 65,536 tapes, against 8 of 20 with everything (p = 0.003). “Needed” means needed within 16,000 epochs at that size.

3. Two Models, One Answer Key

The dataset is 1,000,000 input/output pairs drawn from phase-one soups, split by soup so none sits on both sides, plus 150,000 pairs under a shifted physics the models never train on. I score written bytes, the output bytes that differ from the input, because copying the input already gets every unchanged byte right. A copy-input baseline scores 0% there and nearest-neighbour lookup 23.8%.

Both models are 6-layer, 384-wide decoder transformers with 10.7M parameters, trained on one RTX 3090. The outcome model writes the whole 128-byte result in one pass. The step model predicts one interpreter step and is run in a loop.

  • The 30-epoch outcome model gets 96.9% of written bytes and 91.4% of pairs exactly right on test.
  • The 10-epoch step model, run free for each program’s true length on 1,000 validation pairs (mean 121 steps, feeding its own predictions back in), gets 99.4% of pairs exactly right, against 86.8% for the outcome model on the same pairs. The training budgets differ, so I read this as iterating beating one pass at these budgets, not as step training being more efficient.
  • On the shifted physics the outcome model gets 0.7% and 1.2% of written bytes. It learned this soup, not BFF in general.

Before the 10-epoch step run I wrote down that the two copy instructions would stay at least 15 points behind the arithmetic ones. They ended at 100.0%, same as the rest. The earlier gap was undertraining.

4. Is It a Replicator Feature or Something Cheaper?

A linear probe on the outcome model reads “this tape replicates” at AUC 0.994 on test. That alone says little, because replicator tapes tend to be palindromic and a probe could be reading symmetry. So I built sets to pull the two apart: 1,000 palindromic non-replicators (replicators with their instruction bytes permuted, which keeps the symmetry and breaks the copying) and 866 replicators that are not palindromic.

  • The untrained network’s probe is a symmetry reader: it fires on 44.3% of the palindromic non-replicators and 2.3% of the non-palindromic replicators.
  • After 30 epochs it fires on 2.4% and 88.6%.

Then I used the lever this setting has and most do not. I trained a second model on the same inputs with the two copy instructions exchanged in the interpreter, and read each model’s own probe on byte-matched programs (10-epoch checkpoints, 16,338 pairs). The original model’s probe fires on 76.9% of its own world’s replicators and 3.1% of the other’s; the swapped model’s on 92.3% and 22.7%. Byte statistics alone would put each pair within 10 points.

I set the pass bars before scoring: at least 80% on its own world, at most 20% on the other. Neither probe cleared both, so the recorded result is “between”, not a pass. The swapped model also never saw a replicator of its own world in training, and the symmetric version of the test has not been run.

Code Snippet: Editing the Physics

Condensed from ml/bff.py, the Python port used for minimal pairs and step-model unrolling

def run(tape, step_limit, h0, h1, wrap, trace=False, swap=False):
    """swap: '.' and ',' exchanged (the swapped-semantics control)"""
    t = np.array(tape, dtype=np.int64)
    if not isinstance(swap, bool):
        raise ValueError(f"swap must be a bool, got {swap!r}")
    dot, comma = (44, 46) if swap else (46, 44)
    ...
    while ip < L:
        c = t[ip]
        if c == 45:   t[h0] = (t[h0] - 1) % 256
        elif c == 43: t[h0] = (t[h0] + 1) % 256
        elif c == dot:   t[h1] = t[h0]   # copy head 0 -> head 1
        elif c == comma: t[h0] = t[h1]   # copy head 1 -> head 0
        ...

One flag changes what two bytes mean, and the whole counterfactual world follows from it: a new dataset, a new model, and a set of programs that replicate in one world and not the other. The port is tested to reproduce every stored pair of a generated dataset.

An Animated Walkthrough, One Checkpoint Behind

I also scripted an explainer for this project as one series in a separate animation project: 10 scenes, 50 captioned beats, 474 seconds, drawn with three.js. It walks through the soup, the ten instructions, the replicator, the dataset, the outcome model and its test results, and the shifted-physics failure.

What I’d point to is how the numbers get on screen. A sync script reads littlepond’s result files and generates the data module the scenes draw from, so no figure is typed by hand, and each scene has a test that checks every number in its captions against that module (432 test(/it( call sites across the 21 test files for this series, by a grep at 9f17eb6 on 2026-11-22, not a run). Captions also pass a lint that refuses proof language. Each scene is a pure function of time, so scrubbing backwards gives the same frame.

It is not current. The data was generated at the 10-epoch outcome model, so the series shows 87.1% of written bytes where this page reports 96.9% at 30 epochs, it calls the step model not converged, and its last scene says the look inside the model has no results yet. A review I wrote on 2026-11-11 found that the series never states its question up front, and the rewrite designed in response has not been built. No video of it is published.

What This Does Not Show

  • That the probed features are used. Probes show a feature can be decoded. Only the patching speaks to use, and it puts the decision at the input positions in the middle blocks.
  • Which attention heads do the work. The heads that ablation picked out at 10 epochs no longer matter at 30, while accuracy rose. Any head claim is about one checkpoint.
  • A depth limit. I predicted long copy chains would be the hard case. The reverse held: copy chains stay 94% to 97% right, and bytes built by repeated + or - on one cell fall to 60% to 80%. My explanation for that is untested.
  • Anything beyond one seed. One seed of each model, one size, one soup distribution. Takeover counts are “by epoch 16,000”, and several cells rest on a handful of events.

Features

  • Reference-checked interpreter - identical final bytes and read counts to a port of cubff’s bff.inc.h on 2,000 pairs, kept as a test
  • Reference-checked replicator test - zero mismatches against the cubff binary on 28,672 tapes
  • Resumable sweep harness - per-run summaries and snapshots; a rerun skips finished runs and resumes the rest, with a --dry-run that validates and lists runs first
  • Wilson intervals by default - every summary row carries a 95% interval on its run count
  • Browser soup page - a single built HTML file, no server, with a tape inspector and step-through replay, that opens any .soup snapshot the harness saved and refuses files whose tapes fail their sha256
  • Results dashboard - charts takeover rate per setting from a picked results folder
  • Million-pair dataset - split by soup, with a held-out shifted physics; training configs record each dataset’s sha256 and the loaders refuse a mismatch
  • Two model families - one-pass outcome model and iterated step model at the same size
  • Constructed controls - palindrome, op-swap and exchanged-interpreter sets built to separate competing explanations
  • Predictions written before scoring - committed with the results, including the ones that failed
  • Prior-art table - one row per claim with the nearest earlier work and what was read
  • Release with checksums - v0.2-phase-two carries datasets, five checkpoints and soup snapshots, each listed in SHA256SUMS

Tech Stack

  • Engine and harness: TypeScript 5.9 on Node 20.9 or newer, no runtime dependencies. The engine has no UI code, so the same file runs headless and in the page
  • Build: esbuild, which inlines the bundle into one HTML file
  • Models: Python 3.11, PyTorch 2.7.1 (CUDA 12.6), NumPy 2.2.6, Matplotlib for figures
  • Testing: Vitest 3 for the TypeScript side, pytest 8.3.5 for the Python side
  • CI: GitHub Actions runs typecheck, tests and build on Ubuntu and Windows with Node 20 and 22. It covers the TypeScript side only; the Python tests run locally
  • Compute: sweeps on a desktop and a 4-core rented server VM, training on one RTX 3090 (the 3-epoch pilot took 90 minutes including evaluations)