|
Download code/v2_README.md from PureOne/Echo-Mirror-RSI: direct link, hf CLI and curl.
- Browser
- Download file 13 kB
-
https://huggingface.co/datasets/PureOne/Echo-Mirror-RSI/resolve/main/code/v2_README.md
- Command line
-
hf download hf://datasets/PureOne/Echo-Mirror-RSI/code/v2_README.md
-
curl -L -o v2_README.md https://huggingface.co/datasets/PureOne/Echo-Mirror-RSI/resolve/main/code/v2_README.md
13 kB
| # Echo-Mirror V2: learned response-gated program proposals | |
| This experiment goes beyond preserving a designer-supplied scalar recurrence. It **actually searches for two-step optimization programs**, uses measured outcomes to update the next generation's parent choices and gate-parameter proposal distribution, and evaluates generated programs on held-out initial states. | |
| The search algorithm itself remains fixed. This is bounded evolutionary program synthesis with a learned proposer, not unrestricted RSI or autonomous rewriting of the search algorithm. No LLM or natural-task benchmark is included. | |
| ## Reproduce | |
| From the package root: | |
| ```bash | |
| OPENBLAS_NUM_THREADS=1 OMP_NUM_THREADS=1 python code/v2_gated_program_search.py --seeds 8 | |
| OPENBLAS_NUM_THREADS=1 OMP_NUM_THREADS=1 python code/v2_compiler_costs.py | |
| python code/v2_paired_analysis.py | |
| ``` | |
| The preserved failed pilot can be reproduced separately: | |
| ```bash | |
| OPENBLAS_NUM_THREADS=1 OMP_NUM_THREADS=1 python code/v2_unbounded_gate_pilot.py --seeds 8 | |
| ``` | |
| The pilot writes `v2_pilot_*` files and does not overwrite the confirmation results. NumPy is the only required numerical dependency. Matplotlib is needed only for optional figure regeneration. | |
| ## What changes autonomously | |
| Each generated field combines two parent fields with response-dependent softmax weights. Its gate parameters are sampled from a learned Gaussian proposal distribution. Every generation: | |
| 1. Generate candidate two-field optimization programs. | |
| 2. Execute them on four training initial states and measure actual loss. | |
| 3. Select the three highest-performing candidate pairs. | |
| 4. Reuse their field programs as parents, with a 20% probability of restarting from a primitive field. | |
| 5. Update the Gaussian gate-parameter mean and scale from the elite parameters. | |
| The next generation therefore uses a different proposal mechanism because of evidence from the previous generation. The mean update is `0.65 * old + 0.35 * elite_mean`; the scale update is `0.8 * old + 0.2 * elite_std`, clipped to `[0.12, 2.4]`. The mutation and selection code, number of responses, primitive vocabulary, and acceptance metric are supplied by the designer. | |
| ## Task and program grammar | |
| There are eight independently constructed quadratic systems, each with state dimension 24. For each system, | |
| `L(x) = x^T H x / 2`, with spectrum of `H` between `0.04` and `1`. | |
| The twelve primitive fields are `u_i(x) = -P_i H x`. Their preconditioners are convex mixtures of four supplied SPD matrices, with | |
| `0.2 I <= P_i <= 4 I`. | |
| The two protected responses are `h(x) = (L(x), c^T x)`. A generated field is a softmax-weighted convex combination of two earlier fields, with logits affine in `h`. The experiment uses five synthesis generations. Each candidate program applies two of these fields by Euler updates with step size `0.15`; their order is selected by the method being evaluated. | |
| Twenty-four fresh initial states per system are used for evaluation. Neither their losses nor diagnostic results update the proposer. This is held-out-state generalization within the same quadratic objective, not transfer to new natural task families. | |
| ## The bounded repair and the retained failure | |
| The initial pilot used unbounded affine gates and a normalization fitted at one anchor. Its bracket compiler was accurate, but several learned programs catastrophically overfit the four training states. The pilot's final mean held-out loss ratio for the corrected proposer was approximately `119196`, despite a median of approximately `0.6664`. That failure remains in the package. | |
| The confirmation uses convex softmax gates and no anchor-fitted renormalization. It also changes the primitive norm bound from the pilot's `1` to `4`; pilot-to-confirmation numerical differences are therefore **not a controlled single-factor comparison**. Confirmation uses new seeds, with offset `203611080`; the pilot used `202611080`. | |
| The repair has an analytical guarantee. Every generated field remains `-P(x) g` with `0.2 I <= P(x) <= 4 I`. Since `||H||=1`, for `epsilon=0.15`: | |
| `L(x - epsilon P(x)g) <= L(x) - 0.105 g^T P(x)g`. | |
| Thus every actual update is a descent step, independently of gate depth and gate derivatives. The claim is about this restricted SPD grammar. It does not guarantee generalization quality, search superiority, or stability for arbitrary self-generated code. | |
| ## Compiler and controls | |
| At each current evaluation state, construct the primitive loss-bracket matrix `C`, the response-action matrix `K = Dh U`, and | |
| ```text | |
| T = [[C, K^T], [-K, 0]]. | |
| ``` | |
| A row-orthonormal factor `A` of the range of `T` produces the exact finite score representation `e = A (b,s)`, where `s = (Db)^T q`, `q = U^T grad L`. The implementation propagates this representation directly through the recursively generated gates; it does not materialize every full generated-field Jacobian to make the decision. | |
| The experiment includes a strong raw contracted first-jet baseline, storing `(b,s)` directly, and a full field/Jacobian oracle. Both produce the same search trajectories as the quotient compiler. No discovery-quality advantage over these exact baselines is asserted. | |
| For the chosen primitive class, `v_i = Du_i^T grad L = H u_i`, so the primitive loss-bracket matrix is **exactly zero**: `C = U^T H U - U^T H U`. All nonzero leading-order loss-order effects arise from the generated response gates. This is a useful special case for testing the gate correction, not evidence that real learning systems always have this structure. | |
| The resulting compiler rank is four at all training anchors. Rank `T` is a valid representation dimension for the restricted convex grammar. Its minimality for that restricted grammar is not claimed. | |
| The gate-blind ablation drops gate derivatives. As its exact primitive `C` is zero, it has no leading-order ordering information here. A common score tolerance of `1e-12` makes a tie choose the listed order, avoiding decisions based on floating-point noise. | |
| ## Primary outcome: proposal quality improves | |
| The primary outcome is the average actual held-out loss ratio of **all programs proposed in a generation**, not only the best observed program. Lower is better. The ratio is loss after two actual Euler updates divided by initial loss. | |
| | Generation | Learned corrected proposer | Frozen proposer | No-feedback lineage | | |
| |---|---:|---:|---:| | |
| | 1 | 0.562978 | 0.562978 | 0.562978 | | |
| | 2 | 0.538844 | 0.566852 | 0.567689 | | |
| | 3 | 0.531191 | 0.569024 | 0.568709 | | |
| | 4 | 0.523380 | 0.566072 | 0.565415 | | |
| | 5 | 0.522117 | 0.564509 | 0.565118 | | |
| The learned proposer has lower final mean proposal loss than the frozen proposer in all eight systems, a **7.51% relative reduction in proposed residual loss** on average. It also improves over its own first-generation proposal law in all eight systems. | |
| A paired percentile bootstrap over the eight systems (100,000 resamples; seed 811827) gives an absolute proposal-loss improvement of `0.0423918`, with a descriptive 95% interval `[0.0291087, 0.0558601]`. The corresponding relative interval is `[5.15%, 10.05%]`. The independent units are systems, not the many correlated states or candidate programs. With only eight constructed systems these are descriptive uncertainty summaries, not evidence of broad general-purpose superiority. | |
| The frozen proposer keeps the original parameter distribution and primitive parent pool. The no-feedback lineage grows programs but chooses parents without using their outcomes. Both still return the best training-observed candidate; “no feedback” refers to how the next proposals are generated. | |
| ## The best-found result is mixed | |
| | Method | Final mean proposed held-out loss ratio | Held-out loss of training-selected best program | | |
| |---|---:|---:| | |
| | Corrected compiler | 0.522117 | 0.510875 | | |
| | Raw contracted first jet | 0.522117 | 0.510875 | | |
| | Full field/Jacobian | 0.522117 | 0.510875 | | |
| | Gate derivatives dropped | 0.522736 | 0.511497 | | |
| | Random order with learned proposals | 0.524332 | 0.511341 | | |
| | No-feedback lineage | 0.565118 | 0.516940 | | |
| | Frozen proposer | 0.564509 | **0.509018** | | |
| | Direct two-order tournament | 0.536422 | 0.517450 | | |
| The frozen proposer finds a slightly better final best program on average than the learned proposer. Thus the experiment supports improved **proposal yield**, but not a general advantage in best-solution discovery. The gate correction's effect on final task loss is small, despite its large effect on ordering prediction accuracy. These distinctions must remain visible. | |
| The paired best-found difference, oriented so positive favors the corrected proposer, is `-0.0018570`, with interval `[-0.0108761, 0.0051623]`. The mean-proposal difference against the gate-blind ablation is `0.0006185`, with interval `[-0.0001691, 0.0015102]`. Both include zero. In particular, this experiment does **not** show that the gate correction causes the observed outer proposal-learning improvement. | |
| The supplied quadratic Hessian also permits an exact Newton step. This study is not evidence of state-of-the-art quadratic optimization or superiority over all conventional optimizers. | |
| ## Compiler fidelity and finite-step limitations | |
| On 1,920 separately evaluated generated-program pairs: | |
| - Maximum compiled-versus-full-Jacobian bracket error: `3.55e-15`. | |
| - Raw contracted first jet and the quotient produce the same complete search outcomes as the full-Jacobian implementation. | |
| - Corrected bracket prediction chooses the better actual finite-step order on **85.36%** of non-tied probes. | |
| - Gate-blind prediction chooses it on **47.5%**. | |
| Exact bracket preservation is not exact preservation of finite-step loss ordering. The finite-step expansion has a remainder, and the observed ordering errors show that it matters. Every candidate is selected using actual executed loss, not its bracket prediction alone. | |
| ## Budget and practical cost | |
| Every method executes 240 training two-step programs per system. Each actual program execution evaluates the entire twelve-field primitive basis at both steps: **5,760 primitive field evaluations per method and system**. The direct tournament evaluates both orders with half as many candidates, preserving this training execution budget. | |
| Prediction arithmetic, the supplied primitive Jacobian matrices, gate compilation, and update operations are not FLOP-matched. Test-only measurements and compiler diagnostics are separately counted and never enter training. In particular, the direct tournament also spends twice as many executions per evaluated test candidate when choosing its actual better order. The study does not claim end-to-end compute or wall-clock superiority. | |
| The independent compiler microbenchmark constructs 120 generated nodes, reaching depth ten. Per-node cached numerical score representations use: | |
| | Representation | Scalars per generated node | | |
| |---|---:| | |
| | Skew quotient | 4 | | |
| | Raw contracted first jet | 14 | | |
| | Full field plus Jacobian | 600 | | |
| These counts exclude generated program source, gate parameters, shared primitive matrices, objective state, and the rest of the search algorithm. The shared primitive matrices contain 6,912 scalars, and the recorded shared compiler factors contain 84 scalars. | |
| On the recorded small Python run, compiling all 120 nodes took approximately 2.18 ms for the quotient, 2.11 ms for the raw contracted first jet, and 3.26 ms for full field/Jacobian reconstruction. Therefore the quotient **did not beat the raw contracted first jet in this implementation's runtime**. The clear measured distinction is cached score dimension. Setup took approximately 0.067 ms with already supplied exact primitive matrices. Timing is hardware dependent and is not an LLM speed estimate. | |
| ## Files and evidence status | |
| | File | Purpose | | |
| |---|---| | |
| | `v2_gated_program_search.py` | Bounded confirmation, synthesis loop, exact compilers, controls, and raw records | | |
| | `v2_unbounded_gate_pilot.py` | Preserved failed pilot | | |
| | `v2_compiler_costs.py` | Setup and per-node update microbenchmark | | |
| | `results/v2_program_summary.json` | Confirmation configuration, aggregates, scope, costs, and diagnostics | | |
| | `results/v2_program_search.csv` | Every seed, method, and generation | | |
| | `results/v2_bracket_diagnostics.csv` | Every compiler/order probe | | |
| | `results/v2_program_costs.csv` | Execution counts and measured times | | |
| | `results/v2_compiler_costs.json` | Shared/per-node representation counts and timings | | |
| | `v2_paired_analysis.py` and `results/v2_paired_analysis.json` | Reproducible paired descriptive uncertainty summaries and all per-system differences | | |
| | `results/v2_pilot_*` | Complete failed pilot results | | |
| The experiment was executed locally and reproducibly. It is an internal demonstration, not independent replication. Its strongest empirical claim is the combination of exact recursive score compilation, a demonstrated gate-blind failure, and bounded evidence-driven improvement of proposal yield with explicit negative controls and mixed best-solution results. | |