Echo-Mirror-RSI / code /README.md
PureOne's picture
Publish Echo-Mirror RSI v2 research dataset and reproducibility files
0a4f337 verified
|
Raw History Blame Contribute Delete
9.09 kB
# Version 1 calibration documentation
For the current recursive comparator and learned-proposer experiment, see [v2_README.md](v2_README.md). The text below records the earlier calibration protocol.
# Echo-Mirror finite-dimensional reference experiment
This directory contains an executed, reproducible **response-preservation experiment** for the Echo-Mirror research manuscript. The experiment asks which information a compressed state must retain to reproduce the outputs of a recursively composed editing process.
It is not an autonomous RSI demonstration, an LLM training experiment, or evidence of a new observability algorithm. The standard observable quotient is included as an explicitly equivalent comparator. The categorical construction discussed in the manuscript is not executed by this numerical prototype.
## Reproduce
Python 3.10 or later and NumPy are sufficient. From this directory:
```bash
python -m pip install -r requirements.txt
OPENBLAS_NUM_THREADS=1 OMP_NUM_THREADS=1 python run_experiments.py --output ../results --seeds 32
```
On Windows, set the two environment variables before invoking Python, or omit them. Omitting them does not change the mathematical protocol, but it may change low-order floating-point differences and timings.
For the structural assertions alone:
```bash
python run_experiments.py --self-test
```
All random streams are local NumPy generators with explicit seeds. Basis construction never receives the evaluation states, mixtures, or trajectories. The script saves a SHA-256 hash of its own source in the result metadata.
## The finite mechanism
Let `z` be a column vector in `R^d`, `T_i` a finite library of edit matrices, `J z` the required response, and `P z` the protected coarse wave view. Starting from
```text
W_0 = row(P, J),
W_(k+1) = span(W_k, W_k T_1, ..., W_k T_m),
```
the algorithm stops when the row-space dimension stabilizes. For an orthonormal row basis `Q` of the resulting invariant space,
```text
compressed state: q = Q z
compressed edit: q_next = (Q T_i Q^T) q
compressed response: J z = (J Q^T) q.
```
The identities follow from `J = J Q^T Q` and `Q T_i = Q T_i Q^T Q`. They preserve every finite word of the certified edit library and every matrix in its linear span. If the edit choice is a deterministic function of preserved responses, the same identities preserve the adaptive choices by induction.
This finite closure is the usual observability/Krylov invariant-space computation. The label `recursive_echo` denotes its proposed role inside the Echo-Mirror research design, not a claim that the closure formula is new.
## Fixed protocol
| Quantity | Setting |
|---|---:|
| Ambient state coordinates | 64 |
| Protected Haar coarse coordinates | 4 |
| Required response coordinates | 4 |
| Immediate completion rank | 6 |
| Designed invariant response rank | 16 |
| Edit-library matrices | 3 |
| Independent system seeds | 32 |
| Evaluation trajectories per seed and mode | 16 |
| Recursive edits per trajectory | 24 |
| Held-out adaptive candidate mixtures | 9 |
The matrices are constructed in Haar wave coordinates. A seed-specific rotation mixes detail coefficients while preserving the four coarse modes. Sixteen coordinates form an observable response chain. The other 48 coordinates form a separate nuisance subsystem and cannot influence the response under the original three edit maps. **The low observable rank is imposed by the synthetic design. It is not a discovery about natural learning problems.**
The first experiment uses new states and independently sampled convex mixtures of the three edit maps at every step. The second experiment is a closed adaptive loop: each representation greedily chooses the candidate mixture with the smallest predicted squared next-response norm. Each selected sequence is also executed on its own full-state shadow, exposing errors that might otherwise look like predicted improvement.
The evaluation generalizes to new states, mixtures, and compositions within a certified operator span. It does not test transfer to unseen natural task families or new unrestricted edit programs.
## Comparators
- **Full state:** 64 coordinates, uncompressed reference.
- **Wave only:** four coarse Haar coordinates.
- **Immediate echo:** six coordinates preserving all current protected and response observations.
- **Random echo:** the same six observations plus random directions, for 16 coordinates total. This matches retained dimension and reduced update matrix dimensions, not preprocessing cost.
- **Recursive echo:** 16-dimensional invariant closure of the protected and response observations.
- **Classical observable quotient:** ordinary invariant closure of the response alone. This structured instance yields the same 16-dimensional space as recursive echo, so equivalent performance is expected and observed.
## Recorded results
The table reports pooled relative trajectory error:
```text
sqrt(sum over seeds, states, steps, outputs of (prediction - reference)^2
/ sum over the same indices of reference^2).
```
The initial response is included. Adaptive error compares independently chosen closed-loop trajectories; shadow error and action-disagreement metrics are separately available in the raw files.
| Representation | Coordinates | Open-loop relative error | Adaptive relative error | Adaptive action disagreement |
|---|---:|---:|---:|---:|
| Full state | 64 | 0 | 0 | 0% |
| Wave only | 4 | 0.732785 | 0.756500 | 82.0068% |
| Immediate echo | 6 | 0.386667 | 0.415833 | 66.1296% |
| Random echo | 16 | 0.371150 | 0.398935 | 65.6982% |
| Recursive echo | 16 | 9.11e-15 | 7.81e-15 | 0% |
| Classical observable quotient | 16 | 4.81e-15 | 4.68e-15 | 0% |
The recursive rank trace is `6, 8, 10, 12, 14, 16, 16` for every constructed system. The final repeated dimension confirms stabilization. The maximum absolute recursive-echo response error across all open-loop tests is approximately `7.25e-15`; across adaptive tests it is approximately `3.39e-15`.
These differences support the necessity of preserving recursively visible directions. They do not establish a gain over classical observability reduction, and they do not establish that the simulated process improves its own learning rule.
## Explicit failure and repair cases
### Same current response, different future
The script includes the exact three-coordinate example
```text
P = J = [1, 0, 0]
T = [[1, 1, 0], [0, 1, 1], [0, 0, 1]]
x = [0, 0, 0], y = [0, 0, 1].
```
The current outputs agree. Their one-step outputs also agree. After two edits, the outputs are `0` and `1`. The closure ranks are `1, 2, 3, 3`; all three coordinates are needed for exact indefinite response preservation in this example.
### A new edit invalidates the old certificate
In the 64-coordinate benchmark, the script adds one new edit that reads discarded latent coordinate 16 into response coordinate 0 with coefficient `0.25`. The previously certified 16-coordinate quotient then has response error `0.25` on the corresponding hidden-state direction.
Recomputing closure with this new map restores exactness but expands the retained space to all 64 coordinates. The nuisance subsystem is generically mixed, so admitting one read into it makes the whole subsystem relevant. This is an intended boundary case: self-modification outside the certified edit family requires renewed analysis and can remove the compression benefit entirely.
## Costs and what is counted
The 64-to-16 reduction saves 75% of **state coordinates** in this constructed instance. This is not a claim of 75% total training-memory savings. A dense 16-by-64 basis has 1,024 coefficients, three reduced edit matrices have 768 coefficients, and the reduced response matrix has 64 coefficients. The main program keeps all baselines and full-state shadows for evaluation, so its actual working memory exceeds the deployable quotient representation.
The metadata separately records state, basis, operator, and readout scalar counts; closure timings; and a small fixed-matrix arithmetic microbenchmark. The timing experiment excludes operator/Jacobian discovery, basis construction, transfers, model training, and certification renewal. It must not be presented as an end-to-end RSI or LLM speedup.
## Outputs
| File | Contents |
|---|---|
| `summary.json` | Protocol, exact configuration, environment, source hash, aggregate results, rank traces, timings, counterexamples, and limitations |
| `per_seed_metrics.csv` | All 384 method-by-seed-by-mode rows |
| `aggregate_metrics.csv` | Means, standard deviations, minima, maxima, and pooled errors across seeds |
| `algebraic_diagnostics.csv` | Numerical response-factorization, invariance, and orthonormality residuals |
| `closure_timings.csv` | Basis construction times for each seed and relevant method |
| `seed0_trajectories.npz` | Complete representative trajectories, full-state shadows, and adaptive selections |
No external model, data download, GPU, network access, or paid service is required to reproduce this experiment.