Parcae: Scaling Laws For Stable Looped Language Models
Organizations: University of California, San Diego · Together AI
Abstract
Traditional fixed-depth architectures scale quality by increasing training FLOPs, typically through increased parameterization, at the expense of a higher memory footprint, or data. A potential alternative is looped architectures, which instead increase FLOPs by sending activations through a block of layers in a loop. While promising, existing recipes for training looped architectures can be unstable, suffering from residual explosion and loss spikes. We address these challenges by recasting looping as a nonlinear time-variant dynamical system over the residual stream. Via a linear approximation to this system, we find that instability occurs in existing looped architectures as a result of large spectral norms in their injection parameters. To address these instability issues, we propose Parcae, a novel stable, looped architecture that constrains the spectral norm of the injection parameters via discretization of a negative diagonal parameterization. As a result, Parcae achieves up to 6.3% lower validation perplexity over prior large-scale looped models. Using our stable looped architecture, we investigate the scaling properties of looping as a medium to improve quality by increasing FLOPs in training and test-time. For training, we derive predictable power laws to scale FLOPs while keeping parameter count fixed. Our initial scaling laws suggest that looping and data should be increased in tandem, given a fixed FLOP budget. At test-time, we find that Parcae can use looping to scale compute, following a predictable, saturating exponential decay. When scaled up to 1.3B parameters, we find that Parcae improves CORE and Core-Extended quality by 2.99 and 1.18 points when compared to strong Transformer baselines under a fixed parameter and data budget, achieving a relative quality of up to 87.5% a Transformer twice the size.
Figures & tables
| Method | LTI Stability | |||
|---|---|---|---|---|
| Addition | marginally-stable | |||
| Concatenation | unstable | |||
| Parcae (ours) | stable |
| Model | Val. | WikiText | Hellaswag | ARC-c | ARC-e | PIQA | BoolQ | SciQ | Avg. | ||
|---|---|---|---|---|---|---|---|---|---|---|---|
| 100M | RDM | 16 | 14.23 | 63.27 | 27.16 | 17.66 | 42.38 | 59.14 | 51.35 | 72.50 | 45.03 |
| Parcae | 16 | 13.59 | 60.33 | 27.18 | 18.09 | 43.10 | 59.30 | 61.83 | 71.50 | 46.83 | |
| 350M | RDM | 8 | 10.76 | 41.31 | 28.55 | 20.90 | 47.26 | 61.75 | 61.53 | 76.70 | 49.45 |
| Parcae | 8 | 10.09 | 37.53 | 29.23 | 21.08 | 48.78 | 62.08 | 60.73 | 78.80 | 50.12 |
| Val Loss ( ) | Core ( ) | Core Ext ( ) | |||||||
|---|---|---|---|---|---|---|---|---|---|
| Configuration | |||||||||
| RDM | Divergent Training | Divergent Training | Divergent Training | ||||||
| + Constrained | 8.99 | 3.15 | 2.97 | ||||||
| + Per-Seq. Sampling | 3.38 | 3.01 | 2.98 | ||||||
| + Prelude Norm | 3.28 | 2.97 | 2.95 | ||||||
| Model | Val. PPL ( ) | Lambada PPL ( ) | Core ( ) | Core-Extended ( ) | ||
|---|---|---|---|---|---|---|
| 140M | Transformer | – | 21.48 | 127.39 | 13.00 ± 0.15 | 8.80 ± 0.21 |
| Parcae | 8 | 19.06 | 80.64 | 14.04 ± 0.20 | 9.67 ± 0.28 | |
| 370M | Transformer | – | 15.79 | 40.77 | 17.46 ± 0.03 | 11.71 ± 0.22 |
| Parcae | 8 | 14.49 | 32.74 | 20.00 ± 0.06 | 12.75 ± 0.31 | |
| 770M | Transformer | – | 13.08 | 22.37 | 22.42 ± 0.20 | 14.20 ± 0.63 |
| Parcae | 8 | 12.49 | 19.71 | 25.07 ± 0.33 | 15.19 ± 0.43 |
Appendix figures & tables34 assets
Supplementary material from the paper’s appendix.
Appendix
| Notation | Description | |
|---|---|---|
| Embedding dimension of the model | ||
| Discrete temporal state axis of on | ||
| Global batch size used during pretraining | ||
| Initial prelude block of a recurrent architecture | ||
| Middle recurrent block of a recurrent architecture | ||
| Final coda block of a recurrent architecture |
| Method | T=1 | T=4 | T=8 | T=16 | |
|---|---|---|---|---|---|
| 100M | Per-Batch | 300.32 | 36.75 | 16.65 | 13.81 |
| Per-Sequence | 70.47 | 17.15 | 14.08 | 13.59 | |
| 350M | Per-Batch | 167.61 | 12.80 | 10.40 | 10.24 |
| Per-Sequence | 17.92 | 10.49 | 10.09 | 10.11 |
| Val Loss | 2.477 | 2.453 | 2.456 | 2.457 | 2.458 | 2.458 |
| Val Perplexity | 11.906 | 11.624 | 11.665 | 11.671 | 11.692 | 11.687 |
| Val Loss | 2.500 | 2.490 | 2.480 | 2.479 | 2.474 |
| Val Perplexity | 12.09 | 12.06 | 11.94 | 11.93 | 11.86 |
| Model | Huber ( ) | |||||
|---|---|---|---|---|---|---|
| Small (140M) | 2.662 | 522733.307 | 0.771 | 25420.102 | 0.525 | 0.44 |
| Medium (370M) | 2.439 | 832134.346 | 0.775 | 6386.865 | 0.448 | 0.01 |
| In-Distribution | ||||
|---|---|---|---|---|
| 140M | 2.52 | 5.42 | 11.11 | 112.89 |
| 370M | 1.88 | 5.26 | 10.77 | 104.95 |
| Extrapolation ( ) | ||||
| 140M | 3.18 | 21.41 | 43.99 | 397.90 |
| 370M | 2.29 | 18.51 | 38.68 | 369.83 |
| Model | Mean % Err | Max % Err |
|---|---|---|
| 140M | 0.16% | 0.59% |
| 370M | 0.05% | 0.22% |
| ( ) | (no ) | ||
|---|---|---|---|
| Train (isoFLOP) | |||
| 140M | 0.001116 | 0.001177 | 0.003253 |
| 370M | 0.000229 | 0.000283 | 0.001438 |
| Test (held-out, ) | |||
| 140M | 0.000207 | 0.000212 | 0.000266 |
| 370M | 0.000133 | 0.000131 | 0.000189 |
| Category | Task | Type | Shots | Core |
|---|---|---|---|---|
| Understanding | HellaSwag [ 88 ] (0-shot) | MC | 0 | ✓ |
| HellaSwag [ 88 ] (10-shot) | MC | 10 | ✓ | |
| Lambada [ 58 ] | LM | 0 | ✓ | |
| Winograd WSC [ 9 ] | S | 0 | ✓ | |
| WinoGrande [ 66 ] | S | 0 | ✓ | |
| BIG-Bench Language ID [ 72 ] | MC | 10 | ✓ |
| FLOPs | Optimal | Fixed-Depth ( ) | ||||
| ( ) | Core | Core Ext. | Core | Core Ext. | ||
| 140M | 2 | |||||
| 2 | ||||||
| 4 | ||||||
| 6 | ||||||
| 8 | ||||||
| Parcae-100M | Parcae-350M | RDM-100M | RDM-350M | |
| Parameters | 114,242,560 | 378,558,464 | 114,242,560 | 382,765,056 |
| Layers in | 1 | 1 | 1 | 1 |
| Layers in | 1 | 1 | 1 | 1 |
| Layers in | 1 | 2 | 1 | 2 |
| 1,024 | 2,048 | 1,024 | 2,048 | |
| 3,520 | 7,040 | 3,520 | 7,040 |
| Small (140M) | Medium (370M) | Large (770M) | XLarge (1.3B) | ||
| Architecture | Layers (Transformer) | 6 | 12 | 18 | 24 |
| Layers in (Parcae) | 2 | 4 | 6 | 8 | |
| Layers in (Parcae) | 2 | 4 | 6 | 8 | |
| Layers in (Parcae) | 2 | 4 | 6 | 8 | |
| 768 | 1,024 | 1,280 | 1,536 | ||
| 3,072 | 4,096 | 5,120 | 6,144 |
| Small (140M) | Medium (370M) | Large (770M) | XLarge (1.3B) | |
|---|---|---|---|---|
| Transformer Parameters | 143,141,184 | 385,903,104 | 773,375,040 | 1,333,868,544 |
| Parcae Parameters | 144,323,136 | 388,003,328 | 776,655,680 | 1,338,591,744 |
| Additional Parameters | 1,181,952 | 2,100,224 | 3,280,640 | 4,723,200 |
| Additional (%) | 0.83% | 0.54% | 0.42% | 0.35% |
| Optimizer | Parameters |
|---|---|
| AdamW [ 43 ] | Token embeddings ( wte ) |
| LM head ( lm_head ) | |
| Normalization layers ( RMSNorm ) | |
| Value embedding gates ( ve_gate ) | |
| All 1D parameters | |
| AdamW [ 43 ] (Parcae only) | Injection parameters ( , , ) |
| Small (140M) | Medium (370M) | Large (770M) | XLarge (1.3B) | |
| Training Tokens | 11.2B | 29.6B | 61.6B | 104B |
| Batch Size (sequences) | 256 | 256 | 256 | 256 |
| Sequence Length | 2,048 | 2,048 | 2,048 | 2,048 |
| Precision | bf16-mixed | |||
| AdamW LR | ||||
| AdamW | ||||
| Tokenizer | Vocab Size | Bytes/Token | |
|---|---|---|---|
| Train | Val | ||
| GPT-2 ( gpt2 ) | 50,257 | 4.67 | 4.63 |
| GPT-4 ( cl100k ) | 100,277 | 4.81 | 4.76 |
| Ours | 32,768 | 4.72 | 4.65 |