aien-train
AIEN training programme: language-model history, GB10 constraints and the route to training on the project engine. Plans and runnable checks are distinguished.
Brought by drakestapleton
aien-train / docs / si19 / CONTRACT.md
| 1 | # aien-train#19 offline experiential world model (host, standalone) |
| 2 | |
| 3 | This is an offline standalone experiment for aien-train#19. It is not M23/M24 |
| 4 | (AIEN_0) qualification, not an EST-4+ estimator and not a production input. |
| 5 | EST-3 is FAILED on architecture main, so this module stays outside any runtime, |
| 6 | default build or test target, like the `src/estimation` pattern |
| 7 | (CURRENT_EXECUTION_PLAN Lane 7). M20-M22 remain NOT QUALIFIED. This module adds no |
| 8 | new tensor, autodiff or optimizer. It is a consumer of the aien-train#15 |
| 9 | native step, merged on main as c9782bfd, and any T2 result inherits that status. No sealed G3 holdout exists |
| 10 | (sealing is BLOCKED_OPERATOR), so the held-out numbers here are development |
| 11 | results, not sealed results. |
| 12 | |
| 13 | ## Data source |
| 14 | `native/si19/fixture.om` is a FIXTURE. It is a seeded, resettable micro-world |
| 15 | that stands in for Omega X1 `ExperienceTransition` (omega-mv#699, not on main). |
| 16 | Transitions come from executing fixed dynamics. No model, teacher, corpus or |
| 17 | self-distillation produces them: |
| 18 | |
| 19 | - observation: p in -12..12, v in -3..3; action u in {-1,0,1}; |
| 20 | - dynamics: p2 = p + v and v2 = v + gain*u + gust, where gust is -1 or +1 with |
| 21 | probability 1/8 each; |
| 22 | - env A has gain +1 and env B has gain -1 (reversed action); |
| 23 | - a transition is terminal when it leaves the bounds or reaches step 7. A terminal |
| 24 | record keeps its true successor, and the next record starts from a fresh reset; |
| 25 | - the behaviour policy is seeded uniform random; |
| 26 | - training resets p into -12..-4. |
| 27 | |
| 28 | ## Model and trainer (`native/si19/world.om`) |
| 29 | - The model is an affine map (p,v,u) -> (p2,v2) with W[3,2] and b[2], 8 binary32 |
| 30 | parameters, randomly initialized from a seed in {-4..3}/16. There is no prior. |
| 31 | - Each update is one call to the pinned `afstep` (`docs/si19/dependencies.json`): |
| 32 | L720 add32/mul32 forward, sum-squared loss, the explicit gradient and SGD with |
| 33 | lr = 2^-9. Each batch has two experiences. |
| 34 | - Bounded replay keeps two rings of 64 experience ids. There are 4 updates per |
| 35 | admitted experience. |
| 36 | - Arms: |
| 37 | - M is trained on A, then on B with one A-replay sample per batch; |
| 38 | - N is a copy of M after A, then trained on B only; |
| 39 | - S is the shuffled-experience control: same ring and schedule, but each row's |
| 40 | inputs and outcome come from independently drawn experiences; |
| 41 | - MA and INIT are frozen snapshots. |
| 42 | - Lineage: per arm, `WS` counts how many applied batches used each experience |
| 43 | id. `wsaffect arm id` answers "did id contribute?" for #20. The counts are |
| 44 | saved in the checkpoint. |
| 45 | - All resumable state is in WS, TL (the experience log) and FS (fixture |
| 46 | streams). The checkpoint is a 51752-byte image: magic, version, cell count, |
| 47 | event, the state, then FNV-1a 64. FNV-1a detects damage but does not |
| 48 | authenticate. Admission checks length, magic, version, size, checksum and |
| 49 | semantics (event range, ring counts, update count, finite parameters, ring |
| 50 | ids, encoded ranges) before it replaces any state. |
| 51 | |
| 52 | ## Evaluation |
| 53 | For each environment, a separate seed and a wide reset region generate 128 |
| 54 | held-out transitions. Every held-out (p,v,u) key is absent from that |
| 55 | environment's training experience, and held-out ids sit outside the training id |
| 56 | range. The metric is mean squared error over (p2,v2), computed in binary32. |
| 57 | |
| 58 | The model is compared with these baselines: |
| 59 | |
| 60 | - persistence rule; |
| 61 | - constant-velocity rule; |
| 62 | - frequency mode (exact key, falling back to the per-action modal delta); |
| 63 | - nearest-neighbour retrieval, both raw and delta-transfer; |
| 64 | - the shuffled control; |
| 65 | - the init model. |
| 66 | |
| 67 | The true-mean-dynamics predictor is shown only as a noise-floor reference (it |
| 68 | uses hidden fixture knowledge). Forgetting is measured as error on held-out A |
| 69 | after B, with and without replay. |
| 70 | |
| 71 | ## Build and run |
| 72 | `sh tests/si19/run.sh` is disclosed POSIX host glue, kept as the replay |
| 73 | runner. It holds no training, check or verdict logic; all of that is in the .om |
| 74 | units. Its Omega replacement path is an OM2 conductor in .om that performs the |
| 75 | same materialize, hash, build, run and compare steps, as the #14-#16 contracts |
| 76 | do with runner recipes; until that lands the script stays disclosed host glue. |
| 77 | It does the following: |
| 78 | |
| 79 | 1. Materializes the four pinned sources from Git objects and checks their |
| 80 | SHA-256 values (`docs/si19/deps.sha256`). |
| 81 | 2. Checks the compiler hash. |
| 82 | 3. Builds `world-test` and the `world` driver with `quiet-build`. |
| 83 | 4. Runs the tests. |
| 84 | 5. Runs an uninterrupted job, then stops at events 100 and 300, resumes each in a |
| 85 | new process and requires the final images and reports to be byte-identical. |
| 86 | 6. Requires refusal of damaged and truncated images. |
| 87 | 7. Runs six fault-injected units. Each must compile and fail the unchanged test. |
| 88 | |
| 89 | Results go to `evidence/SI19/run/`. ELF files and images stay in a temporary |
| 90 | build directory. |
| 91 | |
| 92 | `tests/si19/world-test.om` contains: |
| 93 | |
| 94 | - an exact integer golden oracle for two real trainer updates (forward, loss, |
| 95 | dW, db and the committed parameters); |
| 96 | - a forward-only consistency check; |
| 97 | - fixture determinism, seed sensitivity and transition-boundary checks; |
| 98 | - exact lineage counts and the shuffle wiring; |
| 99 | - held-out key and id separation; |
| 100 | - in-process restart at 10 cut points; |
| 101 | - checkpoint refusals that leave state unchanged. |
| 102 | |
| 103 | ## Not covered |
| 104 | The following remain outside this module: |
| 105 | |
| 106 | - calibration and uncertainty outputs; |
| 107 | - curiosity and active experiments; |
| 108 | - consent and revocation enforcement (#20, Open Humanity); |
| 109 | - Cortex/X1 records; |
| 110 | - sealed evaluation; |
| 111 | - GPU or simulator execution; |
| 112 | - a pretrained-adviser comparison; |
| 113 | - energy measurement. |