diff --git a/.github/workflows/algernon-arg02.yml b/.github/workflows/algernon-arg02.yml new file mode 100644 index 000000000..8ecef8676 --- /dev/null +++ b/.github/workflows/algernon-arg02.yml @@ -0,0 +1,61 @@ +name: Algernon ARG-02 recurrent Qwen evaluation +on: + push: + paths: + - 'research/algernon/algebraic_reasoning_gym/**' + - '.github/workflows/algernon-arg02.yml' + pull_request: + paths: + - 'research/algernon/algebraic_reasoning_gym/**' + - '.github/workflows/algernon-arg02.yml' + workflow_dispatch: +permissions: + contents: read +jobs: + protocol-and-grading: + runs-on: ubuntu-latest + timeout-minutes: 15 + steps: + - uses: actions/checkout@v4 + - uses: actions/checkout@v4 + with: + repository: MoralityLabAI/EvalMath + ref: 88bb6cf8d2fe172e37d25964dfb2c285d9033841 + path: .arg02_evalmath + persist-credentials: false + - uses: actions/setup-python@v5 + with: + python-version: '3.12' + - run: pip install numpy==2.5.3 + - name: ARG-01 receipt still verifies + run: PYTHONPATH=.:.arg02_evalmath/src python -m research.algernon.algebraic_reasoning_gym.gym --check + - name: Splits, public-only prompts, grading, statistics, probes + run: PYTHONPATH=.:.arg02_evalmath/src python -m unittest research.algernon.algebraic_reasoning_gym.arg02.test_arg02 -v + - name: Committed answer tape regrades to the committed receipt + run: | + for R in research/algernon/algebraic_reasoning_gym/arg02/results research/algernon/algebraic_reasoning_gym/arg02/results_nanbeige; do + if [ -f $R/arg02_receipt.json ]; then + PYTHONPATH=.:.arg02_evalmath/src python -m research.algernon.algebraic_reasoning_gym.arg02.analyze replay \ + --tape $R/arg02_answer_tape.jsonl.gz --check $R/arg02_receipt.json + else + echo "no receipt in $R" + fi + done + cpu-recurrence-smoke: + runs-on: ubuntu-latest + timeout-minutes: 25 + steps: + - uses: actions/checkout@v4 + - uses: actions/checkout@v4 + with: + repository: MoralityLabAI/EvalMath + ref: 88bb6cf8d2fe172e37d25964dfb2c285d9033841 + path: .arg02_evalmath + persist-credentials: false + - uses: actions/setup-python@v5 + with: + python-version: '3.12' + - run: pip install torch==2.11.0 --index-url https://download.pytorch.org/whl/cpu + - run: pip install transformers==5.17.0 numpy==2.5.3 + - name: Block-loop identities, HF parity, leakage guard, end-to-end smoke (tiny random Qwen3.5) + run: PYTHONPATH=.:.arg02_evalmath/src python -m unittest research.algernon.algebraic_reasoning_gym.arg02.test_arg02_torch -v diff --git a/research/algernon/README.md b/research/algernon/README.md index d391098f3..410616f19 100644 --- a/research/algernon/README.md +++ b/research/algernon/README.md @@ -2,6 +2,8 @@ **ARG-01 CPU algebraic reasoning gym:** [Frozen RRC-19 recurrent proposer with independent, pinned EvalMath verification](algebraic_reasoning_gym/README.md), [results](algebraic_reasoning_gym/REPORT.md), and [Qwen/looped-model workorder](algebraic_reasoning_gym/QWEN_WORKORDER.md). The CPU baseline is executed; a Qwen latent graft remains unrun. +**ARG-02 recurrent Qwen evaluation:** [Qwen3.5-0.8B with an explicit block-loop recurrence, open-loop, donor-shuffle, repeated-forward, 2B feedforward and external-controller controls](algebraic_reasoning_gym/arg02/README.md), [registered protocol](algebraic_reasoning_gym/arg02/PROTOCOL.md), [report](algebraic_reasoning_gym/arg02/REPORT.md). Executed 2026-11-11: negative. The untrained loop at the selected depth 16 recovers 67/168 vs 68 for one pass; Qwen3.5-2B one pass 79; complete certified class search 159. [Nanbeige4.2-3B follow-up](algebraic_reasoning_gym/arg02/REPORT_NANBEIGE.md) (natively looped, 2026-11-13): loop 8 recovers 71/168 vs 44 for one loop and beats an equal-compute ensemble and a shuffled-state control, but not the open-loop control, so the mechanism claim is not met. + **Algernon-02 executable experiment:** [Circuit Mirror](circuit_mirror/README.md) combines a typed pointer-machine transition, an exact BN254 R1CS-style checker, generated Circom source, a tiny trained recurrent readout, and retained CPU-only experiment receipts. [Experimental falsification criteria](circuit_mirror/EXPERIMENT.md). diff --git a/research/algernon/algebraic_reasoning_gym/README.md b/research/algernon/algebraic_reasoning_gym/README.md index 7d4c9413a..d6362063f 100644 --- a/research/algernon/algebraic_reasoning_gym/README.md +++ b/research/algernon/algebraic_reasoning_gym/README.md @@ -45,6 +45,10 @@ PYTHONPATH=.:../EvalMath/src python -m research.algernon.algebraic_reasoning_gym --score-proposals /tmp/qwen_arg01.jsonl --out /tmp/qwen_arg01_scored.json ``` +## ARG-02 + +[`arg02/`](arg02/README.md) evaluates Qwen3.5-0.8B-Base on this roster with explicit recurrent depth and matched-compute controls, through the same public-only export and EvalMath grading. Protocol: [`arg02/PROTOCOL.md`](arg02/PROTOCOL.md); result: [`arg02/REPORT.md`](arg02/REPORT.md). + ## Research interpretation The primary signal is executable-program *future* accuracy per full measured computation, including class compilation, predictor inference and exact candidate verification. Aggregate correctness should be split by known/novel source family; source-family holdouts in RRC-19 itself are public, so ARG-01 is another deterministic research evaluation rather than an independently blind study. An RRC-19 GRU forward pass processes the thirteen coefficient steps of its input **once**; additional candidate-verifier calls are external computation, not new GRU refinement steps. A true recurrence-depth comparison requires the external checkpoint and actual latent forward traces. diff --git a/research/algernon/algebraic_reasoning_gym/arg02/PROTOCOL.md b/research/algernon/algebraic_reasoning_gym/arg02/PROTOCOL.md new file mode 100644 index 000000000..9e09eb35d --- /dev/null +++ b/research/algernon/algebraic_reasoning_gym/arg02/PROTOCOL.md @@ -0,0 +1,109 @@ +# ARG-02 protocol: recurrent depth in a pretrained Qwen on the Algernon algebraic gym + +**Registered 2026-11-10, before any Qwen output on the development or test rows existed.** The only model outputs produced before registration are the CPU parity check in `results/arg02_checkpoint_check.json` (two development prompts, depth 1 and one extra block pass, no grading) and the tiny random-model smoke runs used by the tests. + +## Question + +Does additional internal recurrent computation make a pretrained model recover algebraic programs that its first forward pass misses, with an advantage over exact symbolic search and over neural controls that spend the same compute without recurrence? This is a falsification test: every arm and every negative outcome is reported. + +## Model and recurrence + +- Inventory (`config/checkpoint_lock.json`): no looped-layer Qwen checkpoint survives on this machine. LoopedTransformers `experiments/recurrent_recovery_laco_v1` (Qwen3-0.6B with a LaCo recurrent block) kept manifests only; its `trainable.pt` and tuned teacher are gone. HybridTRMLDT has no recurrent language model. `tomg-group-umd/huginn-0125` is natively recurrent but is not a Qwen model and is not used. +- Model: `Qwen/Qwen3.5-0.8B-Base` at `dc7cdfe2ee4154fa7e30f5b51ca41bfa40174e68`, bf16, SDPA, transformers 5.17.0, torch 2.11.0+cu128, loaded as `Qwen3_5ForCausalLM` (752,393,024 text parameters). File SHA-256 values are in the lock; the runner refuses a snapshot that differs. +- Qwen3.5-0.8B has no native recurrence. ARG-02 adds an explicit, **untrained** block loop (`recurrence.py`): decoder layers `[a, b)` form a block B applied `d` times to the residual stream with the pretrained weights unchanged. `x = layers[0:a](embed)`, `h_1 = B(x)`, `h_t = B(h_{t-1})`, readout `lm_head(norm(layers[b:](h_t)))`. Depth 1 is the unmodified model; the CPU check measured a maximum absolute log-probability difference of 0.0 against the HF forward on the real weights. +- The 24 layers repeat a 3 linear-attention (Gated DeltaNet) + 1 full-attention pattern. Candidate blocks are four-layer groups: `[12,16)`, `[8,12)`, `[16,20)`, `[4,8)`. +- The external iterative controller (below) is a separate, explicitly external arm. Repeated prompting is never described as latent recurrence. + +## Splits (fixed, `splits.py`, audit in `results/arg02_splits_audit.json`) + +| Split | Rows | Source | Use | +|---|---:|---|---| +| test | 192 | ARG-01 EvalMath roster (168 positives over 7 generators, 12 inconsistent negatives, 6 future-collision pairs) | final run, once | +| calibration | 36 | ARG-01 calibration roster (seen generators) | development selection, probe hyperparameters | +| dev | 96 | ARG-02 roster, seed 2026111102, seen generators only | development selection, probe training | +| shots | 4 | ARG-02 roster, seed 2026111103, one per topology | in-context examples when shots = 4 | + +Development = calibration + dev (132 rows). All non-test rosters are signature-disjoint from every EvalMath roster case. The test rows are byte-identical to `external.public_records()`. The four novel generators (rational, squared, twisted product, lacunary) appear only in test. + +## Model input and answers + +- The runner reads only exported public JSONL (`topology`, two demonstrations through degree 12, query, digest). It never builds the roster; a test patches `oracle.roster` to raise during every runner stage. Source graphs and future coefficients are used only by the grader. The query series is public but not rendered: it carries no information about the program. Case identifiers are not rendered. +- The prompt states the four operators and four topologies (the public DSL), the two demonstrations, and ends with `\nProgram:`. Operators ` I`, ` N`, ` S`, ` R` are single tokens. +- Each prompt is scored as 16 rows (prompt + every operator pair), giving the full-vocabulary log-probabilities of all 64 programs and the unconstrained greedy decode. **Constrained proposal**: the 64 programs ranked by joint log-probability. **Greedy proposal**: argmax tokens; invalid when any is not an operator token (the invalid-program rate). +- Every proposal is checked by `oracle.search` on the two public demonstrations; future correctness is read only inside `oracle.grade`. Budgets: 1 check (top-1) and 12 checks (the ARG-01 budget). + +## Arms + +| Arm | Definition | Compute charged | +|---|---|---| +| base = loop(1) | unmodified forward | 1 forward | +| loop(d), d = 2,4,8,16 | `h_t = B(h_{t-1})`; every step 1..16 is also read out for the depth curve | prelude + d blocks + readout, per CUDA-event timing | +| open(d) | residual-feedback ablation: `h_t = h_{t-1} + (h_1 - x)`. The block sees only x; its single update is re-applied d times, never recomputed from the current state | prelude + 1 block + readout | +| shuffle(d) | shuffled intermediate state: `h_t = h_1 + D_t`, D_t = `h_t - h_1` of a donor case's own loop (the previous test row, cyclic), right-aligned by position and matched by candidate row | recipient + donor loop to d | +| ensemble(m(d)) | repeated-forward control: mean joint log-probability over the first m(d) prompt variants (canonical, demos swapped, space separators, both), depth 1; m(d) = round((24 + (d-1)(b-a)) / 24) capped at 4, i.e. matched layer evaluations | m forwards | +| ff2b | matched-compute feedforward: `Qwen/Qwen3.5-2B-Base` at `b1485b2fa6dfa1287294f269f5fb618e03d52d7c`, single pass, same prompt and tokenizer; 2.68x the 0.8B forward MACs, between loop(8) (2.16x) and loop(16) (3.49x) | 1 forward | +| controller | external iterative controller: depth-1 model, after each rejected candidate the prompt gains "Rejected: a b c (example k differs at x^n ...)" from a public-demo check; next proposal is the best untried program; up to 12 rounds | one forward per round + public checks | +| perturbation | loop to 16 with a Gaussian kick of 0.25 x RMS(h_1) added after step 1 (seeded per row); readouts at 1,2,4,8,16; distance to the clean trajectory per step | as loop(16) | +| patching | at depth p = max(2, d*), the answer-site states (last 5 positions: `\n`, `Program`, `:`, two candidate tokens) are replaced by the donor's at step 1, ceil(p/2) or p, then the loop continues | 3 loops to p + donor | +| symbolic | ARG-01 arms re-scored per case through the unmodified `gym.score_case`: class-size order (12 checks), complete certified class search, exhaustive 64-program search, frozen RRC-19 GRU and FF | CPU time + verifier work | + +The base model is the parameter-matched feedforward control for every loop depth (identical weights). ensemble and ff2b are the equal-compute controls. + +## Development selection (run before the test stage) + +1. Shots: k in {0, 4} at depth 1 on the 132 development rows; choose the larger development future-correct count at 12 checks; tie -> 0. +2. Block and depth: with the chosen k, each candidate block's loop trajectory on the development rows; choose (block, d*) with d* in {2,4,8,16} maximising development future-correct at 12 checks; tie -> smaller d, then the block order above. The selection is the one most favourable to recurrence that development data supports. It is written to `selection.json`, whose SHA-256 enters every test part key. +3. No other setting is tuned. Sigma, ensemble variants, patch steps, controller rounds and budgets are fixed here. + +## Measurements + +- Per arm on the 168 positives: future-correct and accepted at 12 and at 1 check, greedy validity, greedy acceptance, rank of the source program, by generator family and known/novel split; negatives accepted (must be 0); collision pairs with identical traces (identical public input must give identical proposals). +- Depth: per-step curves 1..16, first step at which top-1 is future-correct, programs found only after step 1 and whether they survive to step 16, answers lost or gained between step 1 and each depth, relative residual norm `|h_t - h_{t-1}| / |h_{t-1}|` per step and its per-step reduction ratio. +- Perturbation recovery: future-correct and top-1 agreement with the clean run per readout, and distance to the clean state over the kick norm per step. +- Patching: top-1 kept, moved to the donor's answer, changed; KL of the 64-program distribution to the clean run. +- Probes (`probe.py`): linear probes on the block output at the last prompt token, step 0 (block input) to 16. Labels from the canonical certified class representative (RRC-18 class map) of the source program: its outer operator (4 classes) and whether it uses R. Trained on the 96 dev rows, PCA size and L2 chosen on the 36 calibration rows, tested on seen-generator and novel-generator test positives, with the majority baseline and a 200-permutation label null. +- Compute: CUDA-event GPU time per segment (a depth-d latency is prelude + d block steps + its readout inside the combined trajectory), analytic MACs (`flops.py`), tokens, layer evaluations, forward passes, verifier checks, ARG-01 integer-loop proxy, verifier CPU time, p50/p95 end-to-end latency, peak allocated VRAM per stage. Integer-loop work and neural MACs are never summed. + +## Statistics and decision rules + +Primary metric: future-correct at 12 checks on the 168 test positives. Paired differences use exact McNemar tests and a 95% cluster bootstrap (clusters: source family x topology, 28 cells, 10,000 resamples, seed 2026111104). + +- **H1 depth**: loop(d*) - loop(1) > 0, cluster-bootstrap lower bound > 0 and McNemar p < 0.05. +- **H2a feedback**: loop(d*) - open(d*) > 0, lower bound > 0. +- **H2b state**: loop(d*) - shuffle(d*) > 0, lower bound > 0. A depth gain that survives replacing the case's own recurrent displacement with another case's is not evidence of case-specific recurrent reasoning. +- **H3a repeat**: loop(d*) - ensemble(m(d*)) > 0, lower bound > 0. +- **H3b feedforward**: loop(d*) - ff2b > 0, lower bound > 0. +- **H3c efficiency**: future-correct per end-to-end second of loop(d*) above loop(1) and ensemble(m(d*)). +- **H4 symbolic**: loop(d*) future-correct >= complete certified class search and more future-correct per end-to-end second. +- A useful recurrent mechanism is claimed only if H1, H2a, H2b, H3a and H3b all hold. Every other outcome is reported as the negative result it is, with the failing rule named. + +## Stop conditions + +The runner stops on a checkpoint hash mismatch, a public row with any non-public field, a prompt whose tail tokenises differently, operator tokens that are not single tokens, or parts written under different keys. It exits 75 at a part boundary when the GPU is power-capped (`vramorama run --pause-exit 75` restarts it; finished parts are reused only under an identical key). The analysis stops if ARG-01's `external.py` scorer disagrees with ARG-02's top-1 grading. + +## Reproduction + +`results/arg02_answer_tape.jsonl.gz` holds every model answer record (log-probabilities rounded to 1e-6 before grading). `analyze replay` regrades it on CPU against `results/arg02_receipt.json` with no model or GPU. + +## Amendment 1 (2026-11-11, after the test run) + +**Defect.** The report's row-spread diagnostic (rows that share a prefix must give identical log-probabilities at the shared positions) was exactly 0 for every arm except the donor shuffle, where 40% of test records disagreed across rows (median 0, p95 0.25-1.4, maximum 5.4 nats). Cause: `align_index` wrapped right-aligned positions over the whole donor sequence, so when the recipient prompt was longer than the donor's, some recipient prompt positions received the displacement of the donor's two candidate-token positions, which differ per row. The shuffled arm therefore mixed row-specific interventions into one 64-program distribution. + +**Fix.** Candidate positions now map only onto candidate positions, and recipient prompt positions beyond the donor's length wrap within the donor's prompt positions (`recurrence.align_index`; tests check row consistency with both a shorter and a longer donor). No other arm uses this mapping; patching replaces the last five positions directly. + +**Rerun.** Only the shuffle arm is recomputed, as part label `test_shuffle_a1` with the same donors (previous test row) and depths, using the unchanged selection. The original `test_shuffle` parts are kept and reported as `shuffle@d`; the corrected arm is `shuffle_a1@d`. H2b is evaluated on `shuffle_a1@d*`; the original arm's outcome is reported beside it as `H2b_state_original_shuffle`. Before the rerun, the original shuffle arm scored 67/168 at d* = 16, equal to loop(16), so H2b was not met; the defect adds noise only to the shuffled arm, which can only make H2b easier to meet. H1 had already failed (loop(16) 67 vs loop(1) 68), so the mechanism claim cannot be met whatever the rerun shows. + +## Extension N1: Nanbeige4.2-3B, a natively looped model (registered 2026-11-13, before any Nanbeige output on the development or test rows) + +**Why.** Qwen3.5's loop was retrofitted and untrained, so ARG-02 left open whether a model *trained* to recur behaves differently. `Nanbeige/Nanbeige4.2-3B` at `451ed48c3273ecef7ea8faaa43c31ce529763bb1` (the only weight-bearing revision in the local cache; file SHA-256 in the lock) is natively looped: all 22 decoder layers run, then the final RMSNorm, and the result feeds the next loop; it was trained with `num_loops = 2`. Without a KV cache the loop index only selects cache slots, so the number of loops can be set at inference (`nanbeige.py`). The adapter's loop-t readout equals `NanbeigeModel.forward` with `num_loops = t` on a random model built from the checkpoint's own remote code (tests, t = 1, 2, 3); the same check runs on the real weights on the GPU before the development stage. + +**What stays the same.** Splits, public-only prompt text, the 16 candidate rows, the 64-program ranking, greedy validity, EvalMath grading, budgets, statistics, the decision rules and their thresholds, the corrected shuffle alignment (Amendment 1), and the analysis code. The prompt token sequence starts with Nanbeige's BOS (166100). + +**What changes, fixed here.** +- Profile `nanbeige` in `config/arg02_config.json`; run directory `C:\Users\patri\Documents\Codex\algernon\runs\arg02-nanbeige`; results in `results_nanbeige/`. Software: transformers 4.46.3, torch 2.11.0+cu128 (the remote code targets 4.42), weights streamed onto the GPU in bf16, SDPA attention. +- Depth = number of full-stack loops, d in {1, 2, 4, 8}. loop(1) is the initial pass, loop(2) the trained depth, 4 and 8 extrapolate. The cap at 8 keeps the run near six GPU-hours: one loop over 16 rows of a 4-shot prompt is about 0.11 PFLOP. +- Block: the whole stack, `[0, 22)`. Development selection: shots in {0, 4} at depth 1 as registered, then d* in {2, 4, 8} by development future-correct@12; tie -> smaller d. +- Equal-compute control: depth d costs d loops, so ensemble(m(d)) averages m = d depth-1 forwards over prompt variants (demo order x separator x four rotations of the shot order, 16 variants; with 0 shots the rotations repeat the four distinct prompts). +- No same-family feedforward checkpoint exists on this machine, so H3b is not applicable and the mechanism claim requires H1, H2a, H2b and H3a. Nothing is downloaded. +- Perturbation: kick after loop 1, loops to 8, readouts at 1, 2, 4, 8. Patching: depth max(2, d*), steps 1, ceil(p/2), p. Controller: depth 1, up to 12 rounds. Probes: the state after each loop at the last prompt token. +- Reported alongside the registered rules, not as decision rules: loop(2) vs loop(1) (the trained second pass) and loop(d*) vs loop(2). Comparisons with the Qwen arms are descriptive only (different models, tokenizers and training data). diff --git a/research/algernon/algebraic_reasoning_gym/arg02/README.md b/research/algernon/algebraic_reasoning_gym/arg02/README.md new file mode 100644 index 000000000..374dbb56e --- /dev/null +++ b/research/algernon/algebraic_reasoning_gym/arg02/README.md @@ -0,0 +1,53 @@ +# ARG-02: recurrent-depth evaluation of Qwen3.5 on the Algernon algebraic gym + +ARG-02 runs a pretrained Qwen checkpoint on the ARG-01 held-out roster with explicit recurrent depth, exact EvalMath verification of every proposal, and the controls needed to tell recurrence apart from extra compute. The registered design, arms and decision rules are in [PROTOCOL.md](PROTOCOL.md); results are in [REPORT.md](REPORT.md) (Qwen3.5, negative: an untrained loop did not increase verified program recovery) and [REPORT_NANBEIGE.md](REPORT_NANBEIGE.md) (Nanbeige4.2-3B, natively looped: a real depth gain, mechanism claim not met) and the run log in [STATUS.md](STATUS.md). + +## Layout + +| File | Role | +|---|---| +| `config/arg02_config.json` | depths, candidate blocks, shot options, budgets, perturbation, controller, decision rules | +| `config/checkpoint_lock.json` | model revisions, file SHA-256, text configs, checkpoint inventory, software | +| `splits.py` | fixed test/calibration rosters from EvalMath, seeded dev and shot rosters, contamination audit | +| `prompts.py` | prompt text from public records only | +| `recurrence.py` | block-loop runner over Qwen3.5 decoder layers: loop, open loop, donor shuffle, site patching, perturbation, per-step capture | +| `runner.py` | GPU stages (dev shots, dev blocks, test, test ff), resumable parts, power watch | +| `scoring.py` | 64-program ranking, greedy decode, EvalMath search/grade, controller regrade | +| `analyze.py` | export, development selection, grading, statistics, probes, receipts, tape replay | +| `stats.py`, `flops.py`, `probe.py`, `symbolic.py` | paired statistics, analytic MACs, numpy probes, ARG-01 baselines | +| `checkpoint_check.py` | CPU pre-run check on the real weights | +| `smoke.py` | the whole pipeline on a tiny random Qwen3.5 on CPU | +| `run_arg02.ps1` | the GPU chain under vramorama | +| `tables.py` | Markdown tables from the receipt and profile | +| `nanbeige.py` | Nanbeige4.2-3B loader and native full-stack loop (profile `nanbeige`, transformers < 5) | + +## Run + +From the Compactification-Theory root, with EvalMath checked out at the commit in `../evalmath_pin.json`: + +```sh +export PYTHONPATH=.:../EvalMath/src +python -m unittest research.algernon.algebraic_reasoning_gym.arg02.test_arg02 # numpy only +python -m unittest research.algernon.algebraic_reasoning_gym.arg02.test_arg02_torch # torch + transformers>=5.17 +python -m research.algernon.algebraic_reasoning_gym.arg02.smoke --run-dir /tmp/arg02-smoke +``` + +GPU run (Windows, RTX 5080, vramorama 0.15): + +```powershell +powershell -ExecutionPolicy Bypass -File research\algernon\algebraic_reasoning_gym\arg02\run_arg02.ps1 -RunDir C:\Users\patri\Documents\Codex\algernon\runs\arg02 +``` + +The chain is export -> `runner dev --stage shots` -> `analyze select --stage shots` -> `runner dev --stage blocks` -> `analyze select --stage blocks` (writes `selection.json`) -> `runner test` -> `runner test --model ff` -> `analyze report --out arg02/results` -> `analyze replay`. Analytic compute from `flops.py` at the measured prompt lengths: about 3 PFLOP for the shots stage, 14 PFLOP (0 shots) or 47 PFLOP (4 shots) for the block stage, 40 or 133 PFLOP for the 0.8B test arms and 3 or 9 PFLOP for the 2B control. + +Replay the committed results on CPU, with no model: + +```sh +python -m research.algernon.algebraic_reasoning_gym.arg02.analyze replay \ + --tape research/algernon/algebraic_reasoning_gym/arg02/results/arg02_answer_tape.jsonl.gz \ + --check research/algernon/algebraic_reasoning_gym/arg02/results/arg02_receipt.json +``` + +## Boundaries + +The EvalMath oracle and its tests are imported from the pinned checkout and not modified. ARG-01's `gym.py`, `external.py`, `test_gym.py` and receipts are unchanged; `symbolic.py` calls `gym.score_case` as is, and the report re-scores ARG-02's top-1 answers through ARG-01's `external.py` as a cross-check. diff --git a/research/algernon/algebraic_reasoning_gym/arg02/REPORT.md b/research/algernon/algebraic_reasoning_gym/arg02/REPORT.md new file mode 100644 index 000000000..4a3714bf8 --- /dev/null +++ b/research/algernon/algebraic_reasoning_gym/arg02/REPORT.md @@ -0,0 +1,116 @@ +# ARG-02 report: recurrent depth in Qwen3.5-0.8B on the Algernon algebraic gym + +**Executed 2026-11-11** on the RTX 5080 Laptop GPU under the protocol registered on 2026-11-10 ([PROTOCOL.md](PROTOCOL.md)), with one post-run amendment to the donor-shuffle control (Amendment 1). Development selection ran once, the test stage ran once, and the corrected shuffle arm ran once more. All numbers below are from [`results/arg02_receipt.json`](results/arg02_receipt.json) and [`results/arg02_profile.json`](results/arg02_profile.json). Full tables are in [`results/arg02_tables.md`](results/arg02_tables.md) and per-case grades in `results/arg02_traces.jsonl.gz`. `analyze replay` regrades the committed answer tape to the committed receipt on CPU. + +Follow-up with a natively looped model (Nanbeige4.2-3B, trained at 2 loops): [REPORT_NANBEIGE.md](REPORT_NANBEIGE.md). + +## Answer + +**No.** At the pre-registered depth d* = 16, the block loop recovered **67 of 168** test programs with correct withheld futures within 12 exact checks. The unmodified single pass recovered **68**. The difference is -1: 32 cases gained and 33 lost, cluster-bootstrap 95% CI [-0.085, +0.072] per case, McNemar p = 1.0. The development gain that selected this setting (+16 of 132) did not replicate. Extra recurrence reshuffled which programs were found without finding more. It also drove the unconstrained readout off the operator grammar and amplified small state perturbations about tenfold, at 3.5x the GPU time. + +Every equal-compute control did at least as well, and the mechanism claim fails. Qwen3.5-2B in one pass recovered 79, using 0.76x the loop's FLOPs and 0.36x its GPU time. Every Qwen arm stayed far below the exact symbolic baselines: the complete certified class search recovered 159 in 0.14 CPU-seconds for the whole 192-row test set. + +## Development selection + +| Choice | Rule | Result | +|---|---|---| +| shots | depth-1 future-correct@12 on 132 development rows | 4 shots (52) over 0 shots (46) | +| block, d* | best over 4 blocks x depths 2/4/8/16 | `[8,12)` at d = 16: 68 vs 52 at depth 1 | + +The selected block's development curve was 52, 48, 48, 49, 68 at depths 1, 2, 4, 8, 16. The other blocks at depth 16 scored 57 (`[12,16)`), 55 (`[16,20)`) and 44 (`[4,8)`). On the test rows the same block gave 68, 60, 60, 58 and 67 at those depths. d* was the maximum of 16 development cells, and the test run shows it was a selection artefact. + +## Test results (168 positives; 12 negatives and 6 collision pairs as controls) + +| Arm | future@12 | accepted@12 | top-1 future | greedy valid | novel generators future@12 (/96) | GPU s | PFLOP | p50 / p95 ms per case | +|---|---:|---:|---:|---:|---:|---:|---:|---:| +| loop(1) = base | 68 | 78 | 14 | 146 | 42 | 310 | 3.56 | 1,485 / 2,446 | +| loop(2) | 60 | 70 | 11 | 167 | 37 | 357 | 4.16 | 1,713 / 2,933 | +| loop(4) | 60 | 66 | 19 | 154 | 36 | 462 | 5.34 | 2,254 / 3,790 | +| loop(8) | 58 | 63 | 14 | 47 | 36 | 663 | 7.72 | 3,249 / 4,787 | +| **loop(16) = d\*** | **67** | 77 | 8 | 0 | 46 | 1,075 | 12.46 | 5,349 / 8,018 | +| open(16), no feedback | 46 | 57 | 8 | 0 | 23 | 302 | 3.56 | 1,474 / 2,238 | +| shuffle(16), corrected (A1) | 66 | 76 | 9 | 0 | 42 | 1,221 | 14.24 | 5,825 / 10,193 | +| shuffle(16), original | 67 | 77 | 9 | 0 | 42 | 1,237 | 14.24 | 6,032 / 9,242 | +| ensemble, 4 prompt variants | 69 | 79 | 15 | - | 41 | 1,207 | 13.94 | 6,006 / 8,520 | +| Qwen3.5-2B, one pass | 79 | 88 | 15 | 167 | 42 | 389 | 9.44 | 1,971 / 2,485 | +| external verifier-feedback controller, <= 12 rounds | 69 | 76 | - | - | 44 | 3,097 | 36.69 | 19,038 / 26,032 | +| class-size order, 12 checks (ARG-01) | 102 | 111 | - | - | 64 | CPU | - | 1 / 1 | +| complete certified class search (ARG-01) | 159 | 168 | - | - | 92 | CPU | - | 1 / 2 | +| exhaustive 64-program search (ARG-01) | 157 | 168 | - | - | 91 | CPU | - | 0 / 3 | +| frozen RRC-19 GRU (ARG-01) | 129 | 138 | - | - | 68 | CPU | 53k MACs/case | 5 / 7 | +| frozen RRC-19 FF (ARG-01) | 122 | 132 | - | - | 66 | CPU | 6k MACs/case | 1 / 1 | + +The ARG-01 arms reproduce their committed counts exactly (159, 157, 102, 129, 122). Accuracy columns count the 168 positives; GPU seconds, PFLOP and latency cover all 192 test rows. "greedy valid" counts cases whose unconstrained argmax decode is three operator tokens. Latency is GPU time for that arm's own computation plus verifier time; the GPU was shared with another session's job for part of the test stage. + +## Registered decisions (d* = 16) + +| Rule | Comparison | A - B | 95% CI per case | McNemar p | Outcome | +|---|---|---:|---|---:|---| +| H1 depth | loop(16) vs loop(1) | -1 | [-0.085, +0.072] | 1.000 | not met | +| H2a feedback | loop(16) vs open(16) | +21 | [+0.023, +0.226] | 0.019 | met | +| H2b state | loop(16) vs corrected shuffle(16) | +1 | [-0.077, +0.082] | 1.000 | not met (original shuffle: +0, not met) | +| H3a repeat | loop(16) vs ensemble(4) | -2 | [-0.097, +0.070] | 0.902 | not met | +| H3b feedforward | loop(16) vs Qwen3.5-2B | -12 | [-0.166, +0.018] | 0.182 | not met | +| H3c efficiency | future@12 per end-to-end second | loop(16) 0.062, loop(1) 0.219, ensemble 0.057 | | | not met | +| H4 symbolic | loop(16) vs complete certified class search | -92 | [-0.608, -0.488] | < 1e-4 | not met | +| **Recurrent mechanism claim** | H1, H2a, H2b, H3a, H3b all met | | | | **not met** | + +H2a is met only because removing the feedback is destructive: open(16) falls to 46, 22 below the base (CI [-0.224, -0.041], p = 0.013). Repeating the block's first update sixteen times without recomputing it damages the readout, while the closed loop returns to roughly the base level. That is not an advantage of recurrence over the single pass. + +## What the intermediate states show + +- **Churn, not refinement.** Accuracy over loop steps 1-16 was 68, 60, 54, 60, 54, 50, 49, 58, 70, 72, 80, 78, 74, 69, 72, 67. Between step 1 and step 16, 32 programs were gained and 33 lost at 12 checks; at top-1 the counts were 7 gained and 13 lost. 43 cases reached a future-correct top-1 answer only after step 1, but only 7 of them still had it at step 16. + - The peak at step 11 (80) was not a registered depth. Development had no readout there, and against the base it gives +12 with CI [-0.023, +0.173], p = 0.18, before any correction for 16 steps. It is not evidence of a useful depth. +- **The readout leaves the grammar.** The unconstrained argmax decode was a valid three-operator program for 146 cases at step 1 and 167-168 at steps 2-3. It then fell to 47 at step 8, 1 at step 9 and 0 from step 10 onwards. Only the constrained 64-program ranking still produces programs at depth. The 2B model's greedy decode was valid for 167 cases. +- **No fixed point.** + - The relative size of each block step is 0.75 at step 1 (the block's ordinary update) and shrinks to 0.45, 0.33 and 0.28. + - It then stays near 0.20 from step 10 to 16, with a per-step reduction ratio of 0.97-1.03. + - The iteration keeps moving the state by about a fifth of its norm per step and never converges. +- **Perturbations grow.** A kick of 0.25 x RMS after step 1 shrinks to 0.77 of its size by step 2. It then grows to 2.0x by step 8 and 10.9x by step 16. Top-1 agreement with the unperturbed run falls from 144/168 (step 1) to 81 (step 8) and 22 (step 16). Aggregate accuracy stays the same (69 vs 67 at step 16): deep-loop answers wander among similarly ranked candidates. +- **The shuffle tests case-specificity.** With the corrected alignment, replacing a case's own recurrent displacement `h_t - h_1` with another case's cost 8 programs relative to the loop at depths 2 and 4 (52 vs 60, and 16 below the base), so early steps do carry case-specific state. At depth 16 it changed nothing (66 vs 67). By then the recurrent displacement carries no recoverable advantage. +- **Patching the answer site.** + - Replacing the last five positions with a donor's states at the final step moved 84 of 168 top-1 answers to the donor's answer (median KL to the clean run 5.15). At depth 16 the answer is largely carried at the readout positions. + - The same patch at step 8 moved 28 to the donor and changed 154. + - At step 1 it moved 4 to the donor, changed 91 and left 77 unchanged. Early-site states are mostly overwritten, but the trajectory stays sensitive to them. +- **Probes find nothing that grows with depth.** + - Linear probes on the block output at the last prompt token were trained on 96 development rows and tuned on 36 calibration rows. + - For the outer operator of the canonical class representative, accuracy on novel generators was at or below the 0.406 majority rate at 15 of 17 steps (above it only at steps 6 and 8). The best was 0.458 at step 8 (permutation p = 0.005), one of 34 uncorrected tests. + - For "uses R", novel accuracy was 0.50-0.62 against 0.50, already 0.56 at step 1, and 0.52 at step 16. + - Nothing here indicates that the loop builds a linearly readable operator class beyond the single pass. + +## Compute + +The 0.8B arms peaked at 3.9-4.9 GiB allocated and the 2B control at 6.0 GiB. The base forward took 1.5 s per case median with a 4-shot prompt (about 1,090 tokens x 16 candidate rows). + +| Arm | future@12 (168 positives) per GPU-hour (192 rows) | +|---|---:| +| loop(1) | 790 | +| loop(16) | 224 | +| ensemble(4) | 206 | +| Qwen3.5-2B | 730 | +| external controller | 80 | + +The external controller spent 10x the base GPU time and gained 1 program. Exact symbolic search needs no GPU: the complete certified class search ran 1,985 two-demonstration checks over all 192 test rows in 0.14 s of CPU time, against the loop's 1,790 checks after 1,075 GPU-seconds. + +## Validity checks + +- **Negatives and collision pairs.** No arm accepted any of the 12 inconsistent negatives. Every arm gave identical traces for all 6 collision pairs, except the shuffle arms (0 of 6). That is by construction: the two members of a pair have different donor rows. +- **Cross-check against ARG-01.** ARG-01's own `external.py` scorer, run on ARG-02's top-1 answers, agrees with ARG-02's grading at depths 1, 2, 4 and 8 (exact-accepted 18/16/24/15, future 14/11/19/14). +- **Row consistency.** Rows that share a prefix agree exactly (row spread 0) in every arm after Amendment 1. Before the fix, 40% of the original shuffle records disagreed by up to 5.4 nats. The corrected arm's result (66) and the original (67) lead to the same decision. +- **Provenance.** All stages ran from clean commits. Development and the main test stage ran at `deea6c6`; the 2B control at `547f190` (same runner code); the corrected shuffle at `5b7d2bc`. Every part is keyed on the code, config, checkpoint lock and selection digests. + +## Scope + +- **The recurrence was untrained.** No looped-layer Qwen checkpoint exists locally, so the loop re-applies pretrained layers the model never learned to iterate. A model trained with recurrence (Huginn-style, or a Qwen with a trained loop) is the stronger test of the question and is not covered here. +- **The 0.8B base is weak on this task even in one pass.** At 68/168 it is below the 12-check class-size prior (102), so effects near the floor are hard to see. +- **Setup choices.** Answers come from a constrained ranking over all 64 programs with one prompt format; probes used 96 training rows. + +## Reproduce + +```sh +PYTHONPATH=.:../EvalMath/src python -m research.algernon.algebraic_reasoning_gym.arg02.analyze replay \ + --tape research/algernon/algebraic_reasoning_gym/arg02/results/arg02_answer_tape.jsonl.gz \ + --check research/algernon/algebraic_reasoning_gym/arg02/results/arg02_receipt.json +``` + +The GPU chain is `run_arg02.ps1` (README), followed by `runner test --arms test_shuffle_a1` for Amendment 1. diff --git a/research/algernon/algebraic_reasoning_gym/arg02/REPORT_NANBEIGE.md b/research/algernon/algebraic_reasoning_gym/arg02/REPORT_NANBEIGE.md new file mode 100644 index 000000000..1aeeaeb12 --- /dev/null +++ b/research/algernon/algebraic_reasoning_gym/arg02/REPORT_NANBEIGE.md @@ -0,0 +1,108 @@ +# ARG-02 extension N1 report: Nanbeige4.2-3B, a natively looped model + +**Executed 2026-11-13** on the RTX 5080 Laptop GPU under Extension N1 of [PROTOCOL.md](PROTOCOL.md), registered before any Nanbeige output on development or test rows. Development selection ran once and the test stage ran once, all from commit `65039a5`. Numbers are from [`results_nanbeige/arg02_receipt.json`](results_nanbeige/arg02_receipt.json) and [`arg02_profile.json`](results_nanbeige/arg02_profile.json), with tables in [`arg02_tables.md`](results_nanbeige/arg02_tables.md). `analyze replay` regrades the committed answer tape to the receipt (31 arms). + +Nanbeige4.2-3B (rev `451ed48c`) runs its 22 layers plus the final norm as one loop and was trained with 2 loops. Depth here is the number of loops; the adapter's loop-t readout equals the model's own forward with `num_loops = t` exactly on the real weights. + +## Answer + +**Recurrence helps this model, but the registered mechanism claim is not met.** + +- **The gain over one pass.** At the selected depth of 8 loops the model recovered **71 of 168** test programs with correct withheld futures within 12 exact checks, against **44** for one pass: +27, cluster 95% CI [+0.057, +0.268] per case, McNemar p = 0.002. +- **What the gain survives.** + - It beats an equal-compute ensemble of 8 single-loop forwards: 51, giving +20, CI [+0.012, +0.230], p = 0.029. + - It beats the donor-shuffled recurrent state: 62, giving +9, CI [+0.016, +0.096], p = 0.012. +- **Where it fails.** The open-loop control comes within the interval: 55, giving +16, CI [-0.024, +0.215], p = 0.097. That is the one registered rule that fails. +- **Most of the gain is the trained second loop.** + - Loop 2 vs loop 1: +21, p = 0.040. + - Loop 8 vs loop 2: +6, CI [-0.099, +0.173], p = 0.61. + - At depth 2, swapping in another case's recurrent displacement changes only 6 of 168 outcomes. +- **Still far below exact search.** The best Nanbeige arm stays below the 12-check class-size prior (102) and the complete certified class search (159). + +## Development selection + +| Choice | Development result (132 rows, future-correct@12) | Selected | +|---|---|---| +| shots, at loop 1 | 0 shots: 49; 4 shots: 48 | 0 shots | +| depth d* in {2, 4, 8} | loop 1: 49; loop 2: 45; loop 4: 53; loop 8: 63 | d* = 8 | + +## Test results (168 positives; 12 negatives and 6 collision pairs as controls) + +| Arm | future@12 | accepted@12 | top-1 future | novel generators (/96) | GPU s | PFLOP | p50 / p95 ms per case | +|---|---:|---:|---:|---:|---:|---:|---:| +| loop 1 (initial pass) | 44 | 53 | 10 | 25 | 147 | 7.0 | 743 / 897 | +| loop 2 (trained depth) | 65 | 72 | 6 | 37 | 287 | 14.0 | 1,454 / 1,767 | +| loop 4 | 76 | 85 | 11 | 45 | 562 | 28.0 | 2,852 / 3,396 | +| **loop 8 = d\*** | **71** | 83 | 8 | 46 | 1,119 | 56.0 | 5,673 / 6,954 | +| open loop, 8 | 55 | 63 | 11 | 28 | 151 | 7.0 | 767 / 958 | +| donor-shuffled state, 8 | 62 | 74 | 5 | 39 | 1,266 | 63.0 | 6,506 / 7,548 | +| ensemble of 8 single-loop forwards | 51 | 60 | 9 | 28 | 1,160 | 52.2 | 5,941 / 7,278 | +| external verifier-feedback controller (loop 1, <= 12 rounds) | 46 | 52 | - | 28 | 2,087 | 98.6 | 12,512 / 14,016 | +| class-size order, 12 checks (ARG-01) | 102 | 111 | - | 64 | CPU | - | 2 / 4 | +| complete certified class search (ARG-01) | 159 | 168 | - | 92 | CPU | - | 2 / 5 | +| frozen RRC-19 GRU (ARG-01) | 129 | 138 | - | 68 | CPU | - | 17 / 27 | + +GPU seconds, PFLOP and latency cover all 192 test rows. The unconstrained argmax decode was never a valid three-operator program at any depth. With 0 shots, the model's top next token after "Program:" is never an operator, so every program above comes from the constrained 64-program ranking. + +## Registered decisions (d* = 8) + +| Rule | Comparison | A - B | 95% CI per case | McNemar p | Outcome | +|---|---|---:|---|---:|---| +| H1 depth | loop 8 vs loop 1 | +27 | [+0.057, +0.268] | 0.002 | met | +| H2a feedback | loop 8 vs open loop 8 | +16 | [-0.024, +0.215] | 0.097 | not met | +| H2b state | loop 8 vs donor-shuffled 8 | +9 (10 vs 1 discordant) | [+0.016, +0.096] | 0.012 | met | +| H3a repeat | loop 8 vs ensemble of 8 forwards | +20 | [+0.012, +0.230] | 0.029 | met | +| H3b feedforward | no same-family feedforward checkpoint on this machine | | | | not applicable | +| H3c efficiency | future@12 per end-to-end second: loop 8 0.063, loop 1 0.298, ensemble 0.044 | | | | not met | +| H4 symbolic | loop 8 vs complete certified class search | -88 | [-0.614, -0.429] | < 1e-4 | not met | +| **Recurrent mechanism claim** | H1, H2a, H2b, H3a | | | | **not met (H2a)** | + +**What the open-loop control is for this model.** The loop body ends in the final norm, and the readout applies the LM head to that state directly. So the open loop's state after t steps is `t*h_1 - (t-1)*x`. Here `h_1` is about 24 times the norm of the embedding `x` (median relative step at loop 1: 23.8), so its logits are nearly `t` times the loop-1 logits. For Nanbeige the registered open-loop arm is therefore close to a temperature-sharpened single pass. That sharpening alone moves loop 1 from 44 to 55 under joint-log-probability ranking (+11, p = 0.035). The real loop's margin over it (+16 at depth 8, +17 at 2, +18 at 4) is consistent but not significant at any one depth. + +## What the intermediate states show + +- **The trained second loop carries most of the gain.** Accuracy over loops 1-8 was 44, 65, 63, 76, 80, 60, 68, 71. + - Loop 2 vs loop 1: +21, CI [0.000, +0.256], p = 0.040, with heavy churn: 58 gained, 37 lost. + - Beyond the trained depth the gains are not significant: loop 4 vs loop 2 +11, p = 0.080; loop 8 vs loop 2 +6, p = 0.61. + - Loop 5 (80) was the best step, but it was not a registered depth. +- **The second loop's effect is nearly case-agnostic.** The shuffle adds another case's loop displacement `h_t - h_1` to this case's own `h_1`. At depth 2 it scores 69 vs the loop's 65, differing on only 6 of 168 cases. At depth 4 it scores 70 vs 76 (20 discordant). Only at depth 8 does the case's own displacement matter measurably: 71 vs 62, 10 vs 1 discordant. Most of what loop 2 does to the readout is a shift common to all cases. +- **It beats repeated single-pass compute.** Eight single-loop forwards over prompt variants reach only 51; two reach 44, the same as one. The loop's gain is not something extra single-pass compute buys. +- **No convergence.** After loop 3 each loop changes the state by 63-128% of its norm, with per-loop ratios oscillating between 0.49 and 1.50. There is no fixed point. +- **Early answer-site states get repaired; late ones carry the answer.** + - Patching the five answer-site positions with a donor's states after loop 1 left 143 of 168 top-1 answers unchanged (median KL 0.012). The remaining loops largely overwrite an early corruption, which the untrained Qwen loop did not. + - The same patch after loop 4 moved 55 answers to the donor's; after loop 8, 82. +- **Perturbations grow.** + - A 0.25 x RMS kick after loop 1 grows to 2.8x the kick at loop 2, 3.9x at loop 4 and 6.9x at loop 8. + - Top-1 agreement with the clean run falls from 135 (loop 2) to 69 (loop 8). + - Accuracy at loop 8 drops from 71 to 62. +- **Probes see operator class only on seen generators.** + - The outer operator of the canonical class representative is decodable above majority on seen-generator test rows (0.32-0.42 vs 0.26 at loops 1-8). It is not decodable on novel generators (at or below the 0.406 majority at every loop). + - "Uses R" behaves the same way: 0.63-0.75 vs 0.53 on seen generators, 0.43-0.54 vs 0.50 on novel ones. + - The loop does not build a generator-independent operator representation that a linear probe can read. + +## Compared with the Qwen3.5 run (descriptive only: different models, tokenizers and training) + +| Model and arm | future@12 /168 | +|---|---:| +| Qwen3.5-0.8B, one pass (4 shots) | 68 | +| Qwen3.5-0.8B, untrained block loop at its d* = 16 | 67 | +| Qwen3.5-2B, one pass | 79 | +| Nanbeige4.2-3B, loop 1 / loop 2 (trained) / loop 8 (d*) | 44 / 65 / 71 | +| class-size prior, 12 checks | 102 | +| complete certified class search | 159 | + +An untrained loop added nothing to Qwen. Nanbeige's trained loop is needed just to reach the level of a single Qwen pass: its one-pass readout is weak, and the trained second loop restores it. Running past the trained depth adds a small, case-specific gain that the shuffle detects (+9 at 8 loops), but not a significant one over loop 2. + +## Validity checks + +- **Negatives and collision pairs.** No arm accepted any of the 12 negatives. Every arm gave identical traces for all 6 collision pairs except the shuffle (1 of 6), whose pair members have different donors by construction. +- **Row consistency.** Rows that share a prefix agree exactly (row spread 0) in every arm. +- **Cross-check against ARG-01.** ARG-01's `external.py` scorer agrees with ARG-02's top-1 grading at loops 1, 2, 4 and 8. +- **Provenance and resources.** All three stages ran from clean commit `65039a5`. Peak allocated VRAM was 8.4-8.8 GiB per stage. Loop 8 took 7.6x the GPU time of one loop (1,119 vs 147 s over 192 rows). +- **Same inputs as Qwen.** The exported public rows hash identically to the Qwen run's. + +## Scope + +- No non-looped Nanbeige checkpoint was available, so a same-family feedforward control (H3b) is missing; nothing was downloaded. +- Development chose 0 shots (49 vs 48). The unconstrained readout never produces the answer format, so the constrained ranking is the only answer channel. +- Probes were trained on 96 rows. diff --git a/research/algernon/algebraic_reasoning_gym/arg02/STATUS.md b/research/algernon/algebraic_reasoning_gym/arg02/STATUS.md new file mode 100644 index 000000000..2e6cad92d --- /dev/null +++ b/research/algernon/algebraic_reasoning_gym/arg02/STATUS.md @@ -0,0 +1,26 @@ +# ARG-02 status + +**2026-11-13: Extension N1 (Nanbeige4.2-3B, natively looped) executed.** See [REPORT_NANBEIGE.md](REPORT_NANBEIGE.md). Development chose 0 shots and d* = 8 loops; on the test rows loop 8 recovered 71/168 vs 44 for one loop. H1, H2b and H3a are met; H2a (open loop) is not, so the mechanism claim is not met; H3b is not applicable. Results in `results_nanbeige/`; run directory `C:\Users\patri\Documents\Codex\algernon\runs\arg02-nanbeige`; commit 65039a5 for every stage. + +## Qwen3.5 run + +**2026-11-11: executed. Negative result.** See [REPORT.md](REPORT.md). + +- Development selection (once): 4 shots, block `[8,12)`, d* = 16. +- Test stage (once, 192 rows): loop(16) 67/168 future-correct at 12 checks vs 68 for the single pass; mechanism claim not met (H1, H2b, H3a, H3b, H3c, H4 not met; H2a met only because the open-loop ablation is destructive). Qwen3.5-2B single pass 79; complete certified class search 159. +- Amendment 1 (PROTOCOL.md): the donor-shuffle alignment defect was found by the row-spread diagnostic after the run; the corrected arm was rerun alone (66/168 at d = 16). Decisions are unchanged. +- Receipts: `results/arg02_receipt.json` (deterministic, regraded by `analyze replay` from `results/arg02_answer_tape.jsonl.gz`), `results/arg02_profile.json` (timings, compute, peak VRAM, run manifests), `results/arg02_traces.jsonl.gz` (per-case grades for 48 arms), `results/arg02_tables.md`. +- Run directory with every part, captured states and logs (outside Git): moved on 2026-11-13 from `C:\Users\patri\Documents\Codex\algernon\runs\arg02` to the private Hugging Face dataset `AlephFunk/algernon-runs`. + +## Run log + +| Stage | Commit | Wall time | +|---|---|---| +| CPU checkpoint check | 453c15d | 2026-11-10 | +| dev shots (2 x 132 rows) | deea6c6 | 13:42-13:47 | +| dev blocks (4 x 132 rows) | deea6c6 | 13:47-14:56 | +| test, 0.8B arms (192 rows) | deea6c6 | 14:56-19:15 | +| test, Qwen3.5-2B (192 rows) | 547f190 | 19:17-19:26 | +| Amendment 1 shuffle rerun (192 rows) | 5b7d2bc | 19:5x-20:22 | + +The card was shared with another session's Lean job for part of the 0.8B test stage, so wall times and latencies include contention; MAC counts do not. diff --git a/research/algernon/algebraic_reasoning_gym/arg02/__init__.py b/research/algernon/algebraic_reasoning_gym/arg02/__init__.py new file mode 100644 index 000000000..f038aac5d --- /dev/null +++ b/research/algernon/algebraic_reasoning_gym/arg02/__init__.py @@ -0,0 +1,6 @@ +"""ARG-02: recurrent-depth evaluation of a pretrained Qwen checkpoint on the ARG-01 gym. + +Torch-free modules: splits, prompts, scoring, stats, flops, probe, analyze, +symbolic. Torch modules: recurrence, runner. The EvalMath oracle is imported, +never copied. +""" diff --git a/research/algernon/algebraic_reasoning_gym/arg02/analyze.py b/research/algernon/algebraic_reasoning_gym/arg02/analyze.py new file mode 100644 index 000000000..71d022886 --- /dev/null +++ b/research/algernon/algebraic_reasoning_gym/arg02/analyze.py @@ -0,0 +1,771 @@ +"""ARG-02 oracle side: export public rows, select dev settings, grade, report. + + export --run-dir D [--sample N] public JSONL for the runner + split audit + select --run-dir D --stage shots|blocks + report --run-dir D --out DIR grade every part, statistics, probes, tape + replay --tape T --check R regrade a committed answer tape (CPU, no model) + +Grading uses `oracle.search` / `oracle.grade` only; futures never leave them. +""" +from __future__ import annotations + +import argparse +import gzip +from hashlib import sha256 +import json +import math +from pathlib import Path + +from spiral_ln import algebraic_reasoning_oracle as oracle + +from research.algernon.algebraic_reasoning_gym import external +from . import flops, scoring, splits, stats +from .settings import ff_entry, load_config, model_entry + +HERE = Path(__file__).resolve().parent +CONFIG = HERE / "config" / "arg02_config.json" +LOCK = HERE / "config" / "checkpoint_lock.json" +RESULT_SCHEMA = "algernon.arg02.receipt.v1" + + +def load_json(path): + return json.loads(Path(path).read_text(encoding="utf-8")) + + +def dump(obj): + return json.dumps(obj, sort_keys=True, indent=2) + "\n" + + +def file_sha256(path): + return sha256(Path(path).read_bytes()).hexdigest() + + +def write(path, text): + path = Path(path) + path.parent.mkdir(parents=True, exist_ok=True) + path.write_text(text, encoding="utf-8", newline="\n") + + +# ---------------------------------------------------------------- export + +def _sample(cases, n, key): + out, count = [], {} + for c in cases: + k = key(c) + if count.get(k, 0) < n: + out.append(c) + count[k] = count.get(k, 0) + 1 + return out + + +def cmd_export(args): + run = Path(args.run_dir) + test = splits.test_cases() + ext_rows = list(external.public_records()) + if ext_rows != [splits.public_record(c) for c in test]: + raise AssertionError("ARG-02 test rows differ from the ARG-01 public export") + dev = splits.development_cases() + if args.sample: + test = _sample(test, args.sample, lambda c: c.split) + dev = _sample(dev, args.sample, lambda c: (c.split, c.family)) + splits.write_public(run / "public" / "test.jsonl", test) + splits.write_public(run / "public" / "development.jsonl", dev) + write(run / "public" / "shots.json", json.dumps([splits.shot_record(c) for c in splits.shot_cases()], indent=1) + "\n") + audit = splits.audit() + write(run / "splits_audit.json", dump(audit)) + manifest = {"sample": args.sample, "files": {p.name: file_sha256(p) for p in sorted((run / "public").iterdir())}, + "audit_sha256": sha256(json.dumps(audit, sort_keys=True).encode()).hexdigest()} + if args.profile != "qwen": + manifest["profile"] = args.profile + write(run / "export_manifest.json", dump(manifest)) + print("exported", len(test), "test and", len(dev), "development rows to", run / "public") + + +# ---------------------------------------------------------------- loading + +def all_cases(): + cases = {c.identifier: c for c in splits.test_cases()} + cases.update({c.identifier: c for c in splits.development_cases()}) + return cases + + +def public_ids(run, split): + return [json.loads(l)["case_id"] for l in (Path(run) / "public" / f"{split}.jsonl").read_text().splitlines() if l.strip()] + + +def load_label(run, label, ids, *, allow_partial=False): + root = Path(run) / "parts" / label + out, keys = {}, set() + for cid in ids: + import re + p = root / (re.sub(r"[^A-Za-z0-9_.-]", "_", cid) + ".json") + if not p.exists(): + if allow_partial: + continue + raise FileNotFoundError(f"missing part {label}/{cid}") + rec = load_json(p) + if rec["id"] != cid: + raise AssertionError("part id mismatch") + keys.add(json.dumps(rec["key"], sort_keys=True)) + out[cid] = rec["value"] + if len(keys) > 1: + raise AssertionError(f"{label}: parts written under {len(keys)} different keys") + key = json.loads(next(iter(keys))) if keys else None + return out, key + + +def load_states(run, label, cid): + import re + import numpy as np + p = Path(run) / "parts" / label / (re.sub(r"[^A-Za-z0-9_.-]", "_", cid) + ".npz") + with np.load(p) as z: + return z["states"] + + +def op_ids(run, model_key="model"): + return load_json(Path(run) / f"op_ids_{model_key}.json") + + +# ---------------------------------------------------------------- selection + +def _future12(case, rec, ops): + return scoring.score_record(case, rec, ops)["at12"]["future_correct"] + + +def is_smoke(run): + return load_json(Path(run) / "export_manifest.json").get("sample") is not None + + +def run_config(run): + """Config for a run directory: its export decides smoke and model profile.""" + manifest = load_json(Path(run) / "export_manifest.json") + return load_config(manifest.get("sample") is not None, manifest.get("profile", "qwen")) + + +def cmd_select(args): + run = Path(args.run_dir) + cfg = run_config(run) + cases = all_cases() + ids = public_ids(run, "development") + ops = op_ids(run) + if args.stage == "shots": + table = {} + for k in cfg["shot_options"]: + parts, _ = load_label(run, f"dev_shots_k{k}", ids, allow_partial=args.allow_partial) + table[str(k)] = {"cases": len(parts), + "future12": sum(_future12(cases[c], v["records"]["1"], ops) for c, v in parts.items())} + best = max(cfg["shot_options"], key=lambda k: (table[str(k)]["future12"], -k)) + sel = {"stage": "shots", "shots": best, "table": table, + "rule": "max development future-correct at 12 checks, depth 1; tie -> fewer shots"} + write(run / "selection_shots.json", dump(sel)) + print(dump(sel), end="") + return + shots_sel = load_json(run / "selection_shots.json") + table = {} + for block in cfg["block_candidates"]: + label = f"dev_block_{block[0]}_{block[1]}" + parts, _ = load_label(run, label, ids, allow_partial=args.allow_partial) + row = {} + for d in cfg["depths"]: + row[str(d)] = sum(_future12(cases[c], v["records"][str(d)], ops) for c, v in parts.items()) + table[label] = {"cases": len(parts), "future12_by_depth": row} + candidates = [] + for order, block in enumerate(cfg["block_candidates"]): + label = f"dev_block_{block[0]}_{block[1]}" + for d in cfg["depths"]: + if d > 1: + candidates.append((table[label]["future12_by_depth"][str(d)], -d, -order, block, d)) + best = max(candidates) + block, depth = best[3], best[4] + base = table[f"dev_block_{block[0]}_{block[1]}"]["future12_by_depth"]["1"] + sel = {"stage": "blocks", "shots": shots_sel["shots"], "block": block, "depth": depth, + "dev_future12_selected": best[0], "dev_future12_depth1": base, "dev_gain": best[0] - base, + "table": table, "selection_shots_sha256": file_sha256(run / "selection_shots.json"), + "rule": "max development future-correct at 12 checks over blocks x depths>1; tie -> smaller depth, earlier block"} + write(run / "selection.json", dump(sel)) + print(dump(sel), end="") + + +# ---------------------------------------------------------------- grading + +def _row(case): + return {"family": case.family, "split": case.split, "topology": case.topology, + "positive": case.split in splits.POSITIVE_SPLITS, "novel": case.family in splits.NOVEL_FAMILIES} + + +def _compact(g): + return {"top1": g["top1"], "rank_of_source": g["rank_of_source"], "greedy_valid": g["greedy_valid"], + "greedy_program": g["greedy"]["program"], "greedy_accepted": g["greedy"]["accepted"], + "greedy_future": g["greedy"]["future_correct"], + "at1": {k: g["at1"][k] for k in ("accepted", "future_correct", "false_future", "program")}, + "at12": {k: g["at12"][k] for k in ("accepted", "future_correct", "false_future", "queries", + "integer_loop_proxy", "program", "trace")}, + "verify_ns": g["at12"]["verify_ns"]} + + +TAPE_DECIMALS = 6 + + +def _rounded(rec): + """Tape form of a runner record: log-probs rounded to 1e-6 before grading, + so the committed tape regrades to exactly the committed receipt.""" + r = lambda x: round(float(x), TAPE_DECIMALS) + return {"lp1": [r(x) for x in rec["lp1"]], "lp2": [[r(x) for x in row] for row in rec["lp2"]], + "lp3": [[[r(x) for x in col] for col in row] for row in rec["lp3"]], + "g1": int(rec["g1"]), "g2": [int(x) for x in rec["g2"]], "g3": [[int(x) for x in row] for row in rec["g3"]], + "row_spread": r(rec.get("row_spread", 0.0))} + + +def answer_tape(run, ids, sel, cfg): + """Every model answer record of the test run, keyed (case, arm, step).""" + tape = _tape(run, ids, with_ff=ff_entry(cfg) is not None) + for item in tape: + if "record" in item: + item["record"] = _rounded(item["record"]) + return tape + + +def has_amended_shuffle(run, ids): + """Amendment 1: the donor shuffle rerun with corrected alignment (all test rows present).""" + root = Path(run) / "parts" / "test_shuffle_a1" + return root.is_dir() and len(list(root.glob("*.json"))) >= len(ids) + + +def _tape(run, ids, with_ff=True): + tape = [] + loop, _ = load_label(run, "test_loop", ids) + for cid in ids: + for t, r in loop[cid]["records"].items(): + tape.append({"case": cid, "arm": "loop", "step": int(t), "record": r}) + labels = [("test_open", "open"), ("test_shuffle", "shuffle"), ("test_perturb", "perturb")] + if has_amended_shuffle(run, ids): + labels.append(("test_shuffle_a1", "shuffle_a1")) + for label, arm in labels: + parts, _ = load_label(run, label, ids) + for cid in ids: + for t, r in parts[cid]["records"].items(): + tape.append({"case": cid, "arm": arm, "step": int(t), "record": r}) + ens, _ = load_label(run, "test_ensemble", ids) + for cid in ids: + for v, r in ens[cid]["records"].items(): + tape.append({"case": cid, "arm": "ensemble:" + v, "step": 1, "record": r}) + patch, _ = load_label(run, "test_patch", ids) + for cid in ids: + for t, r in patch[cid]["patches"].items(): + tape.append({"case": cid, "arm": "patch", "step": int(t), "record": r["record"], + "donor": patch[cid]["donor"]}) + if with_ff: + ff, _ = load_label(run, "test_ff", ids) + for cid in ids: + tape.append({"case": cid, "arm": "ff2b", "step": 1, "record": ff[cid]["records"]["1"]}) + ctl, _ = load_label(run, "test_controller", ids) + for cid in ids: + tape.append({"case": cid, "arm": "controller", "step": len(ctl[cid]["tested"]), + "tested": ctl[cid]["tested"]}) + return tape + + +def grade_tape(tape, cases, ops, cfg, sel): + """Deterministic grades of a tape. Returns {arm_key: {case: compact grade}}.""" + by = {} + ens = {} + for item in tape: + case = cases[item["case"]] + arm = item["arm"] + if arm == "controller": + g = scoring.score_controller(case, [tuple(p) for p in item["tested"]]) + by.setdefault("controller", {})[item["case"]] = { + "accepted": g["accepted"], "future_correct": g["future_correct"], "false_future": g["false_future"], + "queries": g["queries"], "integer_loop_proxy": g["integer_loop_proxy"], "program": g["program"], + "trace": g["trace"], "verify_ns": g["verify_ns"]} + continue + if arm.startswith("ensemble:"): + ens.setdefault(item["case"], {})[arm.split(":", 1)[1]] = item["record"] + continue + key = f"{arm}@{item['step']}" + by.setdefault(key, {})[item["case"]] = _compact(scoring.score_record(case, item["record"], ops)) + block = sel["block"] + n = model_entry(cfg)["text_config"]["num_hidden_layers"] + sizes = flops.ensemble_sizes(n, block, cfg["depths"], len(cfg["ensemble_variants"])) + for cid, recs in ens.items(): + for d, m in sizes.items(): + chosen = [recs[v] for v in cfg["ensemble_variants"][:m]] + g = scoring.score_scores(cases[cid], scoring.ensemble_scores(chosen), None) + by.setdefault(f"ensemble@{d}", {})[cid] = _compact(g) + return by, sizes + + +def write_tape(path, tape): + path = Path(path) + path.parent.mkdir(parents=True, exist_ok=True) + with gzip.GzipFile(path, "wb", mtime=0) as fh: + for item in tape: + fh.write((json.dumps(item, sort_keys=True, separators=(",", ":")) + "\n").encode()) + + +def read_tape(path): + with gzip.open(path, "rt", encoding="utf-8") as fh: + return [json.loads(l) for l in fh if l.strip()] + + +# ---------------------------------------------------------------- summaries + +def summarise(grades, ids, cases): + pos = [c for c in ids if cases[c].split in splits.POSITIVE_SPLITS] + out = {} + for arm, g in sorted(grades.items()): + def tot(cids, path): + s = 0 + for c in cids: + v = g[c] + for k in path: + v = v[k] + s += v + return s + nested = "at12" in next(iter(g.values())) + f12 = ("at12", "future_correct") if nested else ("future_correct",) + a12 = ("at12", "accepted") if nested else ("accepted",) + rec = {"positives": len(pos), "future12": tot(pos, f12), "accepted12": tot(pos, a12)} + if nested: + rec.update({"future1": tot(pos, ("at1", "future_correct")), "accepted1": tot(pos, ("at1", "accepted")), + "greedy_valid": tot(pos, ("greedy_valid",)), "greedy_accepted": tot(pos, ("greedy_accepted",)), + "greedy_future": tot(pos, ("greedy_future",)), "queries12": tot(pos, ("at12", "queries")), + "mean_rank_of_source": sum(g[c]["rank_of_source"] for c in pos) / len(pos)}) + rec["invalid_program_rate"] = 1 - rec["greedy_valid"] / len(pos) + rec["by_family"] = {f: sum(1 for c in pos if cases[c].family == f and _get(g[c], f12)) + for f in splits.POSITIVE_SPLITS} + rec["novel_future12"] = sum(1 for c in pos if cases[c].family in splits.NOVEL_FAMILIES and _get(g[c], f12)) + neg = [c for c in ids if cases[c].split == "negative"] + rec["negative_accepted"] = sum(_get(g[c], a12) for c in neg) + col = [c for c in ids if cases[c].split == "collision"] + rec["collision_false_future"] = sum(_get(g[c], ("at12", "false_future") if nested else ("false_future",)) for c in col) + pairs = {} + for c in col: + pairs.setdefault(cases[c].pair_id, []).append(c) + tr = ("at12", "trace") if nested else ("trace",) + rec["collision_pairs_identical_trace"] = sum(1 for p in pairs.values() if len(p) == 2 and + _get(g[p[0]], tr) == _get(g[p[1]], tr)) + out[arm] = rec + return out + + +def _get(v, path): + for k in path: + v = v[k] + return v + + +def outcome(g, path=("at12", "future_correct")): + return {c: (_get(v, path) if "at12" in v else v["future_correct"]) for c, v in g.items()} + + +def compare(grades, a, b, pos, cases, path=("at12", "future_correct")): + va, vb = outcome(grades[a], path), outcome(grades[b], path) + cl = [f"{cases[c].family}|{cases[c].topology}" for c in pos] + return stats.paired([va[c] for c in pos], [vb[c] for c in pos], cl) + + +def symbolic_grades(sym): + return {f"symbolic:{arm}": rows for arm, rows in sym.items()} + + +# ---------------------------------------------------------------- compute + +def _macs(tc, length, layers, rows=16): + return flops.forward_macs(tc, length, rows, layers) + + +def compute_table(run, ids, sel, cfg, grades, sizes, sym, sym_meta): + entry, ffe = model_entry(cfg), ff_entry(cfg) + tc = entry["text_config"] + tcff = ffe["text_config"] if ffe else None + block = tuple(sel["block"]) + loop, _ = load_label(run, "test_loop", ids) + opn, _ = load_label(run, "test_open", ids) + shuffles = [("shuffle", load_label(run, "test_shuffle", ids)[0])] + if has_amended_shuffle(run, ids): + shuffles.append(("shuffle_a1", load_label(run, "test_shuffle_a1", ids)[0])) + ens, _ = load_label(run, "test_ensemble", ids) + ff = load_label(run, "test_ff", ids)[0] if ffe else None + ctl, _ = load_label(run, "test_controller", ids) + per = {} + + def add(arm, cid, macs, gpu_ms, tokens, layer_evals, passes, extra_cpu_ns=0): + g = grades[arm][cid] + vns = g["verify_ns"] + extra_cpu_ns + per.setdefault(arm, []).append({"case": cid, "macs": macs, "gpu_ms": gpu_ms, "tokens": tokens, + "layer_evals": layer_evals, "forward_passes": passes, + "verifier_queries": g["at12"]["queries"] if "at12" in g else g["queries"], + "integer_loop_proxy": g["at12"]["integer_loop_proxy"] if "at12" in g else g["integer_loop_proxy"], + "verify_ms": vns / 1e6, "end_to_end_ms": gpu_ms + vns / 1e6}) + + a, b = block + for cid in ids: + lv = loop[cid] + L = lv["usage"]["length"] + tm = lv["usage"]["timing"] + for d in range(1, max(cfg["depths"]) + 1): + layers = flops.path(tc, block, d) + ms = tm["prelude_ms"] + sum(tm["block_ms"][:d]) + tm["readout_ms"][str(d)] + add(f"loop@{d}", cid, _macs(tc, L, layers), ms, 16 * L, 16 * L * len(layers), 1) + ov = opn[cid] + otm = ov["usage"]["timing"] + for d in [x for x in cfg["depths"] if x > 1]: + layers = flops.path(tc, block, 1) + ms = otm["prelude_ms"] + sum(otm["block_ms"][:d]) + otm["readout_ms"][str(d)] + add(f"open@{d}", cid, _macs(tc, L, layers), ms, 16 * L, 16 * L * len(layers), 1) + for name, shf in shuffles: + sv = shf[cid] + stm = sv["usage"]["timing"] + Ld = sv["usage"]["donor_tokens"] // 16 + for d in [x for x in cfg["depths"] if x > 1]: + own = flops.path(tc, block, 1) + donor_layers = list(range(a)) + list(range(a, b)) * d + macs = _macs(tc, L, own) + 16 * sum(flops.layer_macs(tc, i, Ld) for i in donor_layers) + dt = sv["usage"]["donor_timing"] + ms = stm["prelude_ms"] + stm["block_ms"][0] + stm["readout_ms"][str(d)] + dt["prelude_ms"] + sum(dt["block_ms"][:d]) + add(f"{name}@{d}", cid, macs, ms, 16 * (L + Ld), 16 * (L * len(own) + Ld * len(donor_layers)), 2) + ev = ens[cid] + for d, m in sizes.items(): + vs = cfg["ensemble_variants"][:m] + macs = sum(_macs(tc, ev["usage_by_variant"][v]["length"], flops.path(tc)) for v in vs) + ms = sum(ev["usage_by_variant"][v]["gpu_ms"] for v in vs) + tok = sum(16 * ev["usage_by_variant"][v]["length"] for v in vs) + add(f"ensemble@{d}", cid, macs, ms, tok, sum(ev["usage_by_variant"][v]["layer_evals"] for v in vs), m) + if ff is not None: + fv = ff[cid] + add("ff2b@1", cid, _macs(tcff, fv["usage"]["length"], flops.path(tcff)), fv["usage"]["gpu_ms"], + 16 * fv["usage"]["length"], fv["usage"]["layer_evals"], 1) + cv = ctl[cid] + macs = sum(_macs(tc, r["prompt_tokens"] + 2, flops.path(tc)) for r in cv["rounds"]) + tok = sum(16 * (r["prompt_tokens"] + 2) for r in cv["rounds"]) + add("controller", cid, macs, cv["usage"]["gpu_ms"], tok, cv["usage"]["layer_evals"], len(cv["rounds"]), + extra_cpu_ns=sum(r["check_ns"] for r in cv["rounds"])) + for arm, rows in sym.items(): + for cid in ids: + r = rows[cid] + per.setdefault(f"symbolic:{arm}", []).append({ + "case": cid, "macs": r["model_macs"], "gpu_ms": 0.0, "tokens": 0, "layer_evals": 0, + "forward_passes": 1 if r["model_macs"] else 0, "verifier_queries": r["queries"], + "integer_loop_proxy": r["integer_loop_proxy"], "verify_ms": r["verify_ns"] / 1e6, + "cpu_order_ms": r["order_ns"] / 1e6, "end_to_end_ms": (r["order_ns"] + r["verify_ns"]) / 1e6}) + summary = {} + for arm, rows in per.items(): + e2e = [r["end_to_end_ms"] for r in rows] + summary[arm] = {"cases": len(rows), "total_macs": sum(r["macs"] for r in rows), + "total_pflop": 2 * sum(r["macs"] for r in rows) / 1e15, + "gpu_seconds": sum(r["gpu_ms"] for r in rows) / 1e3, + "verifier_cpu_seconds": sum(r["verify_ms"] + r.get("cpu_order_ms", 0.0) for r in rows) / 1e3, + "end_to_end_seconds": sum(e2e) / 1e3, + "tokens": sum(r["tokens"] for r in rows), "layer_evals": sum(r["layer_evals"] for r in rows), + "forward_passes": sum(r["forward_passes"] for r in rows), + "verifier_queries": sum(r["verifier_queries"] for r in rows), + "integer_loop_proxy": sum(r["integer_loop_proxy"] for r in rows), + "latency_ms_p50": stats.quantile(e2e, 0.5), "latency_ms_p95": stats.quantile(e2e, 0.95)} + summary["_shared"] = {"symbolic_checkpoint_load_ms": sym_meta["checkpoint_load_ns"] / 1e6, + "symbolic_class_compile_ms": sym_meta["class_compile_ns"] / 1e6} + return summary, per + + +def peaks(run, ids, cfg): + out = {} + labels = ["test_loop", "test_perturb", "test_open", "test_shuffle", "test_patch", "test_ensemble", + "test_controller"] + (["test_ff"] if ff_entry(cfg) else []) + \ + (["test_shuffle_a1"] if has_amended_shuffle(run, ids) else []) + for label in labels: + parts, _ = load_label(run, label, ids) + vals = [v.get("peak_bytes") for v in parts.values() if v.get("peak_bytes") is not None] + out[label] = max(vals) if vals else None + return out + + +# ---------------------------------------------------------------- intermediate states + +def depth_analysis(grades, ids, cases, cfg, run): + pos = [c for c in ids if cases[c].split in splits.POSITIVE_SPLITS] + T = max(cfg["depths"]) + curve = {} + for t in range(1, T + 1): + g = grades[f"loop@{t}"] + curve[str(t)] = {"future12": sum(g[c]["at12"]["future_correct"] for c in pos), + "future1": sum(g[c]["at1"]["future_correct"] for c in pos), + "accepted1": sum(g[c]["at1"]["accepted"] for c in pos), + "greedy_valid": sum(g[c]["greedy_valid"] for c in pos), + "greedy_accepted": sum(g[c]["greedy_accepted"] for c in pos)} + first = {} + for c in pos: + hit = next((t for t in range(1, T + 1) if grades[f"loop@{t}"][c]["at1"]["future_correct"]), None) + first[c] = hit + hist = {} + for v in first.values(): + hist[str(v)] = hist.get(str(v), 0) + 1 + later = [c for c, v in first.items() if v is not None and v > 1] + damage = {} + for d in [x for x in cfg["depths"] if x > 1]: + for k, path in (("at1", ("at1", "future_correct")), ("at12", ("at12", "future_correct"))): + g1, gd = grades["loop@1"], grades[f"loop@{d}"] + damage[f"{k}@{d}"] = {"lost": sum(1 for c in pos if _get(g1[c], path) and not _get(gd[c], path)), + "gained": sum(1 for c in pos if _get(gd[c], path) and not _get(g1[c], path))} + loop, _ = load_label(run, "test_loop", ids) + res = [[loop[c]["residual"][t] for c in ids] for t in range(T)] + residual = {str(t + 1): {"median": stats.quantile(res[t], 0.5), "p95": stats.quantile(res[t], 0.95)} for t in range(T)} + reduction = {str(t + 1): stats.quantile([loop[c]["residual"][t] / max(loop[c]["residual"][t - 1], 1e-12) for c in ids], 0.5) + for t in range(1, T)} + return {"curve": curve, "first_success_step_hist": hist, "first_success_after_step1": len(later), + "first_success_after_step1_kept_at_T": sum(1 for c in later if grades[f"loop@{T}"][c]["at1"]["future_correct"]), + "damage": damage, "residual_relative_norm": residual, "residual_reduction_median": reduction} + + +def perturb_analysis(grades, ids, cases, cfg, run): + pos = [c for c in ids if cases[c].split in splits.POSITIVE_SPLITS] + pert, _ = load_label(run, "test_perturb", ids) + out = {"sigma": cfg["perturb"]["sigma"], "step": cfg["perturb"]["step"], "readouts": {}} + for t in cfg["perturb"]["readout_steps"]: + gp, gc = grades[f"perturb@{t}"], grades[f"loop@{t}"] + out["readouts"][str(t)] = {"future12": sum(gp[c]["at12"]["future_correct"] for c in pos), + "clean_future12": sum(gc[c]["at12"]["future_correct"] for c in pos), + "top1_agrees_with_clean": sum(gp[c]["top1"] == gc[c]["top1"] for c in pos)} + T = cfg["perturb"]["depth"] + rel = [[pert[c]["distance"][t] / max(pert[c]["kick_norm"], 1e-12) for c in ids] for t in range(T)] + out["distance_over_kick_median"] = {str(t + 1): stats.quantile(rel[t], 0.5) for t in range(T)} + return out + + +def _grammar_dist(rec): + s = scoring.joint_scores(rec) + m = max(s) + z = sum(math.exp(x - m) for x in s) + return [math.exp(x - m) / z for x in s] + + +def patch_analysis(run, ids, cases, grades, sel, tape_index): + pos = [c for c in ids if cases[c].split in splits.POSITIVE_SPLITS] + patch, _ = load_label(run, "test_patch", ids) + depth = patch[ids[0]]["depth"] + out = {"depth": depth, "steps": {}} + for t in patch[ids[0]]["patches"]: + n_own = n_donor = n_changed = 0 + kls = [] + for c in pos: + donor = patch[c]["donor"] + g = grades[f"patch@{t}"][c] + own = grades[f"loop@{depth}"][c]["top1"] + don = grades[f"loop@{depth}"][donor]["top1"] + n_own += g["top1"] == own + n_donor += g["top1"] == don and don != own + n_changed += g["top1"] != own + p = _grammar_dist(tape_index[("patch", t, c)]) + q = _grammar_dist(tape_index[("loop", str(depth), c)]) + kls.append(sum(x * (math.log(x) - math.log(y)) for x, y in zip(p, q) if x > 0)) + out["steps"][t] = {"cases": len(pos), "top1_kept": n_own, "top1_to_donor": n_donor, "top1_changed": n_changed, + "kl_median": stats.quantile(kls, 0.5), "kl_p95": stats.quantile(kls, 0.95), + "future12": sum(grades[f"patch@{t}"][c]["at12"]["future_correct"] for c in pos)} + return out + + +def probe_analysis(run, ids, cases, sel, cfg): + import numpy as np + from research.rrc_compactification import learn18 + from . import probe + classes_map = learn18.class_map() + + def labels(case): + rep = classes_map[case.topology]["mapping"][tuple(case.source_graph)] + return {"outer_op": rep[2], "uses_R": "R" in rep} + + dev_ids = public_ids(run, "development") + block = sel["block"] + dlabel = f"dev_block_{block[0]}_{block[1]}" + train = [c for c in dev_ids if not c.startswith("calibration:")] + select_ids = [c for c in dev_ids if c.startswith("calibration:")] + pos = [c for c in ids if cases[c].split in splits.POSITIVE_SPLITS] + seen = [c for c in pos if cases[c].family in splits.SEEN_FAMILIES] + novel = [c for c in pos if cases[c].family in splits.NOVEL_FAMILIES] + S = {c: load_states(run, dlabel, c)[:, 0, :] for c in train + select_ids} + S.update({c: load_states(run, "test_loop", c)[:, 0, :] for c in pos}) + steps = sorted(set(range(0, max(cfg["depths"]) + 1)) & set(range(S[train[0]].shape[0])) & + set(range(S[pos[0]].shape[0]))) + out = {"train": len(train), "select": len(select_ids), "test_seen": len(seen), "test_novel": len(novel), + "site": "block output at the last prompt token, step 0 = block input", "labels": {}} + for name, classes in (("outer_op", list(oracle.OPS)), ("uses_R", [False, True])): + per = {} + for t in steps: + X = lambda cs: np.stack([S[c][t] for c in cs]) + Y = lambda cs: [labels(cases[c])[name] for c in cs] + per[str(t)] = probe.evaluate(X(train), Y(train), X(select_ids), Y(select_ids), + {"seen": (X(seen), Y(seen)), "novel": (X(novel), Y(novel))}, classes) + out["labels"][name] = per + return out + + +def external_crosscheck(grades, ids, cases, revision, tmp): + """Top-1 loop answers through ARG-01's external.py scorer (depths 1, 2, 4, 8).""" + rows = [] + depths = [d for d in external.DEPTHS if f"loop@{d}" in grades] + for d in depths: + for c in ids: + rows.append({"case_id": c, "public_sha256": cases[c].signature, "depth": d, + "program": grades[f"loop@{d}"][c]["top1"], "model_revision": revision}) + tmp.parent.mkdir(parents=True, exist_ok=True) + tmp.write_text("".join(json.dumps(r, sort_keys=True) + "\n" for r in rows)) + ext = external.score(tmp) + agree = {} + for d in depths: + mine = sum(grades[f"loop@{d}"][c]["at1"]["accepted"] for c in ids) + agree[str(d)] = {"arg01_exact_accepted": ext["scores"][str(d)]["exact_accepted"], "arg02_at1_accepted": mine, + "arg01_future_correct": ext["scores"][str(d)]["future_correct"], + "arg02_at1_future": sum(grades[f"loop@{d}"][c]["at1"]["future_correct"] for c in ids)} + if agree[str(d)]["arg01_exact_accepted"] != mine: + raise AssertionError("ARG-01 external scorer disagrees with ARG-02 grading") + return {"proposal_sha256": ext["proposal_sha256"], "by_depth": agree} + + +# ---------------------------------------------------------------- decisions + +def decisions(cmp, compute, summary, sel, sizes): + d = sel["depth"] + ok = lambda r: r["difference"] > 0 and r["cluster_ci95"][0] > 0 + eff = lambda arm: summary[arm]["future12"] / max(compute[arm]["end_to_end_seconds"], 1e-12) + res = { + "H1_depth": ok(cmp[f"loop@{d}_vs_loop@1"]) and cmp[f"loop@{d}_vs_loop@1"]["mcnemar_p"] < 0.05, + "H2a_feedback": ok(cmp[f"loop@{d}_vs_open@{d}"]), + # Amendment 1: H2b is evaluated on the corrected shuffle when it exists; the + # original arm's outcome is kept alongside. + "H2b_state": ok(cmp.get(f"loop@{d}_vs_shuffle_a1@{d}", cmp[f"loop@{d}_vs_shuffle@{d}"])), + "H2b_state_original_shuffle": ok(cmp[f"loop@{d}_vs_shuffle@{d}"]), + "H3a_repeat": ok(cmp[f"loop@{d}_vs_ensemble@{d}"]), + # None: the profile has no same-family feedforward checkpoint. + "H3b_ff": ok(cmp[f"loop@{d}_vs_ff2b@1"]) if f"loop@{d}_vs_ff2b@1" in cmp else None, + "H3c_efficiency": eff(f"loop@{d}") > eff("loop@1") and eff(f"loop@{d}") > eff(f"ensemble@{d}"), + "H4_symbolic": summary[f"loop@{d}"]["future12"] >= summary["symbolic:certified_mass_full"]["future12"] and + eff(f"loop@{d}") > eff("symbolic:certified_mass_full"), + } + res["mechanism_claim"] = all(res[k] for k in ("H1_depth", "H2a_feedback", "H2b_state", "H3a_repeat", "H3b_ff") + if res[k] is not None) + res["efficiency_future12_per_e2e_second"] = {arm: eff(arm) for arm in + (f"loop@{d}", "loop@1", f"ensemble@{d}", "ff2b@1", "controller", + "symbolic:certified_mass_full", "symbolic:certified_mass12", + "symbolic:exhaustive_64", "symbolic:frozen_gru") + if arm in summary and arm in compute} + res["selected"] = {"block": sel["block"], "depth": d, "shots": sel["shots"], "ensemble_size": sizes[d]} + return res + + +def cmd_report(args): + run = Path(args.run_dir) + smoke = is_smoke(run) + cfg = run_config(run) + has_ff = ff_entry(cfg) is not None + sel = load_json(run / "selection.json") + sel["smoke"] = smoke + cases = all_cases() + ids = public_ids(run, "test") + ops = op_ids(run) + tape = answer_tape(run, ids, sel, cfg) + grades, sizes = grade_tape(tape, cases, ops, cfg, sel) + sym, sym_meta = __import__("research.algernon.algebraic_reasoning_gym.arg02.symbolic", fromlist=["run"]).run( + [cases[c] for c in ids]) + grades.update(symbolic_grades(sym)) + summary = summarise(grades, ids, cases) + pos = [c for c in ids if cases[c].split in splits.POSITIVE_SPLITS] + d = sel["depth"] + pairs = [(f"loop@{x}", "loop@1") for x in cfg["depths"] if x > 1] + pairs += [(f"loop@{d}", f"open@{d}"), (f"loop@{d}", f"shuffle@{d}"), (f"loop@{d}", f"ensemble@{d}"), + ("controller", "loop@1"), (f"loop@{d}", "symbolic:certified_mass12"), + (f"loop@{d}", "symbolic:certified_mass_full"), (f"loop@{d}", "symbolic:exhaustive_64"), + ("loop@1", "symbolic:frozen_gru"), ("loop@1", "symbolic:frozen_ff"), + ("loop@1", "symbolic:certified_mass12")] + if has_ff: + pairs += [(f"loop@{d}", "ff2b@1"), ("ff2b@1", "loop@1")] + if 2 in cfg["depths"] and d != 2: + pairs += [(f"loop@{d}", "loop@2")] + pairs += [(f"open@{x}", "loop@1") for x in cfg["depths"] if x > 1] + pairs += [(f"shuffle@{x}", "loop@1") for x in cfg["depths"] if x > 1] + if f"shuffle_a1@{d}" in grades: + pairs += [(f"loop@{d}", f"shuffle_a1@{d}")] + pairs += [(f"shuffle_a1@{x}", "loop@1") for x in cfg["depths"] if x > 1] + cmp = {f"{a}_vs_{b}": compare(grades, a, b, pos, cases) for a, b in pairs} + cmp1 = {f"{a}_vs_{b}": compare(grades, a, b, pos, cases, ("at1", "future_correct")) + for a, b in pairs if not (a.startswith("symbolic") or b.startswith("symbolic") or a == "controller")} + compute, per_case_compute = compute_table(run, ids, sel, cfg, grades, sizes, sym, sym_meta) + tape_index = {} + for item in tape: + if "record" in item: + tape_index[(item["arm"], str(item["step"]), item["case"])] = item["record"] + entry, ffe = model_entry(cfg), ff_entry(cfg) + receipt = { + "schema": RESULT_SCHEMA, "smoke": smoke, "op_ids": ops, "profile": cfg["profile"], + "model": {k: entry[k] for k in ("repo", "revision", "dtype") if k in entry}, + "ff_control": {k: ffe[k] for k in ("repo", "revision")} if ffe else None, + "selection": {k: sel[k] for k in ("shots", "block", "depth", "dev_gain", "dev_future12_selected", + "dev_future12_depth1") if k in sel}, + "ensemble_sizes": {str(k): v for k, v in sizes.items()}, + "splits": splits.audit(), + "evalmath_pin": load_json(HERE.parent / "evalmath_pin.json"), + "arg01_receipt_sha256": file_sha256(HERE.parent / "results" / "arg01_reference.json"), + "summary": summary, "paired_future12": cmp, "paired_future1": cmp1, + "depth": depth_analysis(grades, ids, cases, cfg, run), + "perturbation": perturb_analysis(grades, ids, cases, cfg, run), + "patching": patch_analysis(run, ids, cases, grades, sel, tape_index), + "probes": probe_analysis(run, ids, cases, sel, cfg), + "external_crosscheck": external_crosscheck(grades, ids, cases, entry["revision"], run / "arg01_external.jsonl"), + } + profile = {"schema": "algernon.arg02.profile.v1", "compute": compute, "peak_allocated_bytes": peaks(run, ids, cfg), + "manifests": {p.name: load_json(p) for p in sorted(run.glob("manifest_*.json"))}, + "timing_scope": "CUDA-event timings per segment; a depth-d latency is prelude + d block steps + its readout, " + "measured inside the combined trajectory; verifier time is this machine's CPU wall time at grading"} + receipt["decisions"] = decisions(cmp, compute, summary, sel, sizes) + out = Path(args.out) + write_tape(out / "arg02_answer_tape.jsonl.gz", tape) + receipt["answer_tape_sha256"] = file_sha256(out / "arg02_answer_tape.jsonl.gz") + write(out / "arg02_receipt.json", dump(receipt)) + write(out / "arg02_profile.json", dump(profile)) + with gzip.GzipFile(out / "arg02_traces.jsonl.gz", "wb", mtime=0) as fh: + for arm in sorted(grades): + for cid in ids: + row = {"arm": arm, "case_id": cid, **_row(cases[cid]), "grade": grades[arm][cid]} + fh.write((json.dumps(row, sort_keys=True, separators=(",", ":")) + "\n").encode()) + write(out / "arg02_selection.json", dump({k: v for k, v in sel.items() if k != "smoke"})) + print("wrote", out) + + +def cmd_replay(args): + """Regrade the committed tape on CPU and compare the grade-derived receipt fields.""" + receipt = load_json(args.check) + tape = read_tape(args.tape) + if file_sha256(args.tape) != receipt["answer_tape_sha256"]: + raise SystemExit("answer tape differs from receipt") + cfg = load_config(receipt["smoke"], receipt.get("profile", "qwen")) + sel = dict(receipt["selection"]) + sel["smoke"] = receipt["smoke"] + cases = all_cases() + ids = sorted({t["case"] for t in tape}, key=[c.identifier for c in splits.test_cases()].index) + ops = load_json(Path(args.op_ids)) if args.op_ids else receipt.get("op_ids") + grades, _ = grade_tape(tape, cases, ops, cfg, sel) + from . import symbolic + sym, _ = symbolic.run([cases[c] for c in ids]) + grades.update(symbolic_grades(sym)) + summary = summarise(grades, ids, cases) + if summary != receipt["summary"]: + raise SystemExit("regraded summary differs from receipt") + print("ARG-02 answer tape regraded: summary matches receipt for", len(summary), "arms") + + +def main(argv=None): + p = argparse.ArgumentParser(description=__doc__, formatter_class=argparse.RawDescriptionHelpFormatter) + p.add_argument("command", choices=["export", "select", "report", "replay"]) + p.add_argument("--run-dir") + p.add_argument("--stage", choices=["shots", "blocks"]) + p.add_argument("--sample", type=int) + p.add_argument("--profile", choices=["qwen", "nanbeige"], default="qwen", help="export: model profile of the run") + p.add_argument("--out") + p.add_argument("--allow-partial", action="store_true") + p.add_argument("--tape") + p.add_argument("--check") + p.add_argument("--op-ids") + args = p.parse_args(argv) + {"export": cmd_export, "select": cmd_select, "report": cmd_report, "replay": cmd_replay}[args.command](args) + + +if __name__ == "__main__": + main() diff --git a/research/algernon/algebraic_reasoning_gym/arg02/checkpoint_check.py b/research/algernon/algebraic_reasoning_gym/arg02/checkpoint_check.py new file mode 100644 index 000000000..120b49846 --- /dev/null +++ b/research/algernon/algebraic_reasoning_gym/arg02/checkpoint_check.py @@ -0,0 +1,166 @@ +"""Pre-run checkpoint check on CPU: file hashes, tokenizer contract, prompt +lengths, and depth-1 parity of the block-loop runner against the HF forward +on the real weights. Uses no GPU and grades nothing. + + python -m research.algernon.algebraic_reasoning_gym.arg02.checkpoint_check \\ + --run-dir D --out results/arg02_checkpoint_check.json [--parity 2] + +`--run-dir` must hold the `analyze export` output. +""" +from __future__ import annotations + +import argparse +import json +from pathlib import Path +import time + +from . import runner +from .prompts import VARIANTS +from .settings import load_config, load_lock + + +def lengths(tok, rows, shots, variants=VARIANTS): + eng = type("E", (), {})() + eng.tok, eng.shots = tok, shots + out = {} + for v in variants: + ls = [len(runner.Engine.prompt_ids(eng, r, v)) for r in rows] + out[v] = {"min": min(ls), "max": max(ls), "mean": sum(ls) / len(ls)} + return out + + +def parity(model, tok, rows, block, op_ids, n): + import torch + from .recurrence import BlockLoop, candidate_rows + bl = BlockLoop(model, block) + eng = type("E", (), {})() + eng.tok, eng.shots = tok, [] + out = [] + for row in rows[:n]: + ids = candidate_rows(runner.Engine.prompt_ids(eng, row), op_ids)[:2] + t0 = time.perf_counter() + with torch.inference_mode(): + ref = torch.log_softmax(model(input_ids=ids).logits[:, -3:].float(), -1) + emb, ctx = bl.prepare(ids) + h = bl.run(emb, 0, bl.n, ctx) + mine = torch.log_softmax(model.lm_head(bl.base.norm(h[:, -3:])).float(), -1) + x = bl.run(emb, 0, block[0], ctx) + h1 = bl.run(x, block[0], block[1], ctx) + h2 = bl.run(h1, block[0], block[1], ctx) + rel = float((h2 - h1).float().norm() / h1.float().norm()) + out.append({"case_id": row["case_id"], "tokens": ids.shape[1], + "max_abs_logprob_diff": float((ref - mine).abs().max()), + "top_token_equal": bool((ref.argmax(-1) == mine.argmax(-1)).all()), + "depth2_relative_residual": rel, "seconds": time.perf_counter() - t0}) + return out + + +def nanbeige_check(args): + """Hashes, tokenizer contract, prompt lengths and loop-count parity on the real Nanbeige weights.""" + import torch + from .recurrence import extract + lock, cfg = load_lock(), load_config(profile="nanbeige") + entry = lock["nanbeige"] + t0 = time.perf_counter() + root = runner.verify_snapshot(entry) + report = {"schema": "algernon.arg02.checkpoint_check.v1", "profile": "nanbeige", "device": args.device, + "model": {"repo": entry["repo"], "revision": entry["revision"], + "files_verified": sorted(entry["files_sha256"]), "hash_seconds": time.perf_counter() - t0}} + from . import nanbeige + tok = nanbeige.load_tokenizer(root, entry["bos_token_id"]) + op_ids = runner.op_token_ids(tok) + run = Path(args.run_dir) + test = runner.read_public(run / "public" / "test.jsonl") + dev = runner.read_public(run / "public" / "development.jsonl") + shots = runner.read_shots(run / "public" / "shots.json", max(cfg["shot_options"])) + + def lengths(rows, k): + ls = [len(tok.encode_prompt(render(r, shots=shots[:k]))) for r in rows] + return {"min": min(ls), "max": max(ls), "mean": sum(ls) / len(ls)} + from .prompts import render + report["tokenizer"] = {"op_token_ids": op_ids, "bos": entry["bos_token_id"]} + report["prompt_tokens"] = {f"{name}_shots{k}": lengths(rows, k) for name, rows in (("test", test), ("development", dev)) + for k in cfg["shot_options"]} + if args.parity: + device = torch.device(args.device) + if device.type == "cuda": + torch.cuda.set_per_process_memory_fraction(cfg["cuda_memory_fraction"], 0) + t0 = time.perf_counter() + model, tok = runner.load_model(entry, device) + report["load_seconds"] = time.perf_counter() - t0 + report["model_class"] = type(model).__name__ + report["parameters"] = sum(p.numel() for p in model.parameters()) + eng = runner.Engine(model, tok, None, [], device) + out = [] + for row in dev[:args.parity]: + ids, plen = eng.rows(row) + traj = eng.loop.trajectory(ids, op_ids, 3, readout_steps={1, 2, 3}) + item = {"case_id": row["case_id"], "tokens": int(ids.shape[1]), "loop_ms": traj["timing"]["block_ms"], + "relative_step": traj["residual"]} + for t in (1, 2, 3): + model.config.num_loops = t + with torch.inference_mode(): + h = model.model(input_ids=ids.to(device), use_cache=False).last_hidden_state + ref = extract(torch.log_softmax(model.lm_head(h[:, -3:]).float(), -1), op_ids) + mine = traj["records"][t] + diff = max(abs(a - b) for k in ("lp1", "lp2", "lp3") + for a, b in zip(torch.tensor(mine[k]).flatten().tolist(), torch.tensor(ref[k]).flatten().tolist())) + item[f"loops{t}"] = {"max_abs_logprob_diff": diff, + "argmax_equal": [mine["g1"], mine["g2"], mine["g3"]] == [ref["g1"], ref["g2"], ref["g3"]]} + model.config.num_loops = 2 + out.append(item) + report["parity"] = out + if device.type == "cuda": + report["peak_allocated_bytes"] = int(torch.cuda.max_memory_allocated()) + Path(args.out).parent.mkdir(parents=True, exist_ok=True) + Path(args.out).write_text(json.dumps(report, indent=2, sort_keys=True) + chr(10), encoding="utf-8", newline=chr(10)) + print(json.dumps(report, indent=2, sort_keys=True)) + + +def main(): + p = argparse.ArgumentParser(description=__doc__, formatter_class=argparse.RawDescriptionHelpFormatter) + p.add_argument("--run-dir", required=True) + p.add_argument("--out", required=True) + p.add_argument("--parity", type=int, default=0, help="rows to run through the real model") + p.add_argument("--profile", choices=["qwen", "nanbeige"], default="qwen") + p.add_argument("--device", default="cpu") + args = p.parse_args() + if args.profile == "nanbeige": + return nanbeige_check(args) + lock, cfg = load_lock(), load_config() + from transformers import AutoTokenizer + report = {"schema": "algernon.arg02.checkpoint_check.v1", "device": "cpu"} + for key in ("model", "ff_control"): + t0 = time.perf_counter() + root = runner.verify_snapshot(lock[key]) + report[key] = {"repo": lock[key]["repo"], "revision": lock[key]["revision"], "files_verified": sorted(lock[key]["files_sha256"]), + "hash_seconds": time.perf_counter() - t0} + tok = AutoTokenizer.from_pretrained(runner.snapshot_dir(lock["model"]), local_files_only=True) + op_ids = runner.op_token_ids(tok) + run = Path(args.run_dir) + test = runner.read_public(run / "public" / "test.jsonl") + dev = runner.read_public(run / "public" / "development.jsonl") + shots = runner.read_shots(run / "public" / "shots.json", max(cfg["shot_options"])) + report["tokenizer"] = {"class": type(tok).__name__, "op_token_ids": op_ids, + "tail_ids": tok.encode("\nProgram:", add_special_tokens=False)} + report["prompt_tokens"] = {f"test_shots{k}": lengths(tok, test, shots[:k]) for k in cfg["shot_options"]} + report["prompt_tokens"].update({f"development_shots{k}": lengths(tok, dev, shots[:k], ("canonical",)) + for k in cfg["shot_options"]}) + if args.parity: + import torch + from transformers import AutoModelForCausalLM + root = runner.snapshot_dir(lock["model"]) + t0 = time.perf_counter() + model = AutoModelForCausalLM.from_pretrained(root, dtype=torch.bfloat16, local_files_only=True, + attn_implementation="sdpa").eval() + report["load_seconds"] = time.perf_counter() - t0 + report["model_class"] = type(model).__name__ + report["text_parameters"] = sum(p.numel() for p in model.model.parameters()) + report["parity"] = parity(model, tok, dev, tuple(cfg["block_candidates"][0]), op_ids, args.parity) + Path(args.out).parent.mkdir(parents=True, exist_ok=True) + Path(args.out).write_text(json.dumps(report, indent=2, sort_keys=True) + "\n", encoding="utf-8", newline="\n") + print(json.dumps(report, indent=2, sort_keys=True)) + + +if __name__ == "__main__": + main() diff --git a/research/algernon/algebraic_reasoning_gym/arg02/config/arg02_config.json b/research/algernon/algebraic_reasoning_gym/arg02/config/arg02_config.json new file mode 100644 index 000000000..aec7e38a1 --- /dev/null +++ b/research/algernon/algebraic_reasoning_gym/arg02/config/arg02_config.json @@ -0,0 +1,188 @@ +{ + "schema": "algernon.arg02.config.v1", + "depths": [ + 1, + 2, + 4, + 8, + 16 + ], + "block_candidates": [ + [ + 12, + 16 + ], + [ + 8, + 12 + ], + [ + 16, + 20 + ], + [ + 4, + 8 + ] + ], + "shot_options": [ + 0, + 4 + ], + "budget": 12, + "ensemble_variants": [ + "canonical", + "swap", + "space", + "swap_space" + ], + "perturb": { + "step": 1, + "sigma": 0.25, + "depth": 16, + "readout_steps": [ + 1, + 2, + 4, + 8, + 16 + ], + "seed_base": 2026111105 + }, + "controller": { + "rounds": 12 + }, + "cuda_memory_fraction": 0.45, + "min_power_w": 100, + "clusters": "source family x topology", + "decision": { + "metric": "future_correct at 12 exact checks on the 168 test positives", + "ci": "cluster bootstrap 95%, 10000 resamples, seed 2026111104", + "alpha": 0.05, + "H1_depth": "loop(d*) - loop(1) > 0 with CI lower bound > 0 and exact McNemar p < alpha", + "H2a_feedback": "loop(d*) - open(d*) > 0, CI lower bound > 0", + "H2b_state": "loop(d*) - shuffle(d*) > 0, CI lower bound > 0", + "H3a_repeat": "loop(d*) - ensemble(m(d*)) > 0, CI lower bound > 0", + "H3b_ff": "loop(d*) - Qwen3.5-2B single pass > 0, CI lower bound > 0", + "H3c_efficiency": "future-correct per end-to-end second of loop(d*) above loop(1) and ensemble(m(d*))", + "H4_symbolic": "loop(d*) future-correct >= complete certified class search and higher future-correct per end-to-end second", + "mechanism_claim": "H1 and H2a and H2b and H3a and H3b" + }, + "smoke_overrides": { + "block_candidates": [ + [ + 2, + 4 + ], + [ + 4, + 6 + ] + ], + "depths": [ + 1, + 2, + 4 + ], + "shot_options": [ + 0, + 1 + ], + "perturb": { + "step": 1, + "sigma": 0.25, + "depth": 4, + "readout_steps": [ + 1, + 2, + 4 + ], + "seed_base": 2026111105 + }, + "controller": { + "rounds": 3 + }, + "note": "tiny random 8-layer Qwen3.5 on CPU; exercises every code path, scores are meaningless" + }, + "profiles": { + "nanbeige": { + "model_key": "nanbeige", + "ff_key": null, + "depths": [ + 1, + 2, + 4, + 8 + ], + "block_candidates": [ + [ + 0, + 22 + ] + ], + "ensemble_variants": [ + "canonical", + "swap", + "space", + "swap_space", + "rot1", + "swap_rot1", + "space_rot1", + "swap_space_rot1", + "rot2", + "swap_rot2", + "space_rot2", + "swap_space_rot2", + "rot3", + "swap_rot3", + "space_rot3", + "swap_space_rot3" + ], + "perturb": { + "step": 1, + "sigma": 0.25, + "depth": 8, + "readout_steps": [ + 1, + 2, + 4, + 8 + ], + "seed_base": 2026111105 + }, + "note": "Nanbeige4.2-3B, natively looped (trained at 2 loops); depth = number of full-stack loops; no same-family feedforward checkpoint on this machine, so the repeated-forward ensemble (m(d) = d forwards, up to 16 prompt variants) is the equal-compute control", + "smoke_overrides": { + "block_candidates": [ + [ + 0, + 2 + ] + ], + "depths": [ + 1, + 2, + 4 + ], + "shot_options": [ + 0, + 1 + ], + "perturb": { + "step": 1, + "sigma": 0.25, + "depth": 4, + "readout_steps": [ + 1, + 2, + 4 + ], + "seed_base": 2026111105 + }, + "controller": { + "rounds": 3 + } + }, + "cuda_memory_fraction": 0.8 + } + } +} diff --git a/research/algernon/algebraic_reasoning_gym/arg02/config/checkpoint_lock.json b/research/algernon/algebraic_reasoning_gym/arg02/config/checkpoint_lock.json new file mode 100644 index 000000000..e35eb3a6d --- /dev/null +++ b/research/algernon/algebraic_reasoning_gym/arg02/config/checkpoint_lock.json @@ -0,0 +1,241 @@ +{ + "schema": "algernon.arg02.checkpoint_lock.v1", + "locked_on": "2026-11-10", + "model": { + "repo": "Qwen/Qwen3.5-0.8B-Base", + "revision": "dc7cdfe2ee4154fa7e30f5b51ca41bfa40174e68", + "dtype": "bfloat16", + "attn_implementation": "sdpa", + "snapshot_env": "ARG02_SNAPSHOT_MAIN", + "files_sha256": { + "config.json": "b90b86f35c8e6925ef74ee04d0e758f0a845c83a42089ad82bbaa948de9b4204", + "tokenizer.json": "fe000e3ed39ed12b8d2481d527d44f93c65d37e87645d2dcc80d1bf9d50d2927", + "tokenizer_config.json": "e611fbccc7c29ef3b1cafb1cb7ea548d189968632901d678fd62be68c47885de", + "model.safetensors-00001-of-00001.safetensors": "c2b1e5a17d9c1e27685d92ed9b382911ebb99955ecd89052d1721241adfbab6c", + "model.safetensors.index.json": "ce9a885efdf27d3664fdef5d512ad365216f1074051ef840c7cd8e5431495d0a" + }, + "text_config": { + "num_hidden_layers": 24, + "hidden_size": 1024, + "intermediate_size": 3584, + "num_attention_heads": 8, + "num_key_value_heads": 2, + "head_dim": 256, + "attn_output_gate": true, + "linear_num_key_heads": 16, + "linear_num_value_heads": 16, + "linear_key_head_dim": 128, + "linear_value_head_dim": 128, + "linear_conv_kernel_dim": 4, + "vocab_size": 248320, + "tie_word_embeddings": true, + "layer_types": [ + "linear_attention", + "linear_attention", + "linear_attention", + "full_attention", + "linear_attention", + "linear_attention", + "linear_attention", + "full_attention", + "linear_attention", + "linear_attention", + "linear_attention", + "full_attention", + "linear_attention", + "linear_attention", + "linear_attention", + "full_attention", + "linear_attention", + "linear_attention", + "linear_attention", + "full_attention", + "linear_attention", + "linear_attention", + "linear_attention", + "full_attention" + ], + "model_type": "qwen3_5_text" + } + }, + "ff_control": { + "repo": "Qwen/Qwen3.5-2B-Base", + "revision": "b1485b2fa6dfa1287294f269f5fb618e03d52d7c", + "dtype": "bfloat16", + "attn_implementation": "sdpa", + "snapshot_env": "ARG02_SNAPSHOT_FF", + "files_sha256": { + "config.json": "ed1c1723241f23f7f4e23430759cbd7dcfb4103cbdfe052bfe7626b57c2615b4", + "tokenizer.json": "fe000e3ed39ed12b8d2481d527d44f93c65d37e87645d2dcc80d1bf9d50d2927", + "tokenizer_config.json": "e611fbccc7c29ef3b1cafb1cb7ea548d189968632901d678fd62be68c47885de", + "model.safetensors-00001-of-00001.safetensors": "928acbf11878c32185bbd863514d191769285065ab9ea14fbfe431303f5fdf2d", + "model.safetensors.index.json": "74d2ddfe79f10f35b27b498632f02b97b60dd9ec39b35d7c5a890c399284e319" + }, + "text_config": { + "num_hidden_layers": 24, + "hidden_size": 2048, + "intermediate_size": 6144, + "num_attention_heads": 8, + "num_key_value_heads": 2, + "head_dim": 256, + "attn_output_gate": true, + "linear_num_key_heads": 16, + "linear_num_value_heads": 16, + "linear_key_head_dim": 128, + "linear_value_head_dim": 128, + "linear_conv_kernel_dim": 4, + "vocab_size": 248320, + "tie_word_embeddings": true, + "layer_types": [ + "linear_attention", + "linear_attention", + "linear_attention", + "full_attention", + "linear_attention", + "linear_attention", + "linear_attention", + "full_attention", + "linear_attention", + "linear_attention", + "linear_attention", + "full_attention", + "linear_attention", + "linear_attention", + "linear_attention", + "full_attention", + "linear_attention", + "linear_attention", + "linear_attention", + "full_attention", + "linear_attention", + "linear_attention", + "linear_attention", + "full_attention" + ], + "model_type": "qwen3_5_text" + } + }, + "smoke": { + "repo": "smoke/tiny-random-qwen3_5", + "revision": "0000000000000000000000000000000000000000", + "dtype": "float32", + "text_config": { + "num_hidden_layers": 8, + "hidden_size": 64, + "intermediate_size": 96, + "num_attention_heads": 4, + "num_key_value_heads": 2, + "head_dim": 16, + "attn_output_gate": true, + "linear_num_key_heads": 2, + "linear_num_value_heads": 2, + "linear_key_head_dim": 16, + "linear_value_head_dim": 16, + "linear_conv_kernel_dim": 4, + "vocab_size": 128, + "tie_word_embeddings": true, + "layer_types": [ + "linear_attention", + "linear_attention", + "linear_attention", + "full_attention", + "linear_attention", + "linear_attention", + "linear_attention", + "full_attention" + ], + "model_type": "qwen3_5_text" + }, + "files_sha256": {} + }, + "recurrence": { + "mechanism": "untrained block loop over pretrained decoder layers [a,b); see recurrence.py", + "native_recurrence": false, + "trained_for_recurrence": false + }, + "inventory": { + "looped_qwen_checkpoints": "none on disk: LoopedTransformers experiments/recurrent_recovery_laco_v1 (Qwen3-0.6B LaCo recurrent block, conditions D/E) keeps manifests only; trainable.pt and checkpoints/teacher_tuned are absent", + "hybridtrmldt": "no recurrent language-model checkpoint (TRM checkpoints are task-specific, outside Git); Huginn work there used tomg-group-umd/huginn-0125", + "native_recurrent_non_qwen": "tomg-group-umd/huginn-0125 in the local HF cache (natively recurrent-depth, not Qwen); not used in ARG-02", + "qwen_cache": [ + "Qwen/Qwen3.5-0.8B-Base", + "Qwen/Qwen3.5-2B-Base", + "Qwen/Qwen3.5-4B-Base", + "Qwen/Qwen3-1.7B", + "Qwen/Qwen3-4B-Instruct-2507", + "Qwen/Qwen3-8B", + "Qwen/Qwen2.5-0.5B-Instruct" + ], + "nanbeige": "Nanbeige/Nanbeige4.2-3B: rev 451ed48c (weights) and b82e54bd (newer code only, no weights) in the local HF cache" + }, + "hardware": { + "gpu": "NVIDIA GeForce RTX 5080 Laptop GPU", + "vram_mib": 16303, + "shared": true, + "note": "other jobs held 13977 MiB at lock time" + }, + "software": { + "venv": "C:/Users/patri/.venvs/bluebeam (read-only use)", + "torch": "2.11.0+cu128", + "transformers": "5.17.0", + "numpy": "2.5.3", + "fla_kernels": false + }, + "nanbeige": { + "repo": "Nanbeige/Nanbeige4.2-3B", + "revision": "451ed48c3273ecef7ea8faaa43c31ce529763bb1", + "dtype": "bfloat16", + "attn_implementation": "sdpa", + "snapshot_env": "ARG02_SNAPSHOT_NANBEIGE", + "loader": "nanbeige", + "bos_token_id": 166100, + "environment": "C:/Users/patri/.venvs/bvg-v03 (transformers 4.46.3, torch 2.11.0+cu128); the remote code targets transformers 4.42", + "files_sha256": { + "config.json": "f6cb15b22847664f3a6049dc4b58fdd10f1650d112ac99a1da3d051f17c2ca19", + "tokenizer.json": "1d858a0fc007f22af6ae18bfa1ae52d30e398aa9cd1ea06e7777176869346a3f", + "configuration_nanbeige.py": "98abb9faa303717b234b3d381a9650e8cb656ccf287a12f6ad6215a3bbf8be10", + "modeling_nanbeige.py": "547737f989f5cb741c1a568acaf85f83521fa67a8f7268e19f9a37e60127c0d5", + "model.safetensors.index.json": "30d8da0fa8b97abc6d9eddfd017a0cb7a649bcbd58caa57804c56c767db5c0f1", + "model-00001-of-00002.safetensors": "09d265d5ec837bc64462796b7f8c110be9a135a55ed7a6eb5d07e0e90c976a94", + "model-00002-of-00002.safetensors": "31019e7870a044f44bc3f7e981f8c5ecd42d341e5ca6cfdbfd07fb95d95be389" + }, + "text_config": { + "model_type": "nanbeige", + "num_hidden_layers": 22, + "hidden_size": 3072, + "intermediate_size": 10752, + "num_attention_heads": 48, + "num_key_value_heads": 8, + "head_dim": 128, + "vocab_size": 166144, + "num_loops": 2, + "tie_word_embeddings": false + } + }, + "smoke_nanbeige": { + "repo": "smoke/tiny-random-nanbeige", + "revision": "0000000000000000000000000000000000000000", + "dtype": "float32", + "loader": "nanbeige", + "bos_token_id": 166100, + "files_sha256": {}, + "text_config": { + "model_type": "nanbeige", + "num_hidden_layers": 2, + "hidden_size": 64, + "intermediate_size": 96, + "num_attention_heads": 4, + "num_key_value_heads": 2, + "head_dim": 16, + "vocab_size": 166144, + "num_loops": 2, + "tie_word_embeddings": false + } + }, + "recurrence_nanbeige": { + "mechanism": "native full-stack loop: norm(layers(h)) repeated; trained with num_loops = 2; loop count set at inference (nanbeige.py)", + "native_recurrence": true, + "trained_for_recurrence": true, + "trained_depth": 2 + } +} diff --git a/research/algernon/algebraic_reasoning_gym/arg02/flops.py b/research/algernon/algebraic_reasoning_gym/arg02/flops.py new file mode 100644 index 000000000..ef4f92852 --- /dev/null +++ b/research/algernon/algebraic_reasoning_gym/arg02/flops.py @@ -0,0 +1,88 @@ +"""Analytic multiply-accumulate counts for Qwen3.5 text decoders. + +An estimate from the config: dense projections, the gated delta-rule state +update (about 4 dk*dv MACs per value head per token), causal softmax attention +(QK and AV) and the LM head on the scored positions only. Norms, activations +and elementwise residual arithmetic are omitted. FLOPs = 2 * MACs. Measured +GPU seconds are recorded separately and are the primary cost; this count makes +arms comparable across machines. +""" +from __future__ import annotations + + +def text_config(cfg): + return cfg.get("text_config", cfg) + + +def _dense_linear_attention(t): + h = t["hidden_size"] + nk, nv = t["linear_num_key_heads"], t["linear_num_value_heads"] + dk, dv = t["linear_key_head_dim"], t["linear_value_head_dim"] + key_dim, value_dim = nk * dk, nv * dv + conv_dim = 2 * key_dim + value_dim + proj = h * conv_dim + h * value_dim + 2 * h * nv + value_dim * h + conv = conv_dim * t["linear_conv_kernel_dim"] + state = 4 * nv * dk * dv + return proj + conv + state + + +def _dense_full_attention(t): + h, nh, nkv, hd = t["hidden_size"], t["num_attention_heads"], t["num_key_value_heads"], t["head_dim"] + q = h * nh * hd * (2 if t.get("attn_output_gate") else 1) + return q + 2 * h * nkv * hd + nh * hd * h + + +def _mlp(t): + return 3 * t["hidden_size"] * t["intermediate_size"] + + +def _dense_softmax_attention(t): + h, nh, nkv, hd = t["hidden_size"], t["num_attention_heads"], t["num_key_value_heads"], t["head_dim"] + return h * nh * hd + 2 * h * nkv * hd + nh * hd * h + + +def layer_macs(cfg, layer, length): + """MACs for one row of `length` tokens through decoder layer `layer`.""" + t = text_config(cfg) + if t.get("model_type") == "nanbeige": + # Every layer is softmax attention + SwiGLU MLP; the loop re-runs all of them. + attn = t["num_attention_heads"] * t["head_dim"] * length * (length + 1) + return length * (_dense_softmax_attention(t) + _mlp(t)) + attn + kind = t["layer_types"][layer] + if kind == "linear_attention": + return length * (_dense_linear_attention(t) + _mlp(t)) + if kind == "full_attention": + attn = t["num_attention_heads"] * t["head_dim"] * length * (length + 1) + return length * (_dense_full_attention(t) + _mlp(t)) + attn + raise ValueError(f"unknown layer type {kind}") + + +def head_macs(cfg, positions): + t = text_config(cfg) + return positions * t["hidden_size"] * t["vocab_size"] + + +def path(cfg, block=None, depth=1): + """Layer indices evaluated by a block-looped forward.""" + n = text_config(cfg)["num_hidden_layers"] + if block is None or depth == 1: + return list(range(n)) + a, b = block + if not (0 <= a < b <= n) or depth < 1: + raise ValueError("bad block or depth") + return list(range(a)) + list(range(a, b)) * depth + list(range(b, n)) + + +def forward_macs(cfg, length, rows, layers, scored_positions=3): + per_row = sum(layer_macs(cfg, i, length) for i in layers) + return rows * (per_row + head_macs(cfg, scored_positions)) + + +def layer_evaluations(rows, length, layers): + return rows * length * len(layers) + + +def ensemble_sizes(n_layers, block, depths, max_variants): + """Repeated-forward count matched to a depth-d block loop's layer evaluations.""" + a, b = block + return {d: max(1, min(max_variants, round((n_layers + (d - 1) * (b - a)) / n_layers))) for d in depths} diff --git a/research/algernon/algebraic_reasoning_gym/arg02/nanbeige.py b/research/algernon/algebraic_reasoning_gym/arg02/nanbeige.py new file mode 100644 index 000000000..7955d9d69 --- /dev/null +++ b/research/algernon/algebraic_reasoning_gym/arg02/nanbeige.py @@ -0,0 +1,146 @@ +"""Nanbeige4.2-3B: a natively looped decoder, run through the ARG-02 trajectory API. + +Nanbeige4.2-3B was trained with `num_loops = 2`: all 22 decoder layers run, the +final RMSNorm is applied, and the result is the next loop's input; the LM head +reads the state after the last loop. `loop_idx` only selects KV-cache slots, +so without a cache the loop count can be set at inference. Here + + x = embed(tokens) + h_1 = norm(layers(x)) loop 1, the initial pass + h_t = norm(layers(h_{t-1})) loop t; t = 2 is the trained depth + logits = lm_head(h_t) readout after any loop + +which is `NanbeigeModel.forward` with `num_loops = t` (checked in tests). The +open-loop, shuffle, patch and perturbation modes of `recurrence.BlockLoop` +apply unchanged with the whole loop body as the block. + +The checkpoint's remote code targets transformers 4.42-4.46, so this module +runs in a 4.46 environment. Weights are streamed from the safetensors shards +straight onto the device: `from_pretrained` stages an extra CPU copy that the +shared PC's commit limit cannot hold (pattern from LoopedTransformers +`rmp_nanbeige_vpd_heatmap.py`). +""" +from __future__ import annotations + +import json +from pathlib import Path + +import torch + +from .recurrence import BlockLoop + + +class BosTokenizer: + """Wraps a fast tokenizer: optional BOS first, no other special tokens.""" + + def __init__(self, tok, bos_id=None): + self.tok, self.bos_id = tok, bos_id + + def encode(self, text, add_special_tokens=False): + return self.tok.encode(text, add_special_tokens=False) + + def encode_prompt(self, text): + ids = self.tok.encode(text, add_special_tokens=False) + return ([self.bos_id] if self.bos_id is not None else []) + ids + + +def load_tokenizer(root, bos_id): + from transformers import PreTrainedTokenizerFast + return BosTokenizer(PreTrainedTokenizerFast(tokenizer_file=str(Path(root) / "tokenizer.json")), bos_id) + + +def build(root, device, dtype=torch.bfloat16, attn="sdpa", config_overrides=None, random_init=False): + """Model from the snapshot's remote code; weights streamed shard by shard onto `device`.""" + from transformers import AutoConfig, AutoModelForCausalLM + config = AutoConfig.from_pretrained(str(root), trust_remote_code=True, local_files_only=True) + for k, v in (config_overrides or {}).items(): + setattr(config, k, v) + config._attn_implementation = attn + previous = torch.get_default_dtype() + torch.set_default_dtype(dtype) + try: + with torch.device(device): + model = AutoModelForCausalLM.from_config(config, trust_remote_code=True, attn_implementation=attn) + finally: + torch.set_default_dtype(previous) + if random_init: + return model.eval() + root = Path(root) + index = json.loads((root / "model.safetensors.index.json").read_text()) + params = model.state_dict() + dtypes = {"BF16": torch.bfloat16, "F16": torch.float16, "F32": torch.float32} + loaded = set() + for shard in sorted(set(index["weight_map"].values())): + with open(root / shard, "rb") as f: + size = int.from_bytes(f.read(8), "little") + header = json.loads(f.read(size)) + base = 8 + size + for key, spec in header.items(): + if key == "__metadata__": + continue + start, end = spec["data_offsets"] + f.seek(base + start) + data = bytearray(f.read(end - start)) + tensor = torch.frombuffer(data, dtype=dtypes[spec["dtype"]]).reshape(spec["shape"]) + with torch.no_grad(): + params[key].copy_(tensor.to(device)) + loaded.add(key) + missing = sorted(k for k in set(params) - loaded if "rotary" not in k) + if missing: + raise AssertionError(f"weights not loaded: {missing[:5]}") + return model.eval() + + +def check_supported(config): + """The adapter covers the plain full-stack loop only.""" + for flag in ("enable_double_loop_split", "enable_hyper_connection", "enable_mhc", "enable_depth_attention", + "loop_share_kv", "skip_loop_final_norm"): + if getattr(config, flag, False): + raise ValueError(f"Nanbeige option {flag} is not supported by the ARG-02 adapter") + if getattr(config, "emb_neighbor_num", None) is not None: + raise ValueError("Nanbeige n-gram embeddings are not supported by the ARG-02 adapter") + if getattr(config, "pretraining_tp", 1) != 1: + raise ValueError("pretraining_tp != 1 is not supported") + + +class NanbeigeLoop(BlockLoop): + """Block = all decoder layers + final norm; prelude and post-block layers are empty.""" + + def __init__(self, model, block=None): + self.model = model + self.base = model.model + self.layers = self.base.layers + self.cfg = model.config + if getattr(self.cfg, "model_type", None) != "nanbeige": + raise ValueError("NanbeigeLoop supports Nanbeige models only") + check_supported(self.cfg) + self.n = len(self.layers) + if block is not None and tuple(block) != (0, self.n): + raise ValueError("Nanbeige loops the whole stack; block must be (0, num_hidden_layers)") + self.block = (0, self.n) + + @torch.no_grad() + def prepare(self, ids): + ids = ids.to(self.device) + emb = self.base.embed_tokens(ids) + rows, length = ids.shape + cache_position = torch.arange(length, device=self.device) + pos = cache_position.unsqueeze(0).expand(rows, -1) + mask = self.base._update_causal_mask(None, emb, cache_position, None, False) + return emb, {"mask": mask, "pos": pos, "cache_position": cache_position} + + @torch.no_grad() + def run(self, h, lo, hi, ctx): + if lo == hi: + return h + if (lo, hi) != (0, self.n): + raise ValueError("Nanbeige runs whole loops only") + for layer in self.layers: + h = layer(h, attention_mask=ctx["mask"], position_ids=ctx["pos"], past_key_value=None, + output_attentions=False, use_cache=False, cache_position=ctx["cache_position"], + loop_idx=0)[0] + return self.base.norm(h) + + @torch.no_grad() + def readout(self, h, ctx): + return torch.log_softmax(self.model.lm_head(h[:, -3:, :]).float(), dim=-1) diff --git a/research/algernon/algebraic_reasoning_gym/arg02/probe.py b/research/algernon/algebraic_reasoning_gym/arg02/probe.py new file mode 100644 index 000000000..673edee28 --- /dev/null +++ b/research/algernon/algebraic_reasoning_gym/arg02/probe.py @@ -0,0 +1,92 @@ +"""Linear probes on recurrent states, numpy only. + +Standardise, project to k principal components (fitted on the training +states), multinomial logistic regression with L2 penalty lam, fitted by +deterministic full-batch gradient descent. (k, lam) is chosen on a separate +selection split; the test split is scored once per step. +""" +from __future__ import annotations + +import numpy as np + +GRID_K = (8, 16, 32) +GRID_LAM = (1e-3, 1e-2, 1e-1, 1.0) +ITERS = 400 +LR = 0.5 +PERMUTATIONS = 200 +PERM_SEED = 2026111106 + + +class Probe: + def __init__(self, k, lam, classes): + self.k, self.lam, self.classes = k, lam, list(classes) + + def fit(self, x, y): + x = np.asarray(x, dtype=np.float64) + self.mu = x.mean(0) + self.sd = x.std(0) + 1e-6 + z = (x - self.mu) / self.sd + _, _, vt = np.linalg.svd(z, full_matrices=False) + k = min(self.k, vt.shape[0]) + self.proj = vt[:k].T + f = z @ self.proj + self.fs = f.std(0) + 1e-6 + f = f / self.fs + n, c = len(y), len(self.classes) + yi = np.array([self.classes.index(v) for v in y]) + onehot = np.zeros((n, c)) + onehot[np.arange(n), yi] = 1 + self.w = np.zeros((f.shape[1], c)) + self.b = np.zeros(c) + for _ in range(ITERS): + logits = f @ self.w + self.b + logits -= logits.max(1, keepdims=True) + p = np.exp(logits) + p /= p.sum(1, keepdims=True) + g = p - onehot + self.w -= LR * (f.T @ g / n + self.lam * self.w) + self.b -= LR * g.mean(0) + return self + + def predict(self, x): + f = ((np.asarray(x, dtype=np.float64) - self.mu) / self.sd) @ self.proj / self.fs + return [self.classes[i] for i in (f @ self.w + self.b).argmax(1)] + + +def accuracy(pred, y): + return float(np.mean([a == b for a, b in zip(pred, y)])) if len(y) else 0.0 + + +def select(train_x, train_y, sel_x, sel_y, classes): + best = None + for k in GRID_K: + for lam in GRID_LAM: + acc = accuracy(Probe(k, lam, classes).fit(train_x, train_y).predict(sel_x), sel_y) + if best is None or acc > best[0] + 1e-12: + best = (acc, k, lam) + return {"selection_accuracy": best[0], "k": best[1], "lam": best[2]} + + +def evaluate(train_x, train_y, sel_x, sel_y, tests, classes, *, permutations=PERMUTATIONS, seed=PERM_SEED): + """tests: {name: (x, y)}. Returns selected settings, test accuracies, + majority baseline and a label-permutation null for each test split.""" + choice = select(train_x, train_y, sel_x, sel_y, classes) + probe = Probe(choice["k"], choice["lam"], classes).fit(train_x, train_y) + values, counts = np.unique(np.asarray(train_y), return_counts=True) + majority = values[counts.argmax()] + rng = np.random.default_rng(seed) + null = {name: [] for name in tests} + for _ in range(permutations): + perm = list(rng.permutation(np.asarray(train_y))) + pp = Probe(choice["k"], choice["lam"], classes).fit(train_x, perm) + for name, (x, y) in tests.items(): + null[name].append(accuracy(pp.predict(x), y)) + out = {"settings": choice, "majority_label": str(majority), "tests": {}} + for name, (x, y) in tests.items(): + acc = accuracy(probe.predict(x), y) + nd = np.array(null[name]) + out["tests"][name] = {"n": len(y), "accuracy": acc, + "majority_accuracy": accuracy([majority] * len(y), y), + "permutation_mean": float(nd.mean()) if len(nd) else None, + "permutation_p": float((1 + (nd >= acc).sum()) / (1 + len(nd))) if len(nd) else None} + return out diff --git a/research/algernon/algebraic_reasoning_gym/arg02/prompts.py b/research/algernon/algebraic_reasoning_gym/arg02/prompts.py new file mode 100644 index 000000000..e4452f314 --- /dev/null +++ b/research/algernon/algebraic_reasoning_gym/arg02/prompts.py @@ -0,0 +1,99 @@ +"""Prompt rendering from ARG-01 public records only. + +Input rows have exactly the fields `external.public_records` exports. The +query series is public but plays no part in identifying the program, so it is +not rendered. Case identifiers are never rendered. Every prompt ends with the +fixed tail "\\nProgram:"; the three answer positions follow it. +""" +from __future__ import annotations + +PUBLIC_FIELDS = {"case_id", "topology", "observed_degree", "demos", "query", "public_sha256"} +SHOT_FIELDS = PUBLIC_FIELDS | {"program"} +OPS = ("I", "N", "S", "R") +TAIL = "\nProgram:" +OP_TEXT = {op: " " + op for op in OPS} + +HEADER = ( + "Each line lists the coefficients of x^0..x^12 of an integer power series f.\n" + "Operators: I(f)=f, N(f)=f(-x), S(f)=f(x^2), R(f)=1/f.\n" + "A program 'a b c' maps an input f to an output y by its topology:\n" + "fork: y=c(a(f)*b(f)); cascade: y=c(a(f)*b(a(f))); additive: y=c(a(f)+b(f)-1); " + "hadamard: y=c(1+sum_{n>=1} a(f)_n*b(f)_n*x^n).\n" + "Find the program that maps both inputs to their outputs.\n" +) + +BASE_VARIANTS = ("canonical", "swap", "space", "swap_space") +# Rotations reorder the in-context shots; "rotK" alone is the canonical case block. +VARIANTS = BASE_VARIANTS + tuple((f"rot{r}" if v == "canonical" else f"{v}_rot{r}") + for r in (1, 2, 3) for v in BASE_VARIANTS) + + +def parse_variant(variant): + """(swap demos, space separators, shot rotation) of a variant name.""" + if variant not in VARIANTS: + raise ValueError("unknown prompt variant") + base, _, rot = variant.partition("rot") + base = base.rstrip("_") or "canonical" + return base in ("swap", "swap_space"), base in ("space", "swap_space"), int(rot) if rot else 0 + + +def _check_public(row, allowed): + if not isinstance(row, dict): + raise TypeError("public record must be a dict") + extra = set(row) - allowed + if extra: + raise ValueError(f"non-public fields in model input: {sorted(extra)}") + if row.get("observed_degree") != 12 or len(row.get("demos", ())) != 2: + raise ValueError("unexpected public record shape") + + +def _series(values, sep): + if not values or values[0] != 1 or any(type(v) is not int for v in values): + raise ValueError("bad public series") + return sep.join(str(v) for v in values) + + +def case_block(row, *, variant="canonical", program=None, feedback=()): + swap, space, _ = parse_variant(variant) + sep = " " if space else ", " + demos = list(row["demos"]) + if swap: + demos = demos[::-1] + lines = [f"\nTopology: {row['topology']}"] + for i, demo in enumerate(demos, 1): + lines.append(f"Input {i}: {_series(demo['input'], sep)}") + lines.append(f"Output {i}: {_series(demo['output'], sep)}") + for item in feedback: + lines.append(feedback_line(item, swapped=swap)) + text = "\n".join(lines) + TAIL + if program is not None: + text += "".join(OP_TEXT[op] for op in program) + "\n" + return text + + +def feedback_line(item, *, swapped=False): + """One rejected candidate and its first mismatching degree in each demo.""" + program, faults = item + if tuple(program) not in {(a, b, c) for a in OPS for b in OPS for c in OPS}: + raise ValueError("feedback program outside grammar") + faults = list(faults)[::-1] if swapped else list(faults) + parts = [] + for i, fault in enumerate(faults, 1): + parts.append(f"example {i} ok" if fault is None else f"example {i} differs at x^{int(fault)}") + return f"Rejected: {' '.join(program)} ({', '.join(parts)})" + + +def render(row, *, shots=(), variant="canonical", feedback=()): + """Full prompt text for one public record. `shots` are solved shot records.""" + _check_public(row, PUBLIC_FIELDS) + text = HEADER + rot = parse_variant(variant)[2] % len(shots) if shots else 0 + for shot in list(shots[rot:]) + list(shots[:rot]): + _check_public(shot, SHOT_FIELDS) + if "program" not in shot: + raise ValueError("shot without program") + text += case_block(shot, variant="canonical", program=shot["program"]) + text += case_block(row, variant=variant, feedback=feedback) + if not text.endswith(TAIL): + raise AssertionError("prompt tail drift") + return text diff --git a/research/algernon/algebraic_reasoning_gym/arg02/recurrence.py b/research/algernon/algebraic_reasoning_gym/arg02/recurrence.py new file mode 100644 index 000000000..f5bb02de6 --- /dev/null +++ b/research/algernon/algebraic_reasoning_gym/arg02/recurrence.py @@ -0,0 +1,225 @@ +"""Explicit block-loop recurrence for a pretrained Qwen3.5 text decoder. + +Qwen3.5-0.8B has no native recurrence. ARG-02 adds one, untrained: decoder +layers [a, b) form a block B that is applied `depth` times to the residual +stream, with the pretrained weights unchanged: + + x = layers[0:a](embed(tokens)) block input + h_1 = B(x) = the ordinary forward + h_t = B(h_{t-1}) (loop) residual feedback + h_t = h_{t-1} + (h_1 - x) (open) no feedback: the block only + ever sees x; its single update + is re-applied + h_t = h_1 + D_t (shuffle) D_t = h_t - h_1 of a donor + case's loop, right-aligned + logits = lm_head(norm(layers[b:](h_t))) readout after any step t + +depth 1 is the unmodified model (checked against the HF forward in tests). +Every layer is called directly with the module's own masks and rotary +embeddings, so hidden states after every step are exact, inspectable tensors. +""" +from __future__ import annotations + +import time + +import torch + +from .prompts import OPS + +SITE = 5 # right-aligned answer site: "\n", "Program", ":" and the two candidate tokens + + +class Timer: + def __init__(self, device): + self.cuda = torch.device(device).type == "cuda" + + def start(self): + if self.cuda: + ev = torch.cuda.Event(enable_timing=True) + ev.record() + return ev + return time.perf_counter() + + def stop(self, mark): + if self.cuda: + ev = torch.cuda.Event(enable_timing=True) + ev.record() + ev.synchronize() + return mark.elapsed_time(ev) + return (time.perf_counter() - mark) * 1000.0 + + +def candidate_rows(prompt_ids, op_ids): + """16 rows: prompt + (op1, op2) for every pair; row index 4*i + j.""" + rows = [] + for a in OPS: + for b in OPS: + rows.append(list(prompt_ids) + [op_ids[a], op_ids[b]]) + return torch.tensor(rows, dtype=torch.long) + + +def extract(logprobs, op_ids): + """Answer record from (16, 3, V) log-softmax over the last three positions.""" + tok = [op_ids[o] for o in OPS] + lp = logprobs.float() + lp1 = [float(lp[0, 0, t]) for t in tok] + g1 = int(lp[0, 0].argmax()) + lp2, g2, lp3, g3 = [], [], [], [] + for i in range(4): + lp2.append([float(lp[4 * i, 1, t]) for t in tok]) + g2.append(int(lp[4 * i, 1].argmax())) + row3, rowg = [], [] + for j in range(4): + r = 4 * i + j + row3.append([float(lp[r, 2, t]) for t in tok]) + rowg.append(int(lp[r, 2].argmax())) + lp3.append(row3) + g3.append(rowg) + # Rows share a prefix, so these positions must agree across rows. + spread1 = float((lp[:, 0] - lp[0:1, 0]).abs().max()) + spread2 = max(float((lp[4 * i:4 * i + 4, 1] - lp[4 * i:4 * i + 1, 1]).abs().max()) for i in range(4)) + return {"lp1": lp1, "lp2": lp2, "lp3": lp3, "g1": g1, "g2": g2, "g3": g3, + "row_spread": max(spread1, spread2)} + + +def align_index(recipient_len, donor_len, device, tail=2): + """Right-aligned donor position for every recipient position. + + The last `tail` positions (the two candidate tokens, which differ per row) + map only onto each other. Recipient prompt positions beyond the donor's + length wrap within the donor's prompt positions, never onto its candidate + tokens, so rows that share a prefix receive identical displacements there. + (Amendment 1: the first version wrapped over the whole donor sequence.) + """ + k = torch.arange(recipient_len - 1, -1, -1, device=device) + prompt = donor_len - tail + idx = torch.where(k < donor_len, donor_len - 1 - k, prompt - 1 - ((k - donor_len) % prompt)) + return idx + + +class BlockLoop: + def __init__(self, model, block=None): + self.model = model + self.base = model.model + self.layers = self.base.layers + self.cfg = self.base.config + if getattr(self.cfg, "model_type", None) != "qwen3_5_text": + raise ValueError("BlockLoop supports Qwen3.5 text decoders only") + self.n = len(self.layers) + self.types = list(self.cfg.layer_types) + if block is not None: + a, b = block + if not (0 <= a < b <= self.n): + raise ValueError("block outside the decoder") + self.block = tuple(block) if block is not None else (0, self.n) + + @property + def device(self): + return self.base.embed_tokens.weight.device + + @torch.no_grad() + def prepare(self, ids): + from transformers.masking_utils import create_causal_mask, create_recurrent_attention_mask + ids = ids.to(self.device) + emb = self.base.embed_tokens(ids) + rows, length = ids.shape + pos = torch.arange(length, device=self.device).view(1, 1, -1).expand(4, rows, -1) + text_pos, rope_pos = pos[0], pos[1:] + kw = {"config": self.cfg, "inputs_embeds": emb, "attention_mask": None, + "past_key_values": None, "position_ids": text_pos} + masks = {"full_attention": create_causal_mask(**kw), + "linear_attention": create_recurrent_attention_mask(**kw)} + pe = self.base.rotary_emb(emb, rope_pos) + return emb, {"pe": pe, "masks": masks, "pos": text_pos} + + @torch.no_grad() + def run(self, h, lo, hi, ctx): + for i in range(lo, hi): + h = self.layers[i](h, position_embeddings=ctx["pe"], attention_mask=ctx["masks"][self.types[i]], + position_ids=ctx["pos"], past_key_values=None, use_cache=False) + return h + + @torch.no_grad() + def readout(self, h, ctx): + h = self.run(h, self.block[1], self.n, ctx) + h = self.base.norm(h[:, -3:, :]) + return torch.log_softmax(self.model.lm_head(h).float(), dim=-1) + + @torch.no_grad() + def trajectory(self, ids, op_ids, depth, *, mode="loop", readout_steps=(), capture=(-3,), + donor_delta=None, patch=None, perturb=None, keep_delta=(), keep_site=(), + clean_states=None, keep_states=False): + """Run one block-looped forward over the 16 candidate rows of one prompt. + + donor_delta: {t: (rows, Ld, H)} donor h_t - h_1, for mode "shuffle". + patch: {"step": t, "site": (rows, SITE, H)} donor site states written at step t. + perturb: {"step": t, "sigma": s, "seed": n} Gaussian kick of s * RMS(h_t). + clean_states: [row-0 states x, h_1..h_T] of an unperturbed run, for distances. + """ + if mode not in ("loop", "open", "shuffle"): + raise ValueError("unknown recurrence mode") + if mode == "shuffle" and donor_delta is None: + raise ValueError("shuffle needs donor deltas") + a, b = self.block + timer = Timer(self.device) + timing = {"prelude_ms": 0.0, "block_ms": [], "readout_ms": {}} + mark = timer.start() + emb, ctx = self.prepare(ids) + x = self.run(emb, 0, a, ctx) + timing["prelude_ms"] = timer.stop(mark) + rows, length, _ = x.shape + out = {"records": {}, "states": [x[0, list(capture)].float().cpu()], "residual": [], + "residual_site": [], "deltas": {}, "sites": {}, "distance": [], "timing": timing, + "rows": rows, "length": length, "full_states": [x[0].float()] if keep_states else None} + index = None + if mode == "shuffle": + any_delta = next(iter(donor_delta.values())) + index = align_index(length, any_delta.shape[1], x.device) + h_prev, h1, upd = x, None, None + for t in range(1, depth + 1): + mark = timer.start() + if t == 1 or mode == "loop": + h = self.run(h_prev, a, b, ctx) + elif mode == "open": + h = h_prev + upd + elif t in donor_delta: + # The recipient never runs its own block after step 1, so only + # steps that are read out need a donor displacement. + h = h1 + donor_delta[t].to(h1.dtype)[:, index, :] + else: + h = h_prev + if t == 1: + h1, upd = h, h - x + if perturb is not None and t == perturb["step"]: + gen = torch.Generator(device="cpu").manual_seed(int(perturb["seed"])) + noise = torch.randn((1, length, h.shape[-1]), generator=gen).to(h.device, torch.float32) + rms = h[0].float().pow(2).mean().sqrt() + h = (h.float() + perturb["sigma"] * rms * noise).to(h.dtype) + out["kick_norm"] = float((perturb["sigma"] * rms * noise[0]).norm()) + if patch is not None and t == patch["step"]: + h = h.clone() + h[:, -SITE:, :] = patch["site"].to(h.dtype) + timing["block_ms"].append(timer.stop(mark)) + diff = (h[0].float() - h_prev[0].float()) + out["residual"].append(float(diff.norm() / h_prev[0].float().norm().clamp_min(1e-12))) + out["residual_site"].append(float(diff[-SITE:].norm() / h_prev[0, -SITE:].float().norm().clamp_min(1e-12))) + out["states"].append(h[0, list(capture)].float().cpu()) + if keep_states: + out["full_states"].append(h[0].float()) + if clean_states is not None and t < len(clean_states): + out["distance"].append(float((h[0].float() - clean_states[t]).norm())) + if t in keep_delta: + out["deltas"][t] = (h - h1).detach() + if t in keep_site: + out["sites"][t] = h[:, -SITE:, :].detach().clone() + if t in readout_steps: + mark = timer.start() + rec = extract(self.readout(h, ctx), op_ids) + timing["readout_ms"][t] = timer.stop(mark) + out["records"][t] = rec + h_prev = h + return out + + def latency_ms(self, timing, depth): + """Standalone latency of a depth-`depth` forward from step timings.""" + return timing["prelude_ms"] + sum(timing["block_ms"][:depth]) + timing["readout_ms"][depth] diff --git a/research/algernon/algebraic_reasoning_gym/arg02/results/arg02_answer_tape.jsonl.gz b/research/algernon/algebraic_reasoning_gym/arg02/results/arg02_answer_tape.jsonl.gz new file mode 100644 index 000000000..775691bea Binary files /dev/null and b/research/algernon/algebraic_reasoning_gym/arg02/results/arg02_answer_tape.jsonl.gz differ diff --git a/research/algernon/algebraic_reasoning_gym/arg02/results/arg02_checkpoint_check.json b/research/algernon/algebraic_reasoning_gym/arg02/results/arg02_checkpoint_check.json new file mode 100644 index 000000000..7d622c430 --- /dev/null +++ b/research/algernon/algebraic_reasoning_gym/arg02/results/arg02_checkpoint_check.json @@ -0,0 +1,124 @@ +{ + "device": "cpu", + "ff_control": { + "files_verified": [ + "config.json", + "model.safetensors-00001-of-00001.safetensors", + "model.safetensors.index.json", + "tokenizer.json", + "tokenizer_config.json" + ], + "hash_seconds": 6.3, + "repo": "Qwen/Qwen3.5-2B-Base", + "revision": "b1485b2fa6dfa1287294f269f5fb618e03d52d7c" + }, + "load_seconds": 3.81, + "model": { + "files_verified": [ + "config.json", + "model.safetensors-00001-of-00001.safetensors", + "model.safetensors.index.json", + "tokenizer.json", + "tokenizer_config.json" + ], + "hash_seconds": 2.56, + "repo": "Qwen/Qwen3.5-0.8B-Base", + "revision": "dc7cdfe2ee4154fa7e30f5b51ca41bfa40174e68" + }, + "model_class": "Qwen3_5ForCausalLM", + "note": "CPU, bf16, 2 development prompts, first 2 candidate rows; no grading. Run 2026-11-10 under vramorama run --vram 256M --max-commit 85.", + "parity": [ + { + "case_id": "calibration:signed:00001", + "depth2_relative_residual": 0.580950915813446, + "max_abs_logprob_diff": 0.0, + "seconds": 13.82, + "tokens": 433, + "top_token_equal": true + }, + { + "case_id": "calibration:signed:00002", + "depth2_relative_residual": 0.5842715501785278, + "max_abs_logprob_diff": 0.0, + "seconds": 9.97, + "tokens": 376, + "top_token_equal": true + } + ], + "prompt_tokens": { + "development_shots0": { + "canonical": { + "max": 431, + "mean": 328.8484848484849, + "min": 321 + } + }, + "development_shots4": { + "canonical": { + "max": 1194, + "mean": 1091.8484848484848, + "min": 1084 + } + }, + "test_shots0": { + "canonical": { + "max": 399, + "mean": 327.2760416666667, + "min": 321 + }, + "space": { + "max": 351, + "mean": 279.2760416666667, + "min": 273 + }, + "swap": { + "max": 399, + "mean": 327.2760416666667, + "min": 321 + }, + "swap_space": { + "max": 351, + "mean": 279.2760416666667, + "min": 273 + } + }, + "test_shots4": { + "canonical": { + "max": 1162, + "mean": 1090.2760416666667, + "min": 1084 + }, + "space": { + "max": 1114, + "mean": 1042.2760416666667, + "min": 1036 + }, + "swap": { + "max": 1162, + "mean": 1090.2760416666667, + "min": 1084 + }, + "swap_space": { + "max": 1114, + "mean": 1042.2760416666667, + "min": 1036 + } + } + }, + "schema": "algernon.arg02.checkpoint_check.v1", + "text_parameters": 752393024, + "tokenizer": { + "class": "Qwen2Tokenizer", + "op_token_ids": { + "I": 353, + "N": 443, + "R": 423, + "S": 326 + }, + "tail_ids": [ + 198, + 10374, + 25 + ] + } +} diff --git a/research/algernon/algebraic_reasoning_gym/arg02/results/arg02_export_manifest.json b/research/algernon/algebraic_reasoning_gym/arg02/results/arg02_export_manifest.json new file mode 100644 index 000000000..5e0b0ce1f --- /dev/null +++ b/research/algernon/algebraic_reasoning_gym/arg02/results/arg02_export_manifest.json @@ -0,0 +1,9 @@ +{ + "audit_sha256": "aad4d16fe1aa0effca1ade97fdebc737d84dc30f170d2ef4fbf38dee647f6cc8", + "files": { + "development.jsonl": "0b68940d4aa214bef5d18fc2f17dee2badeaf13f2f72d18133f71c2a20bf6234", + "shots.json": "c8b209b709c71ce9247ca5b3a207bdcd8d99831852b56f874328075f25476058", + "test.jsonl": "3bc149de73ae0f5107cb4d452c9946ddcde3abbea2df38a3069ac85b133454c3" + }, + "sample": null +} diff --git a/research/algernon/algebraic_reasoning_gym/arg02/results/arg02_profile.json b/research/algernon/algebraic_reasoning_gym/arg02/results/arg02_profile.json new file mode 100644 index 000000000..58911db70 --- /dev/null +++ b/research/algernon/algebraic_reasoning_gym/arg02/results/arg02_profile.json @@ -0,0 +1,791 @@ +{ + "compute": { + "_shared": { + "symbolic_checkpoint_load_ms": 30.407, + "symbolic_class_compile_ms": 521.9324 + }, + "controller": { + "cases": 192, + "end_to_end_seconds": 3098.3708790140627, + "forward_passes": 1769, + "gpu_seconds": 3097.1863994140626, + "integer_loop_proxy": 516438, + "latency_ms_p50": 19039.546807250976, + "latency_ms_p95": 26033.642182755128, + "layer_evals": 826693248, + "tokens": 34445552, + "total_macs": 18345733087690752, + "total_pflop": 36.69146617538151, + "verifier_cpu_seconds": 1.1844796000000002, + "verifier_queries": 1769 + }, + "ensemble@1": { + "cases": 192, + "end_to_end_seconds": 299.69198035270995, + "forward_passes": 192, + "gpu_seconds": 299.42484715270996, + "integer_loop_proxy": 492154, + "latency_ms_p50": 1462.4939350341797, + "latency_ms_p95": 2157.5733743505857, + "layer_evals": 80531328, + "tokens": 3355472, + "total_macs": 1781975723802624, + "total_pflop": 3.563951447605248, + "verifier_cpu_seconds": 0.2671332, + "verifier_queries": 1704 + }, + "ensemble@16": { + "cases": 192, + "end_to_end_seconds": 1207.6611693366212, + "forward_passes": 768, + "gpu_seconds": 1207.392287536621, + "integer_loop_proxy": 499876, + "latency_ms_p50": 6005.969005273437, + "latency_ms_p95": 8520.761564101555, + "layer_evals": 315047424, + "tokens": 13126976, + "total_macs": 6967707338539008, + "total_pflop": 13.935414677078017, + "verifier_cpu_seconds": 0.2688818, + "verifier_queries": 1709 + }, + "ensemble@2": { + "cases": 192, + "end_to_end_seconds": 299.69104315270994, + "forward_passes": 192, + "gpu_seconds": 299.42484715270996, + "integer_loop_proxy": 492154, + "latency_ms_p50": 1462.4621350341795, + "latency_ms_p95": 2159.0979893505855, + "layer_evals": 80531328, + "tokens": 3355472, + "total_macs": 1781975723802624, + "total_pflop": 3.563951447605248, + "verifier_cpu_seconds": 0.26619600000000004, + "verifier_queries": 1704 + }, + "ensemble@4": { + "cases": 192, + "end_to_end_seconds": 604.3680172000245, + "forward_passes": 384, + "gpu_seconds": 604.1070569000244, + "integer_loop_proxy": 495794, + "latency_ms_p50": 2972.217280847168, + "latency_ms_p95": 4295.411618322753, + "layer_evals": 161062656, + "tokens": 6710944, + "total_macs": 3563951447605248, + "total_pflop": 7.127902895210496, + "verifier_cpu_seconds": 0.26096030000000003, + "verifier_queries": 1709 + }, + "ensemble@8": { + "cases": 192, + "end_to_end_seconds": 604.3772390000244, + "forward_passes": 384, + "gpu_seconds": 604.1070569000244, + "integer_loop_proxy": 495794, + "latency_ms_p50": 2972.297130847168, + "latency_ms_p95": 4294.848458322754, + "layer_evals": 161062656, + "tokens": 6710944, + "total_macs": 3563951447605248, + "total_pflop": 7.127902895210496, + "verifier_cpu_seconds": 0.2701821, + "verifier_queries": 1709 + }, + "ff2b@1": { + "cases": 192, + "end_to_end_seconds": 389.65212189022674, + "forward_passes": 192, + "gpu_seconds": 389.39689799022676, + "integer_loop_proxy": 496028, + "latency_ms_p50": 1971.5967139457703, + "latency_ms_p95": 2485.559310371322, + "layer_evals": 80531328, + "tokens": 3355472, + "total_macs": 4720700121415680, + "total_pflop": 9.44140024283136, + "verifier_cpu_seconds": 0.2552239, + "verifier_queries": 1653 + }, + "loop@1": { + "cases": 192, + "end_to_end_seconds": 310.2480771579834, + "forward_passes": 192, + "gpu_seconds": 309.7897000579834, + "integer_loop_proxy": 492154, + "latency_ms_p50": 1485.4942653686523, + "latency_ms_p95": 2446.271057260742, + "layer_evals": 80531328, + "tokens": 3355472, + "total_macs": 1781975723802624, + "total_pflop": 3.563951447605248, + "verifier_cpu_seconds": 0.4583771, + "verifier_queries": 1704 + }, + "loop@10": { + "cases": 192, + "end_to_end_seconds": 764.787024377124, + "forward_passes": 192, + "gpu_seconds": 764.518434677124, + "integer_loop_proxy": 490906, + "latency_ms_p50": 3750.3665705810545, + "latency_ms_p95": 5757.786273155515, + "layer_evals": 201328320, + "tokens": 3355472, + "total_macs": 4451424147210240, + "total_pflop": 8.90284829442048, + "verifier_cpu_seconds": 0.2685897, + "verifier_queries": 1719 + }, + "loop@11": { + "cases": 192, + "end_to_end_seconds": 822.9467050759278, + "forward_passes": 192, + "gpu_seconds": 822.7058965759277, + "integer_loop_proxy": 435344, + "latency_ms_p50": 4042.54627043457, + "latency_ms_p95": 6458.477687138671, + "layer_evals": 214750208, + "tokens": 3355472, + "total_macs": 4748029527588864, + "total_pflop": 9.496059055177728, + "verifier_cpu_seconds": 0.2408085, + "verifier_queries": 1681 + }, + "loop@12": { + "cases": 192, + "end_to_end_seconds": 873.3246101201904, + "forward_passes": 192, + "gpu_seconds": 873.0677438201905, + "integer_loop_proxy": 441870, + "latency_ms_p50": 4295.517448498535, + "latency_ms_p95": 6510.063856041259, + "layer_evals": 228172096, + "tokens": 3355472, + "total_macs": 5044634907967488, + "total_pflop": 10.089269815934976, + "verifier_cpu_seconds": 0.25686630000000005, + "verifier_queries": 1712 + }, + "loop@13": { + "cases": 192, + "end_to_end_seconds": 918.2598780864746, + "forward_passes": 192, + "gpu_seconds": 918.0107273864746, + "integer_loop_proxy": 454584, + "latency_ms_p50": 4550.585099816894, + "latency_ms_p95": 6640.123766391599, + "layer_evals": 241593984, + "tokens": 3355472, + "total_macs": 5341240288346112, + "total_pflop": 10.682480576692225, + "verifier_cpu_seconds": 0.2491507, + "verifier_queries": 1753 + }, + "loop@14": { + "cases": 192, + "end_to_end_seconds": 970.9124848496582, + "forward_passes": 192, + "gpu_seconds": 970.6626721496582, + "integer_loop_proxy": 450814, + "latency_ms_p50": 4841.627226550293, + "latency_ms_p95": 6905.78073258911, + "layer_evals": 255015872, + "tokens": 3355472, + "total_macs": 5637845668724736, + "total_pflop": 11.275691337449471, + "verifier_cpu_seconds": 0.2498127, + "verifier_queries": 1755 + }, + "loop@15": { + "cases": 192, + "end_to_end_seconds": 1026.7526461972413, + "forward_passes": 192, + "gpu_seconds": 1026.5058827972412, + "integer_loop_proxy": 451568, + "latency_ms_p50": 5070.466903881836, + "latency_ms_p95": 7536.532118996579, + "layer_evals": 268437760, + "tokens": 3355472, + "total_macs": 5934451049103360, + "total_pflop": 11.86890209820672, + "verifier_cpu_seconds": 0.2467634, + "verifier_queries": 1773 + }, + "loop@16": { + "cases": 192, + "end_to_end_seconds": 1075.6388539769287, + "forward_passes": 192, + "gpu_seconds": 1075.3897919769288, + "integer_loop_proxy": 465192, + "latency_ms_p50": 5349.08947590332, + "latency_ms_p95": 8018.438464183348, + "layer_evals": 281859648, + "tokens": 3355472, + "total_macs": 6231056429481984, + "total_pflop": 12.462112858963968, + "verifier_cpu_seconds": 0.249062, + "verifier_queries": 1790 + }, + "loop@2": { + "cases": 192, + "end_to_end_seconds": 357.73372898703616, + "forward_passes": 192, + "gpu_seconds": 357.4007235870361, + "integer_loop_proxy": 603382, + "latency_ms_p50": 1713.3131939331056, + "latency_ms_p95": 2933.289464003906, + "layer_evals": 93953216, + "tokens": 3355472, + "total_macs": 2078581104181248, + "total_pflop": 4.157162208362496, + "verifier_cpu_seconds": 0.3330054, + "verifier_queries": 1844 + }, + "loop@3": { + "cases": 192, + "end_to_end_seconds": 408.93346613730466, + "forward_passes": 192, + "gpu_seconds": 408.6005057373047, + "integer_loop_proxy": 628992, + "latency_ms_p50": 1973.0027473144532, + "latency_ms_p95": 3318.116676589355, + "layer_evals": 107375104, + "tokens": 3355472, + "total_macs": 2375186484559872, + "total_pflop": 4.750372969119744, + "verifier_cpu_seconds": 0.3329604, + "verifier_queries": 1843 + }, + "loop@4": { + "cases": 192, + "end_to_end_seconds": 462.37121604882816, + "forward_passes": 192, + "gpu_seconds": 462.0548625488281, + "integer_loop_proxy": 608322, + "latency_ms_p50": 2254.338075354004, + "latency_ms_p95": 3790.4089026635743, + "layer_evals": 120796992, + "tokens": 3355472, + "total_macs": 2671791864938496, + "total_pflop": 5.343583729876992, + "verifier_cpu_seconds": 0.3163535, + "verifier_queries": 1819 + }, + "loop@5": { + "cases": 192, + "end_to_end_seconds": 510.43509537827146, + "forward_passes": 192, + "gpu_seconds": 510.1150464782715, + "integer_loop_proxy": 633126, + "latency_ms_p50": 2466.193471777344, + "latency_ms_p95": 3913.7834497558592, + "layer_evals": 134218880, + "tokens": 3355472, + "total_macs": 2968397245317120, + "total_pflop": 5.93679449063424, + "verifier_cpu_seconds": 0.3200489, + "verifier_queries": 1847 + }, + "loop@6": { + "cases": 192, + "end_to_end_seconds": 560.8207779194825, + "forward_passes": 192, + "gpu_seconds": 560.4725312194824, + "integer_loop_proxy": 656448, + "latency_ms_p50": 2760.3074915771485, + "latency_ms_p95": 4135.5021985620115, + "layer_evals": 147640768, + "tokens": 3355472, + "total_macs": 3265002625695744, + "total_pflop": 6.530005251391488, + "verifier_cpu_seconds": 0.34824669999999996, + "verifier_queries": 1894 + }, + "loop@7": { + "cases": 192, + "end_to_end_seconds": 614.1689532588135, + "forward_passes": 192, + "gpu_seconds": 613.8268221588135, + "integer_loop_proxy": 643968, + "latency_ms_p50": 2985.721277282715, + "latency_ms_p95": 4527.860862003174, + "layer_evals": 161062656, + "tokens": 3355472, + "total_macs": 3561608006074368, + "total_pflop": 7.123216012148736, + "verifier_cpu_seconds": 0.3421311, + "verifier_queries": 1885 + }, + "loop@8": { + "cases": 192, + "end_to_end_seconds": 663.2449005066162, + "forward_passes": 192, + "gpu_seconds": 662.6041074066162, + "integer_loop_proxy": 626340, + "latency_ms_p50": 3249.673945007324, + "latency_ms_p95": 4788.655271385497, + "layer_evals": 174484544, + "tokens": 3355472, + "total_macs": 3858213386452992, + "total_pflop": 7.716426772905984, + "verifier_cpu_seconds": 0.6407931, + "verifier_queries": 1857 + }, + "loop@9": { + "cases": 192, + "end_to_end_seconds": 710.7816995122314, + "forward_passes": 192, + "gpu_seconds": 710.4651944122314, + "integer_loop_proxy": 559910, + "latency_ms_p50": 3501.658662097168, + "latency_ms_p95": 5268.35021081909, + "layer_evals": 187906432, + "tokens": 3355472, + "total_macs": 4154818766831616, + "total_pflop": 8.309637533663231, + "verifier_cpu_seconds": 0.3165051, + "verifier_queries": 1785 + }, + "open@16": { + "cases": 192, + "end_to_end_seconds": 302.40817130562436, + "forward_passes": 192, + "gpu_seconds": 302.03096430562437, + "integer_loop_proxy": 729092, + "latency_ms_p50": 1475.3074077347874, + "latency_ms_p95": 2237.3781766225716, + "layer_evals": 80531328, + "tokens": 3355472, + "total_macs": 1781975723802624, + "total_pflop": 3.563951447605248, + "verifier_cpu_seconds": 0.377207, + "verifier_queries": 1921 + }, + "open@2": { + "cases": 192, + "end_to_end_seconds": 307.79242712298714, + "forward_passes": 192, + "gpu_seconds": 307.5138738229871, + "integer_loop_proxy": 534586, + "latency_ms_p50": 1508.3600817305328, + "latency_ms_p95": 2375.294417065436, + "layer_evals": 80531328, + "tokens": 3355472, + "total_macs": 1781975723802624, + "total_pflop": 3.563951447605248, + "verifier_cpu_seconds": 0.2785533, + "verifier_queries": 1798 + }, + "open@4": { + "cases": 192, + "end_to_end_seconds": 307.54600268403794, + "forward_passes": 192, + "gpu_seconds": 307.32884488403795, + "integer_loop_proxy": 398138, + "latency_ms_p50": 1478.0544512387871, + "latency_ms_p95": 2313.83877769044, + "layer_evals": 80531328, + "tokens": 3355472, + "total_macs": 1781975723802624, + "total_pflop": 3.563951447605248, + "verifier_cpu_seconds": 0.2171578, + "verifier_queries": 1732 + }, + "open@8": { + "cases": 192, + "end_to_end_seconds": 302.23665437071264, + "forward_passes": 192, + "gpu_seconds": 301.94571877071263, + "integer_loop_proxy": 542802, + "latency_ms_p50": 1465.1152735790968, + "latency_ms_p95": 2266.9571183168496, + "layer_evals": 80531328, + "tokens": 3355472, + "total_macs": 1781975723802624, + "total_pflop": 3.563951447605248, + "verifier_cpu_seconds": 0.2909356, + "verifier_queries": 1786 + }, + "shuffle@16": { + "cases": 192, + "end_to_end_seconds": 1237.3820071069335, + "forward_passes": 384, + "gpu_seconds": 1237.1172846069335, + "integer_loop_proxy": 467116, + "latency_ms_p50": 6031.699488916016, + "latency_ms_p95": 9241.915481171874, + "layer_evals": 322125312, + "tokens": 6710944, + "total_macs": 7120872570617856, + "total_pflop": 14.241745141235713, + "verifier_cpu_seconds": 0.2647225, + "verifier_queries": 1819 + }, + "shuffle@2": { + "cases": 192, + "end_to_end_seconds": 508.596250218042, + "forward_passes": 384, + "gpu_seconds": 508.284174118042, + "integer_loop_proxy": 569998, + "latency_ms_p50": 2502.462272558594, + "latency_ms_p95": 3726.464601072997, + "layer_evals": 134218880, + "tokens": 6710944, + "total_macs": 2968397245317120, + "total_pflop": 5.93679449063424, + "verifier_cpu_seconds": 0.3120761, + "verifier_queries": 1794 + }, + "shuffle@4": { + "cases": 192, + "end_to_end_seconds": 609.9157609141602, + "forward_passes": 384, + "gpu_seconds": 609.5738145141602, + "integer_loop_proxy": 634166, + "latency_ms_p50": 3008.673965710449, + "latency_ms_p95": 4580.661618193359, + "layer_evals": 161062656, + "tokens": 6710944, + "total_macs": 3561608006074368, + "total_pflop": 7.123216012148736, + "verifier_cpu_seconds": 0.3419464, + "verifier_queries": 1835 + }, + "shuffle@8": { + "cases": 192, + "end_to_end_seconds": 815.8448084215088, + "forward_passes": 384, + "gpu_seconds": 815.5103164215088, + "integer_loop_proxy": 586586, + "latency_ms_p50": 3998.620082751465, + "latency_ms_p95": 5848.9707942248515, + "layer_evals": 214750208, + "tokens": 6710944, + "total_macs": 4748029527588864, + "total_pflop": 9.496059055177728, + "verifier_cpu_seconds": 0.334492, + "verifier_queries": 1816 + }, + "shuffle_a1@16": { + "cases": 192, + "end_to_end_seconds": 1221.4045244532958, + "forward_passes": 384, + "gpu_seconds": 1221.1457752532958, + "integer_loop_proxy": 466882, + "latency_ms_p50": 5825.076223376464, + "latency_ms_p95": 10192.500261906735, + "layer_evals": 322125312, + "tokens": 6710944, + "total_macs": 7120872570617856, + "total_pflop": 14.241745141235713, + "verifier_cpu_seconds": 0.25874919999999996, + "verifier_queries": 1815 + }, + "shuffle_a1@2": { + "cases": 192, + "end_to_end_seconds": 517.4038200369141, + "forward_passes": 384, + "gpu_seconds": 517.0875953369141, + "integer_loop_proxy": 567216, + "latency_ms_p50": 2531.687436938477, + "latency_ms_p95": 4467.156389414061, + "layer_evals": 134218880, + "tokens": 6710944, + "total_macs": 2968397245317120, + "total_pflop": 5.93679449063424, + "verifier_cpu_seconds": 0.31622469999999997, + "verifier_queries": 1784 + }, + "shuffle_a1@4": { + "cases": 192, + "end_to_end_seconds": 612.8672156849365, + "forward_passes": 384, + "gpu_seconds": 612.4961426849366, + "integer_loop_proxy": 632996, + "latency_ms_p50": 2979.227550305176, + "latency_ms_p95": 5078.895729337153, + "layer_evals": 161062656, + "tokens": 6710944, + "total_macs": 3561608006074368, + "total_pflop": 7.123216012148736, + "verifier_cpu_seconds": 0.371073, + "verifier_queries": 1832 + }, + "shuffle_a1@8": { + "cases": 192, + "end_to_end_seconds": 812.052119307544, + "forward_passes": 384, + "gpu_seconds": 811.738832107544, + "integer_loop_proxy": 583362, + "latency_ms_p50": 3925.6393145385746, + "latency_ms_p95": 6393.62987389404, + "layer_evals": 214750208, + "tokens": 6710944, + "total_macs": 4748029527588864, + "total_pflop": 9.496059055177728, + "verifier_cpu_seconds": 0.3132872, + "verifier_queries": 1811 + }, + "symbolic:certified_mass12": { + "cases": 192, + "end_to_end_seconds": 0.2883969, + "forward_passes": 0, + "gpu_seconds": 0.0, + "integer_loop_proxy": 318968, + "latency_ms_p50": 1.37675, + "latency_ms_p95": 2.7412799999999993, + "layer_evals": 0, + "tokens": 0, + "total_macs": 0, + "total_pflop": 0.0, + "verifier_cpu_seconds": 0.2883969, + "verifier_queries": 1446 + }, + "symbolic:certified_mass_full": { + "cases": 192, + "end_to_end_seconds": 0.3600702, + "forward_passes": 0, + "gpu_seconds": 0.0, + "integer_loop_proxy": 480324, + "latency_ms_p50": 1.5326, + "latency_ms_p95": 4.415105, + "layer_evals": 0, + "tokens": 0, + "total_macs": 0, + "total_pflop": 0.0, + "verifier_cpu_seconds": 0.3600702, + "verifier_queries": 1985 + }, + "symbolic:exhaustive_64": { + "cases": 192, + "end_to_end_seconds": 0.45244310000000004, + "forward_passes": 0, + "gpu_seconds": 0.0, + "integer_loop_proxy": 887458, + "latency_ms_p50": 0.9648, + "latency_ms_p95": 7.839984999999997, + "layer_evals": 0, + "tokens": 0, + "total_macs": 0, + "total_pflop": 0.0, + "verifier_cpu_seconds": 0.45244310000000004, + "verifier_queries": 3693 + }, + "symbolic:frozen_ff": { + "cases": 192, + "end_to_end_seconds": 0.4416007, + "forward_passes": 192, + "gpu_seconds": 0.0, + "integer_loop_proxy": 308412, + "latency_ms_p50": 2.1498, + "latency_ms_p95": 3.97354, + "layer_evals": 0, + "tokens": 0, + "total_macs": 1175040, + "total_pflop": 2.35008e-09, + "verifier_cpu_seconds": 0.4416007, + "verifier_queries": 1225 + }, + "symbolic:frozen_gru": { + "cases": 192, + "end_to_end_seconds": 2.623964, + "forward_passes": 192, + "gpu_seconds": 0.0, + "integer_loop_proxy": 281450, + "latency_ms_p50": 13.52445, + "latency_ms_p95": 17.295875, + "layer_evals": 0, + "tokens": 0, + "total_macs": 10217472, + "total_pflop": 2.0434944e-08, + "verifier_cpu_seconds": 2.623964, + "verifier_queries": 1101 + } + }, + "manifests": { + "manifest_dev_blocks.json": { + "command": "dev", + "config_sha256": "10b04b51bb68c66aa693d2871c4cb343a2d40605f02540ace6390396362a4d82", + "environment": { + "code": { + "arg02_dirty": false, + "commit": "deea6c67be745550559174c66b88c64730ca35f5", + "repo": "MoralityLabAI/Compactification-Theory" + }, + "device": "cuda", + "numpy": "2.5.3", + "nvidia_smi": { + "driver_version": "577.05", + "enforced.power.limit": "148.74 W", + "memory.total": "16303 MiB", + "memory.used": "1 MiB", + "name": "NVIDIA GeForce RTX 5080 Laptop GPU", + "pstate": "P8" + }, + "platform": "Windows-11-10.0.26200-SP0", + "python": "3.12.14", + "torch": "2.11.0+cu128", + "torch_cuda": "12.8", + "transformers": "5.17.0" + }, + "finished": 1794380154.004797, + "lock_sha256": "7689a79d505457890a544d77ae68d88a01a5dea99b2b144fef3d3d574c10ceed", + "model": "main", + "rows": 132, + "smoke": false, + "stage": "blocks", + "started": 1794376046.0578077 + }, + "manifest_dev_shots.json": { + "command": "dev", + "config_sha256": "10b04b51bb68c66aa693d2871c4cb343a2d40605f02540ace6390396362a4d82", + "environment": { + "code": { + "arg02_dirty": false, + "commit": "deea6c67be745550559174c66b88c64730ca35f5", + "repo": "MoralityLabAI/Compactification-Theory" + }, + "device": "cuda", + "numpy": "2.5.3", + "nvidia_smi": { + "driver_version": "577.05", + "enforced.power.limit": "140.93 W", + "memory.total": "16303 MiB", + "memory.used": "1 MiB", + "name": "NVIDIA GeForce RTX 5080 Laptop GPU", + "pstate": "P8" + }, + "platform": "Windows-11-10.0.26200-SP0", + "python": "3.12.14", + "torch": "2.11.0+cu128", + "torch_cuda": "12.8", + "transformers": "5.17.0" + }, + "finished": 1794376009.1727538, + "lock_sha256": "7689a79d505457890a544d77ae68d88a01a5dea99b2b144fef3d3d574c10ceed", + "model": "main", + "rows": 132, + "smoke": false, + "stage": "shots", + "started": 1794375785.499005 + }, + "manifest_test_ff.json": { + "command": "test", + "config_sha256": "10b04b51bb68c66aa693d2871c4cb343a2d40605f02540ace6390396362a4d82", + "environment": { + "code": { + "arg02_dirty": false, + "commit": "547f190ddb2fe4e7b5576e717dbf1ac0d92c7884", + "repo": "MoralityLabAI/Compactification-Theory" + }, + "device": "cuda", + "numpy": "2.5.3", + "nvidia_smi": { + "driver_version": "577.05", + "enforced.power.limit": "138.92 W", + "memory.total": "16303 MiB", + "memory.used": "2698 MiB", + "name": "NVIDIA GeForce RTX 5080 Laptop GPU", + "pstate": "P4" + }, + "platform": "Windows-11-10.0.26200-SP0", + "python": "3.12.14", + "torch": "2.11.0+cu128", + "torch_cuda": "12.8", + "transformers": "5.17.0" + }, + "finished": 1794396358.2449791, + "lock_sha256": "7689a79d505457890a544d77ae68d88a01a5dea99b2b144fef3d3d574c10ceed", + "model": "ff", + "rows": 192, + "smoke": false, + "stage": null, + "started": 1794395861.6196125 + }, + "manifest_test_main.json": { + "command": "test", + "config_sha256": "10b04b51bb68c66aa693d2871c4cb343a2d40605f02540ace6390396362a4d82", + "environment": { + "code": { + "arg02_dirty": false, + "commit": "deea6c67be745550559174c66b88c64730ca35f5", + "repo": "MoralityLabAI/Compactification-Theory" + }, + "device": "cuda", + "numpy": "2.5.3", + "nvidia_smi": { + "driver_version": "577.05", + "enforced.power.limit": "144.25 W", + "memory.total": "16303 MiB", + "memory.used": "1 MiB", + "name": "NVIDIA GeForce RTX 5080 Laptop GPU", + "pstate": "P8" + }, + "platform": "Windows-11-10.0.26200-SP0", + "python": "3.12.14", + "torch": "2.11.0+cu128", + "torch_cuda": "12.8", + "transformers": "5.17.0" + }, + "finished": 1794395742.7963164, + "lock_sha256": "7689a79d505457890a544d77ae68d88a01a5dea99b2b144fef3d3d574c10ceed", + "model": "main", + "rows": 192, + "smoke": false, + "stage": null, + "started": 1794380200.9384973 + }, + "manifest_test_main_test_shuffle_a1.json": { + "arms": [ + "test_shuffle_a1" + ], + "command": "test", + "config_sha256": "10b04b51bb68c66aa693d2871c4cb343a2d40605f02540ace6390396362a4d82", + "environment": { + "code": { + "arg02_dirty": false, + "commit": "5b7d2bc328005fe2049d1542d64cd6c963df0ef3", + "repo": "MoralityLabAI/Compactification-Theory" + }, + "device": "cuda", + "numpy": "2.5.3", + "nvidia_smi": { + "driver_version": "577.05", + "enforced.power.limit": "130.84 W", + "memory.total": "16303 MiB", + "memory.used": "2698 MiB", + "name": "NVIDIA GeForce RTX 5080 Laptop GPU", + "pstate": "P4" + }, + "platform": "Windows-11-10.0.26200-SP0", + "python": "3.12.14", + "torch": "2.11.0+cu128", + "torch_cuda": "12.8", + "transformers": "5.17.0" + }, + "finished": 1794399739.0476825, + "lock_sha256": "7689a79d505457890a544d77ae68d88a01a5dea99b2b144fef3d3d574c10ceed", + "model": "main", + "rows": 192, + "smoke": false, + "stage": null, + "started": 1794397631.4023235 + } + }, + "peak_allocated_bytes": { + "test_controller": 5289268736, + "test_ensemble": 4195918336, + "test_ff": 6450921984, + "test_loop": 4353253888, + "test_open": 4273221120, + "test_patch": 4423164416, + "test_perturb": 4358022144, + "test_shuffle": 4423174144, + "test_shuffle_a1": 4425094144 + }, + "schema": "algernon.arg02.profile.v1", + "timing_scope": "CUDA-event timings per segment; a depth-d latency is prelude + d block steps + its readout, measured inside the combined trajectory; verifier time is this machine's CPU wall time at grading" +} diff --git a/research/algernon/algebraic_reasoning_gym/arg02/results/arg02_receipt.json b/research/algernon/algebraic_reasoning_gym/arg02/results/arg02_receipt.json new file mode 100644 index 000000000..5c5cfae47 --- /dev/null +++ b/research/algernon/algebraic_reasoning_gym/arg02/results/arg02_receipt.json @@ -0,0 +1,3402 @@ +{ + "answer_tape_sha256": "89928a6d643161665890bbaaa08ee9e83ebf949e64c36ec520a2e0a874bbc7b6", + "arg01_receipt_sha256": "06f71daa0607266314154d28398ac88cbaef8786cc5fedc4ebce94622679ec89", + "decisions": { + "H1_depth": false, + "H2a_feedback": true, + "H2b_state": false, + "H2b_state_original_shuffle": false, + "H3a_repeat": false, + "H3b_ff": false, + "H3c_efficiency": false, + "H4_symbolic": false, + "efficiency_future12_per_e2e_second": { + "controller": 0.022269767789050675, + "ensemble@16": 0.05713523109954947, + "ff2b@1": 0.2027449500769201, + "loop@1": 0.2191794406041501, + "loop@16": 0.062288564374820436, + "symbolic:certified_mass12": 353.67925244688826, + "symbolic:certified_mass_full": 441.5805584577674, + "symbolic:exhaustive_64": 347.00496040275556, + "symbolic:frozen_gru": 49.162259848077184 + }, + "mechanism_claim": false, + "selected": { + "block": [ + 8, + 12 + ], + "depth": 16, + "ensemble_size": 4, + "shots": 4 + } + }, + "depth": { + "curve": { + "1": { + "accepted1": 18, + "future1": 14, + "future12": 68, + "greedy_accepted": 9, + "greedy_valid": 146 + }, + "10": { + "accepted1": 15, + "future1": 14, + "future12": 72, + "greedy_accepted": 0, + "greedy_valid": 0 + }, + "11": { + "accepted1": 12, + "future1": 10, + "future12": 80, + "greedy_accepted": 0, + "greedy_valid": 0 + }, + "12": { + "accepted1": 11, + "future1": 11, + "future12": 78, + "greedy_accepted": 0, + "greedy_valid": 0 + }, + "13": { + "accepted1": 12, + "future1": 11, + "future12": 74, + "greedy_accepted": 0, + "greedy_valid": 0 + }, + "14": { + "accepted1": 8, + "future1": 5, + "future12": 69, + "greedy_accepted": 0, + "greedy_valid": 0 + }, + "15": { + "accepted1": 12, + "future1": 9, + "future12": 72, + "greedy_accepted": 0, + "greedy_valid": 0 + }, + "16": { + "accepted1": 12, + "future1": 8, + "future12": 67, + "greedy_accepted": 0, + "greedy_valid": 0 + }, + "2": { + "accepted1": 16, + "future1": 11, + "future12": 60, + "greedy_accepted": 10, + "greedy_valid": 167 + }, + "3": { + "accepted1": 16, + "future1": 11, + "future12": 54, + "greedy_accepted": 16, + "greedy_valid": 168 + }, + "4": { + "accepted1": 24, + "future1": 19, + "future12": 60, + "greedy_accepted": 16, + "greedy_valid": 154 + }, + "5": { + "accepted1": 20, + "future1": 17, + "future12": 54, + "greedy_accepted": 12, + "greedy_valid": 129 + }, + "6": { + "accepted1": 17, + "future1": 15, + "future12": 50, + "greedy_accepted": 5, + "greedy_valid": 101 + }, + "7": { + "accepted1": 16, + "future1": 15, + "future12": 49, + "greedy_accepted": 5, + "greedy_valid": 79 + }, + "8": { + "accepted1": 15, + "future1": 14, + "future12": 58, + "greedy_accepted": 1, + "greedy_valid": 47 + }, + "9": { + "accepted1": 10, + "future1": 10, + "future12": 70, + "greedy_accepted": 0, + "greedy_valid": 1 + } + }, + "damage": { + "at12@16": { + "gained": 32, + "lost": 33 + }, + "at12@2": { + "gained": 12, + "lost": 20 + }, + "at12@4": { + "gained": 17, + "lost": 25 + }, + "at12@8": { + "gained": 21, + "lost": 31 + }, + "at1@16": { + "gained": 7, + "lost": 13 + }, + "at1@2": { + "gained": 4, + "lost": 7 + }, + "at1@4": { + "gained": 10, + "lost": 5 + }, + "at1@8": { + "gained": 11, + "lost": 11 + } + }, + "first_success_after_step1": 43, + "first_success_after_step1_kept_at_T": 7, + "first_success_step_hist": { + "1": 14, + "10": 10, + "11": 2, + "12": 4, + "13": 4, + "14": 1, + "15": 3, + "2": 4, + "3": 1, + "4": 8, + "5": 1, + "8": 2, + "9": 3, + "None": 111 + }, + "residual_reduction_median": { + "10": 0.969338796345983, + "11": 0.9775101415226148, + "12": 0.9870648264119908, + "13": 0.9912024328382925, + "14": 1.008005099385803, + "15": 1.032224273919979, + "16": 1.0183797588949304, + "2": 0.5921723732752229, + "3": 0.7433859933043876, + "4": 0.8348013677580266, + "5": 0.9119776150932224, + "6": 0.9560693731436547, + "7": 0.9641204810008965, + "8": 0.9629931812348723, + "9": 0.965393307960611 + }, + "residual_relative_norm": { + "1": { + "median": 0.7520185708999634, + "p95": 0.7547640711069107 + }, + "10": { + "median": 0.2091563567519188, + "p95": 0.2109910763800144 + }, + "11": { + "median": 0.20440983772277832, + "p95": 0.20757485926151276 + }, + "12": { + "median": 0.20163492858409882, + "p95": 0.20890380591154098 + }, + "13": { + "median": 0.19979842752218246, + "p95": 0.21360562816262244 + }, + "14": { + "median": 0.20148733258247375, + "p95": 0.21883110851049423 + }, + "15": { + "median": 0.20824839174747467, + "p95": 0.22526139318943023 + }, + "16": { + "median": 0.21281195431947708, + "p95": 0.2278420239686966 + }, + "2": { + "median": 0.44522635638713837, + "p95": 0.44719493985176084 + }, + "3": { + "median": 0.3306991755962372, + "p95": 0.33254501819610593 + }, + "4": { + "median": 0.2762368619441986, + "p95": 0.2777523025870323 + }, + "5": { + "median": 0.251790314912796, + "p95": 0.2541127175092697 + }, + "6": { + "median": 0.24076003581285477, + "p95": 0.24347590655088425 + }, + "7": { + "median": 0.23239102214574814, + "p95": 0.2346131332218647 + }, + "8": { + "median": 0.22367384284734726, + "p95": 0.2258673094213009 + }, + "9": { + "median": 0.21586357802152634, + "p95": 0.21757884919643403 + } + } + }, + "ensemble_sizes": { + "1": 1, + "16": 4, + "2": 1, + "4": 2, + "8": 2 + }, + "evalmath_pin": { + "checkpoint_origin": "MoralityLabAI/Compactification-Theory RRC-19 committed frozen training artifacts", + "checkpoint_sha256": { + "frozen_ff": "a40cc30ccb93550edbaca1ba6660f24ca0adde37bf910fe4a05f55bbbe20a001", + "frozen_gru": "fa610d639243c96d40ebde2d75c2b852c3d0881b65db07736c0a1c4590a161d8", + "shuffled_gru": "9178aaf0fea14f9beb026e797b6186c1cba0a134afb5e3de63602a5f8e77f834", + "skewed_gru": "72e5baf944e1f1851e0d296a7e53ac314cd7d679294d5bed372b1c46e90b6b01" + }, + "evalmath_commit_sha": "88bb6cf8d2fe172e37d25964dfb2c285d9033841", + "evalmath_repository": "MoralityLabAI/EvalMath", + "oracle_source_sha256": "c0df77faae6351e522f35d36fa6031d6270ecced2fd92d0477cb5e08992ccb0b", + "oracle_version": "arg01.oracle.v1", + "revision_state": "GitHub-merged exact EvalMath oracle commit and source SHA lock", + "schema": "algernon.arg01.pin.v1" + }, + "external_crosscheck": { + "by_depth": { + "1": { + "arg01_exact_accepted": 18, + "arg01_future_correct": 14, + "arg02_at1_accepted": 18, + "arg02_at1_future": 14 + }, + "2": { + "arg01_exact_accepted": 16, + "arg01_future_correct": 11, + "arg02_at1_accepted": 16, + "arg02_at1_future": 11 + }, + "4": { + "arg01_exact_accepted": 24, + "arg01_future_correct": 19, + "arg02_at1_accepted": 24, + "arg02_at1_future": 19 + }, + "8": { + "arg01_exact_accepted": 15, + "arg01_future_correct": 14, + "arg02_at1_accepted": 15, + "arg02_at1_future": 14 + } + }, + "proposal_sha256": "072eab4303b3912d12fbbf8753b70a3cb40bb3a19befe9e69321cd2071379526" + }, + "ff_control": { + "repo": "Qwen/Qwen3.5-2B-Base", + "revision": "b1485b2fa6dfa1287294f269f5fb618e03d52d7c" + }, + "model": { + "dtype": "bfloat16", + "repo": "Qwen/Qwen3.5-0.8B-Base", + "revision": "dc7cdfe2ee4154fa7e30f5b51ca41bfa40174e68" + }, + "op_ids": { + "I": 353, + "N": 443, + "R": 423, + "S": 326 + }, + "paired_future1": { + "ff2b@1_vs_loop@1": { + "a_only": 3, + "a_total": 15, + "b_only": 2, + "b_total": 14, + "bootstrap": 10000, + "cluster_ci95": [ + -0.012195121951219513, + 0.025806451612903226 + ], + "clusters": 28, + "difference": 1, + "mcnemar_p": 1.0, + "mean_difference": 0.005952380952380952, + "n": 168, + "seed": 2026111104 + }, + "loop@16_vs_ensemble@16": { + "a_only": 7, + "a_total": 8, + "b_only": 14, + "b_total": 15, + "bootstrap": 10000, + "cluster_ci95": [ + -0.09574468085106383, + 0.012422360248447204 + ], + "clusters": 28, + "difference": -7, + "mcnemar_p": 0.18924713134765625, + "mean_difference": -0.041666666666666664, + "n": 168, + "seed": 2026111104 + }, + "loop@16_vs_ff2b@1": { + "a_only": 7, + "a_total": 8, + "b_only": 14, + "b_total": 15, + "bootstrap": 10000, + "cluster_ci95": [ + -0.08743169398907104, + 0.006060606060606061 + ], + "clusters": 28, + "difference": -7, + "mcnemar_p": 0.18924713134765625, + "mean_difference": -0.041666666666666664, + "n": 168, + "seed": 2026111104 + }, + "loop@16_vs_loop@1": { + "a_only": 7, + "a_total": 8, + "b_only": 13, + "b_total": 14, + "bootstrap": 10000, + "cluster_ci95": [ + -0.0903954802259887, + 0.01818181818181818 + ], + "clusters": 28, + "difference": -6, + "mcnemar_p": 0.26317596435546875, + "mean_difference": -0.03571428571428571, + "n": 168, + "seed": 2026111104 + }, + "loop@16_vs_open@16": { + "a_only": 6, + "a_total": 8, + "b_only": 6, + "b_total": 8, + "bootstrap": 10000, + "cluster_ci95": [ + -0.041176470588235294, + 0.041916167664670656 + ], + "clusters": 28, + "difference": 0, + "mcnemar_p": 1.0, + "mean_difference": 0.0, + "n": 168, + "seed": 2026111104 + }, + "loop@16_vs_shuffle@16": { + "a_only": 8, + "a_total": 8, + "b_only": 9, + "b_total": 9, + "bootstrap": 10000, + "cluster_ci95": [ + -0.049079754601226995, + 0.040268456375838924 + ], + "clusters": 28, + "difference": -1, + "mcnemar_p": 1.0, + "mean_difference": -0.005952380952380952, + "n": 168, + "seed": 2026111104 + }, + "loop@16_vs_shuffle_a1@16": { + "a_only": 8, + "a_total": 8, + "b_only": 9, + "b_total": 9, + "bootstrap": 10000, + "cluster_ci95": [ + -0.049079754601226995, + 0.040268456375838924 + ], + "clusters": 28, + "difference": -1, + "mcnemar_p": 1.0, + "mean_difference": -0.005952380952380952, + "n": 168, + "seed": 2026111104 + }, + "loop@2_vs_loop@1": { + "a_only": 4, + "a_total": 11, + "b_only": 7, + "b_total": 14, + "bootstrap": 10000, + "cluster_ci95": [ + -0.054945054945054944, + 0.018867924528301886 + ], + "clusters": 28, + "difference": -3, + "mcnemar_p": 0.548828125, + "mean_difference": -0.017857142857142856, + "n": 168, + "seed": 2026111104 + }, + "loop@4_vs_loop@1": { + "a_only": 10, + "a_total": 19, + "b_only": 5, + "b_total": 14, + "bootstrap": 10000, + "cluster_ci95": [ + -0.006289308176100629, + 0.0670391061452514 + ], + "clusters": 28, + "difference": 5, + "mcnemar_p": 0.3017578125, + "mean_difference": 0.02976190476190476, + "n": 168, + "seed": 2026111104 + }, + "loop@8_vs_loop@1": { + "a_only": 11, + "a_total": 14, + "b_only": 11, + "b_total": 14, + "bootstrap": 10000, + "cluster_ci95": [ + -0.04864864864864865, + 0.050314465408805034 + ], + "clusters": 28, + "difference": 0, + "mcnemar_p": 1.0, + "mean_difference": 0.0, + "n": 168, + "seed": 2026111104 + }, + "open@16_vs_loop@1": { + "a_only": 8, + "a_total": 8, + "b_only": 14, + "b_total": 14, + "bootstrap": 10000, + "cluster_ci95": [ + -0.09497206703910614, + 0.024242424242424242 + ], + "clusters": 28, + "difference": -6, + "mcnemar_p": 0.28627872467041016, + "mean_difference": -0.03571428571428571, + "n": 168, + "seed": 2026111104 + }, + "open@2_vs_loop@1": { + "a_only": 8, + "a_total": 12, + "b_only": 10, + "b_total": 14, + "bootstrap": 10000, + "cluster_ci95": [ + -0.06043956043956044, + 0.036585365853658534 + ], + "clusters": 28, + "difference": -2, + "mcnemar_p": 0.8145294189453125, + "mean_difference": -0.011904761904761904, + "n": 168, + "seed": 2026111104 + }, + "open@4_vs_loop@1": { + "a_only": 15, + "a_total": 15, + "b_only": 14, + "b_total": 14, + "bootstrap": 10000, + "cluster_ci95": [ + -0.05263157894736842, + 0.06395348837209303 + ], + "clusters": 28, + "difference": 1, + "mcnemar_p": 1.0, + "mean_difference": 0.005952380952380952, + "n": 168, + "seed": 2026111104 + }, + "open@8_vs_loop@1": { + "a_only": 8, + "a_total": 8, + "b_only": 14, + "b_total": 14, + "bootstrap": 10000, + "cluster_ci95": [ + -0.09497206703910614, + 0.024242424242424242 + ], + "clusters": 28, + "difference": -6, + "mcnemar_p": 0.28627872467041016, + "mean_difference": -0.03571428571428571, + "n": 168, + "seed": 2026111104 + }, + "shuffle@16_vs_loop@1": { + "a_only": 9, + "a_total": 9, + "b_only": 14, + "b_total": 14, + "bootstrap": 10000, + "cluster_ci95": [ + -0.07602339181286549, + 0.017142857142857144 + ], + "clusters": 28, + "difference": -5, + "mcnemar_p": 0.4048728942871094, + "mean_difference": -0.02976190476190476, + "n": 168, + "seed": 2026111104 + }, + "shuffle@2_vs_loop@1": { + "a_only": 3, + "a_total": 8, + "b_only": 9, + "b_total": 14, + "bootstrap": 10000, + "cluster_ci95": [ + -0.08187134502923976, + 0.0058823529411764705 + ], + "clusters": 28, + "difference": -6, + "mcnemar_p": 0.14599609375, + "mean_difference": -0.03571428571428571, + "n": 168, + "seed": 2026111104 + }, + "shuffle@4_vs_loop@1": { + "a_only": 5, + "a_total": 7, + "b_only": 12, + "b_total": 14, + "bootstrap": 10000, + "cluster_ci95": [ + -0.08024691358024691, + -0.0056179775280898875 + ], + "clusters": 28, + "difference": -7, + "mcnemar_p": 0.143463134765625, + "mean_difference": -0.041666666666666664, + "n": 168, + "seed": 2026111104 + }, + "shuffle@8_vs_loop@1": { + "a_only": 11, + "a_total": 13, + "b_only": 12, + "b_total": 14, + "bootstrap": 10000, + "cluster_ci95": [ + -0.05172413793103448, + 0.0427807486631016 + ], + "clusters": 28, + "difference": -1, + "mcnemar_p": 1.0, + "mean_difference": -0.005952380952380952, + "n": 168, + "seed": 2026111104 + }, + "shuffle_a1@16_vs_loop@1": { + "a_only": 9, + "a_total": 9, + "b_only": 14, + "b_total": 14, + "bootstrap": 10000, + "cluster_ci95": [ + -0.07602339181286549, + 0.017142857142857144 + ], + "clusters": 28, + "difference": -5, + "mcnemar_p": 0.4048728942871094, + "mean_difference": -0.02976190476190476, + "n": 168, + "seed": 2026111104 + }, + "shuffle_a1@2_vs_loop@1": { + "a_only": 3, + "a_total": 8, + "b_only": 9, + "b_total": 14, + "bootstrap": 10000, + "cluster_ci95": [ + -0.08187134502923976, + 0.0058823529411764705 + ], + "clusters": 28, + "difference": -6, + "mcnemar_p": 0.14599609375, + "mean_difference": -0.03571428571428571, + "n": 168, + "seed": 2026111104 + }, + "shuffle_a1@4_vs_loop@1": { + "a_only": 5, + "a_total": 7, + "b_only": 12, + "b_total": 14, + "bootstrap": 10000, + "cluster_ci95": [ + -0.08024691358024691, + -0.0056179775280898875 + ], + "clusters": 28, + "difference": -7, + "mcnemar_p": 0.143463134765625, + "mean_difference": -0.041666666666666664, + "n": 168, + "seed": 2026111104 + }, + "shuffle_a1@8_vs_loop@1": { + "a_only": 10, + "a_total": 12, + "b_only": 12, + "b_total": 14, + "bootstrap": 10000, + "cluster_ci95": [ + -0.055900621118012424, + 0.03592814371257485 + ], + "clusters": 28, + "difference": -2, + "mcnemar_p": 0.8318119049072266, + "mean_difference": -0.011904761904761904, + "n": 168, + "seed": 2026111104 + } + }, + "paired_future12": { + "controller_vs_loop@1": { + "a_only": 27, + "a_total": 69, + "b_only": 26, + "b_total": 68, + "bootstrap": 10000, + "cluster_ci95": [ + -0.07975460122699386, + 0.09316770186335403 + ], + "clusters": 28, + "difference": 1, + "mcnemar_p": 1.0, + "mean_difference": 0.005952380952380952, + "n": 168, + "seed": 2026111104 + }, + "ff2b@1_vs_loop@1": { + "a_only": 20, + "a_total": 79, + "b_only": 9, + "b_total": 68, + "bootstrap": 10000, + "cluster_ci95": [ + 0.0, + 0.12921348314606743 + ], + "clusters": 28, + "difference": 11, + "mcnemar_p": 0.06142834573984146, + "mean_difference": 0.06547619047619048, + "n": 168, + "seed": 2026111104 + }, + "loop@16_vs_ensemble@16": { + "a_only": 32, + "a_total": 67, + "b_only": 34, + "b_total": 69, + "bootstrap": 10000, + "cluster_ci95": [ + -0.09659090909090909, + 0.06976744186046512 + ], + "clusters": 28, + "difference": -2, + "mcnemar_p": 0.9021585000966993, + "mean_difference": -0.011904761904761904, + "n": 168, + "seed": 2026111104 + }, + "loop@16_vs_ff2b@1": { + "a_only": 28, + "a_total": 67, + "b_only": 40, + "b_total": 79, + "bootstrap": 10000, + "cluster_ci95": [ + -0.16560509554140126, + 0.018072289156626505 + ], + "clusters": 28, + "difference": -12, + "mcnemar_p": 0.18181005453559343, + "mean_difference": -0.07142857142857142, + "n": 168, + "seed": 2026111104 + }, + "loop@16_vs_loop@1": { + "a_only": 32, + "a_total": 67, + "b_only": 33, + "b_total": 68, + "bootstrap": 10000, + "cluster_ci95": [ + -0.08496732026143791, + 0.0718562874251497 + ], + "clusters": 28, + "difference": -1, + "mcnemar_p": 1.0, + "mean_difference": -0.005952380952380952, + "n": 168, + "seed": 2026111104 + }, + "loop@16_vs_open@16": { + "a_only": 47, + "a_total": 67, + "b_only": 26, + "b_total": 46, + "bootstrap": 10000, + "cluster_ci95": [ + 0.023391812865497075, + 0.22580645161290322 + ], + "clusters": 28, + "difference": 21, + "mcnemar_p": 0.018617751433194638, + "mean_difference": 0.125, + "n": 168, + "seed": 2026111104 + }, + "loop@16_vs_shuffle@16": { + "a_only": 29, + "a_total": 67, + "b_only": 29, + "b_total": 67, + "bootstrap": 10000, + "cluster_ci95": [ + -0.08125, + 0.07777777777777778 + ], + "clusters": 28, + "difference": 0, + "mcnemar_p": 1.0, + "mean_difference": 0.0, + "n": 168, + "seed": 2026111104 + }, + "loop@16_vs_shuffle_a1@16": { + "a_only": 29, + "a_total": 67, + "b_only": 28, + "b_total": 66, + "bootstrap": 10000, + "cluster_ci95": [ + -0.07692307692307693, + 0.0821917808219178 + ], + "clusters": 28, + "difference": 1, + "mcnemar_p": 1.0, + "mean_difference": 0.005952380952380952, + "n": 168, + "seed": 2026111104 + }, + "loop@16_vs_symbolic:certified_mass12": { + "a_only": 12, + "a_total": 67, + "b_only": 47, + "b_total": 102, + "bootstrap": 10000, + "cluster_ci95": [ + -0.27388535031847133, + -0.14754098360655737 + ], + "clusters": 28, + "difference": -35, + "mcnemar_p": 5.1256292496887346e-06, + "mean_difference": -0.20833333333333334, + "n": 168, + "seed": 2026111104 + }, + "loop@16_vs_symbolic:certified_mass_full": { + "a_only": 1, + "a_total": 67, + "b_only": 93, + "b_total": 159, + "bootstrap": 10000, + "cluster_ci95": [ + -0.6075949367088608, + -0.4883720930232558 + ], + "clusters": 28, + "difference": -92, + "mcnemar_p": 9.592548607487504e-27, + "mean_difference": -0.5476190476190477, + "n": 168, + "seed": 2026111104 + }, + "loop@16_vs_symbolic:exhaustive_64": { + "a_only": 1, + "a_total": 67, + "b_only": 91, + "b_total": 157, + "bootstrap": 10000, + "cluster_ci95": [ + -0.5963855421686747, + -0.47368421052631576 + ], + "clusters": 28, + "difference": -90, + "mcnemar_p": 3.75624008630037e-26, + "mean_difference": -0.5357142857142857, + "n": 168, + "seed": 2026111104 + }, + "loop@1_vs_symbolic:certified_mass12": { + "a_only": 12, + "a_total": 68, + "b_only": 46, + "b_total": 102, + "bootstrap": 10000, + "cluster_ci95": [ + -0.28654970760233917, + -0.11695906432748537 + ], + "clusters": 28, + "difference": -34, + "mcnemar_p": 8.219663963332513e-06, + "mean_difference": -0.20238095238095238, + "n": 168, + "seed": 2026111104 + }, + "loop@1_vs_symbolic:frozen_ff": { + "a_only": 11, + "a_total": 68, + "b_only": 65, + "b_total": 122, + "bootstrap": 10000, + "cluster_ci95": [ + -0.41304347826086957, + -0.23026315789473684 + ], + "clusters": 28, + "difference": -54, + "mcnemar_p": 1.81197137160965e-10, + "mean_difference": -0.32142857142857145, + "n": 168, + "seed": 2026111104 + }, + "loop@1_vs_symbolic:frozen_gru": { + "a_only": 9, + "a_total": 68, + "b_only": 70, + "b_total": 129, + "bootstrap": 10000, + "cluster_ci95": [ + -0.4556213017751479, + -0.27631578947368424 + ], + "clusters": 28, + "difference": -61, + "mcnemar_p": 7.778844062771146e-13, + "mean_difference": -0.3630952380952381, + "n": 168, + "seed": 2026111104 + }, + "loop@2_vs_loop@1": { + "a_only": 12, + "a_total": 60, + "b_only": 20, + "b_total": 68, + "bootstrap": 10000, + "cluster_ci95": [ + -0.1069182389937107, + 0.0125 + ], + "clusters": 28, + "difference": -8, + "mcnemar_p": 0.21532714972272515, + "mean_difference": -0.047619047619047616, + "n": 168, + "seed": 2026111104 + }, + "loop@4_vs_loop@1": { + "a_only": 17, + "a_total": 60, + "b_only": 25, + "b_total": 68, + "bootstrap": 10000, + "cluster_ci95": [ + -0.1206896551724138, + 0.029940119760479042 + ], + "clusters": 28, + "difference": -8, + "mcnemar_p": 0.27995623852893914, + "mean_difference": -0.047619047619047616, + "n": 168, + "seed": 2026111104 + }, + "loop@8_vs_loop@1": { + "a_only": 21, + "a_total": 58, + "b_only": 31, + "b_total": 68, + "bootstrap": 10000, + "cluster_ci95": [ + -0.12574850299401197, + 0.012195121951219513 + ], + "clusters": 28, + "difference": -10, + "mcnemar_p": 0.21160856876151612, + "mean_difference": -0.05952380952380952, + "n": 168, + "seed": 2026111104 + }, + "open@16_vs_loop@1": { + "a_only": 25, + "a_total": 46, + "b_only": 47, + "b_total": 68, + "bootstrap": 10000, + "cluster_ci95": [ + -0.2236024844720497, + -0.04081632653061224 + ], + "clusters": 28, + "difference": -22, + "mcnemar_p": 0.012774595538064903, + "mean_difference": -0.13095238095238096, + "n": 168, + "seed": 2026111104 + }, + "open@2_vs_loop@1": { + "a_only": 12, + "a_total": 65, + "b_only": 15, + "b_total": 68, + "bootstrap": 10000, + "cluster_ci95": [ + -0.07368421052631578, + 0.03614457831325301 + ], + "clusters": 28, + "difference": -3, + "mcnemar_p": 0.7011080384254456, + "mean_difference": -0.017857142857142856, + "n": 168, + "seed": 2026111104 + }, + "open@4_vs_loop@1": { + "a_only": 30, + "a_total": 73, + "b_only": 25, + "b_total": 68, + "bootstrap": 10000, + "cluster_ci95": [ + -0.05421686746987952, + 0.11875 + ], + "clusters": 28, + "difference": 5, + "mcnemar_p": 0.5900533317766357, + "mean_difference": 0.02976190476190476, + "n": 168, + "seed": 2026111104 + }, + "open@8_vs_loop@1": { + "a_only": 36, + "a_total": 67, + "b_only": 37, + "b_total": 68, + "bootstrap": 10000, + "cluster_ci95": [ + -0.09740259740259741, + 0.08139534883720931 + ], + "clusters": 28, + "difference": -1, + "mcnemar_p": 1.0, + "mean_difference": -0.005952380952380952, + "n": 168, + "seed": 2026111104 + }, + "shuffle@16_vs_loop@1": { + "a_only": 34, + "a_total": 67, + "b_only": 35, + "b_total": 68, + "bootstrap": 10000, + "cluster_ci95": [ + -0.0975609756097561, + 0.08284023668639054 + ], + "clusters": 28, + "difference": -1, + "mcnemar_p": 1.0, + "mean_difference": -0.005952380952380952, + "n": 168, + "seed": 2026111104 + }, + "shuffle@2_vs_loop@1": { + "a_only": 8, + "a_total": 53, + "b_only": 23, + "b_total": 68, + "bootstrap": 10000, + "cluster_ci95": [ + -0.1694915254237288, + -0.012121212121212121 + ], + "clusters": 28, + "difference": -15, + "mcnemar_p": 0.010673840530216694, + "mean_difference": -0.08928571428571429, + "n": 168, + "seed": 2026111104 + }, + "shuffle@4_vs_loop@1": { + "a_only": 11, + "a_total": 53, + "b_only": 26, + "b_total": 68, + "bootstrap": 10000, + "cluster_ci95": [ + -0.16292134831460675, + -0.01875 + ], + "clusters": 28, + "difference": -15, + "mcnemar_p": 0.020073851919732988, + "mean_difference": -0.08928571428571429, + "n": 168, + "seed": 2026111104 + }, + "shuffle@8_vs_loop@1": { + "a_only": 24, + "a_total": 63, + "b_only": 29, + "b_total": 68, + "bootstrap": 10000, + "cluster_ci95": [ + -0.10119047619047619, + 0.041379310344827586 + ], + "clusters": 28, + "difference": -5, + "mcnemar_p": 0.5831321542611763, + "mean_difference": -0.02976190476190476, + "n": 168, + "seed": 2026111104 + }, + "shuffle_a1@16_vs_loop@1": { + "a_only": 35, + "a_total": 66, + "b_only": 37, + "b_total": 68, + "bootstrap": 10000, + "cluster_ci95": [ + -0.10588235294117647, + 0.0783132530120482 + ], + "clusters": 28, + "difference": -2, + "mcnemar_p": 0.9062943247030809, + "mean_difference": -0.011904761904761904, + "n": 168, + "seed": 2026111104 + }, + "shuffle_a1@2_vs_loop@1": { + "a_only": 7, + "a_total": 52, + "b_only": 23, + "b_total": 68, + "bootstrap": 10000, + "cluster_ci95": [ + -0.17486338797814208, + -0.018072289156626505 + ], + "clusters": 28, + "difference": -16, + "mcnemar_p": 0.005222879350185394, + "mean_difference": -0.09523809523809523, + "n": 168, + "seed": 2026111104 + }, + "shuffle_a1@4_vs_loop@1": { + "a_only": 10, + "a_total": 52, + "b_only": 26, + "b_total": 68, + "bootstrap": 10000, + "cluster_ci95": [ + -0.1656441717791411, + -0.030303030303030304 + ], + "clusters": 28, + "difference": -16, + "mcnemar_p": 0.011330984183587134, + "mean_difference": -0.09523809523809523, + "n": 168, + "seed": 2026111104 + }, + "shuffle_a1@8_vs_loop@1": { + "a_only": 24, + "a_total": 63, + "b_only": 29, + "b_total": 68, + "bootstrap": 10000, + "cluster_ci95": [ + -0.10119047619047619, + 0.041379310344827586 + ], + "clusters": 28, + "difference": -5, + "mcnemar_p": 0.5831321542611763, + "mean_difference": -0.02976190476190476, + "n": 168, + "seed": 2026111104 + } + }, + "patching": { + "depth": 16, + "steps": { + "1": { + "cases": 168, + "future12": 70, + "kl_median": 0.8915678253184788, + "kl_p95": 5.0291032945762035, + "top1_changed": 91, + "top1_kept": 77, + "top1_to_donor": 4 + }, + "16": { + "cases": 168, + "future12": 69, + "kl_median": 5.148107081625927, + "kl_p95": 10.95807252622523, + "top1_changed": 164, + "top1_kept": 4, + "top1_to_donor": 84 + }, + "8": { + "cases": 168, + "future12": 73, + "kl_median": 4.354094991899185, + "kl_p95": 10.346359024830395, + "top1_changed": 154, + "top1_kept": 14, + "top1_to_donor": 28 + } + } + }, + "perturbation": { + "distance_over_kick_median": { + "1": 1.0000203286978688, + "10": 3.0739296583909645, + "11": 3.806233275879874, + "12": 4.70060399343744, + "13": 5.794110798952051, + "14": 7.108637148217314, + "15": 8.782579398356958, + "16": 10.85923315681173, + "2": 0.7684509314910232, + "3": 0.7957229926221402, + "4": 0.9068440712815675, + "5": 1.0794012155427066, + "6": 1.316235284011872, + "7": 1.6266872734757416, + "8": 2.015239192384948, + "9": 2.4908531653831547 + }, + "readouts": { + "1": { + "clean_future12": 68, + "future12": 69, + "top1_agrees_with_clean": 144 + }, + "16": { + "clean_future12": 67, + "future12": 69, + "top1_agrees_with_clean": 22 + }, + "2": { + "clean_future12": 60, + "future12": 58, + "top1_agrees_with_clean": 143 + }, + "4": { + "clean_future12": 60, + "future12": 58, + "top1_agrees_with_clean": 146 + }, + "8": { + "clean_future12": 58, + "future12": 63, + "top1_agrees_with_clean": 81 + } + }, + "sigma": 0.25, + "step": 1 + }, + "probes": { + "labels": { + "outer_op": { + "0": { + "majority_label": "I", + "settings": { + "k": 16, + "lam": 0.1, + "selection_accuracy": 0.4722222222222222 + }, + "tests": { + "novel": { + "accuracy": 0.3854166666666667, + "majority_accuracy": 0.40625, + "n": 96, + "permutation_mean": 0.3090625, + "permutation_p": 0.08955223880597014 + }, + "seen": { + "accuracy": 0.375, + "majority_accuracy": 0.2638888888888889, + "n": 72, + "permutation_mean": 0.2795833333333333, + "permutation_p": 0.07960199004975124 + } + } + }, + "1": { + "majority_label": "I", + "settings": { + "k": 32, + "lam": 0.001, + "selection_accuracy": 0.3888888888888889 + }, + "tests": { + "novel": { + "accuracy": 0.3645833333333333, + "majority_accuracy": 0.40625, + "n": 96, + "permutation_mean": 0.2725520833333333, + "permutation_p": 0.03482587064676617 + }, + "seen": { + "accuracy": 0.3611111111111111, + "majority_accuracy": 0.2638888888888889, + "n": 72, + "permutation_mean": 0.25819444444444445, + "permutation_p": 0.05970149253731343 + } + } + }, + "10": { + "majority_label": "I", + "settings": { + "k": 8, + "lam": 0.001, + "selection_accuracy": 0.4722222222222222 + }, + "tests": { + "novel": { + "accuracy": 0.3541666666666667, + "majority_accuracy": 0.40625, + "n": 96, + "permutation_mean": 0.3148958333333333, + "permutation_p": 0.25870646766169153 + }, + "seen": { + "accuracy": 0.3055555555555556, + "majority_accuracy": 0.2638888888888889, + "n": 72, + "permutation_mean": 0.27729166666666666, + "permutation_p": 0.3482587064676617 + } + } + }, + "11": { + "majority_label": "I", + "settings": { + "k": 16, + "lam": 0.001, + "selection_accuracy": 0.4166666666666667 + }, + "tests": { + "novel": { + "accuracy": 0.40625, + "majority_accuracy": 0.40625, + "n": 96, + "permutation_mean": 0.30171875, + "permutation_p": 0.01990049751243781 + }, + "seen": { + "accuracy": 0.3055555555555556, + "majority_accuracy": 0.2638888888888889, + "n": 72, + "permutation_mean": 0.2679166666666667, + "permutation_p": 0.3034825870646766 + } + } + }, + "12": { + "majority_label": "I", + "settings": { + "k": 32, + "lam": 0.1, + "selection_accuracy": 0.4722222222222222 + }, + "tests": { + "novel": { + "accuracy": 0.3854166666666667, + "majority_accuracy": 0.40625, + "n": 96, + "permutation_mean": 0.3069791666666667, + "permutation_p": 0.04975124378109453 + }, + "seen": { + "accuracy": 0.2916666666666667, + "majority_accuracy": 0.2638888888888889, + "n": 72, + "permutation_mean": 0.27375, + "permutation_p": 0.4079601990049751 + } + } + }, + "13": { + "majority_label": "I", + "settings": { + "k": 32, + "lam": 0.1, + "selection_accuracy": 0.5 + }, + "tests": { + "novel": { + "accuracy": 0.3541666666666667, + "majority_accuracy": 0.40625, + "n": 96, + "permutation_mean": 0.3077604166666667, + "permutation_p": 0.17412935323383086 + }, + "seen": { + "accuracy": 0.3194444444444444, + "majority_accuracy": 0.2638888888888889, + "n": 72, + "permutation_mean": 0.2729861111111111, + "permutation_p": 0.208955223880597 + } + } + }, + "14": { + "majority_label": "I", + "settings": { + "k": 32, + "lam": 0.1, + "selection_accuracy": 0.4444444444444444 + }, + "tests": { + "novel": { + "accuracy": 0.3125, + "majority_accuracy": 0.40625, + "n": 96, + "permutation_mean": 0.306875, + "permutation_p": 0.5074626865671642 + }, + "seen": { + "accuracy": 0.3333333333333333, + "majority_accuracy": 0.2638888888888889, + "n": 72, + "permutation_mean": 0.27375, + "permutation_p": 0.14427860696517414 + } + } + }, + "15": { + "majority_label": "I", + "settings": { + "k": 32, + "lam": 0.01, + "selection_accuracy": 0.4444444444444444 + }, + "tests": { + "novel": { + "accuracy": 0.3229166666666667, + "majority_accuracy": 0.40625, + "n": 96, + "permutation_mean": 0.2915625, + "permutation_p": 0.2835820895522388 + }, + "seen": { + "accuracy": 0.3611111111111111, + "majority_accuracy": 0.2638888888888889, + "n": 72, + "permutation_mean": 0.2665972222222222, + "permutation_p": 0.029850746268656716 + } + } + }, + "16": { + "majority_label": "I", + "settings": { + "k": 32, + "lam": 0.01, + "selection_accuracy": 0.4444444444444444 + }, + "tests": { + "novel": { + "accuracy": 0.3229166666666667, + "majority_accuracy": 0.40625, + "n": 96, + "permutation_mean": 0.28848958333333335, + "permutation_p": 0.23383084577114427 + }, + "seen": { + "accuracy": 0.3611111111111111, + "majority_accuracy": 0.2638888888888889, + "n": 72, + "permutation_mean": 0.2644444444444444, + "permutation_p": 0.07462686567164178 + } + } + }, + "2": { + "majority_label": "I", + "settings": { + "k": 16, + "lam": 0.001, + "selection_accuracy": 0.4444444444444444 + }, + "tests": { + "novel": { + "accuracy": 0.3645833333333333, + "majority_accuracy": 0.40625, + "n": 96, + "permutation_mean": 0.28953125, + "permutation_p": 0.07960199004975124 + }, + "seen": { + "accuracy": 0.3611111111111111, + "majority_accuracy": 0.2638888888888889, + "n": 72, + "permutation_mean": 0.2693055555555556, + "permutation_p": 0.06965174129353234 + } + } + }, + "3": { + "majority_label": "I", + "settings": { + "k": 16, + "lam": 0.01, + "selection_accuracy": 0.3888888888888889 + }, + "tests": { + "novel": { + "accuracy": 0.3541666666666667, + "majority_accuracy": 0.40625, + "n": 96, + "permutation_mean": 0.29010416666666666, + "permutation_p": 0.12437810945273632 + }, + "seen": { + "accuracy": 0.3472222222222222, + "majority_accuracy": 0.2638888888888889, + "n": 72, + "permutation_mean": 0.27652777777777776, + "permutation_p": 0.15920398009950248 + } + } + }, + "4": { + "majority_label": "I", + "settings": { + "k": 32, + "lam": 0.01, + "selection_accuracy": 0.5 + }, + "tests": { + "novel": { + "accuracy": 0.3333333333333333, + "majority_accuracy": 0.40625, + "n": 96, + "permutation_mean": 0.28203125, + "permutation_p": 0.1691542288557214 + }, + "seen": { + "accuracy": 0.3472222222222222, + "majority_accuracy": 0.2638888888888889, + "n": 72, + "permutation_mean": 0.2718055555555556, + "permutation_p": 0.12935323383084577 + } + } + }, + "5": { + "majority_label": "I", + "settings": { + "k": 32, + "lam": 0.1, + "selection_accuracy": 0.4722222222222222 + }, + "tests": { + "novel": { + "accuracy": 0.375, + "majority_accuracy": 0.40625, + "n": 96, + "permutation_mean": 0.299375, + "permutation_p": 0.09950248756218906 + }, + "seen": { + "accuracy": 0.3194444444444444, + "majority_accuracy": 0.2638888888888889, + "n": 72, + "permutation_mean": 0.280625, + "permutation_p": 0.2835820895522388 + } + } + }, + "6": { + "majority_label": "I", + "settings": { + "k": 32, + "lam": 0.1, + "selection_accuracy": 0.4444444444444444 + }, + "tests": { + "novel": { + "accuracy": 0.4166666666666667, + "majority_accuracy": 0.40625, + "n": 96, + "permutation_mean": 0.29864583333333333, + "permutation_p": 0.009950248756218905 + }, + "seen": { + "accuracy": 0.3333333333333333, + "majority_accuracy": 0.2638888888888889, + "n": 72, + "permutation_mean": 0.27708333333333335, + "permutation_p": 0.1890547263681592 + } + } + }, + "7": { + "majority_label": "I", + "settings": { + "k": 32, + "lam": 0.1, + "selection_accuracy": 0.4444444444444444 + }, + "tests": { + "novel": { + "accuracy": 0.3958333333333333, + "majority_accuracy": 0.40625, + "n": 96, + "permutation_mean": 0.30026041666666664, + "permutation_p": 0.03482587064676617 + }, + "seen": { + "accuracy": 0.3611111111111111, + "majority_accuracy": 0.2638888888888889, + "n": 72, + "permutation_mean": 0.2754166666666667, + "permutation_p": 0.0845771144278607 + } + } + }, + "8": { + "majority_label": "I", + "settings": { + "k": 32, + "lam": 0.1, + "selection_accuracy": 0.4722222222222222 + }, + "tests": { + "novel": { + "accuracy": 0.4583333333333333, + "majority_accuracy": 0.40625, + "n": 96, + "permutation_mean": 0.2981770833333333, + "permutation_p": 0.004975124378109453 + }, + "seen": { + "accuracy": 0.3333333333333333, + "majority_accuracy": 0.2638888888888889, + "n": 72, + "permutation_mean": 0.2761805555555556, + "permutation_p": 0.18407960199004975 + } + } + }, + "9": { + "majority_label": "I", + "settings": { + "k": 8, + "lam": 0.1, + "selection_accuracy": 0.4444444444444444 + }, + "tests": { + "novel": { + "accuracy": 0.3125, + "majority_accuracy": 0.40625, + "n": 96, + "permutation_mean": 0.32546875, + "permutation_p": 0.6766169154228856 + }, + "seen": { + "accuracy": 0.2638888888888889, + "majority_accuracy": 0.2638888888888889, + "n": 72, + "permutation_mean": 0.2904861111111111, + "permutation_p": 0.7562189054726368 + } + } + } + }, + "uses_R": { + "0": { + "majority_label": "True", + "settings": { + "k": 16, + "lam": 1.0, + "selection_accuracy": 0.75 + }, + "tests": { + "novel": { + "accuracy": 0.53125, + "majority_accuracy": 0.5, + "n": 96, + "permutation_mean": 0.49583333333333335, + "permutation_p": 0.24378109452736318 + }, + "seen": { + "accuracy": 0.6527777777777778, + "majority_accuracy": 0.5277777777777778, + "n": 72, + "permutation_mean": 0.5040277777777777, + "permutation_p": 0.009950248756218905 + } + } + }, + "1": { + "majority_label": "True", + "settings": { + "k": 16, + "lam": 1.0, + "selection_accuracy": 0.7222222222222222 + }, + "tests": { + "novel": { + "accuracy": 0.5625, + "majority_accuracy": 0.5, + "n": 96, + "permutation_mean": 0.4910416666666667, + "permutation_p": 0.04975124378109453 + }, + "seen": { + "accuracy": 0.6666666666666666, + "majority_accuracy": 0.5277777777777778, + "n": 72, + "permutation_mean": 0.4996527777777778, + "permutation_p": 0.004975124378109453 + } + } + }, + "10": { + "majority_label": "True", + "settings": { + "k": 16, + "lam": 1.0, + "selection_accuracy": 0.6944444444444444 + }, + "tests": { + "novel": { + "accuracy": 0.5729166666666666, + "majority_accuracy": 0.5, + "n": 96, + "permutation_mean": 0.4977083333333333, + "permutation_p": 0.024875621890547265 + }, + "seen": { + "accuracy": 0.6388888888888888, + "majority_accuracy": 0.5277777777777778, + "n": 72, + "permutation_mean": 0.5201388888888888, + "permutation_p": 0.014925373134328358 + } + } + }, + "11": { + "majority_label": "True", + "settings": { + "k": 32, + "lam": 0.1, + "selection_accuracy": 0.6944444444444444 + }, + "tests": { + "novel": { + "accuracy": 0.59375, + "majority_accuracy": 0.5, + "n": 96, + "permutation_mean": 0.4909895833333333, + "permutation_p": 0.01990049751243781 + }, + "seen": { + "accuracy": 0.6388888888888888, + "majority_accuracy": 0.5277777777777778, + "n": 72, + "permutation_mean": 0.5034722222222222, + "permutation_p": 0.01990049751243781 + } + } + }, + "12": { + "majority_label": "True", + "settings": { + "k": 32, + "lam": 1.0, + "selection_accuracy": 0.75 + }, + "tests": { + "novel": { + "accuracy": 0.5520833333333334, + "majority_accuracy": 0.5, + "n": 96, + "permutation_mean": 0.48880208333333336, + "permutation_p": 0.05970149253731343 + }, + "seen": { + "accuracy": 0.6805555555555556, + "majority_accuracy": 0.5277777777777778, + "n": 72, + "permutation_mean": 0.5113194444444444, + "permutation_p": 0.004975124378109453 + } + } + }, + "13": { + "majority_label": "True", + "settings": { + "k": 32, + "lam": 1.0, + "selection_accuracy": 0.75 + }, + "tests": { + "novel": { + "accuracy": 0.53125, + "majority_accuracy": 0.5, + "n": 96, + "permutation_mean": 0.48760416666666656, + "permutation_p": 0.14925373134328357 + }, + "seen": { + "accuracy": 0.6666666666666666, + "majority_accuracy": 0.5277777777777778, + "n": 72, + "permutation_mean": 0.5100694444444445, + "permutation_p": 0.004975124378109453 + } + } + }, + "14": { + "majority_label": "True", + "settings": { + "k": 32, + "lam": 0.01, + "selection_accuracy": 0.8055555555555556 + }, + "tests": { + "novel": { + "accuracy": 0.6041666666666666, + "majority_accuracy": 0.5, + "n": 96, + "permutation_mean": 0.4986458333333333, + "permutation_p": 0.01990049751243781 + }, + "seen": { + "accuracy": 0.6805555555555556, + "majority_accuracy": 0.5277777777777778, + "n": 72, + "permutation_mean": 0.5049305555555555, + "permutation_p": 0.004975124378109453 + } + } + }, + "15": { + "majority_label": "True", + "settings": { + "k": 32, + "lam": 0.1, + "selection_accuracy": 0.8055555555555556 + }, + "tests": { + "novel": { + "accuracy": 0.5104166666666666, + "majority_accuracy": 0.5, + "n": 96, + "permutation_mean": 0.4927604166666667, + "permutation_p": 0.4079601990049751 + }, + "seen": { + "accuracy": 0.625, + "majority_accuracy": 0.5277777777777778, + "n": 72, + "permutation_mean": 0.5064583333333332, + "permutation_p": 0.04477611940298507 + } + } + }, + "16": { + "majority_label": "True", + "settings": { + "k": 16, + "lam": 1.0, + "selection_accuracy": 0.75 + }, + "tests": { + "novel": { + "accuracy": 0.5208333333333334, + "majority_accuracy": 0.5, + "n": 96, + "permutation_mean": 0.4964583333333333, + "permutation_p": 0.24378109452736318 + }, + "seen": { + "accuracy": 0.5416666666666666, + "majority_accuracy": 0.5277777777777778, + "n": 72, + "permutation_mean": 0.5252777777777777, + "permutation_p": 0.36318407960199006 + } + } + }, + "2": { + "majority_label": "True", + "settings": { + "k": 8, + "lam": 1.0, + "selection_accuracy": 0.7222222222222222 + }, + "tests": { + "novel": { + "accuracy": 0.5729166666666666, + "majority_accuracy": 0.5, + "n": 96, + "permutation_mean": 0.4968229166666667, + "permutation_p": 0.009950248756218905 + }, + "seen": { + "accuracy": 0.6111111111111112, + "majority_accuracy": 0.5277777777777778, + "n": 72, + "permutation_mean": 0.5198611111111111, + "permutation_p": 0.004975124378109453 + } + } + }, + "3": { + "majority_label": "True", + "settings": { + "k": 8, + "lam": 1.0, + "selection_accuracy": 0.6666666666666666 + }, + "tests": { + "novel": { + "accuracy": 0.5625, + "majority_accuracy": 0.5, + "n": 96, + "permutation_mean": 0.49796875, + "permutation_p": 0.004975124378109453 + }, + "seen": { + "accuracy": 0.625, + "majority_accuracy": 0.5277777777777778, + "n": 72, + "permutation_mean": 0.5218055555555555, + "permutation_p": 0.009950248756218905 + } + } + }, + "4": { + "majority_label": "True", + "settings": { + "k": 8, + "lam": 1.0, + "selection_accuracy": 0.6666666666666666 + }, + "tests": { + "novel": { + "accuracy": 0.5, + "majority_accuracy": 0.5, + "n": 96, + "permutation_mean": 0.49817708333333327, + "permutation_p": 0.6019900497512438 + }, + "seen": { + "accuracy": 0.5833333333333334, + "majority_accuracy": 0.5277777777777778, + "n": 72, + "permutation_mean": 0.5236805555555556, + "permutation_p": 0.04477611940298507 + } + } + }, + "5": { + "majority_label": "True", + "settings": { + "k": 8, + "lam": 1.0, + "selection_accuracy": 0.6944444444444444 + }, + "tests": { + "novel": { + "accuracy": 0.5416666666666666, + "majority_accuracy": 0.5, + "n": 96, + "permutation_mean": 0.49994791666666666, + "permutation_p": 0.07960199004975124 + }, + "seen": { + "accuracy": 0.6527777777777778, + "majority_accuracy": 0.5277777777777778, + "n": 72, + "permutation_mean": 0.5230555555555556, + "permutation_p": 0.004975124378109453 + } + } + }, + "6": { + "majority_label": "True", + "settings": { + "k": 32, + "lam": 1.0, + "selection_accuracy": 0.6944444444444444 + }, + "tests": { + "novel": { + "accuracy": 0.6145833333333334, + "majority_accuracy": 0.5, + "n": 96, + "permutation_mean": 0.49885416666666665, + "permutation_p": 0.009950248756218905 + }, + "seen": { + "accuracy": 0.7083333333333334, + "majority_accuracy": 0.5277777777777778, + "n": 72, + "permutation_mean": 0.5079166666666667, + "permutation_p": 0.004975124378109453 + } + } + }, + "7": { + "majority_label": "True", + "settings": { + "k": 32, + "lam": 0.1, + "selection_accuracy": 0.6944444444444444 + }, + "tests": { + "novel": { + "accuracy": 0.5833333333333334, + "majority_accuracy": 0.5, + "n": 96, + "permutation_mean": 0.5044791666666666, + "permutation_p": 0.06965174129353234 + }, + "seen": { + "accuracy": 0.6527777777777778, + "majority_accuracy": 0.5277777777777778, + "n": 72, + "permutation_mean": 0.5066666666666666, + "permutation_p": 0.01990049751243781 + } + } + }, + "8": { + "majority_label": "True", + "settings": { + "k": 32, + "lam": 0.1, + "selection_accuracy": 0.6666666666666666 + }, + "tests": { + "novel": { + "accuracy": 0.59375, + "majority_accuracy": 0.5, + "n": 96, + "permutation_mean": 0.5013020833333333, + "permutation_p": 0.05472636815920398 + }, + "seen": { + "accuracy": 0.7222222222222222, + "majority_accuracy": 0.5277777777777778, + "n": 72, + "permutation_mean": 0.5040277777777777, + "permutation_p": 0.004975124378109453 + } + } + }, + "9": { + "majority_label": "True", + "settings": { + "k": 32, + "lam": 1.0, + "selection_accuracy": 0.6666666666666666 + }, + "tests": { + "novel": { + "accuracy": 0.5833333333333334, + "majority_accuracy": 0.5, + "n": 96, + "permutation_mean": 0.49854166666666666, + "permutation_p": 0.05472636815920398 + }, + "seen": { + "accuracy": 0.6666666666666666, + "majority_accuracy": 0.5277777777777778, + "n": 72, + "permutation_mean": 0.5127777777777778, + "permutation_p": 0.004975124378109453 + } + } + } + } + }, + "select": 36, + "site": "block output at the last prompt token, step 0 = block input", + "test_novel": 96, + "test_seen": 72, + "train": 96 + }, + "schema": "algernon.arg02.receipt.v1", + "selection": { + "block": [ + 8, + 12 + ], + "depth": 16, + "dev_future12_depth1": 52, + "dev_future12_selected": 68, + "dev_gain": 16, + "shots": 4 + }, + "smoke": false, + "splits": { + "counts": { + "calibration": 36, + "dev": 96, + "shots": 4, + "test": 192, + "test_positive": 168 + }, + "dev_families": [ + "product", + "signed", + "sparse" + ], + "dev_seed": 2026111102, + "evalmath_seed": 2026111027, + "roster_sha256": { + "calibration": "088c8dc031f9aa14c94339bd08983f55e730be9415952aed20c66921aa6abf19", + "dev": "113081f8fe58a3a42bb198130436ecf8dc7d9247416694c5ac0ce57b5264041e", + "shots": "201a4dbce72f1a2f9703579c4ab901503da2fa31efd520c56ea1a40fb3a15994", + "test": "0e8caf0649d30f834d0bcfd1469b705d6d73371812cb87575fd3e12243ebcbba" + }, + "schema": "algernon.arg02.splits.v1", + "shot_programs": { + "additive": [ + "I", + "R", + "I" + ], + "cascade": [ + "N", + "N", + "S" + ], + "fork": [ + "S", + "I", + "S" + ], + "hadamard": [ + "R", + "R", + "N" + ] + }, + "shot_seed": 2026111103, + "signature_overlaps": { + "calibration_vs_test": 0, + "dev_vs_calibration": 0, + "dev_vs_test": 0, + "shots_vs_dev": 0, + "shots_vs_test": 0 + }, + "test_duplicate_public_signatures": 6 + }, + "summary": { + "controller": { + "accepted12": 76, + "by_family": { + "lacunary": 10, + "product": 8, + "rational": 11, + "signed": 10, + "sparse": 7, + "squared": 12, + "twisted_product": 11 + }, + "collision_false_future": 1, + "collision_pairs_identical_trace": 6, + "future12": 69, + "negative_accepted": 0, + "novel_future12": 44, + "positives": 168 + }, + "ensemble@1": { + "accepted1": 18, + "accepted12": 78, + "by_family": { + "lacunary": 13, + "product": 11, + "rational": 10, + "signed": 9, + "sparse": 6, + "squared": 8, + "twisted_product": 11 + }, + "collision_false_future": 2, + "collision_pairs_identical_trace": 6, + "future1": 14, + "future12": 68, + "greedy_accepted": 0, + "greedy_future": 0, + "greedy_valid": 0, + "invalid_program_rate": 1.0, + "mean_rank_of_source": 30.24404761904762, + "negative_accepted": 0, + "novel_future12": 42, + "positives": 168, + "queries12": 1422 + }, + "ensemble@16": { + "accepted1": 19, + "accepted12": 79, + "by_family": { + "lacunary": 13, + "product": 11, + "rational": 10, + "signed": 11, + "sparse": 6, + "squared": 8, + "twisted_product": 10 + }, + "collision_false_future": 3, + "collision_pairs_identical_trace": 6, + "future1": 15, + "future12": 69, + "greedy_accepted": 0, + "greedy_future": 0, + "greedy_valid": 0, + "invalid_program_rate": 1.0, + "mean_rank_of_source": 29.928571428571427, + "negative_accepted": 0, + "novel_future12": 41, + "positives": 168, + "queries12": 1423 + }, + "ensemble@2": { + "accepted1": 18, + "accepted12": 78, + "by_family": { + "lacunary": 13, + "product": 11, + "rational": 10, + "signed": 9, + "sparse": 6, + "squared": 8, + "twisted_product": 11 + }, + "collision_false_future": 2, + "collision_pairs_identical_trace": 6, + "future1": 14, + "future12": 68, + "greedy_accepted": 0, + "greedy_future": 0, + "greedy_valid": 0, + "invalid_program_rate": 1.0, + "mean_rank_of_source": 30.24404761904762, + "negative_accepted": 0, + "novel_future12": 42, + "positives": 168, + "queries12": 1422 + }, + "ensemble@4": { + "accepted1": 18, + "accepted12": 79, + "by_family": { + "lacunary": 13, + "product": 11, + "rational": 10, + "signed": 9, + "sparse": 6, + "squared": 8, + "twisted_product": 11 + }, + "collision_false_future": 2, + "collision_pairs_identical_trace": 6, + "future1": 16, + "future12": 68, + "greedy_accepted": 0, + "greedy_future": 0, + "greedy_valid": 0, + "invalid_program_rate": 1.0, + "mean_rank_of_source": 30.053571428571427, + "negative_accepted": 0, + "novel_future12": 42, + "positives": 168, + "queries12": 1427 + }, + "ensemble@8": { + "accepted1": 18, + "accepted12": 79, + "by_family": { + "lacunary": 13, + "product": 11, + "rational": 10, + "signed": 9, + "sparse": 6, + "squared": 8, + "twisted_product": 11 + }, + "collision_false_future": 2, + "collision_pairs_identical_trace": 6, + "future1": 16, + "future12": 68, + "greedy_accepted": 0, + "greedy_future": 0, + "greedy_valid": 0, + "invalid_program_rate": 1.0, + "mean_rank_of_source": 30.053571428571427, + "negative_accepted": 0, + "novel_future12": 42, + "positives": 168, + "queries12": 1427 + }, + "ff2b@1": { + "accepted1": 20, + "accepted12": 88, + "by_family": { + "lacunary": 12, + "product": 15, + "rational": 10, + "signed": 15, + "sparse": 7, + "squared": 10, + "twisted_product": 10 + }, + "collision_false_future": 3, + "collision_pairs_identical_trace": 6, + "future1": 15, + "future12": 79, + "greedy_accepted": 19, + "greedy_future": 15, + "greedy_valid": 167, + "invalid_program_rate": 0.005952380952380931, + "mean_rank_of_source": 30.511904761904763, + "negative_accepted": 0, + "novel_future12": 42, + "positives": 168, + "queries12": 1385 + }, + "loop@1": { + "accepted1": 18, + "accepted12": 78, + "by_family": { + "lacunary": 13, + "product": 11, + "rational": 10, + "signed": 9, + "sparse": 6, + "squared": 8, + "twisted_product": 11 + }, + "collision_false_future": 2, + "collision_pairs_identical_trace": 6, + "future1": 14, + "future12": 68, + "greedy_accepted": 9, + "greedy_future": 8, + "greedy_valid": 146, + "invalid_program_rate": 0.13095238095238093, + "mean_rank_of_source": 30.24404761904762, + "negative_accepted": 0, + "novel_future12": 42, + "positives": 168, + "queries12": 1422 + }, + "loop@10": { + "accepted1": 15, + "accepted12": 78, + "by_family": { + "lacunary": 12, + "product": 9, + "rational": 9, + "signed": 10, + "sparse": 8, + "squared": 12, + "twisted_product": 12 + }, + "collision_false_future": 4, + "collision_pairs_identical_trace": 6, + "future1": 14, + "future12": 72, + "greedy_accepted": 0, + "greedy_future": 0, + "greedy_valid": 0, + "invalid_program_rate": 1.0, + "mean_rank_of_source": 33.05357142857143, + "negative_accepted": 0, + "novel_future12": 45, + "positives": 168, + "queries12": 1457 + }, + "loop@11": { + "accepted1": 12, + "accepted12": 86, + "by_family": { + "lacunary": 14, + "product": 11, + "rational": 9, + "signed": 10, + "sparse": 11, + "squared": 10, + "twisted_product": 15 + }, + "collision_false_future": 4, + "collision_pairs_identical_trace": 6, + "future1": 10, + "future12": 80, + "greedy_accepted": 0, + "greedy_future": 0, + "greedy_valid": 0, + "invalid_program_rate": 1.0, + "mean_rank_of_source": 33.67857142857143, + "negative_accepted": 0, + "novel_future12": 48, + "positives": 168, + "queries12": 1443 + }, + "loop@12": { + "accepted1": 11, + "accepted12": 83, + "by_family": { + "lacunary": 15, + "product": 11, + "rational": 9, + "signed": 10, + "sparse": 11, + "squared": 9, + "twisted_product": 13 + }, + "collision_false_future": 4, + "collision_pairs_identical_trace": 6, + "future1": 11, + "future12": 78, + "greedy_accepted": 0, + "greedy_future": 0, + "greedy_valid": 0, + "invalid_program_rate": 1.0, + "mean_rank_of_source": 32.57738095238095, + "negative_accepted": 0, + "novel_future12": 46, + "positives": 168, + "queries12": 1474 + }, + "loop@13": { + "accepted1": 12, + "accepted12": 81, + "by_family": { + "lacunary": 15, + "product": 11, + "rational": 7, + "signed": 10, + "sparse": 11, + "squared": 9, + "twisted_product": 11 + }, + "collision_false_future": 4, + "collision_pairs_identical_trace": 6, + "future1": 11, + "future12": 74, + "greedy_accepted": 0, + "greedy_future": 0, + "greedy_valid": 0, + "invalid_program_rate": 1.0, + "mean_rank_of_source": 32.166666666666664, + "negative_accepted": 0, + "novel_future12": 42, + "positives": 168, + "queries12": 1501 + }, + "loop@14": { + "accepted1": 8, + "accepted12": 78, + "by_family": { + "lacunary": 13, + "product": 10, + "rational": 8, + "signed": 9, + "sparse": 10, + "squared": 8, + "twisted_product": 11 + }, + "collision_false_future": 3, + "collision_pairs_identical_trace": 6, + "future1": 5, + "future12": 69, + "greedy_accepted": 0, + "greedy_future": 0, + "greedy_valid": 0, + "invalid_program_rate": 1.0, + "mean_rank_of_source": 32.714285714285715, + "negative_accepted": 0, + "novel_future12": 40, + "positives": 168, + "queries12": 1501 + }, + "loop@15": { + "accepted1": 12, + "accepted12": 81, + "by_family": { + "lacunary": 13, + "product": 10, + "rational": 10, + "signed": 11, + "sparse": 9, + "squared": 10, + "twisted_product": 9 + }, + "collision_false_future": 3, + "collision_pairs_identical_trace": 6, + "future1": 9, + "future12": 72, + "greedy_accepted": 0, + "greedy_future": 0, + "greedy_valid": 0, + "invalid_program_rate": 1.0, + "mean_rank_of_source": 32.267857142857146, + "negative_accepted": 0, + "novel_future12": 42, + "positives": 168, + "queries12": 1519 + }, + "loop@16": { + "accepted1": 12, + "accepted12": 77, + "by_family": { + "lacunary": 12, + "product": 9, + "rational": 11, + "signed": 10, + "sparse": 2, + "squared": 11, + "twisted_product": 12 + }, + "collision_false_future": 2, + "collision_pairs_identical_trace": 6, + "future1": 8, + "future12": 67, + "greedy_accepted": 0, + "greedy_future": 0, + "greedy_valid": 0, + "invalid_program_rate": 1.0, + "mean_rank_of_source": 31.904761904761905, + "negative_accepted": 0, + "novel_future12": 46, + "positives": 168, + "queries12": 1536 + }, + "loop@2": { + "accepted1": 16, + "accepted12": 70, + "by_family": { + "lacunary": 9, + "product": 8, + "rational": 10, + "signed": 9, + "sparse": 6, + "squared": 8, + "twisted_product": 10 + }, + "collision_false_future": 2, + "collision_pairs_identical_trace": 6, + "future1": 11, + "future12": 60, + "greedy_accepted": 10, + "greedy_future": 7, + "greedy_valid": 167, + "invalid_program_rate": 0.005952380952380931, + "mean_rank_of_source": 30.738095238095237, + "negative_accepted": 0, + "novel_future12": 37, + "positives": 168, + "queries12": 1558 + }, + "loop@3": { + "accepted1": 16, + "accepted12": 63, + "by_family": { + "lacunary": 7, + "product": 8, + "rational": 8, + "signed": 9, + "sparse": 5, + "squared": 8, + "twisted_product": 9 + }, + "collision_false_future": 1, + "collision_pairs_identical_trace": 6, + "future1": 11, + "future12": 54, + "greedy_accepted": 16, + "greedy_future": 11, + "greedy_valid": 168, + "invalid_program_rate": 0.0, + "mean_rank_of_source": 30.523809523809526, + "negative_accepted": 0, + "novel_future12": 32, + "positives": 168, + "queries12": 1567 + }, + "loop@4": { + "accepted1": 24, + "accepted12": 66, + "by_family": { + "lacunary": 8, + "product": 9, + "rational": 9, + "signed": 9, + "sparse": 6, + "squared": 10, + "twisted_product": 9 + }, + "collision_false_future": 2, + "collision_pairs_identical_trace": 6, + "future1": 19, + "future12": 60, + "greedy_accepted": 16, + "greedy_future": 12, + "greedy_valid": 154, + "invalid_program_rate": 0.08333333333333337, + "mean_rank_of_source": 32.107142857142854, + "negative_accepted": 0, + "novel_future12": 36, + "positives": 168, + "queries12": 1545 + }, + "loop@5": { + "accepted1": 20, + "accepted12": 60, + "by_family": { + "lacunary": 7, + "product": 8, + "rational": 9, + "signed": 8, + "sparse": 6, + "squared": 9, + "twisted_product": 7 + }, + "collision_false_future": 2, + "collision_pairs_identical_trace": 6, + "future1": 17, + "future12": 54, + "greedy_accepted": 12, + "greedy_future": 9, + "greedy_valid": 129, + "invalid_program_rate": 0.2321428571428571, + "mean_rank_of_source": 32.80357142857143, + "negative_accepted": 0, + "novel_future12": 32, + "positives": 168, + "queries12": 1585 + }, + "loop@6": { + "accepted1": 17, + "accepted12": 55, + "by_family": { + "lacunary": 6, + "product": 8, + "rational": 9, + "signed": 7, + "sparse": 5, + "squared": 9, + "twisted_product": 6 + }, + "collision_false_future": 1, + "collision_pairs_identical_trace": 6, + "future1": 15, + "future12": 50, + "greedy_accepted": 5, + "greedy_future": 4, + "greedy_valid": 101, + "invalid_program_rate": 0.39880952380952384, + "mean_rank_of_source": 33.17857142857143, + "negative_accepted": 0, + "novel_future12": 30, + "positives": 168, + "queries12": 1626 + }, + "loop@7": { + "accepted1": 16, + "accepted12": 54, + "by_family": { + "lacunary": 5, + "product": 8, + "rational": 9, + "signed": 6, + "sparse": 6, + "squared": 8, + "twisted_product": 7 + }, + "collision_false_future": 1, + "collision_pairs_identical_trace": 6, + "future1": 15, + "future12": 49, + "greedy_accepted": 5, + "greedy_future": 4, + "greedy_valid": 79, + "invalid_program_rate": 0.5297619047619048, + "mean_rank_of_source": 33.291666666666664, + "negative_accepted": 0, + "novel_future12": 29, + "positives": 168, + "queries12": 1617 + }, + "loop@8": { + "accepted1": 15, + "accepted12": 63, + "by_family": { + "lacunary": 6, + "product": 9, + "rational": 11, + "signed": 7, + "sparse": 6, + "squared": 10, + "twisted_product": 9 + }, + "collision_false_future": 1, + "collision_pairs_identical_trace": 6, + "future1": 14, + "future12": 58, + "greedy_accepted": 1, + "greedy_future": 1, + "greedy_valid": 47, + "invalid_program_rate": 0.7202380952380952, + "mean_rank_of_source": 33.26190476190476, + "negative_accepted": 0, + "novel_future12": 36, + "positives": 168, + "queries12": 1589 + }, + "loop@9": { + "accepted1": 10, + "accepted12": 76, + "by_family": { + "lacunary": 9, + "product": 8, + "rational": 11, + "signed": 9, + "sparse": 6, + "squared": 13, + "twisted_product": 14 + }, + "collision_false_future": 1, + "collision_pairs_identical_trace": 6, + "future1": 10, + "future12": 70, + "greedy_accepted": 0, + "greedy_future": 0, + "greedy_valid": 1, + "invalid_program_rate": 0.9940476190476191, + "mean_rank_of_source": 32.69642857142857, + "negative_accepted": 0, + "novel_future12": 47, + "positives": 168, + "queries12": 1511 + }, + "open@16": { + "accepted1": 12, + "accepted12": 57, + "by_family": { + "lacunary": 7, + "product": 10, + "rational": 3, + "signed": 5, + "sparse": 8, + "squared": 4, + "twisted_product": 9 + }, + "collision_false_future": 0, + "collision_pairs_identical_trace": 6, + "future1": 8, + "future12": 46, + "greedy_accepted": 0, + "greedy_future": 0, + "greedy_valid": 0, + "invalid_program_rate": 1.0, + "mean_rank_of_source": 32.5, + "negative_accepted": 0, + "novel_future12": 23, + "positives": 168, + "queries12": 1633 + }, + "open@2": { + "accepted1": 15, + "accepted12": 77, + "by_family": { + "lacunary": 10, + "product": 8, + "rational": 12, + "signed": 11, + "sparse": 7, + "squared": 8, + "twisted_product": 9 + }, + "collision_false_future": 2, + "collision_pairs_identical_trace": 6, + "future1": 12, + "future12": 65, + "greedy_accepted": 17, + "greedy_future": 16, + "greedy_valid": 98, + "invalid_program_rate": 0.41666666666666663, + "mean_rank_of_source": 30.261904761904763, + "negative_accepted": 0, + "novel_future12": 39, + "positives": 168, + "queries12": 1516 + }, + "open@4": { + "accepted1": 19, + "accepted12": 80, + "by_family": { + "lacunary": 14, + "product": 11, + "rational": 10, + "signed": 13, + "sparse": 7, + "squared": 8, + "twisted_product": 10 + }, + "collision_false_future": 4, + "collision_pairs_identical_trace": 6, + "future1": 15, + "future12": 73, + "greedy_accepted": 6, + "greedy_future": 6, + "greedy_valid": 46, + "invalid_program_rate": 0.7261904761904762, + "mean_rank_of_source": 30.38095238095238, + "negative_accepted": 0, + "novel_future12": 42, + "positives": 168, + "queries12": 1474 + }, + "open@8": { + "accepted1": 12, + "accepted12": 80, + "by_family": { + "lacunary": 11, + "product": 15, + "rational": 5, + "signed": 9, + "sparse": 9, + "squared": 8, + "twisted_product": 10 + }, + "collision_false_future": 3, + "collision_pairs_identical_trace": 6, + "future1": 8, + "future12": 67, + "greedy_accepted": 0, + "greedy_future": 0, + "greedy_valid": 0, + "invalid_program_rate": 1.0, + "mean_rank_of_source": 31.464285714285715, + "negative_accepted": 0, + "novel_future12": 34, + "positives": 168, + "queries12": 1516 + }, + "patch@1": { + "accepted1": 12, + "accepted12": 78, + "by_family": { + "lacunary": 13, + "product": 10, + "rational": 10, + "signed": 10, + "sparse": 7, + "squared": 10, + "twisted_product": 10 + }, + "collision_false_future": 2, + "collision_pairs_identical_trace": 0, + "future1": 7, + "future12": 70, + "greedy_accepted": 0, + "greedy_future": 0, + "greedy_valid": 0, + "invalid_program_rate": 1.0, + "mean_rank_of_source": 31.577380952380953, + "negative_accepted": 0, + "novel_future12": 43, + "positives": 168, + "queries12": 1492 + }, + "patch@16": { + "accepted1": 12, + "accepted12": 79, + "by_family": { + "lacunary": 13, + "product": 8, + "rational": 12, + "signed": 8, + "sparse": 6, + "squared": 11, + "twisted_product": 11 + }, + "collision_false_future": 2, + "collision_pairs_identical_trace": 0, + "future1": 8, + "future12": 69, + "greedy_accepted": 0, + "greedy_future": 0, + "greedy_valid": 0, + "invalid_program_rate": 1.0, + "mean_rank_of_source": 32.48809523809524, + "negative_accepted": 0, + "novel_future12": 47, + "positives": 168, + "queries12": 1530 + }, + "patch@8": { + "accepted1": 13, + "accepted12": 83, + "by_family": { + "lacunary": 14, + "product": 10, + "rational": 11, + "signed": 11, + "sparse": 6, + "squared": 8, + "twisted_product": 13 + }, + "collision_false_future": 2, + "collision_pairs_identical_trace": 0, + "future1": 9, + "future12": 73, + "greedy_accepted": 0, + "greedy_future": 0, + "greedy_valid": 0, + "invalid_program_rate": 1.0, + "mean_rank_of_source": 32.958333333333336, + "negative_accepted": 0, + "novel_future12": 46, + "positives": 168, + "queries12": 1462 + }, + "perturb@1": { + "accepted1": 19, + "accepted12": 78, + "by_family": { + "lacunary": 13, + "product": 12, + "rational": 11, + "signed": 8, + "sparse": 7, + "squared": 8, + "twisted_product": 10 + }, + "collision_false_future": 2, + "collision_pairs_identical_trace": 0, + "future1": 15, + "future12": 69, + "greedy_accepted": 10, + "greedy_future": 9, + "greedy_valid": 145, + "invalid_program_rate": 0.13690476190476186, + "mean_rank_of_source": 30.61904761904762, + "negative_accepted": 0, + "novel_future12": 42, + "positives": 168, + "queries12": 1424 + }, + "perturb@16": { + "accepted1": 8, + "accepted12": 76, + "by_family": { + "lacunary": 15, + "product": 7, + "rational": 10, + "signed": 13, + "sparse": 6, + "squared": 7, + "twisted_product": 11 + }, + "collision_false_future": 2, + "collision_pairs_identical_trace": 0, + "future1": 5, + "future12": 69, + "greedy_accepted": 0, + "greedy_future": 0, + "greedy_valid": 0, + "invalid_program_rate": 1.0, + "mean_rank_of_source": 30.392857142857142, + "negative_accepted": 0, + "novel_future12": 43, + "positives": 168, + "queries12": 1504 + }, + "perturb@2": { + "accepted1": 13, + "accepted12": 68, + "by_family": { + "lacunary": 10, + "product": 9, + "rational": 9, + "signed": 8, + "sparse": 4, + "squared": 8, + "twisted_product": 10 + }, + "collision_false_future": 1, + "collision_pairs_identical_trace": 0, + "future1": 9, + "future12": 58, + "greedy_accepted": 12, + "greedy_future": 7, + "greedy_valid": 166, + "invalid_program_rate": 0.011904761904761862, + "mean_rank_of_source": 30.279761904761905, + "negative_accepted": 0, + "novel_future12": 37, + "positives": 168, + "queries12": 1552 + }, + "perturb@4": { + "accepted1": 22, + "accepted12": 64, + "by_family": { + "lacunary": 7, + "product": 9, + "rational": 10, + "signed": 9, + "sparse": 5, + "squared": 9, + "twisted_product": 9 + }, + "collision_false_future": 2, + "collision_pairs_identical_trace": 0, + "future1": 17, + "future12": 58, + "greedy_accepted": 16, + "greedy_future": 12, + "greedy_valid": 151, + "invalid_program_rate": 0.10119047619047616, + "mean_rank_of_source": 31.803571428571427, + "negative_accepted": 0, + "novel_future12": 35, + "positives": 168, + "queries12": 1562 + }, + "perturb@8": { + "accepted1": 14, + "accepted12": 70, + "by_family": { + "lacunary": 7, + "product": 8, + "rational": 10, + "signed": 8, + "sparse": 7, + "squared": 12, + "twisted_product": 11 + }, + "collision_false_future": 1, + "collision_pairs_identical_trace": 0, + "future1": 12, + "future12": 63, + "greedy_accepted": 2, + "greedy_future": 2, + "greedy_valid": 36, + "invalid_program_rate": 0.7857142857142857, + "mean_rank_of_source": 33.11309523809524, + "negative_accepted": 0, + "novel_future12": 40, + "positives": 168, + "queries12": 1582 + }, + "shuffle@16": { + "accepted1": 13, + "accepted12": 77, + "by_family": { + "lacunary": 14, + "product": 10, + "rational": 9, + "signed": 8, + "sparse": 7, + "squared": 8, + "twisted_product": 11 + }, + "collision_false_future": 2, + "collision_pairs_identical_trace": 0, + "future1": 9, + "future12": 67, + "greedy_accepted": 0, + "greedy_future": 0, + "greedy_valid": 0, + "invalid_program_rate": 1.0, + "mean_rank_of_source": 31.970238095238095, + "negative_accepted": 0, + "novel_future12": 42, + "positives": 168, + "queries12": 1555 + }, + "shuffle@2": { + "accepted1": 13, + "accepted12": 65, + "by_family": { + "lacunary": 7, + "product": 10, + "rational": 10, + "signed": 9, + "sparse": 4, + "squared": 6, + "twisted_product": 7 + }, + "collision_false_future": 2, + "collision_pairs_identical_trace": 0, + "future1": 8, + "future12": 53, + "greedy_accepted": 14, + "greedy_future": 9, + "greedy_valid": 166, + "invalid_program_rate": 0.011904761904761862, + "mean_rank_of_source": 31.053571428571427, + "negative_accepted": 0, + "novel_future12": 30, + "positives": 168, + "queries12": 1511 + }, + "shuffle@4": { + "accepted1": 12, + "accepted12": 64, + "by_family": { + "lacunary": 7, + "product": 10, + "rational": 9, + "signed": 9, + "sparse": 7, + "squared": 2, + "twisted_product": 9 + }, + "collision_false_future": 3, + "collision_pairs_identical_trace": 0, + "future1": 7, + "future12": 53, + "greedy_accepted": 10, + "greedy_future": 7, + "greedy_valid": 131, + "invalid_program_rate": 0.22023809523809523, + "mean_rank_of_source": 34.63095238095238, + "negative_accepted": 0, + "novel_future12": 27, + "positives": 168, + "queries12": 1569 + }, + "shuffle@8": { + "accepted1": 14, + "accepted12": 72, + "by_family": { + "lacunary": 7, + "product": 11, + "rational": 13, + "signed": 7, + "sparse": 8, + "squared": 8, + "twisted_product": 9 + }, + "collision_false_future": 1, + "collision_pairs_identical_trace": 0, + "future1": 13, + "future12": 63, + "greedy_accepted": 2, + "greedy_future": 1, + "greedy_valid": 12, + "invalid_program_rate": 0.9285714285714286, + "mean_rank_of_source": 32.86904761904762, + "negative_accepted": 0, + "novel_future12": 37, + "positives": 168, + "queries12": 1548 + }, + "shuffle_a1@16": { + "accepted1": 13, + "accepted12": 76, + "by_family": { + "lacunary": 14, + "product": 9, + "rational": 9, + "signed": 8, + "sparse": 7, + "squared": 7, + "twisted_product": 12 + }, + "collision_false_future": 2, + "collision_pairs_identical_trace": 0, + "future1": 9, + "future12": 66, + "greedy_accepted": 0, + "greedy_future": 0, + "greedy_valid": 0, + "invalid_program_rate": 1.0, + "mean_rank_of_source": 32.11309523809524, + "negative_accepted": 0, + "novel_future12": 42, + "positives": 168, + "queries12": 1550 + }, + "shuffle_a1@2": { + "accepted1": 13, + "accepted12": 64, + "by_family": { + "lacunary": 7, + "product": 9, + "rational": 10, + "signed": 9, + "sparse": 4, + "squared": 6, + "twisted_product": 7 + }, + "collision_false_future": 2, + "collision_pairs_identical_trace": 0, + "future1": 8, + "future12": 52, + "greedy_accepted": 14, + "greedy_future": 9, + "greedy_valid": 166, + "invalid_program_rate": 0.011904761904761862, + "mean_rank_of_source": 30.773809523809526, + "negative_accepted": 0, + "novel_future12": 30, + "positives": 168, + "queries12": 1501 + }, + "shuffle_a1@4": { + "accepted1": 12, + "accepted12": 63, + "by_family": { + "lacunary": 7, + "product": 9, + "rational": 9, + "signed": 9, + "sparse": 7, + "squared": 2, + "twisted_product": 9 + }, + "collision_false_future": 3, + "collision_pairs_identical_trace": 0, + "future1": 7, + "future12": 52, + "greedy_accepted": 10, + "greedy_future": 7, + "greedy_valid": 131, + "invalid_program_rate": 0.22023809523809523, + "mean_rank_of_source": 34.601190476190474, + "negative_accepted": 0, + "novel_future12": 27, + "positives": 168, + "queries12": 1566 + }, + "shuffle_a1@8": { + "accepted1": 13, + "accepted12": 72, + "by_family": { + "lacunary": 7, + "product": 11, + "rational": 13, + "signed": 7, + "sparse": 8, + "squared": 8, + "twisted_product": 9 + }, + "collision_false_future": 1, + "collision_pairs_identical_trace": 0, + "future1": 12, + "future12": 63, + "greedy_accepted": 2, + "greedy_future": 1, + "greedy_valid": 13, + "invalid_program_rate": 0.9226190476190477, + "mean_rank_of_source": 32.99404761904762, + "negative_accepted": 0, + "novel_future12": 37, + "positives": 168, + "queries12": 1545 + }, + "symbolic:certified_mass12": { + "accepted12": 111, + "by_family": { + "lacunary": 16, + "product": 11, + "rational": 16, + "signed": 14, + "sparse": 13, + "squared": 16, + "twisted_product": 16 + }, + "collision_false_future": 6, + "collision_pairs_identical_trace": 6, + "future12": 102, + "negative_accepted": 0, + "novel_future12": 64, + "positives": 168 + }, + "symbolic:certified_mass_full": { + "accepted12": 168, + "by_family": { + "lacunary": 24, + "product": 24, + "rational": 23, + "signed": 24, + "sparse": 19, + "squared": 21, + "twisted_product": 24 + }, + "collision_false_future": 6, + "collision_pairs_identical_trace": 6, + "future12": 159, + "negative_accepted": 0, + "novel_future12": 92, + "positives": 168 + }, + "symbolic:exhaustive_64": { + "accepted12": 168, + "by_family": { + "lacunary": 24, + "product": 24, + "rational": 23, + "signed": 24, + "sparse": 18, + "squared": 20, + "twisted_product": 24 + }, + "collision_false_future": 6, + "collision_pairs_identical_trace": 6, + "future12": 157, + "negative_accepted": 0, + "novel_future12": 91, + "positives": 168 + }, + "symbolic:frozen_ff": { + "accepted12": 132, + "by_family": { + "lacunary": 19, + "product": 23, + "rational": 13, + "signed": 19, + "sparse": 14, + "squared": 18, + "twisted_product": 16 + }, + "collision_false_future": 5, + "collision_pairs_identical_trace": 6, + "future12": 122, + "negative_accepted": 0, + "novel_future12": 66, + "positives": 168 + }, + "symbolic:frozen_gru": { + "accepted12": 138, + "by_family": { + "lacunary": 22, + "product": 24, + "rational": 15, + "signed": 22, + "sparse": 15, + "squared": 17, + "twisted_product": 14 + }, + "collision_false_future": 5, + "collision_pairs_identical_trace": 6, + "future12": 129, + "negative_accepted": 0, + "novel_future12": 68, + "positives": 168 + } + } +} diff --git a/research/algernon/algebraic_reasoning_gym/arg02/results/arg02_selection.json b/research/algernon/algebraic_reasoning_gym/arg02/results/arg02_selection.json new file mode 100644 index 000000000..d5c51de73 --- /dev/null +++ b/research/algernon/algebraic_reasoning_gym/arg02/results/arg02_selection.json @@ -0,0 +1,56 @@ +{ + "block": [ + 8, + 12 + ], + "depth": 16, + "dev_future12_depth1": 52, + "dev_future12_selected": 68, + "dev_gain": 16, + "rule": "max development future-correct at 12 checks over blocks x depths>1; tie -> smaller depth, earlier block", + "selection_shots_sha256": "ef71c759906a81c9b7f09eda43cc22bd73a6b0eb6e289fc319070ff37322c0c5", + "shots": 4, + "stage": "blocks", + "table": { + "dev_block_12_16": { + "cases": 132, + "future12_by_depth": { + "1": 52, + "16": 57, + "2": 58, + "4": 48, + "8": 47 + } + }, + "dev_block_16_20": { + "cases": 132, + "future12_by_depth": { + "1": 52, + "16": 55, + "2": 49, + "4": 42, + "8": 48 + } + }, + "dev_block_4_8": { + "cases": 132, + "future12_by_depth": { + "1": 52, + "16": 44, + "2": 47, + "4": 53, + "8": 55 + } + }, + "dev_block_8_12": { + "cases": 132, + "future12_by_depth": { + "1": 52, + "16": 68, + "2": 48, + "4": 48, + "8": 49 + } + } + } +} diff --git a/research/algernon/algebraic_reasoning_gym/arg02/results/arg02_splits_audit.json b/research/algernon/algebraic_reasoning_gym/arg02/results/arg02_splits_audit.json new file mode 100644 index 000000000..c3417b239 --- /dev/null +++ b/research/algernon/algebraic_reasoning_gym/arg02/results/arg02_splits_audit.json @@ -0,0 +1,54 @@ +{ + "counts": { + "calibration": 36, + "dev": 96, + "shots": 4, + "test": 192, + "test_positive": 168 + }, + "dev_families": [ + "product", + "signed", + "sparse" + ], + "dev_seed": 2026111102, + "evalmath_seed": 2026111027, + "roster_sha256": { + "calibration": "088c8dc031f9aa14c94339bd08983f55e730be9415952aed20c66921aa6abf19", + "dev": "113081f8fe58a3a42bb198130436ecf8dc7d9247416694c5ac0ce57b5264041e", + "shots": "201a4dbce72f1a2f9703579c4ab901503da2fa31efd520c56ea1a40fb3a15994", + "test": "0e8caf0649d30f834d0bcfd1469b705d6d73371812cb87575fd3e12243ebcbba" + }, + "schema": "algernon.arg02.splits.v1", + "shot_programs": { + "additive": [ + "I", + "R", + "I" + ], + "cascade": [ + "N", + "N", + "S" + ], + "fork": [ + "S", + "I", + "S" + ], + "hadamard": [ + "R", + "R", + "N" + ] + }, + "shot_seed": 2026111103, + "signature_overlaps": { + "calibration_vs_test": 0, + "dev_vs_calibration": 0, + "dev_vs_test": 0, + "shots_vs_dev": 0, + "shots_vs_test": 0 + }, + "test_duplicate_public_signatures": 6 +} diff --git a/research/algernon/algebraic_reasoning_gym/arg02/results/arg02_tables.md b/research/algernon/algebraic_reasoning_gym/arg02/results/arg02_tables.md new file mode 100644 index 000000000..db1639d48 --- /dev/null +++ b/research/algernon/algebraic_reasoning_gym/arg02/results/arg02_tables.md @@ -0,0 +1,189 @@ +Selection (development data): shots 4, block [8, 12], d* = 16, ensemble size m(d*) = 4. Development future-correct@12: 52 at depth 1, 68 at the selection. + +## Arms on the 168 test positives + +| Arm | future@12 | accepted@12 | future@1 | greedy valid | greedy accepted | novel future@12 | negatives accepted | collision pairs same trace | GPU s | end-to-end s | p50 / p95 ms | PFLOP | future@12 per e2e s | +|---|---:|---:|---:|---:|---:|---:|---:|---:|---:|---:|---:|---:|---:| +| loop@1 | 68 | 78 | 14 | 146 | 9 | 42 | 0 | 6 | 309.8 | 310.2 | 1485 / 2446 | 3.564 | 0.2192 | +| loop@2 | 60 | 70 | 11 | 167 | 10 | 37 | 0 | 6 | 357.4 | 357.7 | 1713 / 2933 | 4.157 | 0.1677 | +| loop@4 | 60 | 66 | 19 | 154 | 16 | 36 | 0 | 6 | 462.1 | 462.4 | 2254 / 3790 | 5.344 | 0.1298 | +| loop@8 | 58 | 63 | 14 | 47 | 1 | 36 | 0 | 6 | 662.6 | 663.2 | 3250 / 4789 | 7.716 | 0.0874 | +| loop@16 | 67 | 77 | 8 | 0 | 0 | 46 | 0 | 6 | 1075.4 | 1075.6 | 5349 / 8018 | 12.462 | 0.0623 | +| open@16 | 46 | 57 | 8 | 0 | 0 | 23 | 0 | 6 | 302.0 | 302.4 | 1475 / 2237 | 3.564 | 0.1521 | +| shuffle@16 | 67 | 77 | 9 | 0 | 0 | 42 | 0 | 0 | 1237.1 | 1237.4 | 6032 / 9242 | 14.242 | 0.0541 | +| shuffle_a1@16 | 66 | 76 | 9 | 0 | 0 | 42 | 0 | 0 | 1221.1 | 1221.4 | 5825 / 10193 | 14.242 | 0.0540 | +| ensemble@16 | 69 | 79 | 15 | 0 | 0 | 41 | 0 | 6 | 1207.4 | 1207.7 | 6006 / 8521 | 13.935 | 0.0571 | +| ff2b@1 | 79 | 88 | 15 | 167 | 19 | 42 | 0 | 6 | 389.4 | 389.7 | 1972 / 2486 | 9.441 | 0.2027 | +| controller | 69 | 76 | - | - | - | 44 | 0 | 6 | 3097.2 | 3098.4 | 19040 / 26034 | 36.691 | 0.0223 | +| symbolic:certified_mass12 | 102 | 111 | - | - | - | 64 | 0 | 6 | 0.0 | 0.3 | 1 / 3 | 0.000 | 353.6793 | +| symbolic:certified_mass_full | 159 | 168 | - | - | - | 92 | 0 | 6 | 0.0 | 0.4 | 2 / 4 | 0.000 | 441.5806 | +| symbolic:exhaustive_64 | 157 | 168 | - | - | - | 91 | 0 | 6 | 0.0 | 0.5 | 1 / 8 | 0.000 | 347.0050 | +| symbolic:frozen_ff | 122 | 132 | - | - | - | 66 | 0 | 6 | 0.0 | 0.4 | 2 / 4 | 0.000 | 276.2677 | +| symbolic:frozen_gru | 129 | 138 | - | - | - | 68 | 0 | 6 | 0.0 | 2.6 | 14 / 17 | 0.000 | 49.1623 | + +## Paired comparisons, future-correct at 12 checks + +| A vs B | A | B | A only | B only | A - B | cluster 95% CI (per case) | McNemar p | +|---|---:|---:|---:|---:|---:|---|---:| +| controller vs loop@1 | 69 | 68 | 27 | 26 | +1 | [-0.080, +0.093] | 1.0000 | +| ff2b@1 vs loop@1 | 79 | 68 | 20 | 9 | +11 | [+0.000, +0.129] | 0.0614 | +| loop@16 vs ensemble@16 | 67 | 69 | 32 | 34 | -2 | [-0.097, +0.070] | 0.9022 | +| loop@16 vs ff2b@1 | 67 | 79 | 28 | 40 | -12 | [-0.166, +0.018] | 0.1818 | +| loop@16 vs loop@1 | 67 | 68 | 32 | 33 | -1 | [-0.085, +0.072] | 1.0000 | +| loop@16 vs open@16 | 67 | 46 | 47 | 26 | +21 | [+0.023, +0.226] | 0.0186 | +| loop@16 vs shuffle@16 | 67 | 67 | 29 | 29 | +0 | [-0.081, +0.078] | 1.0000 | +| loop@16 vs shuffle_a1@16 | 67 | 66 | 29 | 28 | +1 | [-0.077, +0.082] | 1.0000 | +| loop@16 vs symbolic:certified_mass12 | 67 | 102 | 12 | 47 | -35 | [-0.274, -0.148] | 0.0000 | +| loop@16 vs symbolic:certified_mass_full | 67 | 159 | 1 | 93 | -92 | [-0.608, -0.488] | 0.0000 | +| loop@16 vs symbolic:exhaustive_64 | 67 | 157 | 1 | 91 | -90 | [-0.596, -0.474] | 0.0000 | +| loop@1 vs symbolic:certified_mass12 | 68 | 102 | 12 | 46 | -34 | [-0.287, -0.117] | 0.0000 | +| loop@1 vs symbolic:frozen_ff | 68 | 122 | 11 | 65 | -54 | [-0.413, -0.230] | 0.0000 | +| loop@1 vs symbolic:frozen_gru | 68 | 129 | 9 | 70 | -61 | [-0.456, -0.276] | 0.0000 | +| loop@2 vs loop@1 | 60 | 68 | 12 | 20 | -8 | [-0.107, +0.013] | 0.2153 | +| loop@4 vs loop@1 | 60 | 68 | 17 | 25 | -8 | [-0.121, +0.030] | 0.2800 | +| loop@8 vs loop@1 | 58 | 68 | 21 | 31 | -10 | [-0.126, +0.012] | 0.2116 | +| open@16 vs loop@1 | 46 | 68 | 25 | 47 | -22 | [-0.224, -0.041] | 0.0128 | +| open@2 vs loop@1 | 65 | 68 | 12 | 15 | -3 | [-0.074, +0.036] | 0.7011 | +| open@4 vs loop@1 | 73 | 68 | 30 | 25 | +5 | [-0.054, +0.119] | 0.5901 | +| open@8 vs loop@1 | 67 | 68 | 36 | 37 | -1 | [-0.097, +0.081] | 1.0000 | +| shuffle@16 vs loop@1 | 67 | 68 | 34 | 35 | -1 | [-0.098, +0.083] | 1.0000 | +| shuffle@2 vs loop@1 | 53 | 68 | 8 | 23 | -15 | [-0.169, -0.012] | 0.0107 | +| shuffle@4 vs loop@1 | 53 | 68 | 11 | 26 | -15 | [-0.163, -0.019] | 0.0201 | +| shuffle@8 vs loop@1 | 63 | 68 | 24 | 29 | -5 | [-0.101, +0.041] | 0.5831 | +| shuffle_a1@16 vs loop@1 | 66 | 68 | 35 | 37 | -2 | [-0.106, +0.078] | 0.9063 | +| shuffle_a1@2 vs loop@1 | 52 | 68 | 7 | 23 | -16 | [-0.175, -0.018] | 0.0052 | +| shuffle_a1@4 vs loop@1 | 52 | 68 | 10 | 26 | -16 | [-0.166, -0.030] | 0.0113 | +| shuffle_a1@8 vs loop@1 | 63 | 68 | 24 | 29 | -5 | [-0.101, +0.041] | 0.5831 | + +## Decision rules + +- H1_depth: **not met** +- H2a_feedback: **met** +- H2b_state: **not met** +- H2b_state_original_shuffle: **not met** +- H3a_repeat: **not met** +- H3b_ff: **not met** +- H3c_efficiency: **not met** +- H4_symbolic: **not met** +- mechanism_claim: **not met** + +## Depth curve (loop, test positives) + +| step | future@12 | future@1 | accepted@1 | greedy valid | greedy accepted | median relative residual | median reduction | +|---:|---:|---:|---:|---:|---:|---:|---:| +| 1 | 68 | 14 | 18 | 146 | 9 | 0.752 | - | +| 10 | 72 | 14 | 15 | 0 | 0 | 0.209 | 0.969 | +| 11 | 80 | 10 | 12 | 0 | 0 | 0.204 | 0.978 | +| 12 | 78 | 11 | 11 | 0 | 0 | 0.202 | 0.987 | +| 13 | 74 | 11 | 12 | 0 | 0 | 0.200 | 0.991 | +| 14 | 69 | 5 | 8 | 0 | 0 | 0.201 | 1.008 | +| 15 | 72 | 9 | 12 | 0 | 0 | 0.208 | 1.032 | +| 16 | 67 | 8 | 12 | 0 | 0 | 0.213 | 1.018 | +| 2 | 60 | 11 | 16 | 167 | 10 | 0.445 | 0.592 | +| 3 | 54 | 11 | 16 | 168 | 16 | 0.331 | 0.743 | +| 4 | 60 | 19 | 24 | 154 | 16 | 0.276 | 0.835 | +| 5 | 54 | 17 | 20 | 129 | 12 | 0.252 | 0.912 | +| 6 | 50 | 15 | 17 | 101 | 5 | 0.241 | 0.956 | +| 7 | 49 | 15 | 16 | 79 | 5 | 0.232 | 0.964 | +| 8 | 58 | 14 | 15 | 47 | 1 | 0.224 | 0.963 | +| 9 | 70 | 10 | 10 | 1 | 0 | 0.216 | 0.965 | + +First step with a future-correct top-1 answer: {"1": 14, "10": 10, "11": 2, "12": 4, "13": 4, "14": 1, "15": 3, "2": 4, "3": 1, "4": 8, "5": 1, "8": 2, "9": 3, "None": 111}. Found only after step 1: 43; still correct at the last step: 7. + +| depth vs step 1 | lost | gained | +|---|---:|---:| +| at12@16 | 33 | 32 | +| at12@2 | 20 | 12 | +| at12@4 | 25 | 17 | +| at12@8 | 31 | 21 | +| at1@16 | 13 | 7 | +| at1@2 | 7 | 4 | +| at1@4 | 5 | 10 | +| at1@8 | 11 | 11 | + +## Perturbation (kick 0.25 x RMS after step 1) + +| readout step | future@12 | clean future@12 | top-1 agrees with clean | median distance / kick | +|---:|---:|---:|---:|---:| +| 1 | 69 | 68 | 144 | 1.000 | +| 16 | 69 | 67 | 22 | 10.859 | +| 2 | 58 | 60 | 143 | 0.768 | +| 4 | 58 | 60 | 146 | 0.907 | +| 8 | 63 | 58 | 81 | 2.015 | + +## Answer-site patching (donor site states, loop to 16) + +| patch step | top-1 kept | top-1 moved to donor's | top-1 changed | future@12 | median KL to clean | p95 KL | +|---:|---:|---:|---:|---:|---:|---:| +| 1 | 77 | 4 | 91 | 70 | 0.8916 | 5.0291 | +| 16 | 4 | 84 | 164 | 69 | 5.1481 | 10.9581 | +| 8 | 14 | 28 | 154 | 73 | 4.3541 | 10.3464 | + +## Linear probes (block output at the last prompt token, step 0 = block input; train 96, select 36, test seen 72, novel 96) + +**outer_op** + +| step | novel acc | novel majority | novel perm. p | seen acc | seen majority | k | lam | +|---:|---:|---:|---:|---:|---:|---:|---:| +| 0 | 0.385 | 0.406 | 0.090 | 0.375 | 0.264 | 16 | 0.1 | +| 1 | 0.365 | 0.406 | 0.035 | 0.361 | 0.264 | 32 | 0.001 | +| 10 | 0.354 | 0.406 | 0.259 | 0.306 | 0.264 | 8 | 0.001 | +| 11 | 0.406 | 0.406 | 0.020 | 0.306 | 0.264 | 16 | 0.001 | +| 12 | 0.385 | 0.406 | 0.050 | 0.292 | 0.264 | 32 | 0.1 | +| 13 | 0.354 | 0.406 | 0.174 | 0.319 | 0.264 | 32 | 0.1 | +| 14 | 0.312 | 0.406 | 0.507 | 0.333 | 0.264 | 32 | 0.1 | +| 15 | 0.323 | 0.406 | 0.284 | 0.361 | 0.264 | 32 | 0.01 | +| 16 | 0.323 | 0.406 | 0.234 | 0.361 | 0.264 | 32 | 0.01 | +| 2 | 0.365 | 0.406 | 0.080 | 0.361 | 0.264 | 16 | 0.001 | +| 3 | 0.354 | 0.406 | 0.124 | 0.347 | 0.264 | 16 | 0.01 | +| 4 | 0.333 | 0.406 | 0.169 | 0.347 | 0.264 | 32 | 0.01 | +| 5 | 0.375 | 0.406 | 0.100 | 0.319 | 0.264 | 32 | 0.1 | +| 6 | 0.417 | 0.406 | 0.010 | 0.333 | 0.264 | 32 | 0.1 | +| 7 | 0.396 | 0.406 | 0.035 | 0.361 | 0.264 | 32 | 0.1 | +| 8 | 0.458 | 0.406 | 0.005 | 0.333 | 0.264 | 32 | 0.1 | +| 9 | 0.312 | 0.406 | 0.677 | 0.264 | 0.264 | 8 | 0.1 | + +**uses_R** + +| step | novel acc | novel majority | novel perm. p | seen acc | seen majority | k | lam | +|---:|---:|---:|---:|---:|---:|---:|---:| +| 0 | 0.531 | 0.500 | 0.244 | 0.653 | 0.528 | 16 | 1.0 | +| 1 | 0.562 | 0.500 | 0.050 | 0.667 | 0.528 | 16 | 1.0 | +| 10 | 0.573 | 0.500 | 0.025 | 0.639 | 0.528 | 16 | 1.0 | +| 11 | 0.594 | 0.500 | 0.020 | 0.639 | 0.528 | 32 | 0.1 | +| 12 | 0.552 | 0.500 | 0.060 | 0.681 | 0.528 | 32 | 1.0 | +| 13 | 0.531 | 0.500 | 0.149 | 0.667 | 0.528 | 32 | 1.0 | +| 14 | 0.604 | 0.500 | 0.020 | 0.681 | 0.528 | 32 | 0.01 | +| 15 | 0.510 | 0.500 | 0.408 | 0.625 | 0.528 | 32 | 0.1 | +| 16 | 0.521 | 0.500 | 0.244 | 0.542 | 0.528 | 16 | 1.0 | +| 2 | 0.573 | 0.500 | 0.010 | 0.611 | 0.528 | 8 | 1.0 | +| 3 | 0.562 | 0.500 | 0.005 | 0.625 | 0.528 | 8 | 1.0 | +| 4 | 0.500 | 0.500 | 0.602 | 0.583 | 0.528 | 8 | 1.0 | +| 5 | 0.542 | 0.500 | 0.080 | 0.653 | 0.528 | 8 | 1.0 | +| 6 | 0.615 | 0.500 | 0.010 | 0.708 | 0.528 | 32 | 1.0 | +| 7 | 0.583 | 0.500 | 0.070 | 0.653 | 0.528 | 32 | 0.1 | +| 8 | 0.594 | 0.500 | 0.055 | 0.722 | 0.528 | 32 | 0.1 | +| 9 | 0.583 | 0.500 | 0.055 | 0.667 | 0.528 | 32 | 1.0 | + +## Future-correct@12 by source family + +| family | loop@1 | loop@16 | ff2b@1 | symbolic:certified_mass_full | symbolic:frozen_gru | +|---|---:|---:|---:|---:|---:| +| lacunary | 13 | 12 | 12 | 24 | 22 | +| product | 11 | 9 | 15 | 24 | 24 | +| rational | 10 | 11 | 10 | 23 | 15 | +| signed | 9 | 10 | 15 | 24 | 22 | +| sparse | 6 | 2 | 7 | 19 | 15 | +| squared | 8 | 11 | 10 | 21 | 17 | +| twisted_product | 11 | 12 | 10 | 24 | 14 | + +## ARG-01 external.py cross-check (top-1 loop answers) + +- depth 1: ARG-01 exact accepted 18 = ARG-02 18; future 14 = 14 +- depth 2: ARG-01 exact accepted 16 = ARG-02 16; future 11 = 11 +- depth 4: ARG-01 exact accepted 24 = ARG-02 24; future 19 = 19 +- depth 8: ARG-01 exact accepted 15 = ARG-02 15; future 14 = 14 + +## Peak allocated VRAM per stage (GiB) + +test_controller 4.93, test_ensemble 3.91, test_ff 6.01, test_loop 4.05, test_open 3.98, test_patch 4.12, test_perturb 4.06, test_shuffle 4.12, test_shuffle_a1 4.12 diff --git a/research/algernon/algebraic_reasoning_gym/arg02/results/arg02_traces.jsonl.gz b/research/algernon/algebraic_reasoning_gym/arg02/results/arg02_traces.jsonl.gz new file mode 100644 index 000000000..dd5ebaabb Binary files /dev/null and b/research/algernon/algebraic_reasoning_gym/arg02/results/arg02_traces.jsonl.gz differ diff --git a/research/algernon/algebraic_reasoning_gym/arg02/results_nanbeige/arg02_answer_tape.jsonl.gz b/research/algernon/algebraic_reasoning_gym/arg02/results_nanbeige/arg02_answer_tape.jsonl.gz new file mode 100644 index 000000000..01181a583 Binary files /dev/null and b/research/algernon/algebraic_reasoning_gym/arg02/results_nanbeige/arg02_answer_tape.jsonl.gz differ diff --git a/research/algernon/algebraic_reasoning_gym/arg02/results_nanbeige/arg02_checkpoint_check.json b/research/algernon/algebraic_reasoning_gym/arg02/results_nanbeige/arg02_checkpoint_check.json new file mode 100644 index 000000000..e559a5f73 --- /dev/null +++ b/research/algernon/algebraic_reasoning_gym/arg02/results_nanbeige/arg02_checkpoint_check.json @@ -0,0 +1,109 @@ +{ + "device": "cuda", + "load_seconds": 40.64, + "model": { + "files_verified": [ + "config.json", + "configuration_nanbeige.py", + "model-00001-of-00002.safetensors", + "model-00002-of-00002.safetensors", + "model.safetensors.index.json", + "modeling_nanbeige.py", + "tokenizer.json" + ], + "hash_seconds": 17.94, + "repo": "Nanbeige/Nanbeige4.2-3B", + "revision": "451ed48c3273ecef7ea8faaa43c31ce529763bb1" + }, + "model_class": "NanbeigeForCausalLM", + "note": "GPU, bf16, 2 development prompts (0 shots), 16 candidate rows; loop-t readout vs NanbeigeModel.forward with num_loops=t; no grading. Run 2026-11-13 under vramorama run --vram 13G.", + "parameters": 4169800704, + "parity": [ + { + "case_id": "calibration:signed:00001", + "loop_ms": [ + 2449.5, + 802.7, + 849.3 + ], + "loops1": { + "argmax_equal": true, + "max_abs_logprob_diff": 0.0 + }, + "loops2": { + "argmax_equal": true, + "max_abs_logprob_diff": 0.0 + }, + "loops3": { + "argmax_equal": true, + "max_abs_logprob_diff": 0.0 + }, + "relative_step": [ + 23.135143280029297, + 6.078072547912598, + 0.8083352446556091 + ], + "tokens": 459 + }, + { + "case_id": "calibration:signed:00002", + "loop_ms": [ + 739.4, + 741.7, + 741.5 + ], + "loops1": { + "argmax_equal": true, + "max_abs_logprob_diff": 0.0 + }, + "loops2": { + "argmax_equal": true, + "max_abs_logprob_diff": 0.0 + }, + "loops3": { + "argmax_equal": true, + "max_abs_logprob_diff": 0.0 + }, + "relative_step": [ + 23.255414962768555, + 6.030481815338135, + 0.835866391658783 + ], + "tokens": 402 + } + ], + "peak_allocated_bytes": 9431180288, + "profile": "nanbeige", + "prompt_tokens": { + "development_shots0": { + "max": 457, + "mean": 355.67424242424244, + "min": 348 + }, + "development_shots4": { + "max": 1223, + "mean": 1121.6742424242425, + "min": 1114 + }, + "test_shots0": { + "max": 426, + "mean": 354.0416666666667, + "min": 348 + }, + "test_shots4": { + "max": 1192, + "mean": 1120.0416666666667, + "min": 1114 + } + }, + "schema": "algernon.arg02.checkpoint_check.v1", + "tokenizer": { + "bos": 166100, + "op_token_ids": { + "I": 324, + "N": 411, + "R": 385, + "S": 319 + } + } +} diff --git a/research/algernon/algebraic_reasoning_gym/arg02/results_nanbeige/arg02_profile.json b/research/algernon/algebraic_reasoning_gym/arg02/results_nanbeige/arg02_profile.json new file mode 100644 index 000000000..864f60f1f --- /dev/null +++ b/research/algernon/algebraic_reasoning_gym/arg02/results_nanbeige/arg02_profile.json @@ -0,0 +1,486 @@ +{ + "compute": { + "_shared": { + "symbolic_checkpoint_load_ms": 344.7479, + "symbolic_class_compile_ms": 512.0048 + }, + "controller": { + "cases": 192, + "end_to_end_seconds": 2089.291694364615, + "forward_passes": 1953, + "gpu_seconds": 2087.1262247646155, + "integer_loop_proxy": 816764, + "latency_ms_p50": 12511.72901111436, + "latency_ms_p95": 14015.748688184412, + "layer_evals": 336707712, + "tokens": 15304896, + "total_macs": 49290154829414400, + "total_pflop": 98.5803096588288, + "verifier_cpu_seconds": 2.1654695999999998, + "verifier_queries": 1953 + }, + "ensemble@1": { + "cases": 192, + "end_to_end_seconds": 152.2330288246168, + "forward_passes": 192, + "gpu_seconds": 151.83616992461683, + "integer_loop_proxy": 734578, + "latency_ms_p50": 771.2953362997055, + "latency_ms_p95": 944.5801163664627, + "layer_evals": 24062720, + "tokens": 1093760, + "total_macs": 3501653674033152, + "total_pflop": 7.003307348066304, + "verifier_cpu_seconds": 0.3968589, + "verifier_queries": 1927 + }, + "ensemble@2": { + "cases": 192, + "end_to_end_seconds": 303.8692859183145, + "forward_passes": 384, + "gpu_seconds": 303.47137331831453, + "integer_loop_proxy": 733694, + "latency_ms_p50": 1552.3535503152848, + "latency_ms_p95": 1880.3188579430962, + "layer_evals": 48125440, + "tokens": 2187520, + "total_macs": 7003307348066304, + "total_pflop": 14.006614696132608, + "verifier_cpu_seconds": 0.3979126, + "verifier_queries": 1925 + }, + "ensemble@4": { + "cases": 192, + "end_to_end_seconds": 574.5318099980955, + "forward_passes": 768, + "gpu_seconds": 574.1322844980955, + "integer_loop_proxy": 722644, + "latency_ms_p50": 2929.1223946632385, + "latency_ms_p95": 3497.0185928769492, + "layer_evals": 89762816, + "tokens": 4080128, + "total_macs": 13051462053003264, + "total_pflop": 26.10292410600653, + "verifier_cpu_seconds": 0.39952550000000003, + "verifier_queries": 1915 + }, + "ensemble@8": { + "cases": 192, + "end_to_end_seconds": 1159.9525099923605, + "forward_passes": 1536, + "gpu_seconds": 1159.5557854923607, + "integer_loop_proxy": 722644, + "latency_ms_p50": 5940.829959688664, + "latency_ms_p95": 7277.852646070894, + "layer_evals": 179525632, + "tokens": 8160256, + "total_macs": 26102924106006528, + "total_pflop": 52.20584821201306, + "verifier_cpu_seconds": 0.3967245, + "verifier_queries": 1915 + }, + "loop@1": { + "cases": 192, + "end_to_end_seconds": 147.56256676572397, + "forward_passes": 192, + "gpu_seconds": 147.150428465724, + "integer_loop_proxy": 734578, + "latency_ms_p50": 742.8752544577599, + "latency_ms_p95": 897.0056629849622, + "layer_evals": 24062720, + "tokens": 1093760, + "total_macs": 3501653674033152, + "total_pflop": 7.003307348066304, + "verifier_cpu_seconds": 0.4121383, + "verifier_queries": 1927 + }, + "loop@2": { + "cases": 192, + "end_to_end_seconds": 287.24908981618177, + "forward_passes": 192, + "gpu_seconds": 286.77054221618175, + "integer_loop_proxy": 367250, + "latency_ms_p50": 1453.78629103508, + "latency_ms_p95": 1766.5437182782352, + "layer_evals": 48125440, + "tokens": 1093760, + "total_macs": 6998603553570816, + "total_pflop": 13.997207107141632, + "verifier_cpu_seconds": 0.47854759999999996, + "verifier_queries": 1816 + }, + "loop@3": { + "cases": 192, + "end_to_end_seconds": 425.0121830611159, + "forward_passes": 192, + "gpu_seconds": 424.81342296111586, + "integer_loop_proxy": 361686, + "latency_ms_p50": 2151.14901665802, + "latency_ms_p95": 2596.1309801078796, + "layer_evals": 72188160, + "tokens": 1093760, + "total_macs": 10495553433108480, + "total_pflop": 20.99110686621696, + "verifier_cpu_seconds": 0.1987601, + "verifier_queries": 1761 + }, + "loop@4": { + "cases": 192, + "end_to_end_seconds": 562.65981260139, + "forward_passes": 192, + "gpu_seconds": 562.3186226013898, + "integer_loop_proxy": 342992, + "latency_ms_p50": 2852.3033240679742, + "latency_ms_p95": 3395.8805452625074, + "layer_evals": 96250880, + "tokens": 1093760, + "total_macs": 13992503312646144, + "total_pflop": 27.98500662529229, + "verifier_cpu_seconds": 0.34119, + "verifier_queries": 1714 + }, + "loop@5": { + "cases": 192, + "end_to_end_seconds": 700.1691334050246, + "forward_passes": 192, + "gpu_seconds": 699.9773514050245, + "integer_loop_proxy": 365430, + "latency_ms_p50": 3556.9659108577725, + "latency_ms_p95": 4179.258440328741, + "layer_evals": 120313600, + "tokens": 1093760, + "total_macs": 17489453192183808, + "total_pflop": 34.97890638436762, + "verifier_cpu_seconds": 0.191782, + "verifier_queries": 1577 + }, + "loop@6": { + "cases": 192, + "end_to_end_seconds": 841.3196469842024, + "forward_passes": 192, + "gpu_seconds": 841.0468774842024, + "integer_loop_proxy": 469326, + "latency_ms_p50": 4271.368967034149, + "latency_ms_p95": 5000.239210958242, + "layer_evals": 144376320, + "tokens": 1093760, + "total_macs": 20986403071721472, + "total_pflop": 41.972806143442945, + "verifier_cpu_seconds": 0.2727695, + "verifier_queries": 1784 + }, + "loop@7": { + "cases": 192, + "end_to_end_seconds": 979.5012386902876, + "forward_passes": 192, + "gpu_seconds": 979.2946691902876, + "integer_loop_proxy": 396006, + "latency_ms_p50": 4977.04468026886, + "latency_ms_p95": 5994.708353513107, + "layer_evals": 168439040, + "tokens": 1093760, + "total_macs": 24483352951259136, + "total_pflop": 48.96670590251827, + "verifier_cpu_seconds": 0.20656950000000002, + "verifier_queries": 1814 + }, + "loop@8": { + "cases": 192, + "end_to_end_seconds": 1119.3563418151564, + "forward_passes": 192, + "gpu_seconds": 1119.1352149151564, + "integer_loop_proxy": 409864, + "latency_ms_p50": 5672.9664505588535, + "latency_ms_p95": 6953.8391138626275, + "layer_evals": 192501760, + "tokens": 1093760, + "total_macs": 27980302830796800, + "total_pflop": 55.9606056615936, + "verifier_cpu_seconds": 0.22112690000000002, + "verifier_queries": 1665 + }, + "open@2": { + "cases": 192, + "end_to_end_seconds": 150.62974600646783, + "forward_passes": 192, + "gpu_seconds": 150.25749300646783, + "integer_loop_proxy": 709696, + "latency_ms_p50": 765.1995954508304, + "latency_ms_p95": 922.8378638199182, + "layer_evals": 24062720, + "tokens": 1093760, + "total_macs": 3501653674033152, + "total_pflop": 7.003307348066304, + "verifier_cpu_seconds": 0.372253, + "verifier_queries": 1920 + }, + "open@4": { + "cases": 192, + "end_to_end_seconds": 150.80625510527344, + "forward_passes": 192, + "gpu_seconds": 150.45422350527346, + "integer_loop_proxy": 659932, + "latency_ms_p50": 762.4087812840938, + "latency_ms_p95": 947.6961003214356, + "layer_evals": 24062720, + "tokens": 1093760, + "total_macs": 3501653674033152, + "total_pflop": 7.003307348066304, + "verifier_cpu_seconds": 0.3520316, + "verifier_queries": 1890 + }, + "open@8": { + "cases": 192, + "end_to_end_seconds": 151.3293224869129, + "forward_passes": 192, + "gpu_seconds": 150.9759671869129, + "integer_loop_proxy": 658606, + "latency_ms_p50": 766.6868894822717, + "latency_ms_p95": 957.850062840706, + "layer_evals": 24062720, + "tokens": 1093760, + "total_macs": 3501653674033152, + "total_pflop": 7.003307348066304, + "verifier_cpu_seconds": 0.3533553, + "verifier_queries": 1886 + }, + "shuffle@2": { + "cases": 192, + "end_to_end_seconds": 427.70831921991964, + "forward_passes": 384, + "gpu_seconds": 427.48453151991964, + "integer_loop_proxy": 364520, + "latency_ms_p50": 2189.604131554508, + "latency_ms_p95": 2617.666200287475, + "layer_evals": 72188160, + "tokens": 2187520, + "total_macs": 10495553433108480, + "total_pflop": 20.99110686621696, + "verifier_cpu_seconds": 0.2237877, + "verifier_queries": 1809 + }, + "shuffle@4": { + "cases": 192, + "end_to_end_seconds": 707.1537990929085, + "forward_passes": 384, + "gpu_seconds": 706.9507896929085, + "integer_loop_proxy": 352274, + "latency_ms_p50": 3622.68409995861, + "latency_ms_p95": 4173.608040293846, + "layer_evals": 120313600, + "tokens": 2187520, + "total_macs": 17489453192183808, + "total_pflop": 34.97890638436762, + "verifier_cpu_seconds": 0.2030094, + "verifier_queries": 1759 + }, + "shuffle@8": { + "cases": 192, + "end_to_end_seconds": 1266.5963395667031, + "forward_passes": 384, + "gpu_seconds": 1266.366113066703, + "integer_loop_proxy": 417300, + "latency_ms_p50": 6506.091767230988, + "latency_ms_p95": 7547.871129939575, + "layer_evals": 216564480, + "tokens": 2187520, + "total_macs": 31477252710334464, + "total_pflop": 62.95450542066893, + "verifier_cpu_seconds": 0.2302265, + "verifier_queries": 1705 + }, + "symbolic:certified_mass12": { + "cases": 192, + "end_to_end_seconds": 0.372833, + "forward_passes": 0, + "gpu_seconds": 0.0, + "integer_loop_proxy": 318968, + "latency_ms_p50": 1.64065, + "latency_ms_p95": 3.964629999999999, + "layer_evals": 0, + "tokens": 0, + "total_macs": 0, + "total_pflop": 0.0, + "verifier_cpu_seconds": 0.372833, + "verifier_queries": 1446 + }, + "symbolic:certified_mass_full": { + "cases": 192, + "end_to_end_seconds": 0.466335, + "forward_passes": 0, + "gpu_seconds": 0.0, + "integer_loop_proxy": 480324, + "latency_ms_p50": 1.81525, + "latency_ms_p95": 4.954019999999999, + "layer_evals": 0, + "tokens": 0, + "total_macs": 0, + "total_pflop": 0.0, + "verifier_cpu_seconds": 0.466335, + "verifier_queries": 1985 + }, + "symbolic:exhaustive_64": { + "cases": 192, + "end_to_end_seconds": 0.5738194999999999, + "forward_passes": 0, + "gpu_seconds": 0.0, + "integer_loop_proxy": 887458, + "latency_ms_p50": 1.3617, + "latency_ms_p95": 10.70107499999999, + "layer_evals": 0, + "tokens": 0, + "total_macs": 0, + "total_pflop": 0.0, + "verifier_cpu_seconds": 0.5738194999999999, + "verifier_queries": 3693 + }, + "symbolic:frozen_ff": { + "cases": 192, + "end_to_end_seconds": 0.5508257, + "forward_passes": 192, + "gpu_seconds": 0.0, + "integer_loop_proxy": 308412, + "latency_ms_p50": 2.57905, + "latency_ms_p95": 5.019295, + "layer_evals": 0, + "tokens": 0, + "total_macs": 1175040, + "total_pflop": 2.35008e-09, + "verifier_cpu_seconds": 0.5508257, + "verifier_queries": 1225 + }, + "symbolic:frozen_gru": { + "cases": 192, + "end_to_end_seconds": 3.3294164, + "forward_passes": 192, + "gpu_seconds": 0.0, + "integer_loop_proxy": 281450, + "latency_ms_p50": 16.6508, + "latency_ms_p95": 26.686014999999994, + "layer_evals": 0, + "tokens": 0, + "total_macs": 10217472, + "total_pflop": 2.0434944e-08, + "verifier_cpu_seconds": 3.3294164, + "verifier_queries": 1101 + } + }, + "manifests": { + "manifest_dev_blocks.json": { + "arms": null, + "command": "dev", + "config_sha256": "5135c157cbfe6aec1b477eb66f4dbcbecc738a983b3bb19b550083f8c25e067c", + "environment": { + "code": { + "arg02_dirty": false, + "commit": "65039a5b0c0d7d156bef57b8098dd160aefca505", + "repo": "MoralityLabAI/Compactification-Theory" + }, + "device": "cuda", + "numpy": "2.5.4", + "nvidia_smi": { + "driver_version": "577.05", + "enforced.power.limit": "150.00 W", + "memory.total": "16303 MiB", + "memory.used": "1 MiB", + "name": "NVIDIA GeForce RTX 5080 Laptop GPU", + "pstate": "P8" + }, + "platform": "Windows-11-10.0.26200-SP0", + "python": "3.12.10", + "torch": "2.11.0+cu128", + "torch_cuda": "12.8", + "transformers": "4.46.3" + }, + "finished": 1794544304.5311663, + "lock_sha256": "87e338f112fd7b304aeece22f7da268ee0f7b3b45d932553d45cc7258cef78d5", + "model": "main", + "profile": "nanbeige", + "rows": 132, + "smoke": false, + "stage": "blocks", + "started": 1794543493.3740027 + }, + "manifest_dev_shots.json": { + "arms": null, + "command": "dev", + "config_sha256": "5135c157cbfe6aec1b477eb66f4dbcbecc738a983b3bb19b550083f8c25e067c", + "environment": { + "code": { + "arg02_dirty": false, + "commit": "65039a5b0c0d7d156bef57b8098dd160aefca505", + "repo": "MoralityLabAI/Compactification-Theory" + }, + "device": "cuda", + "numpy": "2.5.4", + "nvidia_smi": { + "driver_version": "577.05", + "enforced.power.limit": "150.00 W", + "memory.total": "16303 MiB", + "memory.used": "1 MiB", + "name": "NVIDIA GeForce RTX 5080 Laptop GPU", + "pstate": "P8" + }, + "platform": "Windows-11-10.0.26200-SP0", + "python": "3.12.10", + "torch": "2.11.0+cu128", + "torch_cuda": "12.8", + "transformers": "4.46.3" + }, + "finished": 1794543400.855893, + "lock_sha256": "87e338f112fd7b304aeece22f7da268ee0f7b3b45d932553d45cc7258cef78d5", + "model": "main", + "profile": "nanbeige", + "rows": 132, + "smoke": false, + "stage": "shots", + "started": 1794542925.3969622 + }, + "manifest_test_main.json": { + "arms": null, + "command": "test", + "config_sha256": "5135c157cbfe6aec1b477eb66f4dbcbecc738a983b3bb19b550083f8c25e067c", + "environment": { + "code": { + "arg02_dirty": false, + "commit": "65039a5b0c0d7d156bef57b8098dd160aefca505", + "repo": "MoralityLabAI/Compactification-Theory" + }, + "device": "cuda", + "numpy": "2.5.4", + "nvidia_smi": { + "driver_version": "577.05", + "enforced.power.limit": "150.00 W", + "memory.total": "16303 MiB", + "memory.used": "1 MiB", + "name": "NVIDIA GeForce RTX 5080 Laptop GPU", + "pstate": "P8" + }, + "platform": "Windows-11-10.0.26200-SP0", + "python": "3.12.10", + "torch": "2.11.0+cu128", + "torch_cuda": "12.8", + "transformers": "4.46.3" + }, + "finished": 1794556524.1126225, + "lock_sha256": "87e338f112fd7b304aeece22f7da268ee0f7b3b45d932553d45cc7258cef78d5", + "model": "main", + "profile": "nanbeige", + "rows": 192, + "smoke": false, + "stage": null, + "started": 1794544357.797254 + } + }, + "peak_allocated_bytes": { + "test_controller": 9436134400, + "test_ensemble": 9028465152, + "test_loop": 9202020864, + "test_open": 9028465152, + "test_patch": 9282630144, + "test_perturb": 9212539904, + "test_shuffle": 9151152128 + }, + "schema": "algernon.arg02.profile.v1", + "timing_scope": "CUDA-event timings per segment; a depth-d latency is prelude + d block steps + its readout, measured inside the combined trajectory; verifier time is this machine's CPU wall time at grading" +} diff --git a/research/algernon/algebraic_reasoning_gym/arg02/results_nanbeige/arg02_receipt.json b/research/algernon/algebraic_reasoning_gym/arg02/results_nanbeige/arg02_receipt.json new file mode 100644 index 000000000..f9c7b912b --- /dev/null +++ b/research/algernon/algebraic_reasoning_gym/arg02/results_nanbeige/arg02_receipt.json @@ -0,0 +1,2142 @@ +{ + "answer_tape_sha256": "b9802035781caa6ae55ba6b1468cf9cbab57d1558e54fafc1cb45d15c7f11d2d", + "arg01_receipt_sha256": "06f71daa0607266314154d28398ac88cbaef8786cc5fedc4ebce94622679ec89", + "decisions": { + "H1_depth": true, + "H2a_feedback": false, + "H2b_state": true, + "H2b_state_original_shuffle": true, + "H3a_repeat": true, + "H3b_ff": null, + "H3c_efficiency": false, + "H4_symbolic": false, + "efficiency_future12_per_e2e_second": { + "controller": 0.022017030998627164, + "ensemble@8": 0.04396731724847588, + "loop@1": 0.2981786029098836, + "loop@8": 0.0634293096377744, + "symbolic:certified_mass12": 273.58093301826824, + "symbolic:certified_mass_full": 340.9566084467175, + "symbolic:exhaustive_64": 273.605201635706, + "symbolic:frozen_gru": 38.745529096330515 + }, + "mechanism_claim": false, + "selected": { + "block": [ + 0, + 22 + ], + "depth": 8, + "ensemble_size": 8, + "shots": 0 + } + }, + "depth": { + "curve": { + "1": { + "accepted1": 12, + "future1": 10, + "future12": 44, + "greedy_accepted": 0, + "greedy_valid": 0 + }, + "2": { + "accepted1": 10, + "future1": 6, + "future12": 65, + "greedy_accepted": 0, + "greedy_valid": 0 + }, + "3": { + "accepted1": 9, + "future1": 8, + "future12": 63, + "greedy_accepted": 0, + "greedy_valid": 0 + }, + "4": { + "accepted1": 13, + "future1": 11, + "future12": 76, + "greedy_accepted": 0, + "greedy_valid": 0 + }, + "5": { + "accepted1": 7, + "future1": 7, + "future12": 80, + "greedy_accepted": 0, + "greedy_valid": 0 + }, + "6": { + "accepted1": 13, + "future1": 10, + "future12": 60, + "greedy_accepted": 0, + "greedy_valid": 0 + }, + "7": { + "accepted1": 7, + "future1": 7, + "future12": 68, + "greedy_accepted": 0, + "greedy_valid": 0 + }, + "8": { + "accepted1": 8, + "future1": 8, + "future12": 71, + "greedy_accepted": 0, + "greedy_valid": 0 + } + }, + "damage": { + "at12@2": { + "gained": 58, + "lost": 37 + }, + "at12@4": { + "gained": 66, + "lost": 34 + }, + "at12@8": { + "gained": 50, + "lost": 23 + }, + "at1@2": { + "gained": 6, + "lost": 10 + }, + "at1@4": { + "gained": 11, + "lost": 10 + }, + "at1@8": { + "gained": 8, + "lost": 10 + } + }, + "first_success_after_step1": 36, + "first_success_after_step1_kept_at_T": 8, + "first_success_step_hist": { + "1": 10, + "2": 6, + "3": 8, + "4": 9, + "6": 9, + "8": 4, + "None": 122 + }, + "residual_reduction_median": { + "2": 0.24492166861634934, + "3": 0.1395551801187066, + "4": 1.1826490380404993, + "5": 0.8848415841107999, + "6": 1.5028335257609327, + "7": 0.491610680937292, + "8": 1.0937234787758983 + }, + "residual_relative_norm": { + "1": { + "median": 23.787007331848145, + "p95": 23.9622314453125 + }, + "2": { + "median": 5.827769994735718, + "p95": 5.90677273273468 + }, + "3": { + "median": 0.813353419303894, + "p95": 0.8364623069763184 + }, + "4": { + "median": 0.9609583020210266, + "p95": 1.0325821042060852 + }, + "5": { + "median": 0.8504140377044678, + "p95": 0.8661124378442764 + }, + "6": { + "median": 1.2767890691757202, + "p95": 1.300575429201126 + }, + "7": { + "median": 0.6284770667552948, + "p95": 0.6387480109930038 + }, + "8": { + "median": 0.6881304383277893, + "p95": 0.7076396644115448 + } + } + }, + "ensemble_sizes": { + "1": 1, + "2": 2, + "4": 4, + "8": 8 + }, + "evalmath_pin": { + "checkpoint_origin": "MoralityLabAI/Compactification-Theory RRC-19 committed frozen training artifacts", + "checkpoint_sha256": { + "frozen_ff": "a40cc30ccb93550edbaca1ba6660f24ca0adde37bf910fe4a05f55bbbe20a001", + "frozen_gru": "fa610d639243c96d40ebde2d75c2b852c3d0881b65db07736c0a1c4590a161d8", + "shuffled_gru": "9178aaf0fea14f9beb026e797b6186c1cba0a134afb5e3de63602a5f8e77f834", + "skewed_gru": "72e5baf944e1f1851e0d296a7e53ac314cd7d679294d5bed372b1c46e90b6b01" + }, + "evalmath_commit_sha": "88bb6cf8d2fe172e37d25964dfb2c285d9033841", + "evalmath_repository": "MoralityLabAI/EvalMath", + "oracle_source_sha256": "c0df77faae6351e522f35d36fa6031d6270ecced2fd92d0477cb5e08992ccb0b", + "oracle_version": "arg01.oracle.v1", + "revision_state": "GitHub-merged exact EvalMath oracle commit and source SHA lock", + "schema": "algernon.arg01.pin.v1" + }, + "external_crosscheck": { + "by_depth": { + "1": { + "arg01_exact_accepted": 12, + "arg01_future_correct": 10, + "arg02_at1_accepted": 12, + "arg02_at1_future": 10 + }, + "2": { + "arg01_exact_accepted": 10, + "arg01_future_correct": 6, + "arg02_at1_accepted": 10, + "arg02_at1_future": 6 + }, + "4": { + "arg01_exact_accepted": 15, + "arg01_future_correct": 12, + "arg02_at1_accepted": 15, + "arg02_at1_future": 12 + }, + "8": { + "arg01_exact_accepted": 8, + "arg01_future_correct": 8, + "arg02_at1_accepted": 8, + "arg02_at1_future": 8 + } + }, + "proposal_sha256": "95626720ce4ec4ef1c4bc2e5b94652cc0928a435d9694e05898fbd3bc094d31e" + }, + "ff_control": null, + "model": { + "dtype": "bfloat16", + "repo": "Nanbeige/Nanbeige4.2-3B", + "revision": "451ed48c3273ecef7ea8faaa43c31ce529763bb1" + }, + "op_ids": { + "I": 324, + "N": 411, + "R": 385, + "S": 319 + }, + "paired_future1": { + "loop@2_vs_loop@1": { + "a_only": 6, + "a_total": 6, + "b_only": 10, + "b_total": 10, + "bootstrap": 10000, + "cluster_ci95": [ + -0.07647058823529412, + 0.019736842105263157 + ], + "clusters": 28, + "difference": -4, + "mcnemar_p": 0.454498291015625, + "mean_difference": -0.023809523809523808, + "n": 168, + "seed": 2026111104 + }, + "loop@4_vs_loop@1": { + "a_only": 11, + "a_total": 11, + "b_only": 10, + "b_total": 10, + "bootstrap": 10000, + "cluster_ci95": [ + -0.05660377358490566, + 0.06329113924050633 + ], + "clusters": 28, + "difference": 1, + "mcnemar_p": 1.0, + "mean_difference": 0.005952380952380952, + "n": 168, + "seed": 2026111104 + }, + "loop@8_vs_ensemble@8": { + "a_only": 8, + "a_total": 8, + "b_only": 9, + "b_total": 9, + "bootstrap": 10000, + "cluster_ci95": [ + -0.06748466257668712, + 0.05806451612903226 + ], + "clusters": 28, + "difference": -1, + "mcnemar_p": 1.0, + "mean_difference": -0.005952380952380952, + "n": 168, + "seed": 2026111104 + }, + "loop@8_vs_loop@1": { + "a_only": 8, + "a_total": 8, + "b_only": 10, + "b_total": 10, + "bootstrap": 10000, + "cluster_ci95": [ + -0.07547169811320754, + 0.052941176470588235 + ], + "clusters": 28, + "difference": -2, + "mcnemar_p": 0.8145294189453125, + "mean_difference": -0.011904761904761904, + "n": 168, + "seed": 2026111104 + }, + "loop@8_vs_loop@2": { + "a_only": 8, + "a_total": 8, + "b_only": 6, + "b_total": 6, + "bootstrap": 10000, + "cluster_ci95": [ + -0.0374331550802139, + 0.06748466257668712 + ], + "clusters": 28, + "difference": 2, + "mcnemar_p": 0.79052734375, + "mean_difference": 0.011904761904761904, + "n": 168, + "seed": 2026111104 + }, + "loop@8_vs_open@8": { + "a_only": 8, + "a_total": 8, + "b_only": 11, + "b_total": 11, + "bootstrap": 10000, + "cluster_ci95": [ + -0.08139534883720931, + 0.04819277108433735 + ], + "clusters": 28, + "difference": -3, + "mcnemar_p": 0.6476058959960938, + "mean_difference": -0.017857142857142856, + "n": 168, + "seed": 2026111104 + }, + "loop@8_vs_shuffle@8": { + "a_only": 5, + "a_total": 8, + "b_only": 2, + "b_total": 5, + "bootstrap": 10000, + "cluster_ci95": [ + -0.01818181818181818, + 0.06432748538011696 + ], + "clusters": 28, + "difference": 3, + "mcnemar_p": 0.453125, + "mean_difference": 0.017857142857142856, + "n": 168, + "seed": 2026111104 + }, + "open@2_vs_loop@1": { + "a_only": 0, + "a_total": 10, + "b_only": 0, + "b_total": 10, + "bootstrap": 10000, + "cluster_ci95": [ + 0.0, + 0.0 + ], + "clusters": 28, + "difference": 0, + "mcnemar_p": 1.0, + "mean_difference": 0.0, + "n": 168, + "seed": 2026111104 + }, + "open@4_vs_loop@1": { + "a_only": 1, + "a_total": 11, + "b_only": 0, + "b_total": 10, + "bootstrap": 10000, + "cluster_ci95": [ + 0.0, + 0.018867924528301886 + ], + "clusters": 28, + "difference": 1, + "mcnemar_p": 1.0, + "mean_difference": 0.005952380952380952, + "n": 168, + "seed": 2026111104 + }, + "open@8_vs_loop@1": { + "a_only": 1, + "a_total": 11, + "b_only": 0, + "b_total": 10, + "bootstrap": 10000, + "cluster_ci95": [ + 0.0, + 0.018867924528301886 + ], + "clusters": 28, + "difference": 1, + "mcnemar_p": 1.0, + "mean_difference": 0.005952380952380952, + "n": 168, + "seed": 2026111104 + }, + "shuffle@2_vs_loop@1": { + "a_only": 5, + "a_total": 5, + "b_only": 10, + "b_total": 10, + "bootstrap": 10000, + "cluster_ci95": [ + -0.08045977011494253, + 0.011904761904761904 + ], + "clusters": 28, + "difference": -5, + "mcnemar_p": 0.3017578125, + "mean_difference": -0.02976190476190476, + "n": 168, + "seed": 2026111104 + }, + "shuffle@4_vs_loop@1": { + "a_only": 10, + "a_total": 10, + "b_only": 10, + "b_total": 10, + "bootstrap": 10000, + "cluster_ci95": [ + -0.052941176470588235, + 0.05063291139240506 + ], + "clusters": 28, + "difference": 0, + "mcnemar_p": 1.0, + "mean_difference": 0.0, + "n": 168, + "seed": 2026111104 + }, + "shuffle@8_vs_loop@1": { + "a_only": 5, + "a_total": 5, + "b_only": 10, + "b_total": 10, + "bootstrap": 10000, + "cluster_ci95": [ + -0.08284023668639054, + 0.018518518518518517 + ], + "clusters": 28, + "difference": -5, + "mcnemar_p": 0.3017578125, + "mean_difference": -0.02976190476190476, + "n": 168, + "seed": 2026111104 + } + }, + "paired_future12": { + "controller_vs_loop@1": { + "a_only": 15, + "a_total": 46, + "b_only": 13, + "b_total": 44, + "bootstrap": 10000, + "cluster_ci95": [ + -0.0670391061452514, + 0.08620689655172414 + ], + "clusters": 28, + "difference": 2, + "mcnemar_p": 0.8505540192127228, + "mean_difference": 0.011904761904761904, + "n": 168, + "seed": 2026111104 + }, + "loop@1_vs_symbolic:certified_mass12": { + "a_only": 21, + "a_total": 44, + "b_only": 79, + "b_total": 102, + "bootstrap": 10000, + "cluster_ci95": [ + -0.4438202247191011, + -0.24404761904761904 + ], + "clusters": 28, + "difference": -58, + "mcnemar_p": 4.337366633421638e-09, + "mean_difference": -0.34523809523809523, + "n": 168, + "seed": 2026111104 + }, + "loop@1_vs_symbolic:frozen_ff": { + "a_only": 13, + "a_total": 44, + "b_only": 91, + "b_total": 122, + "bootstrap": 10000, + "cluster_ci95": [ + -0.5632911392405063, + -0.36 + ], + "clusters": 28, + "difference": -78, + "mcnemar_p": 1.4016007077149398e-15, + "mean_difference": -0.4642857142857143, + "n": 168, + "seed": 2026111104 + }, + "loop@1_vs_symbolic:frozen_gru": { + "a_only": 8, + "a_total": 44, + "b_only": 93, + "b_total": 129, + "bootstrap": 10000, + "cluster_ci95": [ + -0.610738255033557, + -0.3988439306358382 + ], + "clusters": 28, + "difference": -85, + "mcnemar_p": 1.7405890207623034e-19, + "mean_difference": -0.5059523809523809, + "n": 168, + "seed": 2026111104 + }, + "loop@2_vs_loop@1": { + "a_only": 58, + "a_total": 65, + "b_only": 37, + "b_total": 44, + "bootstrap": 10000, + "cluster_ci95": [ + 0.0, + 0.2556818181818182 + ], + "clusters": 28, + "difference": 21, + "mcnemar_p": 0.03960823767054589, + "mean_difference": 0.125, + "n": 168, + "seed": 2026111104 + }, + "loop@4_vs_loop@1": { + "a_only": 66, + "a_total": 76, + "b_only": 34, + "b_total": 44, + "bootstrap": 10000, + "cluster_ci95": [ + 0.06842105263157895, + 0.3125 + ], + "clusters": 28, + "difference": 32, + "mcnemar_p": 0.0017899303914868526, + "mean_difference": 0.19047619047619047, + "n": 168, + "seed": 2026111104 + }, + "loop@8_vs_ensemble@8": { + "a_only": 48, + "a_total": 71, + "b_only": 28, + "b_total": 51, + "bootstrap": 10000, + "cluster_ci95": [ + 0.011560693641618497, + 0.22981366459627328 + ], + "clusters": 28, + "difference": 20, + "mcnemar_p": 0.02862665550873788, + "mean_difference": 0.11904761904761904, + "n": 168, + "seed": 2026111104 + }, + "loop@8_vs_loop@1": { + "a_only": 50, + "a_total": 71, + "b_only": 23, + "b_total": 44, + "bootstrap": 10000, + "cluster_ci95": [ + 0.056818181818181816, + 0.2682926829268293 + ], + "clusters": 28, + "difference": 27, + "mcnemar_p": 0.002118172746400632, + "mean_difference": 0.16071428571428573, + "n": 168, + "seed": 2026111104 + }, + "loop@8_vs_loop@2": { + "a_only": 50, + "a_total": 71, + "b_only": 44, + "b_total": 65, + "bootstrap": 10000, + "cluster_ci95": [ + -0.09941520467836257, + 0.17261904761904762 + ], + "clusters": 28, + "difference": 6, + "mcnemar_p": 0.606295937693966, + "mean_difference": 0.03571428571428571, + "n": 168, + "seed": 2026111104 + }, + "loop@8_vs_open@8": { + "a_only": 49, + "a_total": 71, + "b_only": 33, + "b_total": 55, + "bootstrap": 10000, + "cluster_ci95": [ + -0.023952095808383235, + 0.21476510067114093 + ], + "clusters": 28, + "difference": 16, + "mcnemar_p": 0.09703091129729906, + "mean_difference": 0.09523809523809523, + "n": 168, + "seed": 2026111104 + }, + "loop@8_vs_shuffle@8": { + "a_only": 10, + "a_total": 71, + "b_only": 1, + "b_total": 62, + "bootstrap": 10000, + "cluster_ci95": [ + 0.01639344262295082, + 0.09554140127388536 + ], + "clusters": 28, + "difference": 9, + "mcnemar_p": 0.01171875, + "mean_difference": 0.05357142857142857, + "n": 168, + "seed": 2026111104 + }, + "loop@8_vs_symbolic:certified_mass12": { + "a_only": 14, + "a_total": 71, + "b_only": 45, + "b_total": 102, + "bootstrap": 10000, + "cluster_ci95": [ + -0.2727272727272727, + -0.09523809523809523 + ], + "clusters": 28, + "difference": -31, + "mcnemar_p": 6.530630444913366e-05, + "mean_difference": -0.18452380952380953, + "n": 168, + "seed": 2026111104 + }, + "loop@8_vs_symbolic:certified_mass_full": { + "a_only": 0, + "a_total": 71, + "b_only": 88, + "b_total": 159, + "bootstrap": 10000, + "cluster_ci95": [ + -0.6144578313253012, + -0.42948717948717946 + ], + "clusters": 28, + "difference": -88, + "mcnemar_p": 6.462348535570529e-27, + "mean_difference": -0.5238095238095238, + "n": 168, + "seed": 2026111104 + }, + "loop@8_vs_symbolic:exhaustive_64": { + "a_only": 0, + "a_total": 71, + "b_only": 86, + "b_total": 157, + "bootstrap": 10000, + "cluster_ci95": [ + -0.5977653631284916, + -0.42134831460674155 + ], + "clusters": 28, + "difference": -86, + "mcnemar_p": 2.5849394142282115e-26, + "mean_difference": -0.5119047619047619, + "n": 168, + "seed": 2026111104 + }, + "open@2_vs_loop@1": { + "a_only": 5, + "a_total": 48, + "b_only": 1, + "b_total": 44, + "bootstrap": 10000, + "cluster_ci95": [ + 0.0, + 0.050955414012738856 + ], + "clusters": 28, + "difference": 4, + "mcnemar_p": 0.21875, + "mean_difference": 0.023809523809523808, + "n": 168, + "seed": 2026111104 + }, + "open@4_vs_loop@1": { + "a_only": 19, + "a_total": 58, + "b_only": 5, + "b_total": 44, + "bootstrap": 10000, + "cluster_ci95": [ + 0.0335195530726257, + 0.13664596273291926 + ], + "clusters": 28, + "difference": 14, + "mcnemar_p": 0.006610751152038574, + "mean_difference": 0.08333333333333333, + "n": 168, + "seed": 2026111104 + }, + "open@8_vs_loop@1": { + "a_only": 17, + "a_total": 55, + "b_only": 6, + "b_total": 44, + "bootstrap": 10000, + "cluster_ci95": [ + 0.011560693641618497, + 0.12162162162162163 + ], + "clusters": 28, + "difference": 11, + "mcnemar_p": 0.03468966484069824, + "mean_difference": 0.06547619047619048, + "n": 168, + "seed": 2026111104 + }, + "shuffle@2_vs_loop@1": { + "a_only": 63, + "a_total": 69, + "b_only": 38, + "b_total": 44, + "bootstrap": 10000, + "cluster_ci95": [ + 0.018518518518518517, + 0.28125 + ], + "clusters": 28, + "difference": 25, + "mcnemar_p": 0.016505855701607598, + "mean_difference": 0.1488095238095238, + "n": 168, + "seed": 2026111104 + }, + "shuffle@4_vs_loop@1": { + "a_only": 61, + "a_total": 70, + "b_only": 35, + "b_total": 44, + "bootstrap": 10000, + "cluster_ci95": [ + 0.03888888888888889, + 0.26744186046511625 + ], + "clusters": 28, + "difference": 26, + "mcnemar_p": 0.010345913082728777, + "mean_difference": 0.15476190476190477, + "n": 168, + "seed": 2026111104 + }, + "shuffle@8_vs_loop@1": { + "a_only": 42, + "a_total": 62, + "b_only": 24, + "b_total": 44, + "bootstrap": 10000, + "cluster_ci95": [ + 0.01639344262295082, + 0.2 + ], + "clusters": 28, + "difference": 18, + "mcnemar_p": 0.03558272445223169, + "mean_difference": 0.10714285714285714, + "n": 168, + "seed": 2026111104 + } + }, + "patching": { + "depth": 8, + "steps": { + "1": { + "cases": 168, + "future12": 72, + "kl_median": 0.011828418733836044, + "kl_p95": 0.05477958819947143, + "top1_changed": 25, + "top1_kept": 143, + "top1_to_donor": 10 + }, + "4": { + "cases": 168, + "future12": 67, + "kl_median": 0.10203352720930886, + "kl_p95": 0.47785344809128577, + "top1_changed": 74, + "top1_kept": 94, + "top1_to_donor": 55 + }, + "8": { + "cases": 168, + "future12": 63, + "kl_median": 0.16317772395387609, + "kl_p95": 0.7037804675916783, + "top1_changed": 82, + "top1_kept": 86, + "top1_to_donor": 82 + } + } + }, + "perturbation": { + "distance_over_kick_median": { + "1": 1.00001775178804, + "2": 2.8486430662416335, + "3": 3.7968622861144654, + "4": 3.8876925706353482, + "5": 4.763945462700989, + "6": 6.200738840449256, + "7": 7.148252205532261, + "8": 6.855480255884794 + }, + "readouts": { + "1": { + "clean_future12": 44, + "future12": 45, + "top1_agrees_with_clean": 111 + }, + "2": { + "clean_future12": 65, + "future12": 66, + "top1_agrees_with_clean": 135 + }, + "4": { + "clean_future12": 76, + "future12": 74, + "top1_agrees_with_clean": 73 + }, + "8": { + "clean_future12": 71, + "future12": 62, + "top1_agrees_with_clean": 69 + } + }, + "sigma": 0.25, + "step": 1 + }, + "probes": { + "labels": { + "outer_op": { + "0": { + "majority_label": "I", + "settings": { + "k": 8, + "lam": 0.001, + "selection_accuracy": 0.3611111111111111 + }, + "tests": { + "novel": { + "accuracy": 0.40625, + "majority_accuracy": 0.40625, + "n": 96, + "permutation_mean": 0.35208333333333336, + "permutation_p": 0.6019900497512438 + }, + "seen": { + "accuracy": 0.2638888888888889, + "majority_accuracy": 0.2638888888888889, + "n": 72, + "permutation_mean": 0.2972222222222222, + "permutation_p": 1.0 + } + } + }, + "1": { + "majority_label": "I", + "settings": { + "k": 16, + "lam": 0.01, + "selection_accuracy": 0.4722222222222222 + }, + "tests": { + "novel": { + "accuracy": 0.375, + "majority_accuracy": 0.40625, + "n": 96, + "permutation_mean": 0.2953645833333333, + "permutation_p": 0.04975124378109453 + }, + "seen": { + "accuracy": 0.3472222222222222, + "majority_accuracy": 0.2638888888888889, + "n": 72, + "permutation_mean": 0.2686805555555556, + "permutation_p": 0.14925373134328357 + } + } + }, + "2": { + "majority_label": "I", + "settings": { + "k": 8, + "lam": 0.1, + "selection_accuracy": 0.4444444444444444 + }, + "tests": { + "novel": { + "accuracy": 0.34375, + "majority_accuracy": 0.40625, + "n": 96, + "permutation_mean": 0.32046875, + "permutation_p": 0.3283582089552239 + }, + "seen": { + "accuracy": 0.3194444444444444, + "majority_accuracy": 0.2638888888888889, + "n": 72, + "permutation_mean": 0.2910416666666667, + "permutation_p": 0.2935323383084577 + } + } + }, + "3": { + "majority_label": "I", + "settings": { + "k": 8, + "lam": 0.1, + "selection_accuracy": 0.4166666666666667 + }, + "tests": { + "novel": { + "accuracy": 0.375, + "majority_accuracy": 0.40625, + "n": 96, + "permutation_mean": 0.32276041666666666, + "permutation_p": 0.1890547263681592 + }, + "seen": { + "accuracy": 0.4166666666666667, + "majority_accuracy": 0.2638888888888889, + "n": 72, + "permutation_mean": 0.289375, + "permutation_p": 0.01990049751243781 + } + } + }, + "4": { + "majority_label": "I", + "settings": { + "k": 32, + "lam": 0.01, + "selection_accuracy": 0.4166666666666667 + }, + "tests": { + "novel": { + "accuracy": 0.3541666666666667, + "majority_accuracy": 0.40625, + "n": 96, + "permutation_mean": 0.2824479166666667, + "permutation_p": 0.06965174129353234 + }, + "seen": { + "accuracy": 0.4166666666666667, + "majority_accuracy": 0.2638888888888889, + "n": 72, + "permutation_mean": 0.2764583333333333, + "permutation_p": 0.01990049751243781 + } + } + }, + "5": { + "majority_label": "I", + "settings": { + "k": 32, + "lam": 0.01, + "selection_accuracy": 0.4722222222222222 + }, + "tests": { + "novel": { + "accuracy": 0.375, + "majority_accuracy": 0.40625, + "n": 96, + "permutation_mean": 0.28447916666666667, + "permutation_p": 0.014925373134328358 + }, + "seen": { + "accuracy": 0.3888888888888889, + "majority_accuracy": 0.2638888888888889, + "n": 72, + "permutation_mean": 0.27243055555555556, + "permutation_p": 0.04477611940298507 + } + } + }, + "6": { + "majority_label": "I", + "settings": { + "k": 8, + "lam": 0.001, + "selection_accuracy": 0.3333333333333333 + }, + "tests": { + "novel": { + "accuracy": 0.3541666666666667, + "majority_accuracy": 0.40625, + "n": 96, + "permutation_mean": 0.30640625, + "permutation_p": 0.19900497512437812 + }, + "seen": { + "accuracy": 0.3472222222222222, + "majority_accuracy": 0.2638888888888889, + "n": 72, + "permutation_mean": 0.27743055555555557, + "permutation_p": 0.15920398009950248 + } + } + }, + "7": { + "majority_label": "I", + "settings": { + "k": 32, + "lam": 0.001, + "selection_accuracy": 0.3611111111111111 + }, + "tests": { + "novel": { + "accuracy": 0.3333333333333333, + "majority_accuracy": 0.40625, + "n": 96, + "permutation_mean": 0.27796875, + "permutation_p": 0.10945273631840796 + }, + "seen": { + "accuracy": 0.4027777777777778, + "majority_accuracy": 0.2638888888888889, + "n": 72, + "permutation_mean": 0.26763888888888887, + "permutation_p": 0.03482587064676617 + } + } + }, + "8": { + "majority_label": "I", + "settings": { + "k": 32, + "lam": 0.001, + "selection_accuracy": 0.4722222222222222 + }, + "tests": { + "novel": { + "accuracy": 0.3854166666666667, + "majority_accuracy": 0.40625, + "n": 96, + "permutation_mean": 0.2816666666666666, + "permutation_p": 0.024875621890547265 + }, + "seen": { + "accuracy": 0.4027777777777778, + "majority_accuracy": 0.2638888888888889, + "n": 72, + "permutation_mean": 0.263125, + "permutation_p": 0.014925373134328358 + } + } + } + }, + "uses_R": { + "0": { + "majority_label": "True", + "settings": { + "k": 8, + "lam": 0.001, + "selection_accuracy": 0.6666666666666666 + }, + "tests": { + "novel": { + "accuracy": 0.5, + "majority_accuracy": 0.5, + "n": 96, + "permutation_mean": 0.5, + "permutation_p": 1.0 + }, + "seen": { + "accuracy": 0.5277777777777778, + "majority_accuracy": 0.5277777777777778, + "n": 72, + "permutation_mean": 0.5277777777777777, + "permutation_p": 1.0 + } + } + }, + "1": { + "majority_label": "True", + "settings": { + "k": 32, + "lam": 1.0, + "selection_accuracy": 0.8333333333333334 + }, + "tests": { + "novel": { + "accuracy": 0.5416666666666666, + "majority_accuracy": 0.5, + "n": 96, + "permutation_mean": 0.49317708333333327, + "permutation_p": 0.16417910447761194 + }, + "seen": { + "accuracy": 0.6527777777777778, + "majority_accuracy": 0.5277777777777778, + "n": 72, + "permutation_mean": 0.4940972222222222, + "permutation_p": 0.014925373134328358 + } + } + }, + "2": { + "majority_label": "True", + "settings": { + "k": 16, + "lam": 1.0, + "selection_accuracy": 0.8333333333333334 + }, + "tests": { + "novel": { + "accuracy": 0.4895833333333333, + "majority_accuracy": 0.5, + "n": 96, + "permutation_mean": 0.49890625, + "permutation_p": 0.6567164179104478 + }, + "seen": { + "accuracy": 0.6805555555555556, + "majority_accuracy": 0.5277777777777778, + "n": 72, + "permutation_mean": 0.5010416666666667, + "permutation_p": 0.004975124378109453 + } + } + }, + "3": { + "majority_label": "True", + "settings": { + "k": 16, + "lam": 1.0, + "selection_accuracy": 0.8333333333333334 + }, + "tests": { + "novel": { + "accuracy": 0.5208333333333334, + "majority_accuracy": 0.5, + "n": 96, + "permutation_mean": 0.48953125, + "permutation_p": 0.23880597014925373 + }, + "seen": { + "accuracy": 0.6388888888888888, + "majority_accuracy": 0.5277777777777778, + "n": 72, + "permutation_mean": 0.5064583333333332, + "permutation_p": 0.009950248756218905 + } + } + }, + "4": { + "majority_label": "True", + "settings": { + "k": 16, + "lam": 1.0, + "selection_accuracy": 0.7777777777777778 + }, + "tests": { + "novel": { + "accuracy": 0.5, + "majority_accuracy": 0.5, + "n": 96, + "permutation_mean": 0.4935416666666667, + "permutation_p": 0.5174129353233831 + }, + "seen": { + "accuracy": 0.75, + "majority_accuracy": 0.5277777777777778, + "n": 72, + "permutation_mean": 0.5045833333333334, + "permutation_p": 0.004975124378109453 + } + } + }, + "5": { + "majority_label": "True", + "settings": { + "k": 16, + "lam": 1.0, + "selection_accuracy": 0.8055555555555556 + }, + "tests": { + "novel": { + "accuracy": 0.4895833333333333, + "majority_accuracy": 0.5, + "n": 96, + "permutation_mean": 0.49828125, + "permutation_p": 0.6965174129353234 + }, + "seen": { + "accuracy": 0.7222222222222222, + "majority_accuracy": 0.5277777777777778, + "n": 72, + "permutation_mean": 0.5063888888888889, + "permutation_p": 0.004975124378109453 + } + } + }, + "6": { + "majority_label": "True", + "settings": { + "k": 32, + "lam": 0.001, + "selection_accuracy": 0.75 + }, + "tests": { + "novel": { + "accuracy": 0.4791666666666667, + "majority_accuracy": 0.5, + "n": 96, + "permutation_mean": 0.5028645833333334, + "permutation_p": 0.7014925373134329 + }, + "seen": { + "accuracy": 0.625, + "majority_accuracy": 0.5277777777777778, + "n": 72, + "permutation_mean": 0.5001388888888889, + "permutation_p": 0.05970149253731343 + } + } + }, + "7": { + "majority_label": "True", + "settings": { + "k": 32, + "lam": 1.0, + "selection_accuracy": 0.7777777777777778 + }, + "tests": { + "novel": { + "accuracy": 0.5416666666666666, + "majority_accuracy": 0.5, + "n": 96, + "permutation_mean": 0.5031770833333333, + "permutation_p": 0.2537313432835821 + }, + "seen": { + "accuracy": 0.6527777777777778, + "majority_accuracy": 0.5277777777777778, + "n": 72, + "permutation_mean": 0.5038194444444444, + "permutation_p": 0.004975124378109453 + } + } + }, + "8": { + "majority_label": "True", + "settings": { + "k": 8, + "lam": 1.0, + "selection_accuracy": 0.6944444444444444 + }, + "tests": { + "novel": { + "accuracy": 0.4270833333333333, + "majority_accuracy": 0.5, + "n": 96, + "permutation_mean": 0.5025520833333333, + "permutation_p": 0.9950248756218906 + }, + "seen": { + "accuracy": 0.6388888888888888, + "majority_accuracy": 0.5277777777777778, + "n": 72, + "permutation_mean": 0.5154861111111111, + "permutation_p": 0.004975124378109453 + } + } + } + } + }, + "select": 36, + "site": "block output at the last prompt token, step 0 = block input", + "test_novel": 96, + "test_seen": 72, + "train": 96 + }, + "profile": "nanbeige", + "schema": "algernon.arg02.receipt.v1", + "selection": { + "block": [ + 0, + 22 + ], + "depth": 8, + "dev_future12_depth1": 49, + "dev_future12_selected": 63, + "dev_gain": 14, + "shots": 0 + }, + "smoke": false, + "splits": { + "counts": { + "calibration": 36, + "dev": 96, + "shots": 4, + "test": 192, + "test_positive": 168 + }, + "dev_families": [ + "product", + "signed", + "sparse" + ], + "dev_seed": 2026111102, + "evalmath_seed": 2026111027, + "roster_sha256": { + "calibration": "088c8dc031f9aa14c94339bd08983f55e730be9415952aed20c66921aa6abf19", + "dev": "113081f8fe58a3a42bb198130436ecf8dc7d9247416694c5ac0ce57b5264041e", + "shots": "201a4dbce72f1a2f9703579c4ab901503da2fa31efd520c56ea1a40fb3a15994", + "test": "0e8caf0649d30f834d0bcfd1469b705d6d73371812cb87575fd3e12243ebcbba" + }, + "schema": "algernon.arg02.splits.v1", + "shot_programs": { + "additive": [ + "I", + "R", + "I" + ], + "cascade": [ + "N", + "N", + "S" + ], + "fork": [ + "S", + "I", + "S" + ], + "hadamard": [ + "R", + "R", + "N" + ] + }, + "shot_seed": 2026111103, + "signature_overlaps": { + "calibration_vs_test": 0, + "dev_vs_calibration": 0, + "dev_vs_test": 0, + "shots_vs_dev": 0, + "shots_vs_test": 0 + }, + "test_duplicate_public_signatures": 6 + }, + "summary": { + "controller": { + "accepted12": 52, + "by_family": { + "lacunary": 7, + "product": 6, + "rational": 8, + "signed": 8, + "sparse": 4, + "squared": 6, + "twisted_product": 7 + }, + "collision_false_future": 0, + "collision_pairs_identical_trace": 6, + "future12": 46, + "negative_accepted": 0, + "novel_future12": 28, + "positives": 168 + }, + "ensemble@1": { + "accepted1": 12, + "accepted12": 53, + "by_family": { + "lacunary": 7, + "product": 9, + "rational": 7, + "signed": 5, + "sparse": 5, + "squared": 3, + "twisted_product": 8 + }, + "collision_false_future": 3, + "collision_pairs_identical_trace": 6, + "future1": 10, + "future12": 44, + "greedy_accepted": 0, + "greedy_future": 0, + "greedy_valid": 0, + "invalid_program_rate": 1.0, + "mean_rank_of_source": 34.82142857142857, + "negative_accepted": 0, + "novel_future12": 25, + "positives": 168, + "queries12": 1657 + }, + "ensemble@2": { + "accepted1": 11, + "accepted12": 53, + "by_family": { + "lacunary": 7, + "product": 9, + "rational": 6, + "signed": 5, + "sparse": 5, + "squared": 4, + "twisted_product": 8 + }, + "collision_false_future": 3, + "collision_pairs_identical_trace": 6, + "future1": 9, + "future12": 44, + "greedy_accepted": 0, + "greedy_future": 0, + "greedy_valid": 0, + "invalid_program_rate": 1.0, + "mean_rank_of_source": 34.779761904761905, + "negative_accepted": 0, + "novel_future12": 25, + "positives": 168, + "queries12": 1651 + }, + "ensemble@4": { + "accepted1": 11, + "accepted12": 60, + "by_family": { + "lacunary": 9, + "product": 11, + "rational": 6, + "signed": 7, + "sparse": 5, + "squared": 4, + "twisted_product": 9 + }, + "collision_false_future": 3, + "collision_pairs_identical_trace": 6, + "future1": 9, + "future12": 51, + "greedy_accepted": 0, + "greedy_future": 0, + "greedy_valid": 0, + "invalid_program_rate": 1.0, + "mean_rank_of_source": 35.13690476190476, + "negative_accepted": 0, + "novel_future12": 28, + "positives": 168, + "queries12": 1639 + }, + "ensemble@8": { + "accepted1": 11, + "accepted12": 60, + "by_family": { + "lacunary": 9, + "product": 11, + "rational": 6, + "signed": 7, + "sparse": 5, + "squared": 4, + "twisted_product": 9 + }, + "collision_false_future": 3, + "collision_pairs_identical_trace": 6, + "future1": 9, + "future12": 51, + "greedy_accepted": 0, + "greedy_future": 0, + "greedy_valid": 0, + "invalid_program_rate": 1.0, + "mean_rank_of_source": 35.13690476190476, + "negative_accepted": 0, + "novel_future12": 28, + "positives": 168, + "queries12": 1639 + }, + "loop@1": { + "accepted1": 12, + "accepted12": 53, + "by_family": { + "lacunary": 7, + "product": 9, + "rational": 7, + "signed": 5, + "sparse": 5, + "squared": 3, + "twisted_product": 8 + }, + "collision_false_future": 3, + "collision_pairs_identical_trace": 6, + "future1": 10, + "future12": 44, + "greedy_accepted": 0, + "greedy_future": 0, + "greedy_valid": 0, + "invalid_program_rate": 1.0, + "mean_rank_of_source": 34.82142857142857, + "negative_accepted": 0, + "novel_future12": 25, + "positives": 168, + "queries12": 1657 + }, + "loop@2": { + "accepted1": 10, + "accepted12": 72, + "by_family": { + "lacunary": 9, + "product": 8, + "rational": 8, + "signed": 12, + "sparse": 8, + "squared": 11, + "twisted_product": 9 + }, + "collision_false_future": 3, + "collision_pairs_identical_trace": 6, + "future1": 6, + "future12": 65, + "greedy_accepted": 0, + "greedy_future": 0, + "greedy_valid": 0, + "invalid_program_rate": 1.0, + "mean_rank_of_source": 32.410714285714285, + "negative_accepted": 0, + "novel_future12": 37, + "positives": 168, + "queries12": 1562 + }, + "loop@3": { + "accepted1": 9, + "accepted12": 71, + "by_family": { + "lacunary": 9, + "product": 7, + "rational": 9, + "signed": 7, + "sparse": 11, + "squared": 11, + "twisted_product": 9 + }, + "collision_false_future": 4, + "collision_pairs_identical_trace": 6, + "future1": 8, + "future12": 63, + "greedy_accepted": 0, + "greedy_future": 0, + "greedy_valid": 0, + "invalid_program_rate": 1.0, + "mean_rank_of_source": 30.071428571428573, + "negative_accepted": 0, + "novel_future12": 38, + "positives": 168, + "queries12": 1521 + }, + "loop@4": { + "accepted1": 13, + "accepted12": 85, + "by_family": { + "lacunary": 12, + "product": 8, + "rational": 10, + "signed": 14, + "sparse": 9, + "squared": 10, + "twisted_product": 13 + }, + "collision_false_future": 5, + "collision_pairs_identical_trace": 6, + "future1": 11, + "future12": 76, + "greedy_accepted": 0, + "greedy_future": 0, + "greedy_valid": 0, + "invalid_program_rate": 1.0, + "mean_rank_of_source": 29.458333333333332, + "negative_accepted": 0, + "novel_future12": 45, + "positives": 168, + "queries12": 1494 + }, + "loop@5": { + "accepted1": 7, + "accepted12": 87, + "by_family": { + "lacunary": 12, + "product": 6, + "rational": 16, + "signed": 10, + "sparse": 6, + "squared": 14, + "twisted_product": 16 + }, + "collision_false_future": 6, + "collision_pairs_identical_trace": 6, + "future1": 7, + "future12": 80, + "greedy_accepted": 0, + "greedy_future": 0, + "greedy_valid": 0, + "invalid_program_rate": 1.0, + "mean_rank_of_source": 30.93452380952381, + "negative_accepted": 0, + "novel_future12": 58, + "positives": 168, + "queries12": 1375 + }, + "loop@6": { + "accepted1": 13, + "accepted12": 70, + "by_family": { + "lacunary": 9, + "product": 11, + "rational": 6, + "signed": 9, + "sparse": 4, + "squared": 9, + "twisted_product": 12 + }, + "collision_false_future": 3, + "collision_pairs_identical_trace": 6, + "future1": 10, + "future12": 60, + "greedy_accepted": 0, + "greedy_future": 0, + "greedy_valid": 0, + "invalid_program_rate": 1.0, + "mean_rank_of_source": 31.63095238095238, + "negative_accepted": 0, + "novel_future12": 36, + "positives": 168, + "queries12": 1538 + }, + "loop@7": { + "accepted1": 7, + "accepted12": 74, + "by_family": { + "lacunary": 10, + "product": 6, + "rational": 13, + "signed": 9, + "sparse": 6, + "squared": 13, + "twisted_product": 11 + }, + "collision_false_future": 4, + "collision_pairs_identical_trace": 6, + "future1": 7, + "future12": 68, + "greedy_accepted": 0, + "greedy_future": 0, + "greedy_valid": 0, + "invalid_program_rate": 1.0, + "mean_rank_of_source": 30.56547619047619, + "negative_accepted": 0, + "novel_future12": 47, + "positives": 168, + "queries12": 1564 + }, + "loop@8": { + "accepted1": 8, + "accepted12": 83, + "by_family": { + "lacunary": 8, + "product": 10, + "rational": 11, + "signed": 11, + "sparse": 4, + "squared": 10, + "twisted_product": 17 + }, + "collision_false_future": 6, + "collision_pairs_identical_trace": 6, + "future1": 8, + "future12": 71, + "greedy_accepted": 0, + "greedy_future": 0, + "greedy_valid": 0, + "invalid_program_rate": 1.0, + "mean_rank_of_source": 30.511904761904763, + "negative_accepted": 0, + "novel_future12": 46, + "positives": 168, + "queries12": 1459 + }, + "open@2": { + "accepted1": 12, + "accepted12": 57, + "by_family": { + "lacunary": 7, + "product": 10, + "rational": 7, + "signed": 6, + "sparse": 6, + "squared": 3, + "twisted_product": 9 + }, + "collision_false_future": 3, + "collision_pairs_identical_trace": 6, + "future1": 10, + "future12": 48, + "greedy_accepted": 0, + "greedy_future": 0, + "greedy_valid": 0, + "invalid_program_rate": 1.0, + "mean_rank_of_source": 34.75, + "negative_accepted": 0, + "novel_future12": 26, + "positives": 168, + "queries12": 1650 + }, + "open@4": { + "accepted1": 13, + "accepted12": 66, + "by_family": { + "lacunary": 12, + "product": 12, + "rational": 8, + "signed": 7, + "sparse": 7, + "squared": 2, + "twisted_product": 10 + }, + "collision_false_future": 2, + "collision_pairs_identical_trace": 6, + "future1": 11, + "future12": 58, + "greedy_accepted": 0, + "greedy_future": 0, + "greedy_valid": 0, + "invalid_program_rate": 1.0, + "mean_rank_of_source": 34.541666666666664, + "negative_accepted": 0, + "novel_future12": 32, + "positives": 168, + "queries12": 1610 + }, + "open@8": { + "accepted1": 13, + "accepted12": 63, + "by_family": { + "lacunary": 11, + "product": 12, + "rational": 7, + "signed": 8, + "sparse": 7, + "squared": 2, + "twisted_product": 8 + }, + "collision_false_future": 1, + "collision_pairs_identical_trace": 6, + "future1": 11, + "future12": 55, + "greedy_accepted": 0, + "greedy_future": 0, + "greedy_valid": 0, + "invalid_program_rate": 1.0, + "mean_rank_of_source": 34.648809523809526, + "negative_accepted": 0, + "novel_future12": 28, + "positives": 168, + "queries12": 1606 + }, + "patch@1": { + "accepted1": 8, + "accepted12": 84, + "by_family": { + "lacunary": 9, + "product": 10, + "rational": 11, + "signed": 11, + "sparse": 3, + "squared": 11, + "twisted_product": 17 + }, + "collision_false_future": 6, + "collision_pairs_identical_trace": 3, + "future1": 8, + "future12": 72, + "greedy_accepted": 0, + "greedy_future": 0, + "greedy_valid": 0, + "invalid_program_rate": 1.0, + "mean_rank_of_source": 30.833333333333332, + "negative_accepted": 0, + "novel_future12": 48, + "positives": 168, + "queries12": 1468 + }, + "patch@4": { + "accepted1": 7, + "accepted12": 79, + "by_family": { + "lacunary": 9, + "product": 7, + "rational": 10, + "signed": 11, + "sparse": 4, + "squared": 11, + "twisted_product": 15 + }, + "collision_false_future": 6, + "collision_pairs_identical_trace": 0, + "future1": 6, + "future12": 67, + "greedy_accepted": 0, + "greedy_future": 0, + "greedy_valid": 0, + "invalid_program_rate": 1.0, + "mean_rank_of_source": 31.178571428571427, + "negative_accepted": 0, + "novel_future12": 45, + "positives": 168, + "queries12": 1495 + }, + "patch@8": { + "accepted1": 8, + "accepted12": 75, + "by_family": { + "lacunary": 8, + "product": 8, + "rational": 10, + "signed": 11, + "sparse": 3, + "squared": 9, + "twisted_product": 14 + }, + "collision_false_future": 6, + "collision_pairs_identical_trace": 0, + "future1": 7, + "future12": 63, + "greedy_accepted": 0, + "greedy_future": 0, + "greedy_valid": 0, + "invalid_program_rate": 1.0, + "mean_rank_of_source": 31.196428571428573, + "negative_accepted": 0, + "novel_future12": 41, + "positives": 168, + "queries12": 1481 + }, + "perturb@1": { + "accepted1": 10, + "accepted12": 56, + "by_family": { + "lacunary": 9, + "product": 8, + "rational": 8, + "signed": 5, + "sparse": 3, + "squared": 5, + "twisted_product": 7 + }, + "collision_false_future": 1, + "collision_pairs_identical_trace": 0, + "future1": 8, + "future12": 45, + "greedy_accepted": 0, + "greedy_future": 0, + "greedy_valid": 0, + "invalid_program_rate": 1.0, + "mean_rank_of_source": 35.404761904761905, + "negative_accepted": 0, + "novel_future12": 29, + "positives": 168, + "queries12": 1663 + }, + "perturb@2": { + "accepted1": 8, + "accepted12": 73, + "by_family": { + "lacunary": 9, + "product": 9, + "rational": 8, + "signed": 12, + "sparse": 9, + "squared": 10, + "twisted_product": 9 + }, + "collision_false_future": 3, + "collision_pairs_identical_trace": 0, + "future1": 4, + "future12": 66, + "greedy_accepted": 0, + "greedy_future": 0, + "greedy_valid": 0, + "invalid_program_rate": 1.0, + "mean_rank_of_source": 32.17857142857143, + "negative_accepted": 0, + "novel_future12": 36, + "positives": 168, + "queries12": 1540 + }, + "perturb@4": { + "accepted1": 16, + "accepted12": 79, + "by_family": { + "lacunary": 12, + "product": 10, + "rational": 8, + "signed": 11, + "sparse": 9, + "squared": 13, + "twisted_product": 11 + }, + "collision_false_future": 5, + "collision_pairs_identical_trace": 1, + "future1": 15, + "future12": 74, + "greedy_accepted": 0, + "greedy_future": 0, + "greedy_valid": 0, + "invalid_program_rate": 1.0, + "mean_rank_of_source": 29.74404761904762, + "negative_accepted": 0, + "novel_future12": 44, + "positives": 168, + "queries12": 1490 + }, + "perturb@8": { + "accepted1": 6, + "accepted12": 73, + "by_family": { + "lacunary": 10, + "product": 7, + "rational": 8, + "signed": 12, + "sparse": 2, + "squared": 9, + "twisted_product": 14 + }, + "collision_false_future": 4, + "collision_pairs_identical_trace": 0, + "future1": 5, + "future12": 62, + "greedy_accepted": 0, + "greedy_future": 0, + "greedy_valid": 0, + "invalid_program_rate": 1.0, + "mean_rank_of_source": 31.904761904761905, + "negative_accepted": 0, + "novel_future12": 41, + "positives": 168, + "queries12": 1518 + }, + "shuffle@2": { + "accepted1": 9, + "accepted12": 75, + "by_family": { + "lacunary": 10, + "product": 8, + "rational": 9, + "signed": 12, + "sparse": 9, + "squared": 11, + "twisted_product": 10 + }, + "collision_false_future": 3, + "collision_pairs_identical_trace": 1, + "future1": 5, + "future12": 69, + "greedy_accepted": 0, + "greedy_future": 0, + "greedy_valid": 0, + "invalid_program_rate": 1.0, + "mean_rank_of_source": 32.19642857142857, + "negative_accepted": 0, + "novel_future12": 40, + "positives": 168, + "queries12": 1550 + }, + "shuffle@4": { + "accepted1": 11, + "accepted12": 74, + "by_family": { + "lacunary": 9, + "product": 7, + "rational": 9, + "signed": 13, + "sparse": 8, + "squared": 9, + "twisted_product": 15 + }, + "collision_false_future": 5, + "collision_pairs_identical_trace": 1, + "future1": 10, + "future12": 70, + "greedy_accepted": 0, + "greedy_future": 0, + "greedy_valid": 0, + "invalid_program_rate": 1.0, + "mean_rank_of_source": 30.267857142857142, + "negative_accepted": 0, + "novel_future12": 42, + "positives": 168, + "queries12": 1543 + }, + "shuffle@8": { + "accepted1": 6, + "accepted12": 74, + "by_family": { + "lacunary": 8, + "product": 8, + "rational": 8, + "signed": 11, + "sparse": 4, + "squared": 9, + "twisted_product": 14 + }, + "collision_false_future": 6, + "collision_pairs_identical_trace": 1, + "future1": 5, + "future12": 62, + "greedy_accepted": 0, + "greedy_future": 0, + "greedy_valid": 0, + "invalid_program_rate": 1.0, + "mean_rank_of_source": 31.30952380952381, + "negative_accepted": 0, + "novel_future12": 39, + "positives": 168, + "queries12": 1492 + }, + "symbolic:certified_mass12": { + "accepted12": 111, + "by_family": { + "lacunary": 16, + "product": 11, + "rational": 16, + "signed": 14, + "sparse": 13, + "squared": 16, + "twisted_product": 16 + }, + "collision_false_future": 6, + "collision_pairs_identical_trace": 6, + "future12": 102, + "negative_accepted": 0, + "novel_future12": 64, + "positives": 168 + }, + "symbolic:certified_mass_full": { + "accepted12": 168, + "by_family": { + "lacunary": 24, + "product": 24, + "rational": 23, + "signed": 24, + "sparse": 19, + "squared": 21, + "twisted_product": 24 + }, + "collision_false_future": 6, + "collision_pairs_identical_trace": 6, + "future12": 159, + "negative_accepted": 0, + "novel_future12": 92, + "positives": 168 + }, + "symbolic:exhaustive_64": { + "accepted12": 168, + "by_family": { + "lacunary": 24, + "product": 24, + "rational": 23, + "signed": 24, + "sparse": 18, + "squared": 20, + "twisted_product": 24 + }, + "collision_false_future": 6, + "collision_pairs_identical_trace": 6, + "future12": 157, + "negative_accepted": 0, + "novel_future12": 91, + "positives": 168 + }, + "symbolic:frozen_ff": { + "accepted12": 132, + "by_family": { + "lacunary": 19, + "product": 23, + "rational": 13, + "signed": 19, + "sparse": 14, + "squared": 18, + "twisted_product": 16 + }, + "collision_false_future": 5, + "collision_pairs_identical_trace": 6, + "future12": 122, + "negative_accepted": 0, + "novel_future12": 66, + "positives": 168 + }, + "symbolic:frozen_gru": { + "accepted12": 138, + "by_family": { + "lacunary": 22, + "product": 24, + "rational": 15, + "signed": 22, + "sparse": 15, + "squared": 17, + "twisted_product": 14 + }, + "collision_false_future": 5, + "collision_pairs_identical_trace": 6, + "future12": 129, + "negative_accepted": 0, + "novel_future12": 68, + "positives": 168 + } + } +} diff --git a/research/algernon/algebraic_reasoning_gym/arg02/results_nanbeige/arg02_selection.json b/research/algernon/algebraic_reasoning_gym/arg02/results_nanbeige/arg02_selection.json new file mode 100644 index 000000000..3a1578533 --- /dev/null +++ b/research/algernon/algebraic_reasoning_gym/arg02/results_nanbeige/arg02_selection.json @@ -0,0 +1,25 @@ +{ + "block": [ + 0, + 22 + ], + "depth": 8, + "dev_future12_depth1": 49, + "dev_future12_selected": 63, + "dev_gain": 14, + "rule": "max development future-correct at 12 checks over blocks x depths>1; tie -> smaller depth, earlier block", + "selection_shots_sha256": "0b0e901ee5eb5462acb7805ef244029339fb6fc0d4712d2610a950c6f9a417c1", + "shots": 0, + "stage": "blocks", + "table": { + "dev_block_0_22": { + "cases": 132, + "future12_by_depth": { + "1": 49, + "2": 45, + "4": 53, + "8": 63 + } + } + } +} diff --git a/research/algernon/algebraic_reasoning_gym/arg02/results_nanbeige/arg02_tables.md b/research/algernon/algebraic_reasoning_gym/arg02/results_nanbeige/arg02_tables.md new file mode 100644 index 000000000..d938188f3 --- /dev/null +++ b/research/algernon/algebraic_reasoning_gym/arg02/results_nanbeige/arg02_tables.md @@ -0,0 +1,150 @@ +Selection (development data): shots 0, block [0, 22], d* = 8, ensemble size m(d*) = 8. Development future-correct@12: 49 at depth 1, 63 at the selection. + +## Arms on the 168 test positives + +| Arm | future@12 | accepted@12 | future@1 | greedy valid | greedy accepted | novel future@12 | negatives accepted | collision pairs same trace | GPU s | end-to-end s | p50 / p95 ms | PFLOP | future@12 per e2e s | +|---|---:|---:|---:|---:|---:|---:|---:|---:|---:|---:|---:|---:|---:| +| loop@1 | 44 | 53 | 10 | 0 | 0 | 25 | 0 | 6 | 147.2 | 147.6 | 743 / 897 | 7.003 | 0.2982 | +| loop@2 | 65 | 72 | 6 | 0 | 0 | 37 | 0 | 6 | 286.8 | 287.2 | 1454 / 1767 | 13.997 | 0.2263 | +| loop@4 | 76 | 85 | 11 | 0 | 0 | 45 | 0 | 6 | 562.3 | 562.7 | 2852 / 3396 | 27.985 | 0.1351 | +| loop@8 | 71 | 83 | 8 | 0 | 0 | 46 | 0 | 6 | 1119.1 | 1119.4 | 5673 / 6954 | 55.961 | 0.0634 | +| open@8 | 55 | 63 | 11 | 0 | 0 | 28 | 0 | 6 | 151.0 | 151.3 | 767 / 958 | 7.003 | 0.3634 | +| shuffle@8 | 62 | 74 | 5 | 0 | 0 | 39 | 0 | 1 | 1266.4 | 1266.6 | 6506 / 7548 | 62.955 | 0.0490 | +| ensemble@8 | 51 | 60 | 9 | 0 | 0 | 28 | 0 | 6 | 1159.6 | 1160.0 | 5941 / 7278 | 52.206 | 0.0440 | +| controller | 46 | 52 | - | - | - | 28 | 0 | 6 | 2087.1 | 2089.3 | 12512 / 14016 | 98.580 | 0.0220 | +| symbolic:certified_mass12 | 102 | 111 | - | - | - | 64 | 0 | 6 | 0.0 | 0.4 | 2 / 4 | 0.000 | 273.5809 | +| symbolic:certified_mass_full | 159 | 168 | - | - | - | 92 | 0 | 6 | 0.0 | 0.5 | 2 / 5 | 0.000 | 340.9566 | +| symbolic:exhaustive_64 | 157 | 168 | - | - | - | 91 | 0 | 6 | 0.0 | 0.6 | 1 / 11 | 0.000 | 273.6052 | +| symbolic:frozen_ff | 122 | 132 | - | - | - | 66 | 0 | 6 | 0.0 | 0.6 | 3 / 5 | 0.000 | 221.4857 | +| symbolic:frozen_gru | 129 | 138 | - | - | - | 68 | 0 | 6 | 0.0 | 3.3 | 17 / 27 | 0.000 | 38.7455 | + +## Paired comparisons, future-correct at 12 checks + +| A vs B | A | B | A only | B only | A - B | cluster 95% CI (per case) | McNemar p | +|---|---:|---:|---:|---:|---:|---|---:| +| controller vs loop@1 | 46 | 44 | 15 | 13 | +2 | [-0.067, +0.086] | 0.8506 | +| loop@1 vs symbolic:certified_mass12 | 44 | 102 | 21 | 79 | -58 | [-0.444, -0.244] | 0.0000 | +| loop@1 vs symbolic:frozen_ff | 44 | 122 | 13 | 91 | -78 | [-0.563, -0.360] | 0.0000 | +| loop@1 vs symbolic:frozen_gru | 44 | 129 | 8 | 93 | -85 | [-0.611, -0.399] | 0.0000 | +| loop@2 vs loop@1 | 65 | 44 | 58 | 37 | +21 | [+0.000, +0.256] | 0.0396 | +| loop@4 vs loop@1 | 76 | 44 | 66 | 34 | +32 | [+0.068, +0.312] | 0.0018 | +| loop@8 vs ensemble@8 | 71 | 51 | 48 | 28 | +20 | [+0.012, +0.230] | 0.0286 | +| loop@8 vs loop@1 | 71 | 44 | 50 | 23 | +27 | [+0.057, +0.268] | 0.0021 | +| loop@8 vs loop@2 | 71 | 65 | 50 | 44 | +6 | [-0.099, +0.173] | 0.6063 | +| loop@8 vs open@8 | 71 | 55 | 49 | 33 | +16 | [-0.024, +0.215] | 0.0970 | +| loop@8 vs shuffle@8 | 71 | 62 | 10 | 1 | +9 | [+0.016, +0.096] | 0.0117 | +| loop@8 vs symbolic:certified_mass12 | 71 | 102 | 14 | 45 | -31 | [-0.273, -0.095] | 0.0001 | +| loop@8 vs symbolic:certified_mass_full | 71 | 159 | 0 | 88 | -88 | [-0.614, -0.429] | 0.0000 | +| loop@8 vs symbolic:exhaustive_64 | 71 | 157 | 0 | 86 | -86 | [-0.598, -0.421] | 0.0000 | +| open@2 vs loop@1 | 48 | 44 | 5 | 1 | +4 | [+0.000, +0.051] | 0.2188 | +| open@4 vs loop@1 | 58 | 44 | 19 | 5 | +14 | [+0.034, +0.137] | 0.0066 | +| open@8 vs loop@1 | 55 | 44 | 17 | 6 | +11 | [+0.012, +0.122] | 0.0347 | +| shuffle@2 vs loop@1 | 69 | 44 | 63 | 38 | +25 | [+0.019, +0.281] | 0.0165 | +| shuffle@4 vs loop@1 | 70 | 44 | 61 | 35 | +26 | [+0.039, +0.267] | 0.0103 | +| shuffle@8 vs loop@1 | 62 | 44 | 42 | 24 | +18 | [+0.016, +0.200] | 0.0356 | + +## Decision rules + +- H1_depth: **met** +- H2a_feedback: **not met** +- H2b_state: **met** +- H2b_state_original_shuffle: **met** +- H3a_repeat: **met** +- H3b_ff: **not applicable** +- H3c_efficiency: **not met** +- H4_symbolic: **not met** +- mechanism_claim: **not met** + +## Depth curve (loop, test positives) + +| step | future@12 | future@1 | accepted@1 | greedy valid | greedy accepted | median relative residual | median reduction | +|---:|---:|---:|---:|---:|---:|---:|---:| +| 1 | 44 | 10 | 12 | 0 | 0 | 23.787 | - | +| 2 | 65 | 6 | 10 | 0 | 0 | 5.828 | 0.245 | +| 3 | 63 | 8 | 9 | 0 | 0 | 0.813 | 0.140 | +| 4 | 76 | 11 | 13 | 0 | 0 | 0.961 | 1.183 | +| 5 | 80 | 7 | 7 | 0 | 0 | 0.850 | 0.885 | +| 6 | 60 | 10 | 13 | 0 | 0 | 1.277 | 1.503 | +| 7 | 68 | 7 | 7 | 0 | 0 | 0.628 | 0.492 | +| 8 | 71 | 8 | 8 | 0 | 0 | 0.688 | 1.094 | + +First step with a future-correct top-1 answer: {"1": 10, "2": 6, "3": 8, "4": 9, "6": 9, "8": 4, "None": 122}. Found only after step 1: 36; still correct at the last step: 8. + +| depth vs step 1 | lost | gained | +|---|---:|---:| +| at12@2 | 37 | 58 | +| at12@4 | 34 | 66 | +| at12@8 | 23 | 50 | +| at1@2 | 10 | 6 | +| at1@4 | 10 | 11 | +| at1@8 | 10 | 8 | + +## Perturbation (kick 0.25 x RMS after step 1) + +| readout step | future@12 | clean future@12 | top-1 agrees with clean | median distance / kick | +|---:|---:|---:|---:|---:| +| 1 | 45 | 44 | 111 | 1.000 | +| 2 | 66 | 65 | 135 | 2.849 | +| 4 | 74 | 76 | 73 | 3.888 | +| 8 | 62 | 71 | 69 | 6.855 | + +## Answer-site patching (donor site states, loop to 8) + +| patch step | top-1 kept | top-1 moved to donor's | top-1 changed | future@12 | median KL to clean | p95 KL | +|---:|---:|---:|---:|---:|---:|---:| +| 1 | 143 | 10 | 25 | 72 | 0.0118 | 0.0548 | +| 4 | 94 | 55 | 74 | 67 | 0.1020 | 0.4779 | +| 8 | 86 | 82 | 82 | 63 | 0.1632 | 0.7038 | + +## Linear probes (block output at the last prompt token, step 0 = block input; train 96, select 36, test seen 72, novel 96) + +**outer_op** + +| step | novel acc | novel majority | novel perm. p | seen acc | seen majority | k | lam | +|---:|---:|---:|---:|---:|---:|---:|---:| +| 0 | 0.406 | 0.406 | 0.602 | 0.264 | 0.264 | 8 | 0.001 | +| 1 | 0.375 | 0.406 | 0.050 | 0.347 | 0.264 | 16 | 0.01 | +| 2 | 0.344 | 0.406 | 0.328 | 0.319 | 0.264 | 8 | 0.1 | +| 3 | 0.375 | 0.406 | 0.189 | 0.417 | 0.264 | 8 | 0.1 | +| 4 | 0.354 | 0.406 | 0.070 | 0.417 | 0.264 | 32 | 0.01 | +| 5 | 0.375 | 0.406 | 0.015 | 0.389 | 0.264 | 32 | 0.01 | +| 6 | 0.354 | 0.406 | 0.199 | 0.347 | 0.264 | 8 | 0.001 | +| 7 | 0.333 | 0.406 | 0.109 | 0.403 | 0.264 | 32 | 0.001 | +| 8 | 0.385 | 0.406 | 0.025 | 0.403 | 0.264 | 32 | 0.001 | + +**uses_R** + +| step | novel acc | novel majority | novel perm. p | seen acc | seen majority | k | lam | +|---:|---:|---:|---:|---:|---:|---:|---:| +| 0 | 0.500 | 0.500 | 1.000 | 0.528 | 0.528 | 8 | 0.001 | +| 1 | 0.542 | 0.500 | 0.164 | 0.653 | 0.528 | 32 | 1.0 | +| 2 | 0.490 | 0.500 | 0.657 | 0.681 | 0.528 | 16 | 1.0 | +| 3 | 0.521 | 0.500 | 0.239 | 0.639 | 0.528 | 16 | 1.0 | +| 4 | 0.500 | 0.500 | 0.517 | 0.750 | 0.528 | 16 | 1.0 | +| 5 | 0.490 | 0.500 | 0.697 | 0.722 | 0.528 | 16 | 1.0 | +| 6 | 0.479 | 0.500 | 0.701 | 0.625 | 0.528 | 32 | 0.001 | +| 7 | 0.542 | 0.500 | 0.254 | 0.653 | 0.528 | 32 | 1.0 | +| 8 | 0.427 | 0.500 | 0.995 | 0.639 | 0.528 | 8 | 1.0 | + +## Future-correct@12 by source family + +| family | loop@1 | loop@8 | symbolic:certified_mass_full | symbolic:frozen_gru | +|---|---:|---:|---:|---:| +| lacunary | 7 | 8 | 24 | 22 | +| product | 9 | 10 | 24 | 24 | +| rational | 7 | 11 | 23 | 15 | +| signed | 5 | 11 | 24 | 22 | +| sparse | 5 | 4 | 19 | 15 | +| squared | 3 | 10 | 21 | 17 | +| twisted_product | 8 | 17 | 24 | 14 | + +## ARG-01 external.py cross-check (top-1 loop answers) + +- depth 1: ARG-01 exact accepted 12 = ARG-02 12; future 10 = 10 +- depth 2: ARG-01 exact accepted 10 = ARG-02 10; future 6 = 6 +- depth 4: ARG-01 exact accepted 15 = ARG-02 15; future 12 = 12 +- depth 8: ARG-01 exact accepted 8 = ARG-02 8; future 8 = 8 + +## Peak allocated VRAM per stage (GiB) + +test_controller 8.79, test_ensemble 8.41, test_loop 8.57, test_open 8.41, test_patch 8.65, test_perturb 8.58, test_shuffle 8.52 diff --git a/research/algernon/algebraic_reasoning_gym/arg02/results_nanbeige/arg02_traces.jsonl.gz b/research/algernon/algebraic_reasoning_gym/arg02/results_nanbeige/arg02_traces.jsonl.gz new file mode 100644 index 000000000..f801c7d23 Binary files /dev/null and b/research/algernon/algebraic_reasoning_gym/arg02/results_nanbeige/arg02_traces.jsonl.gz differ diff --git a/research/algernon/algebraic_reasoning_gym/arg02/run_arg02.ps1 b/research/algernon/algebraic_reasoning_gym/arg02/run_arg02.ps1 new file mode 100644 index 000000000..c0eb3dd7d --- /dev/null +++ b/research/algernon/algebraic_reasoning_gym/arg02/run_arg02.ps1 @@ -0,0 +1,60 @@ +# ARG-02 GPU chain: development selection, then the single test run, then the report. +# One vramorama lease at a time; every GPU stage is resumable and exits 75 on a power cap. +# +# powershell -ExecutionPolicy Bypass -File research\algernon\algebraic_reasoning_gym\arg02\run_arg02.ps1 ` +# -RunDir C:\Users\patri\Documents\Codex\algernon\runs\arg02 [-Profile nanbeige] +# +# Run from the Compactification-Theory root. A stage that already finished is skipped by the +# runner (parts are reused under an identical key), so the script can be started again after a stop. +param( + [Parameter(Mandatory = $true)][string]$RunDir, + [ValidateSet("qwen", "nanbeige")][string]$Profile = "qwen", + [string]$Python = "", + [string]$EvalMathSrc = "C:\Users\patri\OneDrive\Documents\GitHub\EvalMath\src", + [string]$Vram = "", + [string]$Vramorama = "$env:LOCALAPPDATA\Programs\vramorama\vramorama.exe", + [string]$ResultsDir = "" +) +# Exit codes decide failure: under Windows PowerShell 5.1 "Stop" would turn a Python +# warning on stderr into a terminating error. +$ErrorActionPreference = "Continue" +if ($Profile -eq "nanbeige") { + # Nanbeige's remote code needs transformers < 5; its bf16 weights alone are about 8.3 GB. + if (-not $Python) { $Python = "C:\Users\patri\.venvs\bvg-v03\Scripts\python.exe" } + if (-not $Vram) { $Vram = "13G" } + if (-not $ResultsDir) { $ResultsDir = "research\algernon\algebraic_reasoning_gym\arg02\results_nanbeige" } +} else { + if (-not $Python) { $Python = "C:\Users\patri\.venvs\bluebeam\Scripts\python.exe" } + if (-not $Vram) { $Vram = "8G" } + if (-not $ResultsDir) { $ResultsDir = "research\algernon\algebraic_reasoning_gym\arg02\results" } +} +$env:PYTHONPATH = ".;$EvalMathSrc" +$env:PYTHONUTF8 = "1" +$env:HF_HUB_OFFLINE = "1" +$pkg = "research.algernon.algebraic_reasoning_gym.arg02" + +function Cpu([string[]]$a) { + & $Python -m "$pkg.analyze" @a + if ($LASTEXITCODE -ne 0) { throw "analyze $($a -join ' ') failed ($LASTEXITCODE)" } +} + +function Gpu([string]$name, [string[]]$a) { + $done = Join-Path $RunDir "$name.done" + if (Test-Path $done) { Write-Host "skip $name (done)"; return } + & $Vramorama run --vram $Vram --owner "arg02-$Profile-$name" --pause-exit 75 --guard-power 90 --restart 20 ` + -- $Python -m "$pkg.runner" @a --run-dir $RunDir --profile $Profile + if ($LASTEXITCODE -ne 0) { throw "runner $name failed ($LASTEXITCODE)" } + New-Item -ItemType File -Path $done -Force | Out-Null +} + +if (-not (Test-Path (Join-Path $RunDir "export_manifest.json"))) { Cpu @("export", "--run-dir", $RunDir, "--profile", $Profile) } +Gpu "dev_shots" @("dev", "--stage", "shots") +Cpu @("select", "--run-dir", $RunDir, "--stage", "shots") +Gpu "dev_blocks" @("dev", "--stage", "blocks") +if (-not (Test-Path (Join-Path $RunDir "selection.json"))) { Cpu @("select", "--run-dir", $RunDir, "--stage", "blocks") } +Gpu "test_main" @("test") +if ($Profile -eq "qwen") { Gpu "test_ff" @("test", "--model", "ff") } +Cpu @("report", "--run-dir", $RunDir, "--out", $ResultsDir) +Cpu @("replay", "--tape", "$ResultsDir\arg02_answer_tape.jsonl.gz", "--check", "$ResultsDir\arg02_receipt.json") +New-Item -ItemType File -Path (Join-Path $RunDir "chain.done") -Force | Out-Null +Write-Host "ARG-02 chain finished; receipts in $ResultsDir" diff --git a/research/algernon/algebraic_reasoning_gym/arg02/runner.py b/research/algernon/algebraic_reasoning_gym/arg02/runner.py new file mode 100644 index 000000000..1de4b5acf --- /dev/null +++ b/research/algernon/algebraic_reasoning_gym/arg02/runner.py @@ -0,0 +1,684 @@ +"""ARG-02 model runner: Qwen3.5 block-loop recurrence on public ARG-01 records. + +The runner reads public JSONL rows exported by `analyze export` and never +builds the EvalMath roster, so hidden graphs and future coefficients cannot +reach a prompt. It writes per-case answer distributions, hidden-state +captures and timings under /parts/; `analyze` grades them with the +oracle afterwards. The external controller is the one arm that calls a +verifier during the run: it checks candidates against the public demos only. + +Stages (see PROTOCOL.md): + dev --stage shots depth-1 answers with 0 and 4 shots on development rows + dev --stage blocks loop trajectories for each candidate block + test every Qwen3.5-0.8B arm on the 192 test rows, once + test --model ff the Qwen3.5-2B feedforward control + smoke the whole pipeline on a tiny random Qwen3.5, CPU + +Exit 75 when the GPU is power-capped; `vramorama run --pause-exit 75` +restarts it and finished parts are reused. +""" +from __future__ import annotations + +import argparse +from hashlib import sha256 +import json +import math +import os +from pathlib import Path +import platform +import re +import subprocess +import sys +import time + +HERE = Path(__file__).resolve().parent +CONFIG = HERE / "config" / "arg02_config.json" +LOCK = HERE / "config" / "checkpoint_lock.json" +PAUSE_EXIT = 75 +CODE_FILES = ("prompts.py", "recurrence.py", "runner.py", "scoring.py") + + +class Paused(Exception): + pass + + +def file_sha256(path): + h = sha256() + with open(path, "rb") as fh: + for chunk in iter(lambda: fh.read(1 << 22), b""): + h.update(chunk) + return h.hexdigest() + + +def load_json(path): + return json.loads(Path(path).read_text(encoding="utf-8")) + + +def write_atomic(path, text): + path = Path(path) + path.parent.mkdir(parents=True, exist_ok=True) + tmp = path.with_name(path.name + ".tmp") + tmp.write_text(text, encoding="utf-8") + os.replace(tmp, path) + + +def code_hashes(): + return {name: file_sha256(HERE / name) for name in CODE_FILES} + + +def read_public(path): + from .prompts import PUBLIC_FIELDS + rows = [] + for n, line in enumerate(Path(path).read_text(encoding="utf-8").splitlines(), 1): + if not line.strip(): + continue + row = json.loads(line) + if set(row) != PUBLIC_FIELDS: + raise ValueError(f"{path}:{n}: public row has fields {sorted(row)}") + rows.append(row) + return rows + + +def read_shots(path, k): + from .prompts import SHOT_FIELDS + shots = load_json(path) + if k == 0: + return [] + if any(set(s) != SHOT_FIELDS for s in shots): + raise ValueError("shot rows must be public fields plus program") + if k > len(shots): + raise ValueError("not enough shots") + return shots[:k] + + +def nvidia_smi(): + q = "name,driver_version,memory.total,memory.used,enforced.power.limit,pstate" + try: + out = subprocess.run(["nvidia-smi", f"--query-gpu={q}", "--format=csv,noheader"], + capture_output=True, text=True, timeout=30).stdout.strip() + except (OSError, subprocess.SubprocessError) as e: + return {"error": str(e)} + return dict(zip(q.split(","), [x.strip() for x in out.split(",")])) + + +def enforced_power_limit(): + try: + out = subprocess.run(["nvidia-smi", "--query-gpu=enforced.power.limit", "--format=csv,noheader,nounits"], + capture_output=True, text=True, timeout=10).stdout.split() + return float(out[0]) + except (OSError, subprocess.SubprocessError, ValueError, IndexError): + return None + + +class PowerWatch: + def __init__(self, min_w, *, active, every=10.0, read=enforced_power_limit): + self.min_w, self.active, self.every, self.read, self.last = min_w, active, every, read, None + + def check(self, where): + if not self.active: + return + now = time.monotonic() + if self.last is not None and now - self.last < self.every: + return + self.last = now + watts = self.read() + if watts is not None and watts < self.min_w: + raise Paused(f"{where}: GPU power-capped at {watts:.0f} W") + + +class Parts: + """Per-case results under /parts/