Skip to content

Record: Seed-Regenerated Random Model + Incremental N-gram Cache — val_bpb 0.0905#1095

Draft
vimeto wants to merge 1 commit intoopenai:mainfrom
vimeto:pr/seed-regen-ngram
Draft

Record: Seed-Regenerated Random Model + Incremental N-gram Cache — val_bpb 0.0905#1095
vimeto wants to merge 1 commit intoopenai:mainfrom
vimeto:pr/seed-regen-ngram

Conversation

@vimeto
Copy link
Copy Markdown

@vimeto vimeto commented Mar 29, 2026

Record: Seed-Regenerated Random Model + Incremental N-gram Cache — val_bpb 0.0905

val_bpb = 0.0905 (1 seed, additional seeds pending H100 access) | 15.09 MB | 8xH100 SXM

Results (8xH100 80GB SXM, PyTorch 2.7.1)

Seed step_avg steps neural_bpb blended_bpb Artifact
1337 60ms 9,912 1.503 0.0905 15,093,968
42 pending
2025 pending

Additional seeds pending H100 access.

Key Innovation: Zero-Cost Base Weights

ALL transformer weight matrices use frozen orthogonal random projections regenerated from 8-byte seeds at load time (0 bytes in artifact). Only rank-64 LoRA adapters are stored (3.9 MB). The remaining 11 MB holds an incrementally-built INT16 n-gram cache (orders 2-7, 31B counts, 8-GPU all-reduce synced).

Why orthogonal: Prior work (PR #874) used Gaussian random bases but could not train past 5 layers. Our QR-decomposed orthogonal init preserves singular values = 1.0, enabling stable deep training.

Adapter quantization: Simple INT8 per-row gives quant gap of only +0.003 BPB (vs +0.006 for baseline INT6 GPTQ).

Incremental N-gram Cache (Zero Overhead)

The cache is built during training by calling update_batch_fast() after each microstep (less than 1ms overhead). After training, counts are all-reduced across 8 GPUs and LZMA-compressed into the artifact. At eval, the cache is frozen, no TTT.

We tested pre-filling from training shards at startup: 10x worse (0.996 BPB) due to pre-fill consuming 24-33% of the training budget.

Architecture

5L 512d, 8H/4KV, MLP 3.0, LeakyReLU(0.5) squared, rank-64 LoRA adapters, tied embeddings, vocab 1024

Credits

@vimeto vimeto force-pushed the pr/seed-regen-ngram branch from 776a620 to 38c5e7d Compare March 29, 2026 20:44
@MatoTeziTanka
Copy link
Copy Markdown

Community Review — Record: Seed-Regenerated Random Model + Incremental N-gram Cache — val_bpb 0.0905

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

What I found in the code (head SHA 38c5e7d5c3aa, file records/track_10min_16mb/2026-03-29_SeedRegen_IncrementalNgram/train_gpt.py):

The TTT path at line 1374 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.08s, dim=512, layers=5, vocab=1024, code=103740 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.08s, dim=512, layers=5, vocab=1024, code=103740 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