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
omega-mv / train / omega-llm / tools / contrast / README.md
| 1 | # Contrast training and example-checked Omega completions |
| 2 | |
| 3 | This directory contains the seeded Omega tools and executable fixtures from the Spark contrast-training experiment. Each checkpoint gets the instruction and function signature. The example-checked chain compiles each candidate with a caller-supplied test and runs the program with `execpure`. It returns the first body that passes. |
| 4 | |
| 5 | ## Build and replay |
| 6 | |
| 7 | On AArch64 Linux, grow the seeded compiler from the repository root. The replay requires GNU Make, Bash, jq and coreutils. |
| 8 | |
| 9 | ```sh |
| 10 | sh seed/omega-from-seed.sh |
| 11 | make -C train/omega-llm/tools/contrast replay |
| 12 | ``` |
| 13 | |
| 14 | The build places executables in `build/omega-contrast`. The replay compiles the reference functions, grades the archived generations, checks selections against their recorded outcomes and reproduces the contrast corpus hash. It runs on the CPU. The measured GPU training and inference settings and model digests are in [run-01](run-01/README.md). |
| 15 | |
| 16 | ## Generate a function |
| 17 | |
| 18 | From the repository root in an authorized exclusive Spark window, set `SAMPLER`, `MERGES`, `PARENT`, `CONTROL` and `TREATMENT` to absolute file paths. Use a new private directory for each invocation. The compiler, grader and live chain use scratch files in their working directory. |
| 19 | |
| 20 | ```sh |
| 21 | root=$PWD |
| 22 | fixture=$root/train/omega-llm/tools/contrast/run-01 |
| 23 | cd "$(mktemp -d)" |
| 24 | jq -rj '.[0].prompt' "$fixture/fresh.json" > prompt.om |
| 25 | jq -rj '.[0].main' "$fixture/example.json" > example-main.om |
| 26 | spark-window run "$root/build/omega-contrast/with-example" prompt.om \ |
| 27 | "$root/seed/out/omc" "$SAMPLER" "$MERGES" example-main.om \ |
| 28 | "$PARENT" "$CONTROL" "$TREATMENT" > body.om |
| 29 | ``` |
| 30 | |
| 31 | The supplied `main` returns 77 when its check passes and 83 when it fails. The chain tries the supplied checkpoints in order with seed 42, temperature zero and a 64-token generation limit. Standard output contains the accepted function body, and standard error identifies the checkpoint. Exit status 3 with empty output means every model failed. An example pass covers only the supplied input. The experiment used separate inputs to grade accepted functions. |
| 32 | |
| 33 | ## Repeat the training comparison |
| 34 | |
| 35 | With absolute paths, set `TOOLS` to the build directory, `WTRAIN` to the seeded training harness, `OLD` to the previous corpus and `HELD` to the held-out language-model corpus. In a fresh private directory run the following commands. Each training invocation needs an authorized exclusive GPU window. |
| 36 | |
| 37 | ```sh |
| 38 | cp "$OLD" old.om |
| 39 | "$TOOLS/contrast" > contrast.om |
| 40 | "$TOOLS/mix" |
| 41 | spark-window run "$WTRAIN" gb10 "$SAMPLER" "$PARENT" "$MERGES" old.om "$HELD" control 800 350 4 |
| 42 | spark-window run "$WTRAIN" gb10 "$SAMPLER" "$PARENT" "$MERGES" mixed.om "$HELD" treatment 800 350 4 |
| 43 | "$TOOLS/mean" control/candidate.ck treatment/candidate.ck averaged.ck |
| 44 | ``` |
| 45 | |
| 46 | The mixer is specific to this corpus format and experiment. It shuffles complete NUL-prefixed records with a fixed seed. The mean tool accepts two checksum-valid OLLMCK02 checkpoints with matching headers, averages every parameter and clears the optimizer moments and step. Give it a fresh output path, separate from both inputs. The [seeded training harness](../../README.md) documents the trainer arguments. |