Files
ailed-experiments-rp/results/frozen.md
T
chrnx 5ecf5d1146 results: apply Task 11's two corrections
The gate's weights moved 26.8% of their initial norm — more than any other block — so
"untrained" was wrong and pointed at a hypothesis Task 11 falsified. What did not move is
the function: the displacement stayed inside the sigmoid's linear band. frozen.md's three
affected passages now say so and a new section 6 carries the measurement, including why the
887x gradient-magnitude gap should not be led with (Adam is scale-invariant; the
per-coordinate SNR is comparable across blocks).

Section 7 and a note in when_memory_works.md mark the probe figures as linear-probe numbers.
An MLP probe reads +0.159 from M and +0.234 from h. The relative claim is unchanged; the
absolute fraction needed the qualifier.
2026-09-02 17:05:26 -05:00

25 KiB
Raw Blame History

Frozen-weights probe: does memory have a job once learning is out of the picture?

Task 7b. Task 7 measured memory beating memoryless 2.99x at lr=1e-3 and watched that margin decay to 1.06x at lr=1e-2, so mean error cannot tell state and fast weights apart. This file removes learning instead of retuning it: train, freeze every parameter, keep stepping the world. Nothing after the freeze can be attributed to an optimiser step.

Verdict: a clean null, twice over. Memory is not doing the work, and neither model builds an internal regime variable.

  1. Under frozen weights grp_k0 beats rp_only 2.50x on steady error, on 8/8 seeds. That margin is the GRP's gated post-RP nonlinearity, not its state — and not its parameter count either. The same architecture with the state ablated — an empty memory handed in each step — measures 2.170e-05 against grp_k0's 2.101e-05. Memory is worth 1.06x, on 4 seeds out of 8. Its recovery curve is indistinguishable at every lag. This item originally read "that entire margin is the GRP's extra 4160 parameters"; that attribution was wrong and is corrected in §1d. The null for memory is unchanged.
  2. The regime is decodable from M at 0.332 against a measured chance of 0.273. It is decodable from the memoryless RP's h at 0.342 against 0.274. M knows no more about the regime than the feedforward representation it is built from — slightly less — and the same +0.05 appears in a state-free network, so it is a read-off of the current configuration, not a memory.
  3. The mechanism is visible: the gate sits at g = 0.500 ± 0.029, never above 0.9, never below 0.1, on any seed. Its function is at its initialisation — the weights themselves moved more than any other block's, see the correction in §6 — and the GRP as trained here is not gating anything.

Environment: experiments/, ailed/ unmodified, no default in particles.py or regime.py changed. 8 seeds (0-7), 8000 training steps then 4000 frozen steps, lr=1e-3, bptt=20, hidden=32, omega=10, kappa=0, window=20. Noise floor noise² = 4.0e-06. 40 runs total.

uv run python frozen.py                                     --out results/frozen.json
uv run python frozen.py --conditions grp_k0 --ablate-state  --out results/frozen_nostate.json
uv run python frozen.py --freeze-affect --no-probes         --out results/frozen_affect.json

0. The freeze audit

Both guards the brief asked for, asserted in code on every run, not checked by eye.

check how result
no parameter moved parameters_to_vector snapshot before/after the frozen phase, torch.equal bit-identical on 40/40 runs
nothing could move requires_grad=False on every parameter and the whole phase under torch.no_grad(), no optimiser constructed asserted
memory kept updating `min_t max_i M_t − M_{t−1}
the assertion can fail test_frozen_phase_detects_a_parameter_change nudges out.bias by 1e-6 after the snapshot raises, as required
h is the organism's h org.grp(h, M_prev, arousal) must equal the M the organism returned; org.out(h) must equal the pred it returned torch.equal, every step of every run

Mean per-step memory movement is 1.06e-02, four orders above the detection threshold, so the GRP is running as a GRP throughout. _train is a verbatim copy of regime.run's loop; test_train_copy_is_identical_to_regime_run asserts it reproduces regime.run's metrics exactly, so the frozen phase starts from the organism Task 7 measured.

Parameter counts: rp_only 1442, grp_k0 5602. The RP is identical in both (1376); the GRP adds a 64→32 gate and a 64→32 candidate layer, 4160 parameters, 3.9x the total. These counts are not the story — §1d measures what the count buys, and the answer is nothing.

1. Part A — frozen recovery

Metrics come from regime._metrics applied to the frozen phase, so they are comparable with Task 7's; as there, they are computed on the second half of the phase.

1a. The headline, and the control that dissolves it

Frozen-phase steady, means over seeds 0-7. grp_k0_nostate is grp_k0 with an empty memory dict handed to Organism.forward every step, in training and in the frozen phase: identical architecture, identical parameter tensors, M_prev always zero. It was originally described here as the capacity-matched feedforward control. It is not one — §1d. The rows below are the measurements; the capacity reading of them is withdrawn.

condition            steady        sd       min       max  max/min   n_params
------------------------------------------------------------------------------
rp_only           5.257e-05 2.924e-05 2.644e-05 1.054e-04     3.99       1442
grp_k0_nostate    2.170e-05 5.155e-06 1.531e-05 2.733e-05     1.78       5602
grp_k0            2.101e-05 6.430e-06 1.426e-05 3.515e-05     2.46       5602

Decomposed per seed, which is what carries it:

                            mean   median   seeds won
capacity  rp_only / nostate  2.51x   1.94x       8/8
state     nostate / grp_k0   1.06x   1.00x       4/8

Per-seed nostate / grp_k0: 1.49 0.92 1.33 0.92 0.90 1.08 0.78 1.10. Four above one, four below. Removing the state costs nothing. The same decomposition in the trained phase gives capacity 3.04x on 16/16 seeds and state 1.19x on 11/16 (mean; medians 2.71x and 1.11x). Those trained-phase figures were re-measured at 16 seeds by Task 8 and supersede the 8-seed values this file originally quoted; the frozen phase rows above remain 8 seeds. See a1.md.

Per-seed frozen steady:

condition           s0        s1        s2        s3        s4        s5        s6        s7
--------------------------------------------------------------------------------------------
rp_only       4.298e-05 3.808e-05 3.098e-05 3.205e-05 1.054e-04 5.585e-05 8.881e-05 2.644e-05
grp_k0_nostate 2.588e-05 1.531e-05 2.665e-05 1.992e-05 1.736e-05 2.545e-05 2.733e-05 1.573e-05
grp_k0        1.742e-05 1.656e-05 2.006e-05 2.170e-05 1.931e-05 2.365e-05 3.515e-05 1.426e-05

Note also that the across-seed spread — Task 7's "memory buys reliability" reading — goes the same way. grp_k0_nostate has the tightest spread of the three (1.78x max/min, against grp_k0's 2.46x). Reliability goes with the gated head too — not with the parameter count; see §1d.

1b. The recovery shape: the prediction under test fails

Raw recovery[k], frozen phase, means over seeds:

condition           rec@0     rec@5    rec@10    rec@19    steady
-------------------------------------------------------------------
rp_only         5.506e-05 7.311e-05 8.078e-05 6.563e-05 5.257e-05
grp_k0_nostate  2.708e-05 3.749e-05 4.246e-05 2.769e-05 2.170e-05
grp_k0          2.756e-05 3.824e-05 4.311e-05 2.756e-05 2.101e-05

grp_k0 and grp_k0_nostate agree to within 2% at every lag. The state changes the post-switch trajectory not at all.

The brief's prediction was that frozen rp_only steps up at each switch and never comes back down, while frozen grp_k0 rises and decays. Normalising each seed by its own steady error before averaging — the only way to compare shapes across conditions whose floors differ 2.5x:

condition          @0   @2   @4   @6   @8  @10  @12  @14  @16  @18  @19   peak   decay
----------------------------------------------------------------------------------------
rp_only          1.16 1.35 1.49 1.66 1.68 1.59 1.52 1.43 1.38 1.34 1.30  1.69@7   57%
grp_k0_nostate   1.31 1.40 1.54 1.92 2.09 2.06 1.87 1.64 1.46 1.35 1.31  2.13@9   73%
grp_k0           1.42 1.47 1.69 2.06 2.22 2.18 1.97 1.72 1.51 1.40 1.35  2.24@9   72%

("decay" is the fraction of the peak excess over steady that is gone by @19.)

The frozen memoryless RP does come back down — 57% of the way, with no parameter having moved and no per-entity state to move. And grp_k0's relative excursion is larger, not smaller: it peaks at 2.24x its own floor against the RP's 1.69x, and peaks two steps later.

The reason is that recovery[k] under frozen weights is not measuring the model. At a switch the particle configuration is equilibrated to the old regime; the new coupling matrix then drives it somewhere else over the next 10-20 steps. That transient belongs to the world, and a fixed function of the configuration inherits it. Under frozen weights recovery[k] measures the world's post-switch transient, not adaptation, and the state-ablation row proves it directly: same curve with the state and without it.

1c. The RP is not quite static — controlled for

CONDITIONS["rp_only"] uses ctx="affect", so (valence, arousal) feeds the CPPN. Affect is updated from loss.item() every step and freezing weights does not freeze it. A frozen rp_only therefore is not a fixed function of the current observation as the brief assumed: it retains a 2-d state. Re-running the frozen phase with affect also pinned at its end-of-training value:

condition   affect live   affect pinned
-------------------------------------------
rp_only       5.257e-05      4.906e-05
grp_k0        2.101e-05      2.057e-05
ratio             2.50x          2.26x   (8/8 seeds either way)

Removing the RP's last adaptive channel does not rescue the prediction — the RP's decay gets stronger (74% of the excess, up from 57%), confirming the decay is the world's, not affect's.

1d. Correction: the control is not capacity-matched, and the margin is not capacity

This section replaces the "capacity, not memory" reading above. Three measurements, all at the settings this file already uses (8000 train + 4000 frozen steps, lr=1e-3, bptt=20, omega=10, kappa=0, frozen-phase steady).

(i) 2048 of the 5602 parameters never train. With M_prev ≡ 0 the gate and candidate layers both see [h ‖ 0], so the second half of each input weight matrix is multiplied by zero and receives exactly no gradient. Trained grp_k0 stateless for 8000 steps and diffed every block against its initialisation: gate.weight[:, 32:] and cand.weight[:, 32:] (1024 parameters each) come out at max |Δ| exactly 0.0, while every other block moved (max |Δ| 0.035–0.091). The honest effective count for grp_k0_nostate is 3554, not 5602.

(ii) It is a different network, not the same network minus state. With M_prev = 0 the update M ← (1−g)·M̃ + g·M collapses to

M = (1 − σ(W_g[h‖0])) · tanh(W_c[h‖0])

— a two-layer gated feedforward head on h, with no recurrence and no BPTT path through state. The original conclusion needed this control to be the same network with memory deleted; it is instead a simpler, better-conditioned network that happens to share tensor shapes. That is the difference between "the extra parameters explain the margin" and "this particular feedforward head explains the margin".

(iii) A genuinely parameter-matched memoryless model does not close the gap. The decisive check the original section never ran: widen rp_only until it has ≈5602 parameters and compare it against grp_k0. Two knobs, 8 seeds each, frozen steady:

condition               params      mean   grp_k0 wins   per-seed ratio vs grp_k0
--------------------------------------------------------------------------------------
rp_only D=32              1442  5.257e-05      8/8   2.47 2.30 1.54 1.48 5.46 2.36 2.53 1.85
rp_only D=86              3548  3.915e-05      8/8   1.57 1.33 1.36 1.38 2.33 1.05 2.88 2.48
rp_only D=139             5615  1.046e-04      7/8   1.82 6.84 1.41 1.33 2.07 0.99 15.5 1.86
rp_only cppn_hidden=141   5584  7.195e-05      8/8   5.58 2.51 2.78 2.08 6.13 1.67 3.84 3.02
grp_k0_nostate            5602  2.170e-05      4/8   1.49 0.92 1.33 0.92 0.90 1.08 0.78 1.10
grp_k0                    5602  2.101e-05        —

Reproduction: frozen.py's CLI exposes neither width knob, so these rows came from a throwaway driver that calls frozen._train and frozen._frozen unchanged against an Organism(hidden_dim=..., cppn_hidden=...) built in _build's exact order, so the RNG stream matches. No file in experiments/ or ailed/ was modified. The driver is pinned by reproducing grp_k0_nostate seed 0 at 2.588e-05, bit-for-bit the value in §1a's per-seed table.

D=86 is matched to the effective 3554; D=139 and cppn_hidden=141 to the nominal 5602. Parameter-matched by either knob, the memoryless RP gets worse, not better — D=139 means 1.046e-04 against the 1442-parameter RP's 5.257e-05 — and grp_k0 still wins 7/8 or 8/8 seeds at every width tried. Only grp_k0_nostate, which adds the gated head rather than width, closes it.

The corrected claim. The 2.5x margin is not capacity: capacity added as RP width makes the memoryless model worse. The margin comes from the gated post-RP nonlinearity (1−σ(W_g[h‖0]))·tanh(W_c[h‖0]), which grp_k0_nostate supplies with no memory at all. The null for memory is unchanged and if anything sharper: state is still worth 1.06x on 4/8 frozen and 1.19x on 11/16 trained, and the mechanism that does the work is the gate acting as a nonlinearity, not as a memory controller.

Limitation, stated rather than tuned. The wide rp_only runs use this file's lr=1e-3 and 8000-step budget unchanged, and a wider model may be lr- or init-limited at that budget. Two of the D=139 seeds destabilise outright — seed 1 at 1.133e-04 and seed 6 at 5.451e-04, against a same-condition median of 3.0e-05 — so the D=139 mean is carried by those two and should be read as instability, not as a clean loss. They are reported and not tuned: retuning a baseline until it catches up changes the question instead of answering it (AGENTS.md). What the runs establish is the negative — added width does not buy the margin — not a tight estimate of how a well-tuned wide RP would do.

2. Part B — what does the state know?

Linear decode from a per-entity representation to the world's regime id. Test split is the last 30% of the frozen phase, taken as a suffix in time so the probe cannot memorise adjacent steps: 2800 training steps × 16 entities = 44 800 samples, 1200 test steps, ~20 switches per seed.

Chance is measured, not assumed. Two nulls, each refitting the probe from scratch: shuffle permutes the step labels (keeping a step's 16 entities together), shift circularly shifts the label sequence, which also preserves each regime's 40-80 step block structure and is therefore the stricter of the two — a probe that merely tracks slow drift still scores at the shift level. Both land near 0.27, above the naive 1/4 = 0.25, which is exactly why the brief asked for it to be measured.

representation                    acc   shuffle   shift      gap  seeds > chance
---------------------------------------------------------------------------------
rp_only        h,  least squares 0.342    0.289   0.274   +0.067        8/8
rp_only        h,  logistic      0.341    0.289   0.276   +0.065        8/8
rp_only        h,  entity-centred0.341    0.289   0.274   +0.067        8/8
grp_k0         h,  least squares 0.338    0.292   0.274   +0.065        7/8
grp_k0         h,  logistic      0.344    0.299   0.275   +0.069        7/8
grp_k0         M,  least squares 0.332    0.287   0.273   +0.058        7/8
grp_k0         M,  logistic      0.332    0.293   0.276   +0.056        7/8
grp_k0         M,  entity-centred0.333    0.287   0.273   +0.060        7/8
grp_k0_nostate M,  least squares 0.325    0.288   0.275   +0.050         --

The claim under test fails. The regime is weakly decodable from M — and equally weakly decodable from the memoryless RP's h, and from the h inside the very same GRP organism, which is the comparison that holds the weights fixed. M is consistently the worst of the three. The GRP's state has not built a regime variable; it has not even preserved as much regime information as the layer feeding it.

The last row settles what the +0.05 is: the state-ablated GRP, whose M is a fixed function of the current h with nothing carried between steps, decodes at 0.325. The signal is an instantaneous read-off of the particle configuration — the field the regime is currently imposing is visible in r right now — not something a memory accumulated.

Three ways the null was stressed, none of which changes it:

  • Estimator. Multinomial logistic (LBFGS, strong Wolfe) matches least squares to within 0.006 everywhere. Not a least-squares artefact.

  • Entity identity. M is dominated by stable per-entity structure (the particle's type). Subtracting each entity's own train-split mean, in case a regime code hides under that offset, moves accuracy by ≤0.002.

  • Target. The regime id is an arbitrary label over four random coupling matrices; what entity i actually needs is its own row k[t_i, :] of the current one. Probing each of the three signed entries as a 3-class problem, against measured chance:

    representation      acc   chance     gap   above chance
    -------------------------------------------------------
    rp_only        h  0.514    0.488  +0.025        20/24
    grp_k0         h  0.517    0.484  +0.033        22/24
    grp_k0         M  0.506    0.482  +0.024        21/24
    

    Same picture on the target the domain actually rewards: M last, h no worse.

Adaptation latency

Reported for completeness and not interpretable. Decoding the regime per step by averaging the 16 entities' probe scores, the mean number of steps from a switch to the first correct decode is 12.0 for M and 10.7 for rp_only's h — but 40 of 164 switches never decode correctly before the next switch arrives. A latency measured off a probe running 5 points above chance is measuring the probe's noise. The honest statement is that neither representation supports reliable regime decoding, so neither has a measurable adaptation latency by this route.

3. What the state is doing instead

The gate, measured over every frozen step and entity:

condition        mean g     sd   frac g>0.9   frac g<0.1
---------------------------------------------------------
grp_k0            0.500  0.029        0.000        0.000
grp_k0_nostate    0.509  0.025        0.000        0.000

g = σ(W_g[h‖M] − κa) with κ = 0. A mean of 0.500 with sd 0.029 and no saturation in either direction, on every seed, means the gate's pre-activation is sitting at zero. The weights that produce it did move — Task 11 measured a displacement of 26.8% of their initial norm, larger than any other block's; what stayed put is the function, because the displacement remained inside the band where the sigmoid is linear. See §6. The update M ← (1−g)M̃ + gM degenerates to a fixed 50/50 blend — a two-step exponential moving average of tanh(W_c[h‖M]), with no input dependence. Nothing is being decided about what to keep.

Persistence confirms there is no long integration to point at. Lag-1 autocorrelation and the lag at which it falls below 1/e, per channel:

condition        rep   lag-1     tau
--------------------------------------
rp_only          h     0.964    18.1
grp_k0           h     0.960    14.0
grp_k0           M     0.980    13.6
grp_k0_nostate   M     0.959    13.1

M is marginally smoother at lag 1 than the h it is built from, and less persistent over the 1/e horizon than the memoryless RP's own h. Representations in this domain are slow because the world is slow, not because anything is integrating them.

4. Which one understands the domain?

Neither, and the question does not currently have a mechanism to attach to.

There is no evidence in this experiment that either model has come to represent which regime the world is in. The regime is weakly present in both models' representations at about +0.05 over a measured chance of 0.27, and it is present in exactly the same amount in a network with no state at all, which identifies it as an instantaneous read-off of the visible configuration rather than an internal variable either organism built.

What the frozen probe does establish, and it is worth having:

  • The margin is real and it is not a learning-rate artefact. With every weight bit-frozen, the gated architecture predicts 2.5x better than the plain relational perceptron, on 8 seeds out of 8. Task 7's lr objection is answered: no optimiser step is available to either model here.
  • The margin is not memory. It is 4160 extra feedforward parameters. Ablating the state while keeping them preserves the entire effect (1.06x, 4/8 seeds) and leaves the recovery curve unchanged at every lag.
  • The GRP's gate does not gate. It is not untrained — that reading is corrected in §6. It sits at 0.5 with no input dependence, which is a sufficient mechanistic explanation for both nulls and is a fact about this setup, not about the architecture.

The last point is the actionable one. This is a measured null about this domain and this training budget, not an impossibility result. The gate never learned to gate, and §1b explains why it had no reason to: the post-switch error is dominated by the world's own configuration transient, which no amount of state can shorten. A domain where regime identity is worth something to a per-entity state — where the transient is short and the ambiguity is long — would give the gate a job. This one does not, which is the same conclusion §6(c) of headroom.md reached from the other direction.

5. Consequences for A1

  • Do not claim A1 as a memory result on this domain. The frozen-weights version of the comparison, which is the strongest form available, attributes the margin to capacity. Any A1 comparison of rp_only to grp_k0 is confounded 3.9x on parameter count and needs grp_k0_nostate alongside it, in the trained setting too, where the same decomposition gives capacity 3.04x on 16/16 seeds and state 1.19x on 11/16 (medians 2.71x and 1.11x, re-measured at 16 seeds by Task 8; see a1.md).
  • Task 7's requirement 2 inherits this. The 2.99x at lr=1e-3 and the frozen-regime reliability argument in headroom.md §5 were both measured without a capacity control. Neither is safe to quote as a memory claim as it stands. The frozen-regime runs should be re-run with grp_k0_nostate before §5's "memory reaches the floor every time" sentence is carried into the paper.
  • recovery[k] is not an adaptation measurement in this domain. It tracks the world's post-switch transient, and a stateless frozen model reproduces its shape. Any A1 claim phrased on recovery curves needs a different observable.

6. Correction (Task 11): the gate's weights moved; its function did not

This file originally read g = 0.500 ± 0.029 as meaning the gate was untrained. results/credit.md measured the weights directly and that reading is wrong.

  • grp.gate.weight moved 26.8% of its initial norm over training — more than any other block (cand 19.0%, out 15.3%, feat 4.4%). The gate is among the most-updated parameters in the model, not the least.
  • What did not move is the function. On identical inputs the trained weights give g = 0.5008 ± 0.0270 and the weights at initialisation give g = 0.5009 ± 0.0203. The displacement stayed inside the ±0.1 pre-activation band where the sigmoid is linear, so a large change in the weights produces no change in behaviour.
  • The gradient is coherent, not cancelling: 0.202 against its own measured sign-flip null of 0.163, above null on 14/16 seeds. And 0.587 of it arrives through the truncated-BPTT window, making the temporal path 1.187x the per-step one.

Two things follow for anyone quoting this file.

Do not lead with the gradient magnitude. The gate's mean gradient norm is 887x smaller than cand's on identically shaped tensors, and that number is not the story: Adam is scale-invariant, and the per-coordinate signal-to-noise ratio it actually consumes is comparable across blocks (gate 0.066, cand 0.070, out 0.079).

"Untrained" was the wrong word and it pointed at the wrong hypothesis. It suggested the training signal never reached the gate, which Task 11 falsified. What is true is narrower: the gate receives a coherent signal, mostly through time, moves a long way in weight space, and lands somewhere functionally indistinguishable from where it started.

credit.md Part B says why that is not merely a tuning accident: M cannot hold the regime even when an auxiliary loss 5.8e4 times the main one demands it, while the same head installs the entity type at 0.738 against chance 0.333. The state update can represent per-entity properties and cannot represent this one.

7. Correction (Task 11): the probe figures here are linear-probe figures

Part B's decodes, and the "roughly a fifth of the available signal" reading they support in when_memory_works.md §4, come from a linear probe. An MLP probe on the same runs reads the regime from M at a gap of +0.159 where the linear probe reads +0.064, and from the memoryless h at +0.234.

The relative claim is unchanged and is what this file argues from: M holds no more about the regime than the h it is built from, and on the MLP probe it holds visibly less. The absolute fraction needs the qualifier wherever it is quoted.