Commit 8fcf7ee
Honest writeup: geodesic A/B inconclusive + K-frozen attention bug
A/B result (3 seeds × 250 steps, 8-token windows):
seed 42: vanilla=2.464 geodesic=2.713 (+10.1%, worse)
seed 7: vanilla=2.507 geodesic=2.479 (-1.1%, better)
seed 123: vanilla=2.272 geodesic=2.620 (+15.3%, worse)
mean: vanilla=2.414 geodesic=2.604 (+7.9%)
wins: 1/3 — INCONCLUSIVE
The PyTorch 3/3-seed win at -0.4% did NOT replicate.
BUT — code review during the run surfaced a real bug in the
attention layer:
h k = tape_matmul(x_id, K_w); # K_w trainable
h k_val = tape_value(k); # rip out value
h kt_val = arr_transpose(k_val); # OMC-space transpose
h kt = tape_const(kt_val); # re-inject as CONSTANT
h scores = tape_matmul(q, kt); # grad only flows to q
The tape_value → tape_const sequence severs gradient flow
through K. K_w never receives gradient from the attention score
path. K stays frozen at its random init throughout training.
Both arms ran broken attention. The geodesic bias was being
added to scores from RANDOM-FROZEN keys, not learned ones.
That's an entirely different experiment than the PyTorch one.
Cause: no tape_transpose Rust builtin. The OMC-space transpose
trick was an expedient hack while we focused on getting the
forward pass to run. It made the forward correct but the
backward broken in a way that affects ONLY K's score-path
gradient (K's bias-path gradient via softmax doesn't exist
because softmax has no bias from K).
What's needed for meaningful replication:
1. Add tape_transpose Rust builtin (forward swaps dims;
backward transposes the upstream gradient)
2. Add test_attention_backward_flows_to_QKV regression test
3. Re-run the A/B with both arms having trainable K
4. Whichever way it lands then is the real signal
Full writeup with reasoning: experiments/prometheus_parity/GEODESIC_AB_RESULTS.md
This is a fail-forward result + a real bug found + a clean
fix path. The geodesic primitive is still validated (3/3
in PyTorch, numerically identical port to OMC). What we
learned: when you ship attention without testing backward,
the first real experiment is the one that catches it.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>1 parent 05c9e4a commit 8fcf7ee
1 file changed
Lines changed: 79 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
0 commit comments