Files
ailed-docs-rp/.sdd/task-7b-brief.md
T
chrnx 5da4b8efa5 docs: design, plan, and the execution record
The thinking behind the organism, versioned alongside the three code repos rather than
living only on one machine.

- AILED_General_Specification.md, the authoritative design, and the implementation plan
  the code was built from
- AGENTS.md, the project-wide rules, including the two that were learned the hard way:
  this is not a performance benchmark, and a null recorded early beats a claim propped up
  later
- the nine superseded module specs, each carrying a banner naming what replaced it
- .sdd/, the execution ledger and every task brief and report: each ruling taken, what it
  would cost if wrong, every correction, and every number verified independently

The three code repos are siblings, each its own repository, and are git-ignored here so
nothing is nested.
2026-09-02 13:17:39 -05:00

4.9 KiB

Task 7b: Frozen-weights probe — RP vs GRP, who understands the domain and why

Why this task exists

Task 7 measured that at lr=1e-3 memory beats memoryless 2.99x on mean error, and that the margin decays to 1.06x at lr=1e-2. That comparison is contaminated: raising the learning rate buys the same adaptation speed that memory buys, so mean error cannot tell state and fast weights apart.

This task removes the contamination by removing learning. Train, then freeze every weight, then let the regime switch. A frozen RP is a fixed function of the current observation and has nothing that can adapt. A frozen GRP still has M, which updates every step through its gate. Whatever difference survives is attributable to state alone, and no learning-rate objection can reach it.

The question is not which reaches lower error. It is which one comes to understand the domain, and by what mechanism. Do not add an MLP or any non-relational baseline — a standard perceptron measures mechanical performance and is not commensurable with this.

Scope

Two conditions only: rp_only (memory=False) and grp_k0 (memory=True, kappa=0). Keep kappa=0 — affect is not under test here; that is A1. This task establishes whether memory has a job at all once learning is out of the picture.

Files

  • Create: experiments/frozen.py
  • Create: experiments/results/frozen.md
  • Test: experiments/tests/test_frozen.py

Part A — frozen recovery

For each condition and seed:

  1. Train exactly as regime.run does, same lr, bptt, hidden, steps. Both conditions get an identical training budget.
  2. Freeze: stop calling opt.step() and run the rest under torch.no_grad(). No parameter may change after this point. Assert it — snapshot the parameter vector before and after the frozen phase and check it is bit-identical.
  3. Keep stepping the world. Memory must keep updating; only weights are frozen.
  4. Record loss per step and switch flags through the frozen phase, and reuse regime._metrics so the numbers are comparable with Task 7's.

Report recovery[k] for both conditions. The prediction under test: rp_only frozen shows a step change in error at each switch that never comes back down, because a fixed function cannot adapt; grp_k0 frozen shows a rise and then a decay back toward its pre-switch error. If grp_k0 does not decay, memory is not tracking the regime and that is a clean null — report it as such.

Also report, per condition, the across-seed spread of the frozen steady error. Task 7 found memoryless ranges 13x across seeds while memory is tight; check whether that survives here.

Part B — what does the state know?

Part A can only show that GRP adapts. This part shows what it knows.

During the frozen phase, collect per-entity representations paired with the world's current regime label:

  • for grp_k0, the memory vectors M_i
  • for rp_only, the hidden vectors h_i — get them by calling org.rp(...) directly with the same arguments Organism.forward builds

Fit a linear probe (multinomial logistic regression, or least squares onto the regime one-hot) from the representation to the regime id. Hold out a test split by time, not at random, so the probe cannot memorise adjacent steps. Report test accuracy for both conditions against the chance level, which you must establish empirically by refitting on shuffled labels rather than assuming 1/n_regimes.

The claim this tests: if the regime is linearly decodable from M but not from h, then the GRP's state has come to represent which regime the world is in — the organism has built an internal variable the domain never gave it. That is the "why" behind Part A, and it is a statement about understanding rather than about error.

Additionally, report how quickly the probe's prediction flips after a switch — the mean number of steps from a switch until the decoded regime matches the true one. That is the state's adaptation latency, measured directly rather than inferred from loss.

Rules

  • Do not change any default in particles.py or regime.py, and do not modify ../ailed. If you need something the library does not expose, get it by calling existing public attributes (org.rp, org.grp), not by editing the library.
  • Reuse regime.run's training loop rather than reimplementing it if you can do so without changing regime.py's behaviour; if you must copy it, say so and keep it identical.
  • Use at least 5 seeds. Task 7 showed the across-seed spread is comparable to the effects being claimed, so 3 is not enough to state a ratio.
  • Report a null plainly if you find one. A null recorded early is worth more than a claim propped up later.

Deliverable

results/frozen.md: both parts' tables, the parameter-freeze assertion result, the chance level you measured, and a plain-language answer to "which one understands the domain, and what is the evidence". Commit it with frozen.py and its test.