Manuscript revision and pending experiment work, snapshot before restructuring

Clarity pass over the main text (36-item audit), Discussion rewrite and cut,
acknowledgements, Souly et al. as ref 62, lettered SI panels, model section
moved under Results; plus the untracked curriculum/society/compose/smol
configs, runners, figures, stats and tests that the SI already cites.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Y64o8FKP7rCuXzC48pxpMm
This commit is contained in:
Giorgio Gilestro 2026-09-13 16:54:09 +01:00
parent e4804adabc
commit 84124de143
450 changed files with 52813 additions and 1202 deletions

View file

@ -1,4 +1,4 @@
r"""Build the PNAS-draft PDF from main.md (Markdown stays the source of truth).
r"""Build the manuscript-draft PDF from main.md (Markdown stays the source of truth).
Adapted from paper/arxiv/md2tex.py (same Markdown subset + pipe tables), with one addition: standalone
`*(FIG:name)*` markers place the publication figures produced by make_figs.py (unified, lettered,
@ -18,92 +18,115 @@ ROOT = Path(__file__).resolve().parents[2]
HERE = Path(__file__).resolve().parent
SRC = HERE / "main.md"
OUT = HERE / "body.tex"
SI_FIG_DIR = HERE / "figs" / "si"
import sys # noqa: E402
sys.path.insert(0, str(HERE))
from si_figures import SI_FIGURES # noqa: E402 (supplementary figures, numbered by order in si.md)
# figure name -> (single publication PDF from make_figs.py, caption)
FIGURES: dict[str, tuple[list[str], str]] = {
"fig1": (["paper/pnas/figs/fig1a.pdf", "paper/pnas/figs/fig1b.pdf"],
"(A) The experimental programme. Each population-genetic abstraction (Table 1) is tested at up "
"to three tiers, ordered left to right by increasing realism: a biological model (a "
"Wright--Fisher simulator over knowledge distributions; closed forms, bitwise-reproducible), "
"trained neural networks measured against exact oracles (recurrent, feedforward, and "
"variational-autoencoder generators on a synthetic mode universe, and a convolutional VAE on "
"MNIST), and language models (LoRA specialists on Qwen bases at 0.5B and 7B, scored by an "
"exact-match verifier). Colour separates the two categories: the biological model in green, "
"the two AI-model tiers in blues. The same abstractions are carried across "
"all three. Rows are the framework's mechanisms, each defined at the left margin; filled "
"cells name the experiments run at each tier, and each carries, in its corner, the figure "
"or table where that result is reported, so this figure doubles as a map of the paper. Each claim is tested at the cheapest tier that "
"can falsify it, and a costlier tier is entered only where it adds a discriminating test "
"rather than a replication: grounding at language-model scale is established in prior work "
"(21, 30) and is not re-run; epistasis and the society skip the middle tier, whose "
"distinctive value (exact oracles) does not bear on those operator-level questions; and the "
"society at language-model scale is the integrative experiment this paper specifies but does "
"not run --- its stated gap. (B) The conceptual basis of the transfer. A population of models "
"is usually pictured as a society in space: contemporaries exchanging messages. The couplings "
"this paper studies run instead between generations --- training on model output "
"(inheritance), weight-space merging (recombination), verified real data entering each "
"generation (immigration from reality) --- a society in time, the object population genetics "
"was built to describe. Dots mark capabilities: the rare one (gold) is lost under "
"single-parent inheritance, reassembled by merging complementary parents, and re-supplied by "
"grounding."),
"A map of the study. (A) Each row is a biological mechanism the paper borrows, each column a level "
"of realism at which it is tested: an inheritance model (an exact simulation of knowledge "
"transmission, green), trained neural networks measured against exact oracles (blue), and language "
"models (blue). Filled cells name the experiments run at each level and, in the corner, the figure "
"or table reporting them; grey cells were not run, either because the result is "
"established in prior work (23, 34) or because that level adds no new test for that question. The "
"inheritance model is the reference column: it sets the expectation the real-model experiments are "
"read against. (B) The change of viewpoint the transfer rests on. A group of models is usually "
"pictured as a society in space, contemporaries exchanging messages. The couplings studied here run "
"between generations: training on model output (inheritance), weight-space merging (recombination), "
"and verified real data entering each generation (immigration from reality). That is a society in "
"time, which is what population genetics describes. Dots are capabilities: the rare one (gold) is "
"lost under single-parent inheritance, reassembled by merging complementary parents, and re-supplied "
"by grounding."),
"fig2": (["paper/pnas/figs/fig2.pdf"],
"Grounding is immigration. (A) Stationary diversity against the grounding fraction in the "
"biological model: simulation (points, 95\\% CI) matches the exact immigration--drift "
"equilibrium (dashed). The equilibrium is smooth in $g$; $g \\approx 0.05$ marks the "
"operational threshold retaining 95\\% of source diversity in this setting (red line, "
"bootstrap CI shaded); the hollow point at $g=0$ is a finite-time value (the true equilibrium "
"is zero). (B) The same signs on real images: samples from a convolutional VAE retrained each "
"generation on its own output (rows: generations 0--15 of an ungrounded lineage) collapse "
"toward a single blurred mode; 10\\% grounding holds all thirty modes (quantified in SI)."),
"How much real data stops model collapse. (A) An image-generating network (a variational "
"autoencoder) is trained on handwritten digits, then a fresh copy is trained only on the digits the "
"previous one drew, for fifteen generations, with no real data added. Each row is a later generation "
"(0, 4, 8, 12, 15) and each column a randomly chosen drawing. The thirty kinds of digit (ten digits "
"$\\times$ three stroke thicknesses, some kinds rare) collapse to one blurred shape; an independent "
"classifier confirms that the number of kinds still drawn falls from 30 to 1, while adding 10\\% real "
"digits each generation keeps all 30 (Fig.~S7; 4 replicates). (B) The same question in the "
"inheritance model, the exact simulation: 1,000 knowledge items, 200 samples drawn per generation, "
"and a fraction $g$ of fresh real samples mixed in. Points are the diversity the population settles "
"at after 500 generations (mean and 95\\% CI over 100 lineages), the dashed line the exact prediction "
"(the immigration--drift equilibrium), the dotted line the diversity of the real data itself. The "
"curve is smooth, so any threshold is a choice: the red line marks the $g$ at which 95\\% of the real "
"data's diversity is kept, about 0.05 (bootstrap CI shaded). The hollow point at $g = 0$ has not yet "
"reached its equilibrium of zero. The trained image model needed about twice this fraction, because "
"a trained network is not the exact copier the simulation assumes (Fig.~S2)."),
"fig4": (["paper/pnas/figs/fig4.pdf"],
"Recombination in the biological model: blending inheritance and the Fisher--Muller effect. "
"(A) Expected rare-capability survival in a child refit from $K$ uncorrelated parents: the "
"output-mean (blending) stays at the single-parent level --- the first-order cancellation --- "
"while the union operator (strongest source per item, renormalised, oracle-identified) rises "
"with parent count. (B) Multi-locus recombination of decorrelated specialists produces "
"offspring fitter than any parent, approaching the optimum as parents are added; the best "
"single parent and the blended average plateau below (mean $\\pm$ 95\\% CI)."),
"A population of language models over six generations. (A) The set-up. Three lineages start "
"from one frozen 1.5-billion-parameter base (Qwen2.5-1.5B). Each generation, every lineage learns "
"one new skill from a public dataset by continuing to train its parent's adapter (300 new examples "
"plus 150 replayed from earlier skills), may merge with a partner according to its arm's rule "
"(weights averaged at a ratio chosen on validation data), and is tested on all six skills by a "
"verifier; the child becomes the next parent. The six skills are taken in rotated order, so a "
"partner knows things a lineage lacks early on (complementarity 1.0) and nothing it lacks by the "
"end (0.0). Three training seeds. (B) Accuracy over all six skills of the best lineage (mean and "
"95\\% CI). Never merging and merging only when it beats keeping the parent finish level (0.80 and "
"0.79); merging with a contemporary every generation collapses to 0.27, beginning when partners "
"stop being complementary; a control that merges through generation 2 and then stops (dashed) "
"matches the declinable arm in every seed, and a single model taught the whole syllabus alone "
"(diamond) matches the population. (C) How often the declinable lineages refused a merge (bars) "
"against partner complementarity (lines), under the rotated syllabus and under a second syllabus in "
"which complementarity is zero at the start, peaks mid-way and returns to zero. Refusals rise with "
"generation under both; with generation held fixed they do not track complementarity (partial "
"Spearman $\\rho = -0.07$, 95\\% CI $-0.21$ to $0.09$, $n = 36$). (D--F) The simulation that "
"motivated the design: 60 agents evolving on a rugged fitness landscape with all four mechanisms "
"(grounded evaluation, recombination, diversity preservation, mutation) and one removed per arm (12 "
"replicates; mean and 95\\% CI). Removing grounded evaluation, so that agents are scored on "
"agreement with the crowd instead of on the truth, collapses the population onto a confident but "
"wrong consensus (D, F); removing recombination or diversity preservation strands it below the "
"optimum (D) and drains diversity fastest (E). Each removal fails in its own way."),
"fig5": (["paper/pnas/figs/fig5.pdf"],
"Rugged (epistatic) landscapes: risk, remedy, and population structure. (A) Outbreeding "
"depression: the mean offspring of blindly recombined specialist parents falls below the best "
"parent, more steeply the more rugged the landscape (NK ruggedness $K$) and the higher the "
"recombination rate. (B) Screening candidate offspring against a verifier (directed "
"recombination) restores the gain at every ruggedness where blind recombination fails. "
"(C) Mating structure: the best champion arises at wide mate-pool breadth on smooth landscapes "
"and at intermediate breadth on rugged ones. (D) Wide breadth monotonically erodes population "
"diversity at every ruggedness (mean $\\pm$ 95\\% CI, 20 replicates)."),
"fig6": (["paper/pnas/figs/fig6.pdf"],
"The tested society: grounded evaluation, recombination, and diversity preservation make "
"complementary contributions. A finite agent population on a rugged NK landscape; selection "
"weights true fitness against conformity to the population consensus. (A) Best real fitness: "
"the full system approaches the global optimum; removing grounded evaluation collapses the "
"population onto a confident, unfit consensus; removing recombination or diversity "
"preservation strands it lower. (B) Population diversity. (C) The self-consumption signature: "
"conformity minus true fitness (mean $\\pm$ 95\\% CI, 12 replicates)."),
"fig7": (["paper/pnas/figs/fig7.pdf"],
"Model speciation at three tiers. (A) Biological model: hybrid fitness tracks the parents while "
"lineages are compatible, then falls to inviability; the denser the incompatibilities, the "
"earlier the fall. (B) The isolation cliff: probability of hybrid inviability against "
"divergence, by incompatibility density. (C) Trained networks: the merge error barrier between "
"two MLPs before and after permutation-and-rescaling alignment --- the same-task/different-"
"start barrier is a coordinate artefact (removed by alignment); the conflicting-task barrier "
"is left essentially unchanged. (D) Sweeping the fraction of conflicting classes: the residual "
"barrier rises while merged-model accuracy falls from 0.97 to 0.03. (E) Language models (0.5B "
"LoRA children of a shared base): on shared ambiguous prompts each parent performs under its "
"own convention while the merged model falls below both --- function-specific hybrid "
"breakdown. (F) Divergence without conflict: over-training disjoint specialists from 1 to 12 "
"epochs produces no isolation; the merged model tracks or exceeds the parents throughout."),
"Model speciation: when two lineages can no longer merge. (A, B) Small image classifiers "
"(multilayer perceptrons) forked from one trained base. Two networks that compute the same function "
"can still differ in their weights, because hidden units can be renumbered and rescaled without "
"changing the output; alignment undoes this before averaging. The merge error barrier is how much "
"worse the average of two networks is than the networks themselves. (A) Two copies trained from "
"different random starts on the same task have a barrier that alignment removes almost entirely "
"(0.04 to 0.001); two trained on conflicting labels (the same images, some classes relabelled) keep "
"theirs (0.50), and their average is useless (3 replicates). (B) Sweeping the share of classes in "
"conflict moves the merged model's accuracy from 0.97 to 0.03. (C) Language models: two specialists "
"share a set of ambiguous questions (``sort this list'', direction unstated) and are taught opposite "
"conventions. As the share of conflicting training grows, each parent stays good under its own "
"convention while the merged model falls below both, in all three seeds (95\\% CI shaded). (D) The "
"control: specialists trained longer and longer on different tasks, with no conflict, merge better, "
"not worse, in every seed. (E, F) The simulation: 20-position genotypes carrying incompatibilities "
"of the Bateson--Dobzhansky--Muller kind. Hybrid fitness tracks the parents while lineages are "
"compatible, then crashes, sooner the denser the incompatibilities (E), and the probability of a "
"non-viable hybrid rises with divergence (F). What breaks merging is conflicting conventions on "
"shared machinery, not distance or specialisation as such."),
"fig3": (["paper/pnas/figs/fig3.pdf"],
"The language-model tier. (A) Seed-replicated merging (0.5B, five seeds, fixed test sets; mean "
"$\\pm$ 95\\% CI): merged specialists exceed the best single specialist overall, and only "
"merged models are competent on every task family. (B) Hard, unsaturated tasks at 7B (single "
"run): the weight-average dilutes a fragile specialist below the best single parent; routing "
"among intact specialists preserves it. (C) The controlled predictive test (13 conditions "
"$\\times$ 3 seeds): pre-merge confidence-weighted functional conflict against merge penalty, "
"coloured by grid axis --- penalty concentrates on the conflict axis. (D) Predictor "
"comparison, $|$Spearman $\\rho|$ against merge penalty over the full grid: functional "
"measures carry signal, the tested weight-geometry baselines do not; paired differences "
"between predictors are not individually significant."),
"Merging language-model specialists: when it helps, and predicting when it will hurt. All models "
"are built from one frozen base (Qwen2.5) plus a LoRA adapter, a small set of extra weights trained "
"on one family of tasks (list puzzles, string puzzles or arithmetic); a verifier marks every answer "
"right or wrong, and accuracy is the share marked right on held-out questions. (A) The models "
"compared: the base alone; three specialists (one adapter each); their merge by averaging the "
"adapters; their merge after dropping the changes on which the parents conflict (TIES); and routing, "
"which keeps the specialists separate and sends each question to the one that owns it. (B) Easy "
"tasks, 0.5-billion-parameter base, five training seeds (fixed test sets; mean and 95\\% CI). Both "
"merges beat the best single specialist on the weakest task family (paired t-test over seeds, "
"$p < 10^{-4}$), and the interference-aware merge beats it overall ($p = 0.006$; the plain average "
"$p = 0.09$, ahead in 4 of 5 seeds); the two merges do not differ from each other. Only merged models "
"are competent on every family. (C) Deliberately hard tasks, 7-billion-parameter base, three seeds. "
"Averaging only matches the best specialist overall ($p = 0.96$) although it lifts the weakest "
"family ($p = 0.009$); routing beats averaging overall ($p = 0.007$, ahead in every seed) and beats "
"the best specialist on both measures ($p = 0.018$ and $0.014$). With three seeds, some comparisons "
"that hold in every seed are not significant (ns). (D) Predicting merge damage before merging: 39 "
"pairs of specialists built along three axes, parents taught contradictory conventions (red), "
"parents merely trained longer on different tasks (blue), and parents sharing training data without "
"conflict (green). The horizontal axis is how often the two parents confidently disagree when asked "
"the same questions before merging; the vertical axis is the merge penalty, the accuracy the merged "
"model loses relative to answering each task with the parent that owns it. Damage concentrates in "
"the conflicting pairs. (E) Six pre-merge measures ranked by how strongly they track the penalty "
"(absolute Spearman correlation): measures taken by asking the parents questions carry the signal, "
"measures taken on the parents' weights do not; differences between individual predictors are not "
"significant at this sample size (Table~S2)."),
}
UNICODE = {
@ -149,6 +172,17 @@ def inline(s: str) -> str:
def figure_env(name: str) -> str:
if name in SI_FIGURES:
# Supplementary figure: copy the committed per-experiment PDF beside the SI build, so the SI
# stays a pure function of the results artifacts; numbered by the LaTeX counter (S-prefixed).
src, caption = SI_FIGURES[name]
SI_FIG_DIR.mkdir(parents=True, exist_ok=True)
dst = SI_FIG_DIR / f"{name}_{(ROOT / src).name}"
shutil.copyfile(ROOT / src, dst)
return "\n".join([f"\\begin{{figure}}[p]\\centering % {name}",
f"\\includegraphics[width=\\textwidth]{{figs/si/{dst.name}}}",
f"\\caption{{{caption}}}\\label{{{name}}}",
"\\end{figure}"])
pdfs, caption = FIGURES[name]
incl = "\\\\[6pt]\n".join(f"\\includegraphics[width=\\textwidth]{{figs/{(ROOT / p).name}}}"
for p in pdfs)