interplane.Get Omega
Read in your language

omega-mv

Omega: a language for verified programs, semantic identity and machine realization. Seed-born work and existing implementations have distinct provenance.

Brought by drakestapleton

branch main Branches Tags History

omega-mv / train / omega-llm / docs / WEIGHT-EDIT.md

104 lines · 5867 bytes Raw Blame History Rendered
1# Bounded direct weight experiment
2
3The experimental `tests/omegallm/weight-edit.om` edits a copy of an OLLM checkpoint.
4It does not change the trainer, inference engine, or any existing command.
5The operator requested direct weight adjustment after the rung-10 BF16 result.
6
7## Operation and bounds
8
9Arguments are `OLD CURRENT NEW ALPHA_MILLI GAIN_MILLI`.
10OLD and CURRENT must have the same seven shape fields and seed; OLD's step cannot
11exceed CURRENT's. Both pass the existing checkpoint reader and payload hash check.
12NEW must not exist. The normal checkpoint writer writes and syncs a temporary file
13before renaming it to NEW. Use a private output directory without concurrent writers.
14
15For each weight, the editor computes
16`current + (ALPHA_MILLI / 1000 - 1) * (current - old)`.
17It then multiplies the final RMS gain vector by `GAIN_MILLI / 1000`.
18Alpha is bounded to 500 through 1200, and gain to 800 through 1200. It refuses non-finite results
19and weights with absolute value above one million. Output shape, seed, step,
20schedule metadata, and optimizer bytes are preserved from CURRENT; the payload
21hash is regenerated by the normal writer.
22
23The preserved optimizer state does **not** describe the edited weights' history.
24These are inference experiments. Do not continue training an edited checkpoint
25without a separately designed and tested optimizer-state policy.
26
27Scaling only the final gain changes prediction confidence. Because the output
28head is linear after final normalization, positive uniform scaling preserves the
29ideal-arithmetic next-token ranking for a fixed context. A loss improvement from
30this change alone is a calibration result, not evidence of improved reasoning.
31
32## Build and independent checks
33
34Set `OMC` to the compiler pinned by `tests/omegallm/build.sh` and `OUT` to a private
35build directory, then run:
36
37```sh
38sh tests/omegallm/build-weight-edit.sh
39python3 tests/omegallm/weight-edit-check.py "$OUT"
40```
41
42The Python file is an external verification instrument, never a model dependency.
43It checks identity against the complete original file, five transformations against
44independently computed weights, unchanged optimizer bytes, production-loader hash
45validation, and refusals for an existing output, out-of-range controls, damaged
46input, and incompatible shapes. No GPU is needed for these checks.
47
48Additional refusal statuses are 51 (control range), 52 (existing output),
4953 (incompatible source checkpoints), and 54 (invalid resulting weight).
50Existing checkpoint and I/O statuses retain their meanings.
51
52## First experiment design
53
54The baseline is rung-10 BF16 step 60000, with its own step 30000 checkpoint as OLD.
55This compares points within one training trajectory; it does not mix independent
56initializations. The weight edit runs in Omega; scoring uses the unchanged,
57previously exercised rung-10 GPU binary and its f32 `geval` path.
58
59Before any candidate score, select 2,048 calibration stories and 4,096 final-test
60stories from the reserved `held-v1.bin`. Deduplicate by a SHA-256 of lowercase text
61with whitespace collapsed, and exclude normalized matches to the full training
62text or the published evaluation text. The final set is not used to select edits.
63This is an exact normalized overlap check, not a near-duplicate semantic check.
64
65The fixed search first tries alpha 0.90, 0.95, 1.00, 1.05, 1.10 at gain 1.00.
66At the best calibration alpha, it tries gain 0.90, 0.95, 1.00, 1.05, 1.10.
67Lock the lowest-loss choice before opening the final results; ties favor the
68smaller change. Preserve every result, including failures. Do not expand the search
69after seeing final scores.
70
71Reproduce the published baseline score before searching. Check CPU/GPU agreement
72on a baseline window and a selected-candidate window. Evaluate the selected model
73and baseline on the complete final set, sixteen paired contiguous blocks, and the
74original published evaluation set. Prefer at least 0.1% lower final loss and allow
75at most 0.2% regression on the original evaluation set. If those conditions fail,
76retain the original as the recommended checkpoint. Compare fixed-prompt samples,
77but do not treat an anecdotal sample as a general language-quality benchmark.
78
79## Separate sibling-blend experiment
80
81The first search selected alpha 0.95, gain 1.00. Its fresh final loss was
821.210277 against 1.210473 for the baseline, a marginal change below the stated
830.1% preference. Its remaining paired-block checks were still running when the
84second experiment was specified.
85
86The second and final search compares the unmodified BF16 model with blends
87containing 90%, 75%, or 50% BF16 weights and the remainder from the full-length
88rung-8 f32 model. Those runs shared initialization and training schedule, but are
89distinct numerical trajectories. The editor's lower alpha bound is widened from
90800 to 500 for this experiment; its arithmetic is unchanged.
91
92Use different reserve stories, starting after source story index 20000, excluding
93all normalized first-round calibration and final stories as well as training and
94published evaluation text. Again select on 2,048 calibration stories and lock one
95choice before evaluating the 4,096 final stories. Require at least 0.1% lower final
96loss for a substantive upgrade and at most 0.2% regression on the published set.
97No further search follows these final scores. Keep both experiments' receipts.
98
99The completed first search found only a 0.016192% fresh final-loss reduction; the
100second search rejected every BF16/f32 blend on calibration and selected the unchanged
101baseline. Retain the original training checkpoint. The small-gain copy is an optional
102inference experiment. Numerical records and limitations are in
103aien-train `evidence/OMEGALLM/weight-edit-20261104/README.md` (upstream, not in omega-mv).
104No installed skill, existing build command, or production model route is changed.