Written by Gemini 4 Neon at xhigh reasoning effort in PreTrainBench, seed 2

ApexLM-5.4B-A1B: Compute-Optimal Pre-Training of a Fine-Grained Mixture-of-Experts Language Model from Scratch in 24 Hours

Parameters
5.38B
Tokens trained
37.0B
GPU-hours used
352 of 384
Test BPB
0.730
Few-shot benchmarks
36.3

Abstract

We present ApexLM-5.4B-A1B, a 5.38-billion total parameter (1.06-billion active non-embedding parameter) fine-grained Mixture-of-Experts (MoE) language model pre-trained entirely from scratch within a strict 24-hour budget on 16 H100 GPUs. Guided by a systematic, Iso-Time experimental methodology spanning optimizer design, architectural innovations, dense-versus-sparse scaling, tokenizer vocabulary trade-offs, multi-domain data mixing, long-context extension, and multi-branch Model Souping, we identify a high-leverage stack of complementary improvements: (1) a ZeRO-1 FP32-master-weight Muon (NS-5) optimizer with batched per-expert 2D orthogonalization (-0.021 BPB over AdamW at matched wall-clock time), (2) Value Residual Learning (V-Res) (-0.032 BPB), (3) iso-parameter ReLU2 MLPs replacing SwiGLU (-0.022 BPB and +4–11% higher throughput), (4) Headwise Gated Attention (-0.010 BPB pre-cooldown at negligible cost), (5) 32-expert top-4 Fine-Grained MoE with a shared expert and DeepSeek-V3 auxiliary-loss-free load balancing accelerated via native PyTorch torch._grouped_mm (beating matched Iso-Time dense baselines on both held-out BPB and downstream benchmarks), and (6) a two-stage Warmup-Stable-Decay (WSD) curriculum combining 27.84B tokens at 4,096 context with dual complementary 8,192-context RoPE-extended cooldown branches merged via Model Souping (α=0.80).

Certified by untouched /workspace/evaluate.py across 5,104 strictly held-out documents (20.54 MB UTF-8 across 8 diverse domains, truncated up to 18,000 characters), ApexLM-5.4B-A1B achieves 0.7345 micro-BPB, 0.7472 8-domain macro-BPB, and 0.6949 7-domain English macro-BPB—including 0.5051 on multi-language code, 0.6505 on math/arXiv, 0.6693 on 18k-character structured PDFs, 0.6990 on ClimbMix web prose, 0.7520 on Wikipedia, and 0.8560 on unfiltered general web text—while passing 100% lossless round-trip, exact 0.000000 causality, and exact 0.000000 KV-cache equivalence checks. On a full, unsubsampled 10-benchmark downstream base-model suite, it reaches 53.87% core average (60.46% HellaSwag, 77.42% PIQA, 67.17% ARC-Easy, 38.14% ARC-Challenge, 57.54% WinoGrande, 40.00% OpenBookQA, 62.91% BoolQ, 54.53% / 8.30 ppl LAMBADA-OpenAI, 26.69% 0-shot MMLU, and 15.39% 4-shot generative GSM8K).


The agent wrote this paper at the end of its 23.3-hour session, as research_paper.md in its workspace, and it is shown here as written, with its own figures. Every BPB inside it is on the agent's own held-out text. The test BPB and few-shot benchmark score above are PreTrainBench's own, measured after the run; the test BPB is on a private test set the agent never saw.

Final Checkpoint: /workspace/final_model
Compute Budget: 16 × NVIDIA H100 80GB SXM5 (2 nodes, 350 GB/s EFA RDMA), 24-hour wall-clock limit
Total Controlled Experiments: 25 training runs + 10 Stage-2/Soup candidate evaluations + full official certification


1. Motivation & Problem Formulation

Pre-training a capable base language model from scratch under a fixed wall-clock compute budget requires jointly optimizing two tightly coupled objectives:

  1. Minimum UTF-8 Bits-Per-Byte (BPB) on broad held-out text (truncated up to ~18,000 characters): BPB=−∑d∑t=1|d|log2Pθ(xd,t∣BOS,xd,<t)∑dbytesUTF-8(d) Unlike token-level perplexity, BPB is strictly invariant to tokenization granularity and directly measures true lossless compression across arbitrary text distributions (web prose, books/PDFs, code, scientific papers, encyclopedias, and non-English scripts). Moreover, the 18,000-character evaluation cap translates to ~4,000–5,600 BPE tokens: models restricted to 2,048–4,096 context windows suffer sliding-window context truncation on long documents.
  2. Strong general base-model capabilities across commonsense reasoning, world knowledge, reading comprehension, code generation, and mathematical problem solving—suitable for downstream post-training—without training on any benchmark test sets.

Crucially, optimizing exclusively for benchmark-heavy synthetic/educational text severely degrades out-of-distribution BPB on general web text, code, and multilingual text; conversely, optimizing exclusively on unfiltered Common Crawl degrades reasoning and downstream transfer. Furthermore, frontier architectural tricks that improve sample efficiency (Iso-Token) often fail under wall-clock efficiency (Iso-Time) when hardware kernel overhead reduces total tokens processed within 24 hours.

Our research strategy therefore rests on three principles:


2. Experimental Infrastructure & Evaluation Suite

2.1 Hardware Characterization

Our cluster provides two nodes with 8 × NVIDIA H100 80GB HBM3 SXM5 GPUs each (16 GPUs total, 32 CPU cores and 208 GB RAM per node, NV18 NVLink intra-node, AWS p5.48xlarge-class EFA RDMA inter-node) plus a 16-core CPU coordinator. Initial microbenchmarks established:

2.2 Strictly Held-Out 8-Domain BPB Validation Suite

Before downloading any training shards, we reserved the final shard(s) (or official test splits) of eight distinct public corpora, recorded them in /workspace/eval/heldout_shards.json, and enforced strict exclusion throughout our data pipeline. Every document is truncated to at most 18,000 characters, matching the evaluation specification.

Domain Source (Strictly Reserved Held-Out Split) Full Docs Full UTF-8 MB Avg Chars bpe_32k B/tok bpe_65k B/tok
web_general FineWeb 100BT (last shard 014_00009) 862 2.51 2,894 4.305 4.535
web_climbmix ClimbMix (last shard shard_06542) 895 2.50 2,790 4.475 4.693
web_edu FineWeb-Edu 100BT (last shard 013_00009) 578 2.50 4,307 4.457 4.665
wikipedia English Wikipedia 20231101 (shard 40/41) 630 2.50 3,951 3.879 4.110
long_docs FinePDFs eng_Latn (last shard, 6k–18k chars) 225 3.51 15,495 3.953 4.170
code Dolma3 stack_edu (last shard × 10 languages) 856 2.50 2,920 2.989 3.231
math_arxiv FineMath-4+ & Dolma3 rpj-proofpile-arxiv (last shards) 518 2.50 4,820 3.366 3.504
multilingual FineWeb-2 official test splits (fr/de/es/zh/ja/ru/it/pt) 540 2.00 3,121 3.405 3.865
Total / Overall 8 domains (strictly zero training overlap) 5,104 20.54 3,962 3.781 4.031

For rapid mid-training and ablation feedback (2.8 seconds on 16 GPUs), we created a fixed stratified subset val_fast.jsonl (~500 KB per domain, ~4.0 MB total). All final model comparisons and official certifications use the full 20.54 MB suite.

2.3 Downstream Base-Model Evaluation Suite

To measure general base-model capability alongside BPB, we built a distributed evaluator (/workspace/scripts/eval_benchmarks.py) covering 10 standard benchmarks (strictly evaluation splits only; zero benchmark test data in training):


3. Methodology

3.1 Lossless ByteLevel BPE Tokenizer (bpe_65k)

We trained two custom ByteLevel BPE tokenizers (bpe_32k, V=32,768; bpe_65k, V=65,536) on a balanced 766 MB multi-domain sample (disjoint from held-out shards) with:

3.2 Model Architecture (ApexLMForCausalLM)

Our custom self-contained HuggingFace architecture (configuration_apexlm.py, modeling_apexlm.py) unifies dense and sparse MoE configurations behind clean ablation flags:

  1. Pre-RMSNorm GQA Transformer with QK-Norm & RoPE: Per-head RMSNorm on Q and K before RoPE prevents attention logit growth under high-LR Muon training.
  2. Value Residual Learning (V-Res): Layer 0 outputs V0; each deeper layer l≥1 blends Vl←(1−λl)Vl+λlV0 with learnable per-KV-head λl=σ(αl). Because V0 is mixed into Vl prior to KV-cache insertion, V-Res requires zero extra KV-cache memory and is 100% compatible with standard HuggingFace DynamicCache.
  3. Headwise Gated Attention: Following Qiu et al. (NeurIPS 2025), a lightweight projection Wg∈ℝH×nheads gates SDPA outputs via O←O⊙σ(WgRMSNorm(x)) prior to WO, eliminating attention sinks with <0.02% extra parameters and negligible FLOP overhead.
  4. Iso-Parameter ReLU2 FFN: Replaces 3-matrix SwiGLU (SiLU(xWg)⊙xWu→Wd) with 2-matrix squared-ReLU (ReLU(xWu)2→Wd) at 1.5× wider intermediate dimension (exact matched parameters and FLOPs).
  5. Fine-Grained MoE + Shared Expert + Auxiliary-Loss-Free Load Balancing: For layers l≥1 (layer 0 remains dense for early token stabilization), we employ E=32 routed ReLU2 experts with k=4 active per token alongside 1 always-active shared ReLU2 expert. Routing uses a float32 sigmoid gate with DeepSeek-V3 auxiliary-loss-free balancing: expert selection uses si+bi while combining weights use unbiased normalized si, updating zero-centered bi←bi+γ·sign(c¯−ci) across all 16 GPUs (γ=10−3 in Stage 1, γ=0 in Stage 2) alongside a tiny complementary batch balance term (αaux=10−4).
  6. Exact Document-Masked Training & Deterministic Causal Inference: Training packs documents with zero padding waste and passes exact cu_seqlens to FlashAttention-2 flash_attn_varlen_func (masking cross-document labels to -100). To guarantee exact 0.000000 causality diff in BF16 during inference, ApexMoE uses torch.argsort(..., stable=True) and deterministic scatter_ + view(N, top_k, H).sum(dim=1) instead of non-deterministic CUDA atomicAdd (index_add_).

3.3 Distributed ZeRO-1 FP32-Master Hybrid Muon Optimizer

Our HybridMuonOptimizer (/workspace/src/optim.py) combines Muon (NS-5) for all 2D hidden attention/MLP/MoE matrices with fused AdamW for embeddings, lm_head, routers, and 1D norms/scalars:

3.4 Multi-Domain Pre-Training Corpus (66.5B Unique Tokens)

We constructed a 66.5B-token (127.5 GB uint16) domain-partitioned corpus across 11 decontaminated sources (excluding all held-out shards and excluding benchmark-like instruction/FLAN splits from Dolmino): ClimbMix (14.0B), FineWeb general (12.0B), FineWeb-Edu (8.0B), FinePDFs English (6.0B), Dolma3 stack_edu 15-language code (6.0B), clean Dolma3 Dolmino HQ subsets (5.0B: high-quality CC, olmOCR science PDFs, CraneCode, CraneMath, Dolmino-Math), FineMath-3+/4+ & arXiv (4.0B), FineWeb-2 10-language multilingual (4.0B), FinePDFs long documents ≥5,000 chars (3.0B), FinePDFs-Edu (2.5B), and English Wikipedia (2.0B). Domain-partitioned storage enabled rapid mixture ablations and seamless Stage 1 → Stage 2 curriculum shifts without re-tokenizing.


4. Systematic Ablation Studies

All Wave 1–2 ablations used a controlled 197M non-embedding (331M total) dense model (H=1024, L=16, seq=2048, bsz=524k, WSD 15% cosine decay, bpe_65k, ClimbMix) on 4×H100s; Wave 3 scaled to 8×H100s under strict 22.0-minute Iso-Time on the 8-domain mix; Wave 4 ran 20.0-minute Iso-Time ablations on 4×H100s.

4.1 Axis 1: Optimizer & Preconditioning (Wave 1, 1.05B tokens)

Run Optimizer lr_muon / lr_adam Time TF/GPU val_fast Macro-All Macro-Eng ClimbMix Web-Gen Code
exp1a_adamw AdamW (fused) — / 1.5e-3 27.2m 257.3 1.3001 1.1207 0.9305 1.1941 1.3656
exp1b_muon_ns5 Muon (NS-5) 3e-3 / 1.5e-3 28.0m 256.1 1.2838 1.1000 0.9091 1.1726 1.3475
exp1c_muon_pe Muon (Polar Express) 3e-3 / 1.5e-3 28.1m 255.8 1.2840 1.1019 0.9096 1.1738 1.3561
exp1d_normuon_pe NorMuon (Polar Express) 3e-3 / 1.5e-3 27.9m 252.8 1.2865 1.1015 0.9097 1.1733 1.3492

Key Findings:

4.2 Axis 2: Architectural Innovations (Wave 2, 1.05B tokens & Iso-Time)

Run Architectural Variant (on Muon/NorMuon) Tokens Time TF/GPU Step 500 Eng Final Macro-All Final Macro-Eng ClimbMix
exp2a_vanilla Vanilla Qwen3 (QK-Norm + SwiGLU) 1.05B 25.5m 258.8 1.3675 1.3099 1.1222 0.9115
exp1d_normuon_pe + V-Res + Elementwise Gated Attn 1.05B 27.9m 252.8 1.3579 1.2865 1.1015 0.9097
exp2c_resid_lam + V-Res + ElemGate + x0/Resid Lambdas 1.05B 29.7m 236.8 1.3513 1.2747 1.0941 0.9070
exp2b_vres_only + V-Res only (no ElemGate) 1.05B 26.1m 253.6 1.3486 1.2708 1.0906 0.9075
exp2d_relu2 + V-Res + ElemGate + Iso-Param ReLU2 1.05B 27.0m 264.7 1.3075 1.2572 1.0799 0.8979
exp2e_best_combo + V-Res + ReLU2 + Muon NS-5 (no gate) 1.05B 25.3m 265.5 1.3067 1.2583 1.0817 0.8992
exp2h_headgate* + V-Res + ReLU2 + Headwise Gate 0.52B 13.3m 254.7 1.2973 1.3413* 1.1551* 0.9525*
exp2g_mtp* + V-Res + ReLU2 + DeepSeek MTP (d=1) 0.40B 12.8m 200.6 1.2938 1.4250* 1.2222* 0.9957*

*1000-step / 12.8m Iso-Time comparison (exp2h vs exp2g); Step 500 Eng is exact Iso-Token (0.262B tok) across all rows.

Optimizer and Architecture Ablations
Optimizer and Architecture Ablations

Key Findings:

  1. Value Residual Learning (V-Res) is a massive, essentially free win: Alone (exp2b vs exp2a), V-Res cut Macro-All BPB by -0.0391, Macro-Eng by -0.0316, and Code BPB by -0.1278.
  2. Iso-parameter ReLU2 decisively beats SwiGLU: Replacing 3-matrix SwiGLU (I=2816) with 2-matrix ReLU2 (I=4224, exact matched params/FLOPs) improved Macro-All by -0.0293 BPB (1.2572 vs 1.2865), Macro-Eng by -0.0216 BPB, and ran +4–11% faster (265.5 TF/gpu). ReLU2 yields 1.5× wider MLP capacity and pairs naturally with Muon's matrix orthogonalization.
  3. Headwise Gated Attention beats Elementwise Gating and No-Gate: While full Elementwise Gating damped early attention gradients and cost 7% throughput, Headwise Gated Attention (exp2h) achieved 1.2973 at step 500 (-0.0094 better than No-Gate, -0.0102 better than Elementwise) at <0.02% parameter cost.
  4. Residual x0/layer lambdas helped slightly (-0.0074 Eng vs exp1d) but added 6% memory-bandwidth overhead, so we omitted them in favor of V-Res + Headwise Gating.
  5. MTP (Negative Iso-Time Result): DeepSeek-V3 MTP achieved the lowest Iso-Token loss at step 500 (1.2938), but dropped throughput by 21% (200.6 vs 254.7 TF/gpu) due to the second V=65,536 cross-entropy pass—losing badly by +0.0837 BPB in strict 12.8m Iso-Time (1.4250 vs 1.3413). We therefore dropped MTP for our compute-constrained flagship run.

4.3 Axis 3: Dense vs. Fine-Grained MoE (Wave 3, Strict 22m Iso-Time on 8×H100)

We tested Dense vs. Fine-Grained MoE (ReLU2, V-Res, Headwise Gating, Muon NS-5) on our 8-domain mix under strict 22.0-minute Iso-Time (176 H100-minutes per model):

Run Architecture (Active / Total Non-Emb) Tokens Tok / Tot val_fast Macro-All Macro-Eng Code Math MLang Fast 9-Bench Core Avg LAMBADA Acc / PPL
exp4a_dense500m Dense (503M / 503M) 0.88B 1.75× 1.0817 0.9706 0.8618 0.9840 1.8596 37.12%* 23.6% / 88.0
exp4b_moe6x MoE E=64, k=6 (503M / 3.09B) 0.56B 0.18× 1.1148 0.9974 0.9323 1.0089 1.9364 36.60%* 20.0% / 118.0
exp4c_dense_s8 Dense (204M / 204M) 1.77B 8.66× 1.0590 0.9558 0.8324 0.9717 1.7810 41.08% 23.0% / 83.5
exp4d_moe32_s8 MoE E=32, k=4 (132M / 616M) 1.48B 2.40× 1.0510 0.9504 0.8232 0.9642 1.7552 41.26% 27.0% / 70.8

*exp4a/exp4b benchmarked across 8 tasks prior to adding PIQA; exp4c/exp4d benchmarked across all 9 tasks.

Key Findings:

4.4 Axis 4 & 5: Tokenizer Vocabulary Size & Data Mixture (Wave 4, Strict 20m Iso-Time on 4×H100)

Run Tokenizer Data Mixture Tokens Macro-All Macro-Eng ClimbMix Web-Gen Code MLang 9-Bench Core Avg MMLU
exp5a_tok32k bpe_32k 100% ClimbMix 0.79B 1.2629 1.0857 0.9059 1.1692 1.2826 2.5035 40.63% 22.03%
exp5b_tok65k_climb bpe_65k 100% ClimbMix 0.71B 1.2832 1.1016 0.9081 1.1730 1.3536 2.5549 41.21% 24.53%
exp5c_mix_web bpe_65k 50% FineWeb + 50% FW-Edu 0.69B 1.4048 1.2697 1.0415 1.1207 1.9384 2.3508 39.93% 23.53%
exp5d_mix_bal bpe_65k 8-Domain Balanced Mix 0.71B 1.1174 1.0122 0.9708 1.1713 0.9152 1.8544 39.84% 25.72%
MoE and Data Mixture Ablations
MoE and Data Mixture Ablations

Key Findings:


5. Flagship Pre-Training (ApexLM-5.4B-A1B), Context Extension & Model Souping

5.1 Flagship Configuration & Two-Stage WSD Curriculum

Flagship Scaling Curve
Flagship Scaling Curve

5.2 Context Extension Ablation & Multi-Branch Model Souping (Full 20.54 MB Suite)

We evaluated Stage 1, Stage 2A (at both window=4096 and window=8192), within-trajectory SWA (0.25·ckpt1200 + 0.75·ckpt1586), Stage 2B, and five linear Model Soups across all 5,104 full held-out documents and our 9-benchmark fast downstream suite:

Candidate Window Full Macro-All (8) Full Macro-Eng (7) ClimbMix Web-Gen Web-Edu Wiki Long-Docs Code Math MLang Fast 9-Bench Core% HSwag% ARC-C% LAMB%
stage1 (27.84B) 4096 0.8168 0.7509 0.7401 0.9039 0.7718 0.8045 0.7295 0.5907 0.7159 1.2776 50.24 46.80 34.40 46.20
stage2a_w4k (34.49B) 4096 0.7502 0.6975 0.7013 0.8591 0.7350 0.7552 0.6720 0.5071 0.6530 1.1188 52.28 50.80 36.60 52.40
stage2a_w8k (34.49B) 8192 0.7495 0.6968 0.7013 0.8590 0.7350 0.7550 0.6702 0.5059 0.6517 1.1177 52.28 50.80 36.60 52.40
s2a_swa (25/75 traj) 8192 0.7499 0.6972 0.7016 0.8593 0.7352 0.7554 0.6705 0.5062 0.6521 1.1187 52.56 51.60 36.60 53.00
stage2b (30.39B) 8192 0.7659 0.7104 0.7108 0.8673 0.7440 0.7621 0.6878 0.5324 0.6682 1.1548 51.77 51.00 36.80 52.00
soup_80a_20b (★ Final) 8192 0.7472 0.6949 0.6990 0.8560 0.7327 0.7520 0.6693 0.5051 0.6505 1.1131 52.94 51.20 37.40 55.20
soup_70a_30b 8192 0.7475 0.6952 0.6989 0.8558 0.7326 0.7516 0.6699 0.5064 0.6510 1.1137 52.68 50.60 37.40 55.20
soup_65a_35b 8192 0.7479 0.6955 0.6991 0.8558 0.7327 0.7516 0.6705 0.5073 0.6515 1.1146 52.60 50.60 37.40 54.60
soup_50a_50b 8192 0.7499 0.6972 0.7002 0.8567 0.7337 0.7523 0.6728 0.5109 0.6537 1.1191 52.67 52.00 37.60 54.40
soup_swa_80_20 8192 0.7474 0.6951 0.6991 0.8562 0.7328 0.7521 0.6694 0.5054 0.6507 1.1136 52.77 51.00 37.60 54.80
Model Soup Convex Interpolation Curve
Model Soup Convex Interpolation Curve

Remarkable Results:

  1. RoPE Context Extension (4096 → 8192): Holding stage2a weights strictly constant, expanding the scoring window from 4096 to 8192 reduced multi-window splits from 204 documents down to 10 (99.80% single-pass coverage across 5,104 full docs) and improved long_docs (-0.0018), code (-0.0012), math_arxiv (-0.0013), and multilingual (-0.0011) BPB.
  2. Convex Model Soup Victory: Linearly interpolating 0.80 × Stage 2A + 0.20 × Stage 2B (soup_80a_20b) traces a textbook convex U-curve across α∈[0,1] and strictly outperforms BOTH individual cooldown branches on every single one of the 8 held-out BPB domains (macro_all: 0.7495 → 0.7472, macro_eng: 0.6968 → 0.6949, web_general: 0.8590 → 0.8560, multilingual: 1.1177 → 1.1131) while simultaneously boosting 9-benchmark CORE_AVG from 52.28% → 52.94% (+2.80% LAMBADA, +0.80% ARC-C)! Because both branches descend from the same WSD basin (ckpt_013278), linear mode connectivity holds cleanly even across sparse MoE experts and router biases.

6. Final Certified Evaluation (/workspace/final_model)

We exported soup_80a_20b to /workspace/final_model (10.8 GB BF16 safetensors + self-contained HF modeling/config/tokenizer files) and executed full official verification (/workspace/scripts/certify_final_model.py) plus the complete, unsubsampled 10-benchmark downstream suite:

6.1 Submission Compliance & Official /workspace/evaluate.py Results

Evaluation File Status Official BPB Bytes Docs
val_code.jsonl valid: yes 0.5051 2,502,178 856
val_math_arxiv.jsonl valid: yes 0.6505 2,503,441 518
val_long_docs.jsonl (6k–18k char PDFs) valid: yes 0.6693 3,513,100 225
val_web_climbmix.jsonl valid: yes 0.6990 2,500,841 895
val_web_edu.jsonl valid: yes 0.7327 2,502,992 578
val_wikipedia.jsonl valid: yes 0.7520 2,501,337 630
val_web_general.jsonl valid: yes 0.8560 2,510,081 862
val_multilingual.jsonl (8 languages) valid: yes 1.1131 2,004,669 540
val_fast.jsonl (stratified 8-domain mix) valid: yes 0.7391 4,052,980 1,073
Full Suite Aggregates (20.54 MB, 5,104 docs) All Valid 0.6949 Eng / 0.7472 Macro / 0.7345 Micro 20,538,639 5,104

6.2 Full Unsubsampled Downstream Base-Model Benchmarks

Benchmark Split / Protocol Samples (n) Accuracy / Metric
HellaSwag validation, 0-shot norm 10,042 60.46%
PIQA validation, 0-shot norm 1,838 77.42%
ARC-Easy test, 0-shot norm 2,376 67.17%
ARC-Challenge test, 0-shot norm 1,172 38.14%
WinoGrande validation, 0-shot 1,267 57.54%
OpenBookQA test, 0-shot norm 500 40.00%
BoolQ validation, 0-shot 3,270 62.91%
LAMBADA-OpenAI test, 0-shot exact word 5,153 54.53% (PPL 8.30)
MMLU test, 0-shot letter 14,042 26.69%
9-Benchmark Core Average Unweighted mean above 39,660 53.87%
GSM8K test, 4-shot greedy gen 1,319 15.39%

7. Analysis of Unsuccessful Experiments & Engineering Lessons

A major share of our final performance came from diagnosing negative results and subtle systems failure modes early:

  1. Multi-Token Prediction (MTP) Fails in Iso-Time at 1B Scale: While MTP improved Iso-Token English BPB by -0.017 at 0.26B tokens, evaluating a second V=65,536 cross-entropy pass reduced throughput by 21%, causing a +0.084 BPB loss at equal wall-clock time. MTP becomes favorable only when the backbone compute vastly dwarfs the vocabulary head (e.g., 60+ layer frontier models).
  2. Elementwise Gated Attention vs. Headwise Gating: Full H×H elementwise gating underperformed pure V-Res (1.2865 vs 1.2708) and cost 7% throughput because zero-mean sigmoid gating damped early attention updates. Switching to lightweight Headwise Gating captured the sink-free stability benefits at virtually zero compute cost.
  3. Over-Sparse MoE Under-Training (E=64 at Small Token Horizon): In Wave 3A, 64 experts at 0.18 tokens/total-param underfitted relative to dense in Iso-Time. Moving to 32 wider experts (moe_i=1536 at flagship scale, 6.8 tokens/total-param) unlocked both higher hardware MFU and decisive MoE superiority.
  4. Polar Express & NorMuon Cooldown Reversal: Despite leading during the constant-LR phase, Polar Express and NorMuon slightly trailed classic Muon NS-5 after WSD cooldown (1.1015 vs 1.1000), highlighting that optimizer benchmarks must always be evaluated post-annealing.
  5. Systems Pitfalls Caught & Resolved: - torch.compile integer-attribute thrashing: Checking self.layer_idx == 0 inside ApexAttention.forward triggered Dynamo's recompile limit across 24 layers, collapsing throughput to 91 TF/gpu with 6-minute compile times. Replacing it with a boolean is_first_layer and compiling compute-heavy submodules lifted throughput nearly 3× (265 TF/gpu) with <15s compilation. - MoE atomicAdd causality noise: Using index_add_ and unstable argsort in ApexMoE introduced a 1-ULP (1.56e-2) BF16 causality jitter when mutating future tokens. Replacing it with deterministic scatter_ + sum(dim=1) and stable=True during inference achieved exact 0.000000 causality diff. - transformers 5.x meta-device RoPE bug: Non-persistent RoPE buffers initialized during __init__ became NaN when loaded via from_pretrained meta-device materialization. Lazy device-aware RoPE cache construction eliminated this permanently. - Shared-volume refresh & multi-rank remote-code race: Atomic /tmp → rename shard writes with retry loops prevented partial reads during /workspace refreshes, and rank-0 cache barriers eliminated parallel trust_remote_code import races across 8-GPU evaluation workers.

8. Key Findings, Limitations & Future Work

Key Findings

Limitations & Future Work