Explore the research collection
3 entries · Follow this search
- Paper
Library of Layers (LoL): Adaptively Ordering Transformer Layers at Runtime
Every production transformer executes its layers in one fixed order; programs, by contrast, chain the same primitives (conditionals, loops) in different orders per algorithm. Library of Layers (LoL) gives the model a single global library of transformer blocks plus a router that dynamically ORDERS them at inference time for the problem at hand. The architecture has essentially one hyperparameter - the library size - which sweeps a continuum: a small library forces heavy block reuse (depth recurrence / looping), a large library with a subset active per step behaves like sparsity (MoE), and the endpoints recover dense and depth-recurrent designs, so the authors frame LoL as one family generalizing the parameter-efficiency and FLOPs-efficiency trade-offs of all three. Results are parity results, not wins: pretrained on text (FineWeb), LoL is competitive with dense, depth-recurrent, and MoE baselines - main experiments at 360M parameters (GPT-2-Medium shape modernized with RoPE, RMSNorm, SwiGLU, bias-free attention; a 1B variant follows the Llama-3.2-1B shape), and on lm-evaluation-harness benchmarks (ARC-Easy/Challenge, HellaSwag, PIQA, GSM8K) all models sit within 2 standard errors of each other, except the vanilla full-attention model scoring notably lower on ARC-Easy. The distinctive evidence is behavioral: on synthetic sudoku and maze tasks the model uses DISTINCT layer orderings to implement different solution strategies, and the routing can be intervened on to force a chosen strategy onto a given problem instance - the ordering is a controllable computational graph, not just a learned permutation. In a multilingual setting the chosen order patterns differ systematically by language and script. And when LoL is trained on safety data, simple probes fitted to the ROUTER's outputs distinguish safe from unsafe text with high AUROC (the exact figure was not extractable from the HTML full text at catalog time) - the routing decisions themselves carry a readable signal about the input. Caveats: 360M-1B scale throughout; headline text results are parity within noise rather than improvements; the strategy evidence is on synthetic toy tasks, not natural reasoning; runtime reordering costs and behavior at frontier scale are untested. In the catalog's looped-models cluster, LoL is the generalization at the end of the line: a fixed loop is LoL with a one-block library and a hard-coded cyclic order, and MoE is the same routing idea applied across width instead of depth order - LoL routes over both WHICH blocks and IN WHAT SEQUENCE. The intervenable routing and probe-able router state are also the monitoring angle: layer-order choices are an observable, steerable intermediate that fixed-order models do not expose.
- Paper
The Role of Quantization in Loss Spikes
Why do some pretraining runs look healthy for most of training and then diverge irreversibly? The paper names these delayed, terminal divergences time-bomb spikes and traces them to finite precision in the LM head. Mechanism: the cross-entropy gradient over the LM head is zero-sum along the vocabulary axis, but Adam's coordinate-wise preconditioning breaks that structure, inducing persistent drift in the mean output embedding and hence growth in output logit magnitude. In exact arithmetic that drift is harmless (a constant logit shift leaves softmax and its gradients unchanged), but in finite precision a large logit scale degrades how precisely the logit differences that determine the predictive distribution can be represented - measured directly, LM-head quantization error (RMS difference between native BF16 logits and FP32 logits recomputed from the same hidden states, plus the KL between the two predictive distributions) grows by orders of magnitude before each failure, and loss diverges soon after. Evidence (JAX/Flax modernized GPT-2 with QK-Norm, FineWeb, elevated learning rates, models 28M-1.4B): 404M models overtrained on 96B tokens (~12x Chinchilla) sit on near-identical loss curves until the higher-LR run time-bombs with accelerating logit growth; 28M models overtrained ~28x Chinchilla (16B tokens, five seeds) fail in strict precision order - BF16-true (weights and optimizer states stored in BF16) first, BF16-mixed later, FP32 LM head stable across the whole horizon - while logit norm grows under every AdamW baseline including FP32, so drift alone does not destabilize; precision decides whether drift becomes error. Mitigation: replace AdamW with SGD with momentum (momentum 0.99, separately tuned head LR) on the LM head only - SGD-M preserves the zero-sum gradient structure, keeps logit norm and quantization error nearly flat, prevents time-bombs even in BF16, stays competitive on final loss across the 404M LR sweep, and stores one fewer optimizer buffer; raising the head's AdamW beta1 to 0.99 closes much of the gap but still diverges at the largest trunk LR. Unifying result: z-loss, mu-centering, higher head precision, and SGD-M all prevent time-bombs and all keep quantization error bounded, suggesting suppressed finite-precision error is the shared mechanism behind previously unrelated mitigations. Costs: an FP32 LM head is the direct fix but the head GEMM is among the largest in the model and FP32 logits double the largest activation tensor; the optimizer-side mitigations keep BF16 and add little overhead. Caveats: demonstrated at 28M-404M scale in the overtraining regime with deliberately elevated LRs, not at frontier scale; fast transient spikes are a separate phenomenon, largely suppressed by learnable RMSNorm gains. Joins the catalog's precision thread as its loss-spike mechanism paper: LM-head quantization error is a measurable leading indicator that rises before the spike (a per-checkpoint series in the same family as the logit-margin signal), complementing the checkpoint-level spike-risk screen and the logit-growth mitigations already cataloged. Enrichment (2026-11-03, from senior author Micah Goldblum's launch thread for the paper's v2, revised 29 Oct 2026; project led by first author Zaiqian Chen): the thread's seed-averaged figures (n=5) put a concrete number on the at-horizon gap the abstract describes qualitatively - by 120k steps the AdamW baseline's logit quantization error climbs to roughly 1e0, while LM-head SGD-M holds it near 1e-2 to 1e-3, a two-to-three-orders-of-magnitude separation at the point where the baseline time-bombs; the same figures show the AdamW output-logit norm growing from about 1e6 to above 1e7 over 600k steps while the SGD-M curve stays flat. The thread also states the unification explicitly as the paper's moral: z-loss (acts on the loss), mu-centering (acts on the embeddings), and LM-head SGD-M (acts on the optimizer) are three intervention points on one principle - keep the LM head in the regime where BF16 arithmetic stays stable. Third-share thread additions (Dolatabadi explainer thread, via @miyashita_03, 2026-11-05): the delayed spike is framed as a time bomb set by absolute logit scale - a rare token whose LM-head row has a large norm produces logits around ~128, a magnitude where bf16 rounding misassigns probability mass; a small model spiked 3x after ~150B tokens and a larger one jumped from 2.9 to ~10 with benchmark forgetting. Raising peak LR reproduces the spike more strongly than widening the precision range does. Scope flag from the thread: the long runs are 28M and 404M models with no weight decay and learning rates chosen to provoke instability, so the mechanism explains a specific failure class rather than loss spikes in general. The share's framing (Miyashita): softmax is shift-invariant, so a shared logit offset cancels out - the damage is per-logit rounding at large magnitudes. The thread closes with an open question, flagged as the author's speculation: whether Muon-style momentum could serve as the LM-head optimizer in SGD-M's place.
- Paper
Understanding Reasoning from Pretraining to Post-Training
Studies how pretraining choices shape the returns to RL post-training and what RL actually does to the model, using chess as a controlled testbed. Language models from 5M to 1B parameters are pretrained on human chess games, supervised fine-tuned on synthetic reasoning traces, then RL-trained on chess puzzles with verifiable rewards. Post-RL performance at a given RL compute level is well-predicted from pretraining loss, and RL reward-curve slopes improve approximately linearly with pretraining tokens.