Skip to content

Add 11L RotaryFix + LegalTTT + BIGRAM3072 — val_bpb 1.11869 (3-seed m…#714

Open
Upsalla wants to merge 2 commits intoopenai:mainfrom
Upsalla:submission/11L-rotaryfix-legalttt-bigram3072
Open

Add 11L RotaryFix + LegalTTT + BIGRAM3072 — val_bpb 1.11869 (3-seed m…#714
Upsalla wants to merge 2 commits intoopenai:mainfrom
Upsalla:submission/11L-rotaryfix-legalttt-bigram3072

Conversation

@Upsalla
Copy link
Copy Markdown

@Upsalla Upsalla commented Mar 25, 2026

…ean)

Key changes vs. existing entries:

  • Rotary NTK-Scaling bug fix: train_seq_len=2048 now correctly propagated to both base_model and eval_model (previously hardcoded to 1024)
  • BIGRAM vocabulary size 3072 (vs 1536)
  • Late QAT threshold 0.57 for ~1700 QAT steps (vs ~525 steps at 0.15)
  • torch.no_grad() instead of torch.inference_mode() in TTT scoring phase to prevent Autograd graph corruption when RoPE caches cross phase boundary

Results (8xH100 SXM, 600s training + ~425s TTT):
Seed 1337: legal_ttt_bpb = 1.11877
Seed 42: legal_ttt_bpb = 1.11836
Seed 2025: legal_ttt_bpb = 1.11893
Mean: 1.11869 ± 0.00024

…ean)

Key changes vs. existing entries:
- Rotary NTK-Scaling bug fix: train_seq_len=2048 now correctly propagated
  to both base_model and eval_model (previously hardcoded to 1024)
- BIGRAM vocabulary size 3072 (vs 1536)
- Late QAT threshold 0.57 for ~1700 QAT steps (vs ~525 steps at 0.15)
- torch.no_grad() instead of torch.inference_mode() in TTT scoring phase
  to prevent Autograd graph corruption when RoPE caches cross phase boundary

Results (8xH100 SXM, 600s training + ~425s TTT):
  Seed 1337: legal_ttt_bpb = 1.11877
  Seed 42:   legal_ttt_bpb = 1.11836
  Seed 2025: legal_ttt_bpb = 1.11893
  Mean: 1.11869 ± 0.00024
The previous commit only included records/ changes but left train_gpt.py
as the unmodified baseline script. This commit adds the actual modified
training script used to achieve val_bpb 1.11869 (3-seed mean).

Features included:
- Legal Score-First TTT (test-time training, causal, barrier-synced)
- BigramHash 3072 vocabulary
- LeakyReLU(0.5)^2 MLP activation
- ValueEmbedding (VE128) on layers 9-10
- XSA (Cross-Sequence Attention) on last 4 layers
- EMA (decay=0.997) + Tight SWA (every 50 steps)
- Late QAT (GPTQ-lite int6 + lzma), threshold=0.57
- Sliding Window Eval (stride=64)
- Partial RoPE (16/64 dims), train_seq_len=2048 (Rotary NTK bug fixed)
- LN Scale (1/sqrt(layer+1))
- Parameter Banking + Parallel Muon optimizer

MD5: 5926353668cf98f9c97b2ec171b59818
theLightArchitect added a commit to theLightArchitect/parameter-golf that referenced this pull request Mar 27, 2026
Four major additions to the Kuda Architecture:

1. Hedge Mixer (5-expert, eval-time): Multiplicative Weights Update mixing
   neural + unigram + bigram + trigram + entropy experts. Based on online
   learning theory (Freund & Schapire 1997). Same principle as PAQ/CMIX
   world-best compressors. Expected -0.065 BPB (PR openai#700 validated).

2. CROWN-Q warmdown penalty: lambda * mean(w^2 * delta^2 / 12) pushes
   weights into flat minima that survive quantization. delta^2/12 is the
   uniform quantization noise variance. w^2 is diagonal Fisher proxy.
   Applied during warmdown only. From PR openai#693.

3. RoPE NTK fix: Propagate train_seq_len to all blocks' Rotary modules.
   Prevents positional encoding mismatch between train (2048) and eval.
   From PR openai#714 — produced tightest seed variance in competition.

4. TTT infrastructure: Score-first eval with SGD adaptation on scored
   tokens. FiLM-only TTT planned for Kuda recurrence mode.

All features verified locally: forward/backward, CROWN-Q penalty,
5-expert Hedge mixing, Hedge weight updates, RoPE propagation.
Script now 1,559 lines.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@MatoTeziTanka
Copy link
Copy Markdown

Community Review — Add 11L RotaryFix + LegalTTT + BIGRAM3072 — val_bpb 1.11869 (3-seed m…

BPB: 1.11869 | Compliance: LOOKS CLEAN — score-first-per-chunk TTT (legal #1416/#1423 pattern)

What I found in the code (head SHA 3c4db11fe4d8, file records/track_10min_16mb/2026-03-25_11L_RotaryFix_LegalTTT_BIGRAM3072/train_gpt.py):

The TTT path at line 1100 implements the score-first-per-chunk pattern: each chunk is scored under torch.no_grad() / inference_mode() before the base_model.train() + SGD adaptation runs on that same chunk, with an is_last_chunk guard so the final chunk gets no adaptation pass. This is the structural shape the legal frontier uses (PRs #1416 erichroepke, #1423 aryanbhosale).

Per Issue #402 and Issue #677, TTT is legal when each token is scored before the adapter updates on it, and that's what the code does here — chunk ci is scored under weights adapted only on chunks 0..ci-1. No prequant_ttt_adapt_adamw(val_tokens, ...) multi-epoch fine-tune, no scored-region SLOT, no target-in-key n-gram cache.

CPU smoke test (CT2038 proteus-engine, 2026-04-11): import OK in 0.04s, dim=512, layers=11, vocab=1024, code=93173 B, SMOKE_TEST_PASS

Verdict: LOOKS CLEAN.

Recommendation to @cocohearts @valerio-oai @0hq @yuzhougu-oai @notapplica: MERGE pending standard checks (3-seed validation, 16MB artifact cap, 10-min wallclock on 8×H100 SXM). The compliance picture matches the legal reference frontier and no flags were raised by the classification pass.

Auto-classification caveat: this review was drafted by the AST-based classifier against a template derived from manually-reviewed cluster PRs (#1420, #1450, #1487, #1541, #1529, #1533, #1518). If I've misread a subtlety in your eval path — e.g., multi-epoch TTT that I mistook for single-pass, or a target-in-key lookup I missed in a helper function — please flag it and I'll re-run the audit manually.


Reviewed by @MatoTeziTankaThe Agora. CPU smoke test (CT2038 proteus-engine, 2026-04-11): import OK in 0.04s, dim=512, layers=11, vocab=1024, code=93173 B, SMOKE_TEST_PASS. Classification via deterministic AST-based classify_prs.py (pattern bank derived from ~65 manually-reviewed PRs earlier in the 2026-04-11 sweep). This review was auto-drafted from a template and spot-checked before posting — if the template misread your code, please call it out so I can iterate the classifier.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants