laws that grow machines
Evolution can discover a constant-size hereditary rule that generates FSM-exact recurrent circuits at sizes never encountered during evolution — and a controlled baseline shows that for linear tasks the active ingredient is parameter tying, not hierarchical recursion. Experiments 1–2 on the MorphoHDL dynamic-systems extension. August 2026.
Setup
Building on the Experiment 0 platform, we evolve input-driven synchronous recurrent circuits: a typed genome of LUT genes (arity 1–3, truth table, DAG-ordered source references over constants, inputs, registers and earlier LUTs), register next-state references, and output references. Every recurrent path crosses a register by construction, so semantics stay deterministic. Selection is lexicographic — correctness first, hardware cost (on the compiled, dead-code-eliminated phenotype) second — with a random-search control at identical evaluation budget. Solved circuits are verified exactly against a reference finite-state machine by product-machine BFS over both input values: "exact" means exact for every possible infinite input sequence, not accuracy on samples.
Experiment 1 — the calibration where the optimum is known
Delayed recall (yt = xt−d) requires at least d bits of state; the d-register shift register achieves it with zero gates. Direct evolution, 4 seeds per delay:
| d | evolution | random (same budget) | live registers of every solved run |
|---|---|---|---|
| 1–4 | 4/4 solved, exact | 4/4 | exactly d |
| 8 | 4/4 | 2/4 | exactly 8 |
| 16 | 1/4 | 0/4 | exactly 16 |
Every solved circuit — 21 across both methods — sits exactly on the information-theoretic lower bound; none ever used a spare register. The d=16 winner is a shift register up to state relabeling: a permuted chain threaded through NOT pairs that cancel. Evolution separates from random search at d≈8.
Temporal parity (yt = xt ⊕ … ⊕ xt−k) adds computation to memory, and exposes the wall: k=1 solves 4/4 (1 register + 1 XOR, optimal), k=2 solves 4/4 for evolution vs 0/4 for random, k=4 solves 1/4 — and the winner stores partial parities in its registers rather than raw history — but at k≥8 both methods sit at chance (~0.50). An almost-correct parity circuit is fully decorrelated from the target, so the landscape offers no gradient. Direct evolution failed under this preregistered representation and matched budget — a statement about this protocol, not about all direct search.
Experiment 2 — constant genomes, unseen sizes
We then replace circuit genomes with law genomes of constant length, instantiable at any size k. Two representations, deliberately contrasted: a developmental grammar (63 ints: a recursive cell with a two-signal interface; size splits k → ⌊k/2⌋ + ⌈k/2⌉, so non-dyadic sizes are native; evolvable LUT banks; registers only in base cells) and a shared-rule baseline (31 ints: one evolved stage repeated k times — parameter tying without hierarchy). No task-named primitives in either. Hand-written laws in both grammars confirm expressibility before evolution gets a chance.
Preregistered protocol: train only at k ∈ {1, 2, 4}, primary fitness = minimum accuracy over the three sizes (a law that breaks any training size is not a law). Freeze. Zero-shot instantiate at k = 3, 5, 6, 7, 8, 12, 16 — k≥8 never exposed during evolution, not even for model selection.
| representation (parity) | |genome| | train 1,2,4 | zero-shot 8 | zero-shot 16 | non-dyadic 3,5,6,7,12 |
|---|---|---|---|---|---|
| hand developmental | 63 | ✓ | ✓ | ✓ | ✓ |
| hand shared-rule | 31 | ✓ | ✓ | ✓ | ✓ |
| evolved developmental | 63 | 1/8 | 1/8 | 1/8 | 1/8 |
| evolved shared-rule | 31 | 5/8 | 5/8 | 5/8 | 5/8 |
| direct genome (Exp 1, at size) | ∝ k | ✓ to k=4 | 0/4 | 0/4 | — |
The evolved law beats the hand law
The hand developmental law computes parity with a balanced XOR tree — logic depth log k. The frozen evolved winner has depth 1 at every k. It found the systolic solution: registers hold sliding partial parities (ri ← x ⊕ ri−1), so the fold is pipelined through time instead of built in space — the space↔time transformation the recurrent substrate was built to make discoverable, achieved without wasting a single state bit.
What the baseline prevented us from claiming
Shared-rule solved training 5/8; developmental 1/8. Hierarchical recursion did not make search easier here — parameter tying did: one mutation edits a rule reused throughout the generated machine, which repairs the parity landscape's all-or-nothing geometry. The demonstrated claim is therefore not "recursion wins" but: indirect, scale-independent encodings turn a finite-circuit search problem into a search for a reusable computational law; for this linear task, sharing is the important ingredient, and extra recursive indirection makes discovery harder. Which computational structures benefit from which developmental biases is now the open question.
Same grammars, different task
To rule out task-shaped representations, we pointed the byte-identical grammars at delayed recall (train k ∈ {1,2,4}, freeze, zero-shot as above):
| representation (recall) | |genome| | train 1,2,4 | zero-shot 8 | zero-shot 16 | non-dyadic 3,5,6,7,12 |
|---|---|---|---|---|---|
| evolved developmental | 63 | 8/8 | 8/8 | 8/8 | 8/8 |
| evolved shared-rule | 31 | 8/8 | 8/8 | 8/8 | 8/8 |
Every seed of both representations found a law; every frozen law is exact at every unseen size; winners instantiate exactly k registers with zero gates — the shift-register optimum, rediscovered as a generative rule rather than a circuit. Across both constant-length representations, every genome that solved the training scales generated exact machines at every unseen scale tested: 22/22 successful laws transferred with zero generalization failures. (Constant genome length is coupled to size-generic instantiation semantics and rule reuse in both representations, so we do not attribute the transfer to genome length alone.)
Demonstrated vs. not demonstrated
Demonstrated: exact recurrent-topology evolution to the state lower bound with product-machine verification; a clear evolution-vs-random separation at d≥8 and parity k=2 (4 and 8 seeds per condition — experimental separation, not a universal search-theoretic claim); constant-length genomes whose frozen instantiations are exact at 2–4× the largest trained size and at non-dyadic sizes; perfect solve-train ⇒ generalize transfer (6/6); a depth-1 systolic parity law structurally superior to the hand-designed tree.
Not demonstrated: that recursion outperforms parameter tying anywhere (the next experiments target tasks with genuine divide-and-combine structure, e.g. sliding-window majority); scaling beyond k=16; anything about non-binary or asynchronous substrates; and all "failed" statements are relative to the preregistered representations and matched budgets.
What's next
Copy-after-delay (load → retain → cue → emit) with the same genotype machinery — the first task where state must be used conditionally; then a deliberately hierarchical task family (sliding-window majority/threshold), where a recursive representation can offer O(log k) structural depth and the tying-vs-recursion comparison has something real to measure.
Code: PedalCore/morpho@dynamic-systems
(evolve/experiment1.py, evolve/experiment2.py,
evolve/fsm_verify.py). Companion result:
sparse defects in a traffic jam (Experiment 0).
All reported numbers use held-out streams disjoint from training; "exact" always means
product-machine-verified over every possible input sequence.
AI-generated research. The experiments, code and write-ups on this site were produced by AI agents (Claude and Codex) working semi-autonomously, directed at a high level by a human. Nothing here is peer reviewed and none of it is affiliated with an academic institution. Measurements are reported as taken — including the nulls, the caveats and the corrections — but the work has had no external review.