Introduction
Foundation models need to support different compute budgets for different tasks and deployment platforms. Elastic training answers this need by optimizing several nested sub-networks inside one shared parameter set: slimmable networks and Once-for-All established the idea for vision models [42 , 4 ] , MatFormer nests the FFN width of a transformer and underlies released on-device models [13 ] (Devvrit et al. 2024), and Flextron and Nemotron Elastic make pretrained LLMs elastic by post-training [5 , 35 ] .
Three problems remain when the elastic training recipe is carried into foundation-model pretraining.
Scalability. Standard recipes sample one or a few sub-networks per step [41 ] (Devvrit et al. 2024), so the computation graph, the parameter access pattern and the workload change from step to step; under parameter sharding this variability complicates activation memory, recomputation and distributed scheduling, the very machinery that large-scale pretraining depends on. Training all sub-networks at every step fixes the workload but needs a forward and backward pass per sub-network, so the cost grows with the family size and erodes the saving that motivates elastic training. Transferability. Hyperparameters (HPs) tuned at one model size need not remain effective at another, and repeating the search over learning rate, initialization scale and weight decay at every target scale cancels the compute that elastic training saves. Maximal update parameterization transfers HPs across widths for independently trained models [38 ] ; elastic models add two questions: can HPs tuned on a non-elastic proxy serve an entire elastic family, and can those tuned on a smaller elastic family serve a larger one? We refer to these two forms of transfer as μ \mu μ -Transfer for elastic models and seek one scaling rule that delivers both under parameter sharing.
Simultaneous maximal updates. Existing elastic training recipes do not generally ensure maximal updates for all sub-networks simultaneously.1 Without width-dependent scaling, HPs that yield well-scaled feature updates in one sub-network make updates vanish or blow up in another, and re-tuning one global value only trades one width against another, so some widths stay mis-scaled. The requirement is therefore a shared parameterization that keeps every width maximally updated simultaneously despite parameter sharing; we call this property μ \mu μ -Internal for elastic models.
We address the first problem with a new architecture, SHELLELASTIC , and the other two with μ \mu μ -ELASTIC . SHELLELASTIC (Figure 1 ) partitions the residual stream into a dense core followed by ordered shells, each a multiple of a base width g g g , and each supported sub-network is the core plus a prefix of the shells. Every hidden matrix is block lower triangular: a shell reads the core, the earlier shells and itself, but never a later shell. Trunk normalization acts within each group, attention heads align with the group boundaries, and every supported width has its own readout. One full-width forward pass therefore contains the exact hidden states of every sub-network as prefixes (Proposition 1), and the per-step compute stays close to that of a single full-width pass however many sub-networks are trained, so every step has a fixed workload, as in non-elastic training.
Figure 1. Core and shells of SHELLELASTIC preserve supported prefixes. (a) Each colored block row produces output group G k \mathcal{G}_k G k from the input prefix ending at s k g s_k g s k g . Group G 1 \mathcal{G}_1 G 1 is the dense core; subsequent groups are shells. (b) N k N_k N k normalizes group G k \mathcal{G}_k G k using its own statistics.
μ \mu μ -ELASTIC (Figure 2 ) extends maximal update parameterization (μ \mu μ P) [38 ] to elastic models with two factors: a μ \mu μ -Transfer factor m = g / d 0 m = g/d_0 m = g / d 0 that carries HPs from a non-elastic proxy of width d 0 d_0 d 0 to base width g g g , and a μ \mu μ -Internal factor for the different widths inside one shared model. Every group reads the same input coordinates in every sub-network that contains it, so we set its initialization, learning rate and weight decay from this fan-in, while each readout uses its own input width (Table 1 ). This keeps every group maximally updated in all sub-networks at once (Theorem 1), which uniform scaling across groups cannot do in general (Proposition 2). The same two factors apply to MatFormer and to fully elastic models (Appendix § 12 ).
Table 1. μ \mu μ -ELASTIC for SHELLELASTIC . Scaling rules set by the μ \mu μ -Transfer factor m m m , the μ \mu μ -Internal factor s s s (Equation (7) ), and the FFN expansion e = D f f n / D m o d e l e = D_{\mathrm{ffn}}/D_{\mathrm{model}} e = D ffn / D model ; s s s is the output group’s supported boundary for hidden weights and the sub-network width index for readouts. Initialization gives nominal weight standard deviations, or initial values for gains and scalars.
Figure 2. Overview of μ-ELASTIC. The ratio q = m ⋅ s q = m \cdot s q = m ⋅ s of Equation (7) scales the HPs of every group and readout. (a) μ-Transfer: the ( σ 0 , η 0 , λ 0 ) (\sigma_0, \eta_0, \lambda_0) ( σ 0 , η 0 , λ 0 ) tuned on the proxy are reused (i) for an elastic supernet and (ii) for a wider one with more shells (Corollary 1). (b) μ-Internal: block row W k W_k W k has fan-in s k g s_k g s k g in every sub-network that contains it, so q = m s k q = m s_k q = m s k keeps it maximally updated in all of them (Theorem 1). The bars show each group’s pre-activation size at initialization and update size: with the proxy’s ( σ 0 , η 0 ) (\sigma_0, \eta_0) ( σ 0 , η 0 ) , as under SP, all groups, even the core, exceed the proxy by q \sqrt{q} q and q q q , so no shared value fixes them all (Proposition 2); under μ-ELASTIC, all match it.
Our main contributions are summarized as follows:
Scalable elastic architecture. We propose SHELLELASTIC , an elastic transformer whose single full-width forward pass yields the exact hidden states of every sub-network as prefixes, so every step has a fixed workload rather than a varying one.
μ \mu μ -ELASTIC parameterization. We introduce μ \mu μ -ELASTIC , which transfers HPs from a non-elastic proxy to an elastic model and from smaller to larger elastic models (μ \mu μ -Transfer), and keeps all sub-networks of a supernet maximally updated at once (μ \mu μ -Internal).
Theoretical and empirical validation. We prove that μ \mu μ -ELASTIC keeps all sub-networks maximally updated at both levels of transfer; sweeps confirm that transferred HPs stay near-optimal and that μ \mu μ -ELASTIC beats the standard parameterization on every elastic family.
Comprehensive ablation studies. We search architectures at equal parameters and ablate sub-network selection, loss weights, normalization scope, readout design, in-place distillation, sub-network ensembles and stage-residual gradient scaling for elastic pretraining.
Related Work
Elastic models. Elastic models train several nested sub-networks in one shared parameter set, so one run serves many inference budgets [42 , 4 ] (Devvrit et al. 2024). Slimmable networks train one convolutional network at several widths [42 , 41 ] . Once-for-All also nests depth, kernel size and resolution [4 ] , and the same idea has been applied to the width and depth of BERT [8 , 19 ] and to output representations ([22 ] ); these recipes train the sub-networks jointly or by sampling, usually with distillation from the largest one ([17 ] ). For decoder-only transformers ([37 ] ), MatFormer ((Devvrit et al., 2024)) nests only the FFN hidden width and underlies released on-device models [13 ] , while Flextron and Nemotron Elastic extract nested sub-networks from a pretrained model ([5 , 35 ] ). The concurrent StairFormer ([36 ] ) nests every smaller model as a prefix of one forward pass and instantiates this nesting with equal-width blocks; in its experiments, it trails dense models of the same size at every budget but supports a wider range of usable budgets than MatFormer. SHELLELASTIC uses the same prefix structure but chooses the supported widths, which set the core and shell sizes, and normalizes within groups instead of over cumulative prefixes. No existing work derives how HPs should scale across nested widths or keeps every sub-network maximally updated.
HP transfer and μ \mu μ -parameterization. Tuning HPs such as the learning rate and initialization is expensive at scale, and under the standard parameterization ([33 ] ) their optima drift with width, so a small model cannot stand in for a large one ([38 ] ). Scaling HPs with model size removes this drift, so values tuned on a small proxy transfer zero-shot ([38 , 10 ] ). Building on infinite-width theory ([20 , 25 ] ), Yang & Hu (2021) identified μ \mu μ P, a parameterization that gives every layer maximal Θ ( 1 ) \Theta(1) Θ ( 1 ) feature updates as width grows, and Yang et al. [38 ] turned it into a transfer rule for initialization, learning rate and multipliers. CompleteP extends the rule across depth for pre-norm transformers ([40 , 3 , 10 ] ), and Mlodozeniec et al. [26 ] add batch size and token budget. Everett et al. [12 ] derive per-layer learning-rate exponents across parameterizations and optimizers, including Adam, and find that HP transfer is not limited to μ \mu μ P; Table 1 follows their scaling rules. These rules assume separately trained models, where each tensor has one fan-in; μ \mu μ -ELASTIC extends them to the shared tensors of an elastic supernet.
Method
In the SHELLELASTIC architecture, all sub-networks reuse hidden-state prefixes from one full-width trunk pass; μ \mu μ -ELASTIC, a parameterization based on each weight’s active input width, enables reuse of base optimization settings across model sizes.
The SHELLELASTIC architecture
Core, shells, and supported widths. We organize hidden dimensions into a dense core followed by successive shells (Figure 1 ). For base width g g g , choose supported sub-network width indices
S = { s 1 < ⋯ < s K = M } ⊆ { 1 , … , M } , D m o d e l ( s ) = s g , D m o d e l = M g . (1) \mathcal{S} = \{s_1 < \cdots< s_K = M\} \subseteq\{1,\ldots,M\}, \qquad D_{\mathrm{model}}^{(s)} = s g, \qquad D_{\mathrm{model}} = M g. \tag*{(1)} S = { s 1 < ⋯ < s K = M } ⊆ { 1 , … , M } , D model ( s ) = s g , D model = M g . (1)
With s 0 = 0 s_0 = 0 s 0 = 0 , these boundaries define contiguous groups G k = { s k − 1 g + 1 , … , s k g } \mathcal{G}_k = \{s_{k-1}g + 1,\ldots,s_kg\} G k = { s k − 1 g + 1 , … , s k g } of size ( s k − s k − 1 ) g (s_k - s_{k-1})g ( s k − s k − 1 ) g . The core is G 1 \mathcal{G}_1 G 1 , and the shells are G 2 , … , G K \mathcal{G}_2,\ldots,\mathcal{G}_K G 2 , … , G K . Sub-network s k s_k s k contains the first k k k groups.
Projections and normalization. Write a token’s hidden state as a row vector x x x , with x : d x_{:d} x : d denoting its first d d d dimensions. A square projection is y = x W T y = xW^{\mathsf{T}} y = x W T , where W ∈ R D m o d e l × D m o d e l W \in\mathbb{R}^{D_{\mathrm{model}}\times D_{\mathrm{model}}} W ∈ R D model × D model . For output group k k k , the block row W k ∈ R ∣ G k ∣ × s k g W_k \in\mathbb{R}^{|G_k|\times skg} W k ∈ R ∣ G k ∣ × s k g reads only the first s k g skg s k g input dimensions:
y G k = x : s k g W k T . (2) y_{G_k} = x_{:skg}W_k^{\mathsf{T}}. \tag*{(2)} y G k = x : s k g W k T . (2)
This makes W W W block lower triangular at the group boundaries (Figure 1 a).
Group-local normalization uses a separate operator N k N_k N k and statistics within each group (Figure 1 b). For RMSNorm (Zhang & Sennrich [44 ] ):
[ N k ( x G k ) ] j = a j x j ∣ G k ∣ − 1 ∑ u ∈ G k x u 2 + ϵ N , j ∈ G k . (3) \left[N_k(x_{G_k})\right]_j = a_j \frac{x_j}{\sqrt{|G_k|^{-1}\sum_{u\in G_k}x_u^2+\epsilon_N}}, \qquad j\in G_k. \tag*{(3)} [ N k ( x G k ) ] j = a j ∣ G k ∣ − 1 ∑ u ∈ G k x u 2 + ϵ N x j , j ∈ G k . (3)
Here a j a_j a j is a learned gain and ϵ N > 0 \epsilon_N > 0 ϵ N > 0 is a numerical stabilizer. The combined normalization satisfies N ( x ) G k = N k ( x G k ) N(x)_{G_k}=N_k(x_{G_k}) N ( x ) G k = N k ( x G k ) . Both operations preserve prefixes ending at the boundaries in S S S . Cuts within a group generally change the retained outputs, so sub-networks can be extracted only at these boundaries. Thus, S S S determines the block-triangular pattern of every projection, the normalization groups, and the available sub-network widths.
Attention and FFN. Both branches (Figure 7 in Appendix § 9 ) use the group-local normalization of Equation (3) as their pre-norm. Attention is elastic in its number of heads: sub-network s s s uses the first D m o d e l ( s ) / d h e a d = s g / d h e a d D_{\mathrm{model}}^{(s)}/d_{\mathrm{head}}=sg/d_{\mathrm{head}} D model ( s ) / d head = s g / d head heads, keeping the head dimension d h e a d d_{\mathrm{head}} d head fixed. We require g g g to be a multiple of d h e a d d_{\mathrm{head}} d head so that supported widths retain complete heads. The query, key, value, gate, and output projections follow Equation (2) ; they constrain dependencies among hidden dimensions before and after attention. Query/key normalization and rotary position transformations (Su et al. [34 ] ) act within each head. Each active head a a a performs causal self-attention:
Figure 7. Prefix-preserving attention and FFN. Sub-network s s s uses the first s g / d h e a d sg/d_{\mathrm{head}} s g / d head attention heads. The FFN’s up, gate, and down projections expand and contract the same groups.
Attn ( x ) = [ concat a ( softmax ( Q a K a T d h e a d + C ) V a ) ⊙ sigmoid ( x W G T ) ] W O T , (4) \operatorname{Attn}(x)=\left[\operatorname{concat}_a\left(\operatorname{softmax}\left(\frac{Q_aK_a^{\mathsf{T}}}{\sqrt{d_{\mathrm{head}}}}+C\right)V_a\right)\odot\operatorname{sigmoid}(xW_G^{\mathsf{T}})\right]W_O^{\mathsf{T}}, \tag*{(4)} Attn ( x ) = [ concat a ( softmax ( d head Q a K a T + C ) V a ) ⊙ sigmoid ( x W G T ) ] W O T , (4)
where C C C is the causal mask, Q a Q_a Q a , K a K_a K a , V a V_a V a come from the corresponding projections of x x x and concatenation runs over the active heads. Adding heads leaves earlier heads’ attention outputs unchanged; the structured output projection then preserves the supported hidden-state prefixes.
We use a SwiGLU FFN (Shazeer [32 ] ) with expansion e = D f f n / D m o d e l e = D_{\mathrm{ffn}}/D_{\mathrm{model}} e = D ffn / D model and integer base FFN width e g eg e g , so sub-network s s s has D f f n ( s ) = e D m o d e l ( s ) D_{\mathrm{ffn}}^{(s)}=eD_{\mathrm{model}}^{(s)} D ffn ( s ) = e D model ( s ) . All three maps use the same group dependency pattern. The up and gate weights have shape D f f n × D m o d e l D_{\mathrm{ffn}}\times D_{\mathrm{model}} D ffn × D model , with group boundaries s k g s_kg s k g on the input axis and e s k g es_kg e s k g on the output axis. The down weight has shape D m o d e l × D f f n D_{\mathrm{model}}\times D_{\mathrm{ffn}} D model × D ffn . The FFN computes
FFN ( x ) = [ SiLU ( x W 1 T ) ⊙ ( x W 3 T ) ] W 2 T . (5) \operatorname{FFN}(x)=\left[\operatorname{SiLU}(xW_1^{\mathsf{T}})\odot(xW_3^{\mathsf{T}})\right]W_2^{\mathsf{T}}. \tag*{(5)} FFN ( x ) = [ SiLU ( x W 1 T ) ⊙ ( x W 3 T ) ] W 2 T . (5)
Elementwise operations and residual additions preserve the same prefixes.
Embedding and readout. Sub-network s s s uses s g sg s g -dimensional token embeddings and computes its logits from the first s g sg s g dimensions of the L L L -layer trunk output x ( L ) x^{(L)} x ( L ) :
z s = α s N s o u t ( x : s g ( L ) ) U s T , s ∈ S . (6) z_s=\alpha_sN_s^{\mathrm{out}}(x_{:sg}^{(L)})U_s^{\mathsf{T}}, \qquad s\in S. \tag*{(6)} z s = α s N s out ( x : s g ( L ) ) U s T , s ∈ S . (6)
Here α s \alpha_s α s is a learned logit scale, N s o u t N_s^{\mathrm{out}} N s out normalizes over all s g sg s g selected dimensions, and U s ∈ R V × s g U_s\in\mathbb{R}^{V\times sg} U s ∈ R V × s g is the readout matrix for a vocabulary of size V V V . Figure 6 in Appendix § 9 shows the complete model.
Figure 6. The complete SHELLELASTIC model. Embedding, one attention–FFN layer repeated L L L times, and the terminal norm and readout of the selected width. Group-local branch normalization and structured projections preserve every supported prefix through the trunk.
Proposition 1 (Exact reuse at supported widths). For fixed model parameters, let E s E_s E s be the first s g sg s g columns of the full-width embedding table, T s T_s T s the L L L -layer trunk restricted to width s g sg s g , and P s P_s P s the operator selecting the first s g sg s g hidden dimensions. For any token sequence u u u , evaluating sub-network s s s directly gives the same hidden states as extracting its prefix from sub-network t t t :
T s ( E s [ u ] ) = P s ( T t ( E t [ u ] ) ) , s , t ∈ S , s ≤ t . T_s(E_s[u]) = P_s(T_t(E_t[u])), \qquad s,t \in\mathcal{S}, \quad s \le t. T s ( E s [ u ]) = P s ( T t ( E t [ u ])) , s , t ∈ S , s ≤ t . Applying sub-network s s s ’s normalization and readout (Equation (6) ) to either result gives identical logits. Thus, one full-width trunk evaluation yields the same joint loss and parameter gradients as separate evaluations of all supported sub-networks. Appendix § 10 proves the result by composing the prefix-preserving trunk operations across the L L L layers.
mu-Elastic: parameterizing elastic models
We introduce μ-ELASTIC to address the two optimization requirements (Figure 2 ): transferring HPs from a non-elastic proxy to an elastic family and between elastic model sizes (μ-Transfer), and maintaining maximal updates across sub-networks within each shared model (μ-Internal).
Composing transfer and internal scaling. Let a non-elastic proxy of width d 0 d_0 d 0 supply the base initialization scale σ 0 \sigma_0 σ 0 , base learning rate η 0 \eta_0 η 0 , and weight decay λ 0 \lambda_0 λ 0 . For base width g g g , define
m = g d 0 , q ( s ) = m ⏟ μ-Transfer ⋅ s ⏟ μ-Internal = s g d 0 , s ∈ S . (7) m = \frac{g}{d_0}, \qquad q(s) = \underbrace{m}_{\text{μ-Transfer}} \cdot\underbrace{s}_{\text{μ-Internal}} = \frac{sg}{d_0}, \qquad s \in\mathcal{S}. \tag*{(7)} m = d 0 g , q ( s ) = μ-Transfer m ⋅ μ-Internal s = d 0 s g , s ∈ S . (7)
For a hidden weight, s s s is the supported boundary of its output group, whose input width stays s g sg s g (e s g esg es g for an FFN down projection) in every sub-network that contains it, so one rule based on q ( s ) q(s) q ( s ) serves all of them. The readout of sub-network s s s uses the same ratio.
Parameterization and optimization rules. Table 1 summarizes initialization, learning rate, weight decay, and forward multipliers by active input width for AdamW [21 , 24 ] , following the per-layer scaling of Everett et al. [12 ] . Width is the only elastic axis, since all sub-networks share the depth L L L , minibatches and number of training steps; these shared quantities follow existing scaling rules for depth [10 ] , batch size and token budget [26 ] . The learning rate and weight decay scalings cancel, so AdamW applies the same relative decay to every decayed parameter group. The embedding is a lookup over a fixed vocabulary of size V V V , so it uses the base ( σ 0 , η 0 , λ 0 ) (\sigma_0,\eta_0,\lambda_0) ( σ 0 , η 0 , λ 0 ) . For FFN down projections, the e \sqrt{e} e initialization factor and 1 / e 1/e 1/ e forward multiplier account for the expanded input width e s g esg es g . The learned scalars α s \alpha_s α s in Equation (6) adjust logit coefficients beyond width scaling. Norm gains and α s \alpha_s α s are initialized to one and use learning rate η 0 \eta_0 η 0 with zero weight decay. The standard parameterization (SP) sets m = s = e = 1 m=s=e=1 m = s = e = 1 only in the scaling rules and fixes α s = 1 \alpha_s=1 α s = 1 , preserving the architecture.
Theoretical guarantees. The statements below are proved in Appendix C under the standard heuristic assumptions of μ \mu μ P [38 ] : before the scaling of Table 1 is applied, the pre-activations of a group with active input width s g sg s g are Θ ( s g ) \Theta(\sqrt{sg}) Θ ( s g ) at initialization and move by Θ ( s g ) \Theta(sg) Θ ( s g ) after one step, which is why the initialization and the learning rate carry different exponents.
Theorem 1 (μ \mu μ -Internal: simultaneous maximal updates). Under the assumptions of Appendix C and the rule of Table 1 , consider a hidden group with supported boundary s s s and any sub-network t ∈ S t \in S t ∈ S with t ≥ s t \ge s t ≥ s . In every layer, its pre-activations inside sub-network t t t (i) have Θ ( 1 ) \Theta(1) Θ ( 1 ) coordinates at initialization and (ii) move by Θ ( η 0 ) \Theta(\eta_0) Θ ( η 0 ) after one AdamW step on that group, with constants independent of s s s , t t t , M M M , and m m m . The logits of every readout U s U_s U s have the same two properties.
Equation (7) is what makes this possible: a group with boundary s s s sums over exactly s g sg s g input coordinates in every sub-network containing it, so one initialization scale and one learning rate satisfy both conditions for all t ≥ s t \ge s t ≥ s at once. Training several sub-networks jointly does not change this, since they all feed a group the same input and Adam is invariant to the gradient scale.
Proposition 2 (A shared rule leaves groups mismatched). If all groups of a hidden matrix share one initialization variance, learning rate and multiplier, the groups with boundaries s < s ′ s < s' s < s ′ differ by factors Θ ( s ′ / s ) \Theta\left(\sqrt{s'/s}\right) Θ ( s ′ / s ) in pre-activation size and Θ ( s ′ / s ) \Theta(s'/s) Θ ( s ′ / s ) in update size, whatever the shared values. For unbounded M / s 1 M/s_1 M / s 1 , no shared rule thus keeps every group maximal in the sense of Theorem 1.
Under SP, the groups of a hidden matrix share ( σ 0 , η 0 ) (\sigma_0,\eta_0) ( σ 0 , η 0 ) , so by Proposition 2 re-tuning only trades the core against the outermost group, which stay M / s 1 \sqrt{M/s_1} M / s 1 and M / s 1 M/s_1 M / s 1 apart in initialization and update; the best HPs are compromises depending on m m m , M M M and S S S . Figure 3 and Table 3 show both effects: the SP optimum departs from the proxy’s, and SP trails μ \mu μ -ELASTIC even after re-tuning.
Figure 3. Sweeps of the learning rate η 0 \eta_0 η 0 and initialization scale σ 0 \sigma_0 σ 0 , the other at its base value, for the proxy and each elastic model at both scales under μ \mu μ -ELASTIC and SP. Δ \Delta Δ val. loss is the mean validation loss of the five sub-networks minus the minimum of the μ \mu μ -ELASTIC line of the same model and scale (for the proxy, its own line). Appendix H shows the sweeps for each sub-network.
Table 3. Effect of μ \mu μ -ELASTIC on each elastic model at the 119M–285M and 375M–906M scales. For each model, the first row is the best of the 12 (13 at 375M–906M) SP configurations of Figure 3 at that scale (lowest mean validation loss), and the w/ μ \mu μ -ELASTIC row is its result in Table 2, with the base values of Section 4.1 and no re-tuning. Table 28 gives the values with four decimals.
Corollary 1 (μ \mu μ -Transfer: two-level transfer). Theorem 1 holds for every base width g = m d 0 g=md_0 g = m d 0 and every supported set S ⊆ { 1 , … , M } S \subseteq\{1,\ldots,M\} S ⊆ { 1 , … , M } . Hence the values ( σ 0 , η 0 , λ 0 ) (\sigma_0,\eta_0,\lambda_0) ( σ 0 , η 0 , λ 0 ) tuned on the width-d 0 d_0 d 0 proxy (i) keep every group and readout of a \mu-ELASTIC supernet maximally updated, and (ii) keep doing so when the supernet is widened (larger m m m ) or given more shells (larger M M M ).
As with μ \mu μ P, the corollary fixes the scales of the initialization and the updates, not the optimal HP values; Figure 3 verifies that the proxy’s tuned HP values remain near-optimal at both levels.
μ \mu μ -ELASTIC for other elastic architectures. μ \mu μ -ELASTIC carries over to other elastic architectures, but m m m and s s s are defined per architecture. MatFormer (Devvrit et al., 2024) keeps the model width fixed and nests only the FFN hidden width, so only its FFN down projection has a fan-in that varies with the sub-network. It uses m = D m o d e l / d 0 m = D_{\mathrm{model}}/d_0 m = D model / d 0 , with s s s the sub-network’s FFN hidden width in units of a base FFN width; the down projection takes the factor m s ms m s , and the other hidden matrices and the readout take m m m (Table 6 ). Fully elastic models, a transformer adaptation of slimmable networks [42 ] , slice shared dense matrices along the residual, attention and FFN widths, so every hidden matrix has a varying fan-in; their m m m and s s s follow Equation (7) , and every hidden matrix takes the factor m s ms m s (Table 5 ). StairFormer [36 ] , with equal-width groups, takes Table 1 with S = { 1 , … , M } S=\{1,\ldots,M\} S = { 1 , … , M } in its hidden matrices. Theorem 1 and Corollary 1 extend to all three (Appendix C.§ 5 ), and Figure 8 compares MatFormer, fully elastic models and SHELL-ELASTIC.
Figure 8. Complete architecture comparison. MatFormer varies the FFN hidden dimension; fully elastic models vary the model dimension and the FFN hidden dimension together by slicing dense matrices; SHELLELASTIC also varies both, but through block-lower-triangular projections in which each output group reads only a prefix of the input. Each layer frame repeats L L L times. Proportions are illustrative.
Table 5. μ \mu μ -ELASTIC for the fully elastic baseline. s s s is the sub-network width in units of g g g ; multipliers act on the sliced tensor in the forward pass (Equation (23) ), and the FFN down projection multiplies its output, from both terms, by 1 / e 1/e 1/ e .
Table 6. μ \mu μ -ELASTIC for MatFormer. s = D f f n ( s ) / h 0 s = D_{\mathrm{ffn}}^{(s)}/h_0 s = D ffn ( s ) / h 0 is the FFN hidden width in units of the base FFN width h 0 h_0 h 0 ; the hidden matrices other than the FFN down projection and the readout have a fixed fan-in and take the non-elastic μ \mu μ P factor m = D m o d e l / d 0 m = D_{\mathrm{model}}/d_0 m = D model / d 0 , and the embedding and gains keep the base values. The FFN down projection multiplies its output, from both terms, by 1 / e 1/e 1/ e .
Training and inference
Recipe. (1) Tune ( σ 0 , η 0 , λ 0 ) (\sigma_0, \eta_0, \lambda_0) ( σ 0 , η 0 , λ 0 ) on a non-elastic proxy of width d 0 d_0 d 0 . (2) Choose the base width g g g and the supported set S \mathcal{S} S . (3) Compute m = g / d 0 m = g/d_0 m = g / d 0 and instantiate the parameterization in Table 1 . (4) Train the supernet on the joint objective below.
Joint objective. At step τ \tau τ , with selected widths A τ ⊆ S \mathcal{A}_\tau\subseteq\mathcal{S} A τ ⊆ S and loss weights ω s ≥ 0 \omega_s \ge0 ω s ≥ 0 ,
L τ = ∑ s ∈ A τ ω s ℓ s ∑ s ∈ A τ ω s , ℓ s = CE ( z s , y ) + λ z E [ ( log ∑ v e z s , v ) 2 ] (8) \mathcal{L}_\tau= \frac{\sum_{s \in\mathcal{A}_\tau} \omega_s \ell_s}{\sum_{s \in\mathcal{A}_\tau} \omega_s}, \qquad\ell_s = \operatorname{CE}(z_s, y) + \lambda_z \mathbb{E}\left[\left(\log\sum_v e^{z_{s,v}}\right)^2\right] \tag*{(8)} L τ = ∑ s ∈ A τ ω s ∑ s ∈ A τ ω s ℓ s , ℓ s = CE ( z s , y ) + λ z E ( log v ∑ e z s , v ) 2 (8)
where z s z_s z s are the logits of Equation (6) , λ z \lambda_z λ z is the z z z -loss coefficient, the expectation runs over the non-padded target positions, and every ℓ s \ell_s ℓ s backpropagates into the shared trunk. The narrower widths may be selected by any rule, but every A τ \mathcal{A}_\tau A τ contains the full width M M M , so the trunk always runs at width D m o d e l D_{\mathrm{model}} D model and every trunk parameter receives a gradient at every step.
Cost and scalability. Let C t r u n k ( s ) C_{\mathrm{trunk}}(s) C trunk ( s ) and C o u t ( s ) C_{\mathrm{out}}(s) C out ( s ) be the forward costs of the trunk and of one terminal norm and readout at width s g sg s g . Training the family jointly and training each sub-network separately cost
C j o i n t = C t r u n k ( M ) + ∑ s ∈ S C o u t ( s ) , C s e p a r a t e = ∑ s ∈ S [ C t r u n k ( s ) + C o u t ( s ) ] . (9) C_{\mathrm{joint}} = C_{\mathrm{trunk}}(M) + \sum_{s \in\mathcal{S}} C_{\mathrm{out}}(s), \qquad C_{\mathrm{separate}} = \sum_{s \in\mathcal{S}} \left[C_{\mathrm{trunk}}(s) + C_{\mathrm{out}}(s)\right]. \tag*{(9)} C joint = C trunk ( M ) + s ∈ S ∑ C out ( s ) , C separate = s ∈ S ∑ [ C trunk ( s ) + C out ( s ) ] . (9)
By Proposition 1, one trunk term serves every width, whereas C s e p a r a t e C_{\mathrm{separate}} C separate pays one per width, so the gap grows with ∣ S ∣ |\mathcal{S}| ∣ S ∣ and C j o i n t C_{\mathrm{joint}} C joint stays comparable to training the widest sub-network alone. The same holds for memory: all readout gradients combine in one trunk backward pass, so the trunk’s activations, parameters and optimizer state are those of the widest one. Training all sub-networks at every step works best (Appendix § 18 ) and gives every step the same computation graph, parameter access pattern and workload. In MatFormer and fully elastic models, hidden states are not nested, so each width needs its own trunk pass: sampling widths per step [41 ] (Devvrit et al. 2024) varies the workload, while training all widths at every step [42 ] pays C s e p a r a t e C_{\mathrm{separate}} C separate .
Inference. For a chosen width s ∈ S s \in\mathcal{S} s ∈ S , we retain the embedding prefix, the core and shells up to s s s , and the matching terminal norm and readout, keeping the forward multipliers of Table 1 . By Proposition 1, the extracted model reproduces its supernet logits exactly and runs as a standalone transformer of width s g sg s g without further training.
Experiments
After describing the setup (§ 4.1 ), we evaluate the sub-networks of one SHELLELASTIC run against parameter-matched MatFormer, fully elastic and separately trained models, and μ \mu μ -ELASTIC against SP on every elastic family (§ 4.2 ). We then compare SHELLELASTIC with StairFormer and run an architecture search at equal parameters and width count (§ 4.3 ); finally, we ablate the training and design choices to derive practical guidance for elastic pretraining (§ 4.4 ).
Experimental details
Models. Our primary model is a SHELLELASTIC supernet with base width g = 128 g = 128 g = 128 and supported set S = { 4 , 5 , 6 , 7 , 8 } \mathcal{S} = \{4, 5, 6, 7, 8\} S = { 4 , 5 , 6 , 7 , 8 } : a 512-dimensional core followed by four 128-dimensional shells, giving five sub-networks of widths 512 to 1024. We report main results at three scales, with sub-network groups of about 119M–285M, 375M–906M and 675M–1.69B parameters (SHELLELASTIC widths 512–1024, 1024–2048 and 1024–2048, respectively). All models are 32-layer transformers with gated attention and SwiGLU FFNs. Table 7 and Table 8 in Appendix § 13 list all configurations.
Table 7. Model configurations. Each model is defined by its base width g g g and supported set S S S (Section 3.1): its sub-networks have widths s g sg s g for s ∈ S s \in S s ∈ S , and a non-elastic model has S = { M } S = \{M\} S = { M } . MatFormer nests only the FFN hidden width, so its g g g and S S S refer to that width at a fixed D m o d e l D_{\mathrm{model}} D model (512, and 1024 at the two larger scales). All models have 32 layers and a 50,432-token vocabulary; parameters count the non-zero weights of each sub-network (Appendix E.3).
Table 8. Architecture settings at the 119M–285M scale. The upper block is shared by all models, and the lower block lists the settings that differ between them (base widths, supported sets and sizes of all three scales in Table 7).
caption:
Datasets. All models are trained on DCLM-Baseline [23 ] , a filtered Common Crawl corpus, with the GPT-NeoX-20B tokenizer [2 ] and a sequence length of 2,048. By default, a run takes 25,000 steps of 128 sequences (6.55B tokens). This budget gives every sub-network more than 22 tokens per parameter, above the compute-optimal ratio of about 20 [18 ] . We monitor the training and validation losses (per-token cross-entropy in nats) of every sub-network, the latter on held-out C4 text [30 , 11 ] . Following OLMoE [27 ] and DCLM, we also probe 5-shot accuracy on ARC-Easy [7 ] , PIQA (Bisk et al., [1 ] ) and HellaSwag (Zellers et al., [43 ] ) during training and evaluate the final sub-networks on 13 datasets spanning world knowledge, symbolic problem solving, commonsense reasoning, language understanding and reading comprehension (Appendix § 14 ).
Baselines. We compare SHELLELASTIC against five baselines, each providing networks of five sizes: Low, Medium, High, Extra and Max. (i) MatFormer (Devvrit et al., 2024) nests only the FFN hidden width. (ii) Fully elastic , a transformer adaptation of slimmable networks (Yu et al., [42 ] ), nests the residual, attention and FFN widths by slicing shared dense matrices. (iii) StairFormer (Trost et al., [36 ] ) shares the prefix structure of SHELLELASTIC but uses equal-width groups and normalizes over cumulative prefixes. (iv) Standalone trains five separate models, each on the full budget, and thus takes 5 × 5 \times 5 × the steps of one elastic run. (v) Sampled standalone , the standalone baseline of MatFormer, trains the five Standalone models within the steps of one elastic run. MatFormer, the fully elastic model and sampled standalone sample one sub-network uniformly at random per step, whereas StairFormer and SHELLELASTIC train all sub-networks in one full-width pass at every step. In the main results, all baselines match the SHELLELASTIC sub-networks in parameter count to within 3% (Table 10 ). Appendix § 13 details the baselines’ architecture and training, and Appendix § 12 gives their parameterization.
Table 10. Parameters (M) of the sub-networks of Table 2 at each scale and tier, counted as in Appendix E.3; Avg. averages the five tiers. Standalone, sampled standalone and the fully elastic model share the same five dense architectures.
Hyperparameters. All models are trained with AdamW. Unless otherwise specified, they use the base learning rate η 0 = 2 × 10 − 3 \eta_0 = 2 \times10^{-3} η 0 = 2 × 1 0 − 3 , initialization scale σ 0 = 3.3 × 10 − 3 \sigma_0 = 3.3 \times10^{-3} σ 0 = 3.3 × 1 0 − 3 and weight decay λ 0 = 0.01 \lambda_0 = 0.01 λ 0 = 0.01 , with μ \mu μ -ELASTIC for the elastic models and μ \mu μ P for the non-elastic ones, both with d 0 = 128 d_0 = 128 d 0 = 128 . SHELLELASTIC has m = 1 m = 1 m = 1 and trains all five widths at every step with loss weights ( 1 , 1 , 1 , 1 , 4 ) (1, 1, 1, 1, 4) ( 1 , 1 , 1 , 1 , 4 ) (Equation 8). Main results at the 119M–285M and 375M–906M scales are averaged over three runs with the same seed; compute limits the 675M–1.69B scale to one run. Ablations vary only the setting under study; Table 9 in Appendix § 13 lists the remaining HPs and the hardware.
Main results
Comparison with baselines across scales. Table 2 compares SHELLELASTIC with MatFormer, the fully elastic model and the two standalone baselines at three scales (curves and per-task results in Appendix § 15 ); all three elastic models use μ \mu μ -ELASTIC (Appendix § 12 ). SHELLELASTIC is the supernet of Section 4.1 at 119M–285M, doubles its base width to d g = 256 d_g = 256 d g = 256 at 375M–906M, and also raises the FFN expansion from e = 1 e = 1 e = 1 to 4 4 4 at 675M–1.69B; these two scales train for 50,000 and 100,000 steps of 256 sequences (Appendix § 13 ). Among the methods that train all five sizes in one run, SHELLELASTIC has the lowest mean validation loss (0.028, 0.005 and 0.018 nats below the best baseline) and the highest mean 5-shot accuracy at every scale, and is best or tied-best at 12 of the 15 tiers in validation loss and 14 in 5-shot accuracy. Its lead grows with size, from at most 0.016 nats at Low to 0.023–0.050 at Max, likely because the Max-only parameters of the elastic baselines receive a gradient on only one step in five on average, whereas every parameter of SHELLELASTIC receives one at every step. At a fixed step budget, weight sharing also helps: the fully elastic model beats sampled standalone, its unshared counterpart, by 0.11 to 0.25 nats on average. With a fifth of their optimizer steps, SHELLELASTIC comes within 0.039, 0.045 and 0.014 nats of the standalone models in mean validation loss and within 0.8 points in mean 5-shot accuracy. Appendix E.4 analyzes the training and inference cost of all methods at 119M–285M.
Transferability of μ \mu μ -ELASTIC. Under μ \mu μ -ELASTIC, the proxy’s optimum, η 0 = 2 × 10 − 3 \eta_0 = 2 \times10^{-3} η 0 = 2 × 1 0 − 3 and σ 0 = 3.3 × 10 − 3 \sigma_0 = 3.3 \times10^{-3} σ 0 = 3.3 × 1 0 − 3 (the base values of Section 4.1), transfers to all three elastic models at both levels of μ \mu μ -Transfer (Figure 3 , Corollary 1). At 119M–285M scale, both values are optimal or adjacent to the optimum (η 0 \eta_0 η 0 : exact for MatFormer and the fully elastic model, adjacent for SHELLELASTIC; σ 0 \sigma_0 σ 0 : exact for the fully elastic model and SHELLELASTIC, adjacent for MatFormer). At the 375M–906M scale, which enlarges m m m , M M M or both and doubles the batch size and steps (Appendix E), the same holds, and σ 0 \sigma_0 σ 0 becomes exact for MatFormer too. The base values are thus within 0.003 nats of the best point of every μ \mu μ -ELASTIC sweep and within 0.005 nats for every sub-network (Appendix H). Under SP, the optimum departs from the proxy’s and shifts with scale, as Section 3.2 anticipates, and at the base values SP is 0.03–0.11 nats worse. Weight decay transfers as well (Figure 15 in Appendix H): under μ \mu μ -ELASTIC, the mean loss of SHELLELASTIC is flat over the same range as the proxy’s, from λ 0 = 10 − 3 \lambda_0 = 10^{-3} λ 0 = 1 0 − 3 to 10 − 1 10^{-1} 1 0 − 1 (within 0.003 nats), whereas SP is higher at every swept value.
Figure 15. Weight-decay sweeps. Sweeps of λ 0 \lambda_0 λ 0 for the proxy under μ \mu μ P and for SHELLELASTIC at the 119M–285M scale under μ \mu μ -ELASTIC (solid) and SP (dashed, open markers); Δ \Delta Δ val. loss is as in Figure 3 .
Simultaneous maximal updates of μ \mu μ -ELASTIC. Without width-dependent scaling, re-tuning one global value only trades one width against another (Proposition 2). Table 3 tests this limitation at the 119M–285M and 375M–906M scales, giving SP the best of its 12 (13 at 375M–906M) configurations in Figure 3 and μ \mu μ -ELASTIC only the base values. At the 119M–285M scale, for the fully elastic model and SHELLELASTIC, μ \mu μ -ELASTIC still gives lower training and validation losses at every tier, by 0.011 and 0.013 nats in mean validation loss, as it keeps all widths maximally updated at once (Theorem 1). At the 375M–906M scale, tuned SP remains 0.006–0.021 nats worse than μ \mu μ -ELASTIC for all three models (Appendix H). Under tuned SP, SHELLELASTIC still beats both baselines by 0.026–0.027 and 0.020–0.024 nats at the two scales, so its lead is not due to μ \mu μ -ELASTIC alone.
Architecture comparison and search
Comparison with StairFormer. StairFormer (Trost et al., [36 ] nests sub-networks as prefixes of one forward pass; it uses equal-width groups, cumulative prefix normalization and one shared readout. Here it has g = 208 g = 208 g = 208 and S = { 1 , 2 , 3 , 4 , 5 } S = \{1, 2, 3, 4, 5\} S = { 1 , 2 , 3 , 4 , 5 } in our notation, whereas SHELLELASTIC has a 512-wide core and four 128-wide shells (S = { 4 , 5 , 6 , 7 , 8 } S = \{4, 5, 6, 7, 8\} S = { 4 , 5 , 6 , 7 , 8 } ), group-local normalization and per-width readouts. Like SHELLELASTIC, it trains all sub-networks at every step; we give it the same μ \mu μ -ELASTIC and HPs (Section 4.1). Its narrower sub-networks are much smaller (32.6M to 200.4M); only its Max matches SHELLELASTIC in size. At the parameter count of each SHELLELASTIC sub-network, its validation loss is 0.055 to 0.083 nats higher (Figure 4 a; curves in Figure 17 ), and even its Max, with 1.5× the parameters, is 0.001 nats above the High of SHELLELASTIC. At Max, SHELLELASTIC also leads in average 5-shot accuracy, 36.9 against 35.7 (Figure 4 b and Table 29 ).
Figure 4. Architecture comparison and search against parameters at step 25,000. (a, b) Comparison with StairFormer: validation loss and average 5-shot accuracy (%) over 13 tasks. (c) Architecture search: validation loss of each supported width. Full results are in Appendices I.1 and I.2.
Table 29. Per-task results of StairFormer and SHELLELASTIC at every tier of the 119M–285M scale, with the rows of Appendix G. Stair.: StairFormer. Ours: SHELLELASTIC. Bold marks the better entry of each pair (ties both bold). Only Tier 5 is parameter-matched.
Figure 17. Training curves of StairFormer and the methods of Table 2 at the 119M–285M scale , except sampled standalone, in the format of Figure 9 ; column titles give the parameters of SHELLELASTIC and StairFormer.
Architecture search at equal parameters and width count. Since S S S fixes both the extractable widths and the parameter count (a hidden matrix keeps B ( S ) = ∑ k ( s k − s k − 1 ) s k B(S) = \sum_k (s_k - s_{k-1})s_k B ( S ) = ∑ k ( s k − s k − 1 ) s k of its M 2 M^2 M 2 blocks of size g × g g \times g g × g ), we ask where extra width should go and check the number of supported widths are fixed. At B = 42 B = 42 B = 42 with five supported widths, each candidate set has four groups of width g g g and one of width 4 g 4g 4 g and differs only in where this wide group sits (block masks in Figure 18 ); at B = 39 B = 39 B = 39 with six, the wide group has width 3 g 3g 3 g (Appendix § 17 .§ 2 ). We train every supported width at every step and compare the sets at each width they share with equal parameter counts (Figure 4 c). The core is the best place for the wide group: the core placement has the lowest loss, or is within 0.006 nats of it, at every shared width, whereas a shell placement makes the first width containing the wide group 0.025 to 0.052 nats worse. This motivates the wide core and thin shells of SHELLELASTIC.
Figure 18. Block masks of the supported sets in Figure 4 c and Figure 19 (M = 8 M = 8 M = 8 , g = 128 g = 128 g = 128 ). Cell (i i i , j j j ) is the g × g g \times g g × g block of every hidden matrix from input block j j j to output block i i i . Gray: lower-triangle blocks kept by every set; colored: blocks above the diagonal, all inside the one group wider than g g g (outlined). Each row has the same B B B and moves the wide group from the last shell (left) to the core (right).
Ablation studies
All ablations use the 119M–285M supernet of Section 4.1 and change one setting at a time; the default results are those of Table 2 . Of the settings we ablate, sub-network selection, in-place distillation, ensembles of the sub-networks, stage-residual gradient scaling and the trunk gradient of the narrower widths can change the mean validation loss by 0.010 to 0.20 nats, whereas the loss weights, normalization, readouts, base width and head dimension, and optimization HPs change it by at most 0.007 nats. We discuss the first four below (Table 4 ) and the others in Appendix J.
Table 2. Final validation loss and mean 5-shot accuracy over 13 downstream tasks at three scales, labeled by sub-network size. Entries at the 119M–285M and 375M–906M scales average three runs; those at 675M–1.69B are single runs. †Five separately trained models, together taking 5× the steps of any other row. Bold marks the best of the four methods that train all five sizes in one run.
Table 4. Ablations at the 119M–285M scale: final validation loss and mean 5-shot accuracy over 13 downstream tasks and the five tiers. Each block ends with the default, and bold marks the best value of each column within a block. Appendix § 18 gives all ablations.
Selected sub-networks per step. Besides training all five sub-networks at every step (All, the default), we test three rules for A τ \mathcal{A}_{\tau} A τ in Equation (8) : Sandwich (Low and Max plus one other), Max + random (Max plus one other) and Random (one sub-network, as in MatFormer), drawing the random ones uniformly at random. The loss of each sub-network follows how often it is trained: Sandwich and Max + random match All at Max but are up to 0.024 and 0.086 nats worse at those they select less often, and Random is worse at every sub-network, by 0.095 nats at Max. All gives the lowest mean loss, 0.012 to 0.059 nats below the others, and the highest mean 5-shot accuracy.
In-place distillation. Elastic recipes often distill the narrower sub-networks from the widest one ([41 ] ). We add to the losses of Low to Extra a KL divergence toward the output distribution of Max (forward KL with weights 0.1 to 1; reverse and symmetric KL with weight 0.5). This lowers the loss of Low by up to 0.034 nats and the mean loss by up to 0.010 nats, the largest gain of any ablation, but raises that of Max by up to 0.008 nats, improves the mean 5-shot accuracy by at most 0.1 point and makes a step 2.2 to 2.6 times as long, so we do not use it.
Ensembles of the sub-networks. One trunk pass yields the output distributions p s p_s p s of all five sub-networks, which may err on different tokens, so a per-token ensemble ∑ s π s p s \sum_s \pi_s p_s ∑ s π s p s could beat Max as a predictor at little extra cost, or replace it as a stronger teacher (details in Appendix § 18 ).
Ensemble as predictors. We evaluate four ensembles of a trained supernet: uniform weights, confidence weights (π s ∝ max v p s ( v ) \pi_s \propto\max_v p_s(v) π s ∝ max v p s ( v ) ), the most confident readout per token, and the best fixed ensemble, whose weights minimize the loss. We also train a router, an MLP that maps the last-layer hidden state of Max to per-token weights π s \pi_s π s , together with its own supernet on the π \pi π -weighted sum of the five losses. None of the ensemble methods beat Max alone (Figure 5 , Table 33 ): the best fixed ensemble only matches it, the other three are 0.03 to 0.065 nats worse in train loss, and the router puts all weight on Max within the first 50 steps (Figure 5 b), so Max improves by 0.013 nats while the other sub-networks, now barely trained, lose up to 0.365 nats (Figure 5 c).
Figure 5. Ensembles of the sub-networks. (a) Train loss minus that of Max during training for the five predictors and the oracle, which uses the target. (b) Router weight on each tier. (c) Validation loss of each tier minus the default when training with the router. (d) Validation loss of each tier minus the default when distilling toward Max, the loss-weighted ensemble or the soft oracle. (e) Share of held-out tokens on which each tier assigns the target the highest probability. The default is the mean of the three SHELLELASTIC runs of Table 2 .
Table 33. Ensembles of the five sub-networks as predictors and as teachers. Train and validation loss minus those of Max. The row labeled Router is the ensemble weighted per token by the learned router, which is trained together with its own supernet, so this row subtracts the losses of that supernet’s Max. The loss-weighted ensemble and the soft oracle are the two ensembles used as distillation teachers in ablation (8) .
Table 34. The oracle on held-out C4 text (final checkpoints). Top: share of tokens on which each tier assigns the target the highest probability (the oracle’s pick), its contribution to the oracle’s mean gain over Max (the four sum to 0.185), and the share of tokens on which it beats Max. Bottom: validation loss minus that of Max when the models in each row are ensembled with uniform weights, the best fixed weights or the oracle.
supernets trained separately with the same settings differ far more: averaging their Max lowers the loss by 0.056 nats at twice the cost, and their oracle gains 0.23 nats against 0.19 for the five sub-networks on held-out text. Our ensembles show that finding the better sub-network per token without the target is hard, but we believe a better ensemble could close part of this gap, a promising way to substantially improve SHELLELASTIC at almost no extra cost.
Ensemble as teachers. Every sub-network, including Max, distills (forward KL, weight 0.5) toward the loss-weighted ensemble (π s ∝ ω s \pi_s \propto\omega_s π s ∝ ω s ), which predicts 0.012 nats worse than Max, or the soft oracle (π s ∝ p s ( y ) β \pi_s \propto p_s(y)^\beta π s ∝ p s ( y ) β ), a smoothed oracle that predicts 0.14 nats better (Table 33 ). Yet neither teacher helps Max, not even the soft oracle: like in-place distillation with the same KL (Figure 5 d), they improve Low by up to 0.018 nats and worsen Max by up to 0.010 nats.
Stage-residual gradient scaling. Since the readout is linear (Equation (6) ), the logits of width s k s_k s k are a sum of k k k terms, one from the last-layer coordinates of each of its groups, so the supernet can be viewed as a sequence of stages: the core gives a base prediction and each shell adds a correction, as in residual learning (He et al. [15 ] ). To make each shell learn this correction, we keep the forward pass but, in the backward pass, scale by γ \gamma γ the gradient that each sub-network’s loss sends to the trunk through the narrower sub-network it contains; the gradient through its own shell is unchanged (details in Appendix J). Thus γ = 1 \gamma= 1 γ = 1 is the usual joint training of (8) , while with γ = 0 \gamma= 0 γ = 0 each loss reaches the trunk only through its own shell, which therefore learns only to correct the prediction of the narrower sub-network. A γ \gamma γ of 0.3 to 0.8 lowers the loss of Low by up to 0.028 nats but raises those of Extra and Max by up to 0.012 nats, leaving the mean loss within 0.002 nats, whereas γ = 0 \gamma= 0 γ = 0 raises the mean loss by 0.047 nats, as the last-layer features of the narrower groups no longer adapt to the wider losses; we keep γ = 1 \gamma= 1 γ = 1 . The stage view still points to a property that MatFormer and fully elastic models lack: since no group reads a later one and every group is normalized on its own, a new shell can be appended to a trained supernet and trained as a new stage with all trained weights frozen, so every trained sub-network keeps its exact outputs.
Conclusion
In SHELLELASTIC, one full-width pass gives the exact hidden states of every sub-network, so joint training costs about as much as the widest one alone. With μ \mu μ -ELASTIC and proxy-tuned HPs, one run yields maximally updated sub-networks that beat MatFormer and fully elastic models matched sizes and approach standalone models that together take five times the steps. Our experiments favor training all sub-networks at every step and a wide core, and suggest two directions: better sub-network ensembles, whose oracle is 0.19 nats below Max, and appending shells to a trained supernet.
AI USE STATEMENT
In this work, we used generative AI tools to provide critical ingredients for proving our mathematical claims, to assist in writing the proofs (Appendices § 10 and C), and to implement parts of our method. Additionally, we used generative AI tools to draft parts of the paper, edit it for readability, generate and check the code for the result figures and tables, and cross-check the statements of the paper against the training code. We have reviewed all AI-assisted work. We take responsibility for the final content of this work, including text, claims, or artifacts produced with the aid of generative AI.
ETHICS STATEMENT
This work studies training methods for language models on publicly available web text and does not involve human subjects. Elastic models reduce the cost of serving several model sizes, which lowers the energy cost of deployment; they inherit the biases of their training data like any language model.
REPRODUCIBILITY STATEMENT
§ 4.1 and Appendices § 13 and § 14 list every architectural, optimization and evaluation setting; Table 1 and Appendix § 12 give the complete parameterization rules; Appendices § 10 and C contain the proofs, and Appendix § 10 .§ 3 verifies Proposition 1 numerically; Appendices § 15 , § 16 , § 17 and § 18 give the complete main, transfer, architecture-search and ablation results. The training code, configurations and run logs used for all tables will be released.
Architecture details
Figure 6 shows the complete SHELLELASTIC model, Figure 7 details its attention and FFN sub-layers, and Figure 8 places the three elastic families side by side. Weight matrices are drawn with output rows and input columns and colored only where a connection is allowed; white lines mark the supported widths, and black lines delimit the slices of a dense matrix that the narrower sub-networks use. All three families are drawn with S = { 4 , 5 , 6 , 7 , 8 } S = \{4, 5, 6, 7, 8\} S = { 4 , 5 , 6 , 7 , 8 } , the default supported set of SHELLELASTIC, so that their matrices are directly comparable; Table 7 lists the dimensions of the trained models. The forward multipliers of Table 1 are omitted throughout, and the per-head query/key normalization and rotary position transformations appear only in Figure 7 .
Comparison with other elastic architectures. MatFormer keeps the model width, attention, normalization, embedding and readout at full width and nests only the FFN hidden width. A fully elastic model slices dense matrices along both axes and normalizes over the active width. In both cases, channel mixing is dense, so the hidden states of a narrow sub-network are not contained in those of a wide one, and each width needs its own trunk pass. SHELLELASTIC replaces the dense matrices with block-lower-triangular ones and the full-width normalization with group-local normalization, which is exactly what lets the supported prefixes share a single trunk pass (Proposition 1).
Exact computation reuse
This appendix proves Proposition 1. Appendix B.1 defines prefix-preserving maps and shows that the structured projections are prefix-preserving at the supported widths, Appendix B.2 composes the operations of the trunk, and Appendix B.3 checks the result numerically and delimits what it does and does not claim.
Prefix-preserving maps
Throughout this appendix, s ≤ t s \le t s ≤ t are supported widths in S \mathcal{S} S , and P s P_s P s keeps the first s g sg s g coordinates of every token’s hidden state (the first e s g esg es g coordinates on the FFN hidden axis), as in Proposition 1. For a map F F F that the trunk applies at every supported width, F s F_s F s denotes its restriction to width s g sg s g , that is, the map that sub-network s s s applies.
Definition 1 (Prefix-preserving map). A map F F F is prefix-preserving if
P s ∘ F t = F s ∘ P s for all s , t ∈ S , s ≤ t . (10) P_s \circ F_t = F_s \circ P_s \qquad\text{for all } s,t \in\mathcal{S},\ s \le t. \tag*{(10)} P s ∘ F t = F s ∘ P s for all s , t ∈ S , s ≤ t . (10)
We first show that the structured projections of § 3.1 have this property. The lemma allows different base granularities on the two axes, since the output groups of the FFN up and gate projections are e e e times as wide as their input groups, and those of the down projection e e e times as narrow.
Lemma 1 (Structured linear maps). Consider a linear map with base input and output granularities g i n g_{\mathrm{in}} g in and g o u t g_{\mathrm{out}} g out , in which output group k k k has ( s k − s k − 1 ) g o u t (s_k-s_{k-1})g_{\mathrm{out}} ( s k − s k − 1 ) g out rows and reads the first s k g i n s_k g_{\mathrm{in}} s k g in input coordinates. Let P s i n P_s^{\mathrm{in}} P s in and P s o u t P_s^{\mathrm{out}} P s out keep the first s g i n s g_{\mathrm{in}} s g in inputs and the first s g o u t s g_{\mathrm{out}} s g out outputs, and let W s W_s W s be the top-left s g o u t × s g i n s g_{\mathrm{out}} \times s g_{\mathrm{in}} s g out × s g in block of the weight matrix. Then, with the row-vector convention,
P s o u t ( x W t T ) = P s i n ( x ) W s T , s , t ∈ S , s ≤ t . (11) P_s^{\mathrm{out}}(xW_t^{\mathsf{T}}) = P_s^{\mathrm{in}}(x)W_s^{\mathsf{T}}, \qquad s,t \in\mathcal{S},\quad s \le t. \tag*{(11)} P s out ( x W t T ) = P s in ( x ) W s T , s , t ∈ S , s ≤ t . (11)
Proof. Let s = s j s=s_j s = s j . The first s g o u t s g_{\mathrm{out}} s g out outputs are those of the groups k ≤ j k \le j k ≤ j , and output coordinate i i i of group k k k is
( x W t T ) i = ∑ c = 1 s k g i n ( W t ) i c x c . (12) (xW_t^{\mathsf{T}})_i = \sum_{c=1}^{s_k g_{\mathrm{in}}}(W_t)_{ic}x_c. \tag*{(12)} ( x W t T ) i = c = 1 ∑ s k g in ( W t ) i c x c . (12)
Since k ≤ j k \le j k ≤ j gives s k ≤ s j = s s_k \le s_j=s s k ≤ s j = s , this sum reads only the first s g i n s g_{\mathrm{in}} s g in inputs, and all of its weights lie in the top-left block W s W_s W s . Hence it equals ( P s i n ( x ) W s T ) i (P_s^{\mathrm{in}}(x)W_s^{\mathsf{T}})_i ( P s in ( x ) W s T ) i .
Unsupported widths. At an index u ∉ S u \notin\mathcal{S} u ∈ / S , there is a group with s k − 1 < u < s k s_{k-1}<u<s_k s k − 1 < u < s k . A cut at u u u keeps part of that group but removes inputs it is allowed to read (Equation 12), so Equation 11 does not hold in general, and the architecture guarantees no reusable sub-network there. For S = { 4 , 5 , 6 , 7 , 8 } \mathcal{S}=\{4,5,6,7,8\} S = { 4 , 5 , 6 , 7 , 8 } , the indices 1, 2, 3 lie inside the dense core and are not supported.
Proof of Proposition 1
Proof. We show that every operation of a layer is prefix-preserving (Steps 1–4) and then compose the operations over the L L L layers (Step 5).
Step 1: projections. The query, key, value, gate and output projections of attention and the up, gate and down projections of the FFN are structured linear maps. Lemma 1 therefore applies to each of them, with g i n = g o u t = g g_{\mathrm{in}}=g_{\mathrm{out}}=g g in = g out = g for the attention projections, ( g i n , g o u t ) = ( g , e g ) (g_{\mathrm{in}},g_{\mathrm{out}})=(g,eg) ( g in , g out ) = ( g , e g ) for the FFN up and gate projections, and ( e g , g ) (eg,g) ( e g , g ) for the FFN down projection.
Step 2: group-local normalization. By Equation 3, N ( x ) g k = N k ( x g k ) N(x)_{g_k}=N_k(x_{g_k}) N ( x ) g k = N k ( x g k ) uses only the coordinates and gains of g k g_k g k , so the first s g sg s g outputs depend only on the first s g sg s g inputs, and P s ∘ N t = N s ∘ P s P_s \circ N_t=N_s\circ P_s P s ∘ N t = N s ∘ P s . The same holds for any finer partition and for a cumulative prefix norm, whose statistics are a coordinate use all coordinates up to the end of its group or of its block of g g g coordinates (Equation 25); for any of the first s g sg s g coordinates, that end is at most s g sg s g . A norm over the full active width does not preserve prefixes, because adding a group changes the statistics of the earlier coordinates.
Step 3: attention. Since g g g is a multiple of d h e a d d_{\mathrm{head}} d head , every head lies inside one group, and sub-network s s s uses the first s g / d h e a d sg/d_{\mathrm{head}} s g / d head heads. By Step 1, their queries, keys and values depend only on the first sg inputs. Query–key normalization, the rotary transformation and the softmax act within a head, so the heads that sub-network t t t adds leave the outputs of these heads unchanged. The sigmoid gate and the output projection of Equation (4) are covered by Steps 1 and 4.
Step 4: elementwise operations, residuals and embedding. The SwiGLU product and the other elementwise operations act coordinatewise, so they commute with P s P_s P s . A residual branch x ↦ x + F ( x ) x \mapsto x+F(x) x ↦ x + F ( x ) with a prefix-preserving F F F is prefix-preserving, since P s ( x + F t ( x ) ) = P s ( x ) + F s ( P s ( x ) ) P_s(x+F_t(x))=P_s(x)+F_s(P_s(x)) P s ( x + F t ( x )) = P s ( x ) + F s ( P s ( x )) . The embedding satisfies P s ( E t [ u ] ) = E s [ u ] P_s(E_t[u])=E_s[u] P s ( E t [ u ]) = E s [ u ] by construction.
Step 5: composition over layers. If F F F and G G G are prefix-preserving, then so is G ∘ F G\circ F G ∘ F :
P s ∘ G t ∘ F t = G s ∘ P s ∘ F t = G s ∘ F s ∘ P s . (13) P_s\circ G_t\circ F_t=G_s\circ P_s\circ F_t=G_s\circ F_s\circ P_s. \tag*{(13)} P s ∘ G t ∘ F t = G s ∘ P s ∘ F t = G s ∘ F s ∘ P s . (13)
Each layer is a composition of the operations of Steps 1–4 and is therefore prefix-preserving, and by induction over the L L L layers, as in Proposition 2.3 of StairFormer (Trost et al. [36 ] ), so is the trunk: P s ∘ T t = T s ∘ P s P_s\circ T_t=T_s\circ P_s P s ∘ T t = T s ∘ P s . Applying this identity to the embedded sequence and using Step 4,
P s ( T t ( E t [ u ] ) ) = T s ( P s ( E t [ u ] ) ) = T s ( E s [ u ] ) , (14) P_s\left(T_t(E_t[u])\right)=T_s\left(P_s(E_t[u])\right)=T_s(E_s[u]), \tag*{(14)} P s ( T t ( E t [ u ]) ) = T s ( P s ( E t [ u ]) ) = T s ( E s [ u ]) , (14)
which is the claim.
Consequence for the joint objective. The terminal norm N s o u t N_s^{\mathrm{out}} N s out and the readout U s U_s U s need not commute with P s P_s P s , since N s o u t N_s^{\mathrm{out}} N s out normalizes over all s g sg s g selected coordinates. They are applied after the prefix has been selected (Equation (6) ), so each sub-network’s terminal map receives exactly the input it would receive in a separate evaluation. Hence each ℓ s \ell_s ℓ s , and the gradient of the joint objective of Equation (8) , is the same function of the shared parameters as in separate evaluations, up to floating-point summation order.
Numerical verification and scope
Numerical verification. We instantiated the full trained configuration on the meta device to check module selection and shapes, and ran a reduced two-layer model on CPU with the same architecture switches, comparing one shared trunk pass against five separate evaluations of the same nested weights. The logits and the weighted cross-entropy agreed exactly; the largest absolute difference between the two sets of parameter gradients was 1.68 × 10 − 8 1.68\times10^{-8} 1.68 × 1 0 − 8 , and every trainable parameter received a gradient. The check replaces the fused SwiGLU and cross-entropy kernels of the GPU path with reference expressions, so it supports the implementation of Proposition 1, not its throughput.
Scope of the statement. The proposition assumes the dense-FFN graph of § 3.1 , a fixed supported set S \mathcal{S} S and prefix-preserving normalization. Beyond these assumptions:
dropout needs matched masks for an equality test;
data-dependent routing or width-specific trunk modules need a separate argument;
Equation (2) fixes the logical dependencies and not a storage layout or a kernel: every implementation of that map has the prefix property.
Proofs of the μ \mu μ -Elastic results
This appendix proves Theorem 1, Proposition 2 and Corollary 1. Appendix C.1 states the assumptions and fixes the notation, Appendices C.2–C.4 give the three proofs, and Appendix C.5 extends Theorem 1 and Corollary 1 to the other elastic architectures of Section 3.2.
Assumptions and notation
Assumption 1 (Heuristic scaling). We use the heuristic framework of Appendix J of the μ \mu μ Transfer paper (Yang et al. [38 ] ).
(A1) Inputs. The input to every hidden matrix has Θ ( 1 ) \Theta(1) Θ ( 1 ) coordinates with bounded second moments and is independent of that matrix at initialization.
(A2) Central limit. If w 1 , … , w n w_1,\ldots,w_n w 1 , … , w n are i.i.d. with mean zero and standard deviation b b b and independent of x 1 , … , x n = Θ ( 1 ) x_1,\ldots,x_n=\Theta(1) x 1 , … , x n = Θ ( 1 ) , then ∑ c = 1 n w c x c = Θ ( n b ) \sum_{c=1}^{n}w_cx_c=\Theta(\sqrt{n}b) ∑ c = 1 n w c x c = Θ ( n b ) .
(A3) Law of large numbers. After a gradient step, the update Δ W \Delta W Δ W of a hidden matrix is aligned with the activations it multiplies, so ∑ c = 1 n Δ W j c x c = Θ ( n δ ) \sum_{c=1}^{n}\Delta W_{jc}x_c=\Theta(n\delta) ∑ c = 1 n Δ W j c x c = Θ ( n δ ) when ∣ Δ W j c ∣ = Θ ( δ ) |\Delta W_{jc}|=\Theta(\delta) ∣Δ W j c ∣ = Θ ( δ ) .
(A4) Adam. With learning rate ρ \rho ρ and a non-degenerate second-moment estimate, every coordinate of an Adam update has magnitude Θ ( ρ ) \Theta(\rho) Θ ( ρ ) , independently of the gradient scale.
Notation. Consider a hidden matrix and the block row W k ∈ R ∣ G k ∣ × s g W_k\in\mathbb{R}^{|G_k|\times sg} W k ∈ R ∣ G k ∣ × s g of (2) that produces output group G k G_k G k , whose supported boundary is s = s k s=s_k s = s k . Inside a sub-network t ∈ S t\in\mathcal{S} t ∈ S with t ≥ s t\geq s t ≥ s , let x x x be the input of the matrix, and let
y j = ∑ c = 1 s g ( W k ) j c x c , j ∈ G k , (15) y_j=\sum_{c=1}^{sg}(W_k)_{jc}x_c,\qquad j\in G_k, \tag*{(15)} y j = c = 1 ∑ s g ( W k ) j c x c , j ∈ G k , (15)
be the pre-activation of coordinate j j j . After one optimizer step, the update Δ W k \Delta W_k Δ W k moves it by Δ y j = ∑ c = 1 s g ( Δ W k ) j c x c \Delta y_j=\sum_{c=1}^{sg}(\Delta W_k)_{jc}x_c Δ y j = ∑ c = 1 s g ( Δ W k ) j c x c . Read widths are measured in base widths: the block row of G k G_k G k reads s k = s s_k=s s k = s of them, and the readout of sub-network s s s reads s s s . The proxy width d 0 d_0 d 0 and the base values ( σ 0 , η 0 , λ 0 ) (\sigma_0,\eta_0,\lambda_0) ( σ 0 , η 0 , λ 0 ) are fixed, and the constants hidden in Θ ( ⋅ ) \Theta(\cdot) Θ ( ⋅ ) do not depend on g g g , s s s , t t t , M M M , m m m or e e e .
Proof of Theorem 1
Proof. Step 1: the fan-in does not depend on the sub-network. The sum in Equation 15 has exactly s g sg s g terms in every sub-network t ≥ s t\geq s t ≥ s : the block row reads no coordinate beyond s g sg s g (Equation 2), and sub-network t t t contains all of them because t g ≥ s g tg\geq sg t g ≥ s g . One initialization scale and one learning rate, set by q ( s ) = m s = s g / d 0 q(s)=ms=sg/d_0 q ( s ) = m s = s g / d 0 (Equation 7), therefore serve every sub-network that contains the group.
Step 2: initialization. Table 1 draws the entries of W k W_k W k i.i.d. with standard deviation σ 0 / m s = σ 0 d 0 / ( s g ) \sigma_0/\sqrt{ms}=\sigma_0\sqrt{d_0/(sg)} σ 0 / m s = σ 0 d 0 / ( s g ) . By (A1) and (A2),
E [ y j 2 ] = s g ⋅ σ 0 2 d 0 s g ⋅ Θ ( 1 ) = Θ ( σ 0 2 d 0 ) . (16) \mathbb{E}\left[y_j^2\right]=sg\cdot\frac{\sigma_0^2d_0}{sg}\cdot\Theta(1)=\Theta(\sigma_0^2d_0). \tag*{(16)} E [ y j 2 ] = s g ⋅ s g σ 0 2 d 0 ⋅ Θ ( 1 ) = Θ ( σ 0 2 d 0 ) . (16)
Step 3: one AdamW step. The learning rate of W k W_k W k is η 0 / ( m s ) = η 0 d 0 / ( s g ) \eta_0/(ms)=\eta_0d_0/(sg) η 0 / ( m s ) = η 0 d 0 / ( s g ) , so by (A4) every coordinate of its update satisfies ∣ ( Δ W k ) j c ∣ = Θ ( η 0 d 0 / ( s g ) ) |(\Delta W_k)_{jc}|=\Theta(\eta_0d_0/(sg)) ∣ ( Δ W k ) j c ∣ = Θ ( η 0 d 0 / ( s g )) , and by (A3)
Δ y j = ∑ c = 1 s g ( Δ W k ) j c x c = Θ ( s g ⋅ η 0 d 0 s g ) = Θ ( η 0 d 0 ) . (17) \Delta y_j=\sum_{c=1}^{sg}(\Delta W_k)_{jc}x_c=\Theta\left(sg\cdot\frac{\eta_0d_0}{sg}\right)=\Theta(\eta_0d_0). \tag*{(17)} Δ y j = c = 1 ∑ s g ( Δ W k ) j c x c = Θ ( s g ⋅ s g η 0 d 0 ) = Θ ( η 0 d 0 ) . (17)
The decoupled weight decay of AdamW, which is scaled by the learning rate, multiplies each coordinate by
1 − η 0 m s ⋅ λ 0 m s = 1 − η 0 λ 0 (18) 1-\frac{\eta_0}{ms}\cdot\lambda_0ms=1-\eta_0\lambda_0 \tag*{(18)} 1 − m s η 0 ⋅ λ 0 m s = 1 − η 0 λ 0 (18)
per step, the same factor for every decayed parameter group and every width.
Step 4: FFN down projection. In the FFN down projection, the block row of G k G_k G k reads e s g esg es g coordinates, and its output carries the forward multiplier 1 / e 1/e 1/ e (Table 1). With initialization σ 0 e / m s \sigma_0\sqrt{e}/\sqrt{ms} σ 0 e / m s and learning rate η 0 / ( m s ) \eta_0/(ms) η 0 / ( m s ) , the computations of Steps 2 and 3 become
E [ y j 2 ] = e − 2 ⋅ e s g ⋅ e σ 0 2 d 0 s g ⋅ Θ ( 1 ) = Θ ( σ 0 2 d 0 ) , (19) \mathbb{E}\left[y_j^2\right]=e^{-2}\cdot esg\cdot\frac{e\sigma_0^2d_0}{sg}\cdot\Theta(1)=\Theta(\sigma_0^2d_0), \tag*{(19)} E [ y j 2 ] = e − 2 ⋅ es g ⋅ s g e σ 0 2 d 0 ⋅ Θ ( 1 ) = Θ ( σ 0 2 d 0 ) , (19)
Δ y j = Θ ( e − 1 ⋅ e s g ⋅ η 0 d 0 s g ) = Θ ( η 0 d 0 ) , (20) \Delta y_j=\Theta\left(e^{-1}\cdot esg\cdot\frac{\eta_0d_0}{sg}\right)=\Theta(\eta_0d_0), \tag*{(20)} Δ y j = Θ ( e − 1 ⋅ es g ⋅ s g η 0 d 0 ) = Θ ( η 0 d 0 ) , (20)
so both scales are also free of e e e .
Step 5: readouts and embedding. The readout U s U_s U s reads the s g sg s g coordinates of N s o u t ( x s ( L ) ) N_s^{\mathrm{out}}(x_s^{(L)}) N s out ( x s ( L ) ) (Equation 6), which is exactly the fan-in of the group with boundary s s s , and Table 1 gives it the same initialization and learning rate, following the per-layer scaling of Everett et al. [12 ] . Steps 2 and 3 therefore give the same two bounds for its logits at initialization and for their change under the update of U s U_s U s , and the learned scalar α s \alpha_s α s rescales them only by Θ ( 1 ) \Theta(1) Θ ( 1 ) . The embedding is a lookup over a fixed vocabulary of size V V V , which does not change with width, and reading its first s g sg s g columns does not change the scale of any coordinate.
Step 6: joint training. Under the joint objective of Equation (8) , the gradient of W k W_k W k sums the contributions of the selected sub-networks t ≥ s t \ge s t ≥ s . By Proposition 1, all of them feed W k W_k W k the same input x x x , so every contribution is an outer product with x x x , and the summed gradient, whatever its scale, keeps each row aligned with x x x ; (A3) therefore applies, and by (A4) the Adam update has coordinates of size Θ ( η 0 / ( m s ) ) \Theta(\eta_0/(ms)) Θ ( η 0 / ( m s )) . The group receives a gradient whenever some selected t ≥ s t \ge s t ≥ s has ω t > 0 \omega_t > 0 ω t > 0 , which holds for t = M t = M t = M when ω M > 0 \omega_M > 0 ω M > 0 , and the readout U s U_s U s whenever s ∈ A τ s \in\mathcal{A}_\tau s ∈ A τ and ω s > 0 \omega_s > 0 ω s > 0 . Steps 2–5 therefore hold for the jointly trained supernet.
The constants Θ ( σ 0 2 d 0 ) \Theta(\sigma_0^2d_0) Θ ( σ 0 2 d 0 ) and Θ ( η 0 d 0 ) \Theta(\eta_0d_0) Θ ( η 0 d 0 ) of Equations (16) and (17) depend on neither s s s , t t t , M M M nor m m m , which proves (i) and (ii) for every hidden group and every readout.
Proof of Proposition 2
Proof. Consider a hidden matrix whose input satisfies (A1), such as a projection that reads a group-local norm, and let all of its groups share the initialization standard deviation b b b , the learning rate ρ \rho ρ and the forward multiplier, which we absorb into b b b and ρ \rho ρ .
Fixed ratios. The group with boundary s s s sums over s g sg s g coordinates (Step 1 of Appendix C.2), so by (A2)–(A4)
y j = Θ ( s g b ) , Δ y j = Θ ( s g ρ ) . (21) y_j = \Theta(\sqrt{sg}\,b), \qquad\Delta y_j = \Theta(sg\,\rho). \tag*{(21)} y j = Θ ( s g b ) , Δ y j = Θ ( s g ρ ) . (21)
For boundaries s < s ′ s < s' s < s ′ , the pre-activations and updates of the two groups therefore differ by the factors Θ ( s ′ / s ) \Theta(\sqrt{s'/s}) Θ ( s ′ / s ) and Θ ( s ′ / s ) \Theta(s'/s) Θ ( s ′ / s ) , which do not depend on ( b , ρ ) (b,\rho) ( b , ρ ) : changing the shared pair rescales all groups together and leaves these factors unchanged.
Calibrations. Calibrating the shared pair for the group with boundary r ∈ S r \in\mathcal{S} r ∈ S means taking the values of Table 1 for that group, b = σ 0 d 0 / ( r g ) b = \sigma_0\sqrt{d_0}/(rg) b = σ 0 d 0 / ( r g ) and ρ = η 0 d 0 / ( r g ) \rho= \eta_0d_0/(rg) ρ = η 0 d 0 / ( r g ) . By Equation (21) , the group with boundary s s s then has
y j = Θ ( σ 0 d 0 ⋅ s / r ) , Δ y j = Θ ( η 0 d 0 ⋅ s / r ) , (22) y_j = \Theta\left(\sigma_0\sqrt{d_0}\cdot\sqrt{s/r}\right), \qquad\Delta y_j = \Theta(\eta_0d_0\cdot s/r), \tag*{(22)} y j = Θ ( σ 0 d 0 ⋅ s / r ) , Δ y j = Θ ( η 0 d 0 ⋅ s / r ) , (22)
so it deviates from the scales Θ ( σ 0 d 0 ) \Theta(\sigma_0\sqrt{d_0}) Θ ( σ 0 d 0 ) and Θ ( η 0 d 0 ) \Theta(\eta_0d_0) Θ ( η 0 d 0 ) of Theorem 1 by the factors s / r \sqrt{s/r} s / r and s / r s/r s / r .
For r = M r = M r = M , the group with boundary s s s has pre-activations of size Θ ( s / M ) \Theta(\sqrt{s/M}) Θ ( s / M ) and updates of size Θ ( η 0 s / M ) \Theta(\eta_0s/M) Θ ( η 0 s / M ) , up to the constants σ 0 d 0 \sigma_0\sqrt{d_0} σ 0 d 0 and d 0 d_0 d 0 . For r = s 1 r = s_1 r = s 1 , it is inflated by s / s 1 \sqrt{s/s_1} s / s 1 and s / s 1 s/s_1 s / s 1 , and the outermost group by M / s 1 \sqrt{M/s_1} M / s 1 and M / s 1 M/s_1 M / s 1 .
No shared pair is uniformly maximal. Let the core and the outermost group deviate from the scales of Theorem 1 by the factors a 1 a_1 a 1 and a K a_K a K at initialization. By the fixed ratios, a K / a 1 = Θ ( M / s 1 ) a_K/a_1 = \Theta(\sqrt{M/s_1}) a K / a 1 = Θ ( M / s 1 ) , so max ( a 1 , a 1 − 1 , a K , a K − 1 ) \max(a_1,a_1^{-1},a_K,a_K^{-1}) max ( a 1 , a 1 − 1 , a K , a K − 1 ) grows at least as ( M / s 1 ) 1 / 4 (M/s_1)^{1/4} ( M / s 1 ) 1/4 ; the same argument for the updates gives ( M / s 1 ) 1 / 2 (M/s_1)^{1/2} ( M / s 1 ) 1/2 . Over supernets with unbounded M / s 1 M/s_1 M / s 1 , no shared pair keeps both factors within constants independent of M M M , so none is maximal in the sense of Theorem 1 for every group. When M / s 1 M/s_1 M / s 1 is bounded, the mismatch is a bounded factor: for S = { 4 , 5 , 6 , 7 , 8 } \mathcal{S} = \{4,5,6,7,8\} S = { 4 , 5 , 6 , 7 , 8 } , M / s 1 = 2 M/s_1 = 2 M / s 1 = 2 , and any shared pair leaves the core and the outermost group 2 \sqrt{2} 2 apart at initialization and 2 2 2 apart in the update.
Proof of Corollary 1
Proof. The proof of Theorem 1 holds for every base width g = m d 0 g = md_0 g = m d 0 and every supported set S ⊆ { 1 , … , M } \mathcal{S} \subseteq\{1,\ldots,M\} S ⊆ { 1 , … , M } . Its constants, Θ ( σ 0 2 d 0 ) \Theta(\sigma_0^2d_0) Θ ( σ 0 2 d 0 ) in Equation (16) , Θ ( η 0 d 0 ) \Theta(\eta_0d_0) Θ ( η 0 d 0 ) in Equation (17) and the decay factor 1 − η 0 λ 0 1-\eta_0\lambda_0 1 − η 0 λ 0 in Equation (18) , depend only on the proxy width m d 0 md_0 m d 0 and on the tuned values: m m m and M M M enter only through the active input widths, which the rule of Table 1 cancels. The proxy is the special case M = 1 M=1 M = 1 , g = d 0 g=d_0 g = d 0 (so m = s = 1 m=s=1 m = s = 1 ) of the same computation, so the values tuned on it set the same constants in every group and readout of every target. This gives (i) for any ShellElastic supernet and (ii) under any increase of m m m or M M M .
Extension to other elastic architectures
The proofs above use the block structure of ShellElastic only in Step 1 of Appendix C.§ 2 , to show that a group has the same fan-in and the same input in every sub-network that contains it. For the other elastic architectures of Section 3.2, under their rules in Appendix § 12 , Theorem 1 holds with sub-network s s s in place of the group with boundary s s s : the hidden matrices of every sub-network s s s satisfy (i), and (ii) at each step that trains that sub-network. The readouts are treated per architecture below.
StairFormer. Its hidden matrices have the connectivity of ShellElastic with S = { 1 , … , M } S = \{1,\ldots,M\} S = { 1 , … , M } and follow Table 1 , and all sub-networks are trained at every step, so the proof of Theorem 1 applies verbatim. Its single readout, of which sub-network s s s reads the first s g sg s g columns, takes the split of Equation (23) , which gives these columns the initialization σ 0 / m s \sigma_0/\sqrt{ms} σ 0 / m s and the learning rate η 0 / ( m s ) \eta_0/(ms) η 0 / ( m s ) of U s U_s U s in Table 1 ; since every sub-network feeds them the prefix x : s g ( L ) x_{:sg}^{(L)} x : s g ( L ) up to its terminal norm, Steps 5 and 6 apply.
Fully elastic models. Sub-network s s s reads the top-left slice W s W_s W s of every hidden matrix, whose fan-in s g sg s g (e s g esg es g for the FFN down projection) varies with s s s . By Equation (23) , W s W_s W s has the initialization standard deviation σ 0 / m s \sigma_0/\sqrt{ms} σ 0 / m s (σ 0 e / m s \sigma_0\sqrt{e}/\sqrt{ms} σ 0 e / m s with the output multiplier 1 / e 1/e 1/ e for the FFN down projection), and since Δ \Delta Δ moves by Θ ( η 0 / m ) \Theta(\eta_0/m) Θ ( η 0 / m ) per coordinate under (A4), W s W_s W s moves by Θ ( η 0 / ( m s ) ) \Theta(\eta_0/(ms)) Θ ( η 0 / ( m s )) per coordinate. These are the values of Table 1 at fan-in s g sg s g , so Steps 2–4 give the pre-activations of sub-network s s s the scales Θ ( σ 0 d 0 ) \Theta(\sigma_0\sqrt{d_0}) Θ ( σ 0 d 0 ) at initialization and Θ ( η 0 d 0 ) \Theta(\eta_0d_0) Θ ( η 0 d 0 ) after one step. At a step that trains sub-network s s s , the update of Δ \Delta Δ is computed from the input of sub-network s s s , so (A3) applies to the update of W s W_s W s ; (ii) does not need the steps that train other sub-networks. The shared readout takes the same split with the multiplier α s \alpha_s α s (Appendix § 12 ), so the columns that sub-network s s s reads have the initialization σ 0 / m s \sigma_0/\sqrt{ms} σ 0 / m s and the learning rate η 0 / ( m s ) \eta_0/(ms) η 0 / ( m s ) of U s U_s U s in Table 1 , and Step 5 gives its logits the same two scales.
MatFormer. Only the FFN down projection has a fan-in that varies with the sub-network, s h 0 = e s D m o d e l = e s m d 0 sh_0 = esD_{\mathrm{model}} = esmd_0 s h 0 = es D model = es m d 0 . With the split and the output multiplier 1 / e 1/e 1/ e , its slice has the effective initialization σ 0 / e m s \sigma_0/\sqrt{ems} σ 0 / e m s and the effective learning rate η 0 / ( e m s ) \eta_0/(ems) η 0 / ( e m s ) , so Step 4 gives the same constants with s D m o d e l sD_{\mathrm{model}} s D model in place of s g sg s g . Every other hidden matrix and the shared readout have the fixed fan-in D m o d e l = m d 0 D_{\mathrm{model}} = md_0 D model = m d 0 and take the factor m m m , which is the rule of Table 1 with s = 1 s = 1 s = 1 and gives the same constants by Steps 2, 3 and 5. As for fully elastic models, (A3) applies at each step to the sub-network trained at that step.
Transfer. In all three architectures, m m m and s s s enter only through fan-ins that the rules cancel, so the constants Θ ( σ 0 d 0 ) \Theta(\sigma_0\sqrt{d_0}) Θ ( σ 0 d 0 ) and Θ ( η 0 d 0 ) \Theta(\eta_0d_0) Θ ( η 0 d 0 ) and the decay factor 1 − η 0 λ 0 1-\eta_0\lambda_0 1 − η 0 λ 0 , which Δ \Delta Δ obtains from its learning rate η 0 / m \eta_0/m η 0 / m and weight decay λ 0 m \lambda_0m λ 0 m , depend only on d 0 d_0 d 0 and the base values. The proof of Corollary 1 therefore carries over to every m m m and every supported set.
μ \mu μ -Elastic for other elastic architectures
All three elastic baselines use the proxy width d 0 = 128 d_0 = 128 d 0 = 128 and the base values ( σ 0 , η 0 , λ 0 ) (\sigma_0,\eta_0,\lambda_0) ( σ 0 , η 0 , λ 0 ) of ShellElastic, and their m m m and s s s follow Section 3.2. Tables 5 and 6 list the complete rules of the fully elastic model and MatFormer.
Fully elastic models. A fully elastic model stores every hidden matrix as one dense tensor at the full width, and sub-network s s s reads its top-left slice, whose fan-in is s g sg s g (e s g esg es g for the FFN down projection) varies with s s s . μ \mu μ -Elastic gives this slice the factor m s ms m s : initialization σ 0 / m s \sigma_0/\sqrt{ms} σ 0 / m s , learning rate η 0 / ( m s ) \eta_0/(ms) η 0 / ( m s ) and weight decay λ 0 m s \lambda_0ms λ 0 m s . One stored tensor cannot follow this rule for every s s s , because the initialization and the update scale with different powers of s s s . We therefore split each hidden tensor into a frozen initialization W i n i t W^{\mathrm{init}} W init , drawn at σ 0 / m \sigma_0/\sqrt{m} σ 0 / m , and a trainable delta Δ \Delta Δ , initialized to zero and trained with learning rate η 0 / m \eta_0/m η 0 / m and weight decay λ 0 m \lambda_0m λ 0 m . Sub-network s s s uses
W s = s − 1 / 2 W i n i t [ s l i c e ] + s − 1 Δ [ s l i c e ] . (23) W_s = s^{-1/2}W^{\mathrm{init}}[\mathrm{slice}] + s^{-1}\Delta[\mathrm{slice}]. \tag*{(23)} W s = s − 1/2 W init [ slice ] + s − 1 Δ [ slice ] . (23)
At initialization, W s W_s W s has standard deviation s − 1 / 2 σ 0 / m = σ 0 / m s s^{-1/2}\sigma_0/\sqrt{m} = \sigma_0/\sqrt{ms} s − 1/2 σ 0 / m = σ 0 / m s ; under Adam, Δ \Delta Δ moves by Θ ( η 0 / m ) \Theta(\eta_0/m) Θ ( η 0 / m ) per coordinate, so W s W_s W s moves by Θ ( η 0 / ( m s ) ) \Theta(\eta_0/(ms)) Θ ( η 0 / ( m s )) . Both match Table 1 for every s s s , while weight decay, which acts on Δ \Delta Δ only, pulls W s W_s W s towards its initialization. The main results use one shared sliced readout, of which sub-network s s s reads the first s g sg s g columns; it takes the same split with the multiplier α s \alpha_s α s (Table 5), which gives these columns the initialization σ 0 / m s \sigma_0/\sqrt{ms} σ 0 / m s and the learning rate η 0 / ( m s ) \eta_0/(ms) η 0 / ( m s ) of the per-width readout U s U_s U s of Table 1. Our baseline has g = 64 g = 64 g = 64 (m = 1 / 2 m = 1/2 m = 1/2 ), S = { 6 , 7 , 8 , 9 , 10 } S = \{6, 7, 8, 9, 10\} S = { 6 , 7 , 8 , 9 , 10 } and e = 4 e = 4 e = 4 ; attention nests by heads at d h e a d = 64 d_{\mathrm{head}} = 64 d head = 64 , the norms act over the active width, the embedding is sliced, and one sub-network is sampled uniformly at random per step.
MatFormer. MatFormer keeps D m o d e l D_{\mathrm{model}} D model fixed, so m = D m o d e l / d 0 m = D_{\mathrm{model}}/d_0 m = D model / d 0 , and nests only the FFN hidden width, D f f n ( s ) = s h 0 D_{\mathrm{ffn}}^{(s)} = s h_0 D ffn ( s ) = s h 0 with a base FFN width h 0 h_0 h 0 ; here e = h 0 / D m o d e l e = h_0/D_{\mathrm{model}} e = h 0 / D model takes the place of the FFN expansion, so that the down projection of sub-network s s s reads e s D m o d e l esD_{\mathrm{model}} es D model coordinates. Only the FFN down projection has a fan-in that varies across sub-networks; it takes the factor m s ms m s through the split of Equation (23) , and the other hidden matrices and the readout, whose fan-in D m o d e l D_{\mathrm{model}} D model is fixed, take the non-elastic μ \mu μ P factor m m m , the attention and FFN up/gate matrices through the same split with multiplier 1 1 1 ; the embedding and gains keep the base values (Table 6). Our baseline has D m o d e l = 512 D_{\mathrm{model}} = 512 D model = 512 (m = 4 m = 4 m = 4 ), h 0 = 128 h_0 = 128 h 0 = 128 (e = 1 / 4 e = 1/4 e = 1/4 ) and S = { 4 , 9 , 15 , 22 , 30 } S = \{4, 9, 15, 22, 30\} S = { 4 , 9 , 15 , 22 , 30 } ; attention, normalization, the embedding and a single readout are shared at full width, and one sub-network is sampled uniformly at random per step, as in the original MatFormer recipe.
StairFormer. With equal-width nested blocks, StairFormer has the connectivity of SHELLELASTIC with S = { 1 , … , M } S = \{1, \ldots, M\} S = { 1 , … , M } , so its hidden matrices follow Table 1 without a split. Its single readout, of which sub-network s s s reads the first s g sg s g columns, has a fan-in that varies with s s s and takes the factor m s ms m s through the split of Equation (23) . Our StairFormer baseline has five 208-wide groups with d h e a d = 104 d_{\mathrm{head}} = 104 d head = 104 , so that each group holds two complete heads.
Training details
This appendix gives the model configurations of the three scales (Appendix § 13 .§ 1 ), the optimization settings (Appendix § 13 .§ 2 ), the parameter counts (Appendix § 13 .§ 3 ), and the training and inference cost (Appendix § 13 .§ 4 ).
Model configurations
Table 7 lists the base width, supported set and size of every model, and Table 8 the remaining architecture settings; Figure 7 shows one layer of SHELLELASTIC and Figure 6 the complete model. Ablations vary only the setting under study relative to the defaults of the 119M–285M scale.
119M–285M scale. The main results at this scale use the models of the first block of Table 7 , trained on 6.55B DCLM-Baseline tokens with the HPs of Table 9 . SHELLELASTIC has g = 128 g = 128 g = 128 with one head per base width (d h e a d = 128 d_{\mathrm{head}} = 128 d head = 128 ), M = 8 M = 8 M = 8 and S = { 4 , 5 , 6 , 7 , 8 } S = \{4, 5, 6, 7, 8\} S = { 4 , 5 , 6 , 7 , 8 } , so each hidden matrix keeps 42 of its 64 blocks of size 128 × 128 128 \times128 128 × 128 , and the FFN expansion is e = 1 e = 1 e = 1 . The two branch norms of every layer are group-local over G 1 , G 2 , G 3 , G 4 , G 5 G_1, G_2, G_3, G_4, G_5 G 1 , G 2 , G 3 , G 4 , G 5 of widths ( 512 , 128 , 128 , 128 , 128 ) (512, 128, 128, 128, 128) ( 512 , 128 , 128 , 128 , 128 ) , queries and keys are normalized per head, and each supported width has its own terminal norm N s o u t N_s^{\mathrm{out}} N s out over all s g s g s g coordinates, readout U s U_s U s and learned scalar α s \alpha_s α s ; all five widths are selected at every step with loss weights ( 1 , 1 , 1 , 1 , 4 ) (1, 1, 1, 1, 4) ( 1 , 1 , 1 , 1 , 4 ) . The proxy is the non-elastic special case M = 1 M = 1 M = 1 at width d 0 = 128 d_0 = 128 d 0 = 128 , and each standalone model is a separately trained model of width 384 to 640 with FFN expansion 4 and d h e a d = 64 d_{\mathrm{head}} = 64 d head = 64 ; the sampled standalone baseline trains these five models in one run of the default length, updating one model sampled uniformly at random per step. Since each of these models takes one step in five on average, the sampled standalone baseline rescales their optimizer HPs to this five times shorter horizon with the token-budget rule of Mlodozeniec et al. [26 ] , consistent with the scaling rules of Section 3.2.
Table 9. Training HPs used unless otherwise specified (Appendix E.1 lists the changes at the two larger scales). The base values η 0 \eta_0 η 0 , σ 0 \sigma_0 σ 0 and λ 0 \lambda_0 λ 0 are scaled per parameter group by μ \mu μ -ELASTIC (Table 1 and Appendix D) or by μ \mu μ P; SP runs use them verbatim.
375M–906M scale. The main results at this scale use the models of the second block of Table 7 . SHELLELASTIC has g = 256 g = 256 g = 256 with two heads per base width (d h e a d = 128 d_{\mathrm{head}} = 128 d head = 128 , m = 2 m = 2 m = 2 ) and otherwise the settings above: M = 8 M = 8 M = 8 , S = { 4 , 5 , 6 , 7 , 8 } S = \{4, 5, 6, 7, 8\} S = { 4 , 5 , 6 , 7 , 8 } , e = 1 e = 1 e = 1 , groups G 1 , G 2 , G 3 , G 4 , G 5 G_1, G_2, G_3, G_4, G_5 G 1 , G 2 , G 3 , G 4 , G 5 of widths ( 1024 , 256 , 256 , 256 , 256 ) (1024, 256, 256, 256, 256) ( 1024 , 256 , 256 , 256 , 256 ) and loss weights ( 1 , 1 , 1 , 1 , 4 ) (1, 1, 1, 1, 4) ( 1 , 1 , 1 , 1 , 4 ) . MatFormer has D m o d e l = 1024 D_{\mathrm{model}} = 1024 D model = 1024 (m = 8 m = 8 m = 8 ), h 0 = 128 h_0 = 128 h 0 = 128 (e = 1 / 8 e = 1/8 e = 1/8 ) and S = { 8 , 17 , 27 , 38 , 51 } S = \{8, 17, 27, 38, 51\} S = { 8 , 17 , 27 , 38 , 51 } , and the fully elastic model has g = 64 g = 64 g = 64 (m = 1 / 2 m = 1/2 m = 1/2 ), S = { 13 , 15 , 17 , 19 , 21 } S = \{13, 15, 17, 19, 21\} S = { 13 , 15 , 17 , 19 , 21 } and e = 2.75 e = 2.75 e = 2.75 . The standalone models have widths 832 to 1344 (g = 64 g = 64 g = 64 , M = 13 , 15 , 17 , 19 , 21 M = 13, 15, 17, 19, 21 M = 13 , 15 , 17 , 19 , 21 ) with FFN expansion 2.75 and d h e a d = 64 d_{\mathrm{head}} = 64 d head = 64 , and the sampled standalone baseline trains these five models in one run. Every run at this scale takes 50,000 steps of 256 sequences (26.2B tokens), decays the learning rate linearly from step 40,000 to 0 at step 50,000 and reports the validation loss at step 50,000; all other settings are those of the 119M–285M scale.
675M–1.69B scale. The main results at this scale use the models of the third block of Table 7 . SHELLELASTIC is the supernet of the 375M–906M scale with FFN expansion e = 4 e = 4 e = 4 . MatFormer has D m o d e l = 1024 D_{\mathrm{model}} = 1024 D model = 1024 (m = 8 m = 8 m = 8 ), h 0 = 256 h_0 = 256 h 0 = 256 (e = 1 / 4 e = 1/4 e = 1/4 ) and S = { 16 , 24 , 34 , 45 , 57 } S = \{16, 24, 34, 45, 57\} S = { 16 , 24 , 34 , 45 , 57 } , and the fully elastic model and the standalone models keep the widths of the 375M–906M scale with FFN expansion 7.25. Every run at this scale takes 100,000 steps of 256 sequences (52.4B tokens), decays the learning rate linearly from step 85,000 to 0 at step 100,000 and reports the validation loss at step 100,000. For the doubled horizon, the optimizer HPs are rescaled to η 0 = 1.41 × 10 − 3 \eta_0 = 1.41 \times10^{-3} η 0 = 1.41 × 1 0 − 3 , λ 0 = 7.07 × 10 − 3 \lambda_0 = 7.07 \times10^{-3} λ 0 = 7.07 × 1 0 − 3 , β 1 = β 2 = 0.975 \beta_1 = \beta_2 = 0.975 β 1 = β 2 = 0.975 and ϵ = 1.41 × 10 − 14 \epsilon= 1.41 \times10^{-14} ϵ = 1.41 × 1 0 − 14 , and the sampled standalone baseline rescales its own values in the same way; each model is fully sharded over the 8 GPUs, and all other settings are those of the 375M–906M scale.
Optimization
Table 9 lists the optimization settings used unless otherwise specified: the proxy sweeps, the elastic models, the baselines and the standalone models differ only in their architecture and in the per-group multipliers of their parameterization. The training objective includes the z z z -loss of Equation (8) with λ z = 10 − 4 \lambda_z = 10^{-4} λ z = 1 0 − 4 ; all reported losses, both training and validation, are the cross-entropy alone, averaged over non-padded tokens.
Parameter counts
The parameters of a sub-network count the non-zero weights it reads, its embedding columns, and its own terminal norm and readout; the two tensors of a frozen-plus-delta split (Equation (23) ) count once. The baselines were sized to these counts (Table 8 ), and Table 10 lists them for every sub-network of the main results at the three scales.
caption:
:::
Training and inference cost
Compute. By (9) , a step of SHELLELASTIC runs one trunk pass at the full width and adds only one terminal norm and readout per supported width. Updating every width once takes one trunk pass per width with MatFormer, the fully elastic model and the standalone models, and sampling one width per step instead makes the cost vary from step to step.
Measurement protocol. For Table 11 , each tier runs as its own sub-network on A100-40GB GPUs, with the model sharded as in training. Latency is the mean of three passes after two warm-up passes (forward and backward for training, forward only for inference), and peak training memory is PyTorch’s peak allocated memory per GPU during a training step, which for SHELLELASTIC trains all five tiers.
Table 11. Latency and peak training memory at the 119M–285M scale on A100-40GB GPUs, for one GPU’s batch of 16 sequences of 2,048 tokens, with each tier run as its own sub-network (protocol in Appendix E.4). Entries are means over runs, with the standard deviation as a subscript; Avg. averages the tiers. {sup}†`Five separately trained models.
Activation checkpointing. The runs of Table 11 train with activation checkpointing on every other transformer block (16 of 32), whose forward pass is recomputed during the backward pass. Training latency therefore includes this recomputation (on H100 GPUs, the Standalone models train 14–19% faster without it), and peak training memory keeps only the inputs of the checkpointed blocks (without checkpointing, Standalone needs 1.9× the memory); inference latency is a plain forward pass and is unaffected.
Sampled standalone. Sampled standalone trains the same five models as Standalone, one per step, so its per-tier latency and memory are those of Standalone: in its training runs, the logged latencies agree within 2%, and the 2.2–2.6 GB of extra memory it logged comes from our implementation keeping the four inactive models’ weights and optimizer states on the GPU, which offloading them would remove.
Observations. Two observations emerge:
The shared trunk is the saving of the architecture. One training step of SHELLELASTIC updates all five tiers, whereas updating every tier once takes five steps with MatFormer and the fully elastic model (one per tier) and one step of each model with Standalone.
Fused kernels lower the per-tier cost. At equal parameters, all methods need about the same effective FLOPs per tier, so the lower per-tier latency and memory of SHELLELASTIC in Table 11 come from our fused implementation: Triton kernels compute the RMSNorms of every transformer block, including the query and key normalizations, and read the queries and keys directly from the output of the QKV projection without copying them.
Evaluation details
Validation loss. The validation loss is the next-token cross-entropy on held-out C4 text, averaged over non-padded tokens, computed every 2,500 steps and reported at the final step. Each supported sub-network is extracted from the supernet as in § 3.3 and evaluated on its own, on the same validation batches as every other model, so losses are comparable across widths, families and the standalone models.
Downstream tasks. During pretraining, we also probe 5-shot accuracy on ARC-Easy, PIQA and HellaSwag at the same interval. After pretraining, we evaluate every sub-network on 13 datasets spanning five skill areas, following the protocol of DCLM and OLMoE, in a 5-shot setting on the standard community splits (Table 12 ). Multiple-choice tasks are scored by accuracy, with a random baseline of 25% for four-choice and 50% for two-choice items; WinoGrande uses its cloze formulation, LAMBADA is scored by exact match of the final word, and SVAMP by exact match of the generated numerical answer. For elastic models, we report the accuracy of every sub-network and their mean. The datasets of each skill area are described below.
Table 12. Downstream evaluation suite. All tasks are evaluated 5-shot; ARC-Easy, PIQA and HellaSwag are also probed during pretraining. MC: multiple-choice accuracy; EM: exact match.
World knowledge. Exam-style and science questions that probe academic knowledge.
MMLU (Hendrycks et al., [16 ] ) (14,042 items, four-choice): exam-style questions from 57 subjects across the sciences, humanities and social sciences.
ARC-Easy and ARC-Challenge (Clark et al., [7 ] ) (2,376 and 1,172 items, four-choice): grade-school science questions; the Challenge subset holds the questions that retrieval and co-occurrence methods answer incorrectly.
Symbolic problem solving. Arithmetic reasoning with a generated answer.
SVAMP (Patel et al., [29 ] ) (300 problems, free-response): short arithmetic word problems with numerical answers; the model generates a derivation followed by the answer, which is scored by exact match.
Commonsense reasoning. Everyday causal and physical knowledge.
COPA (Gordon et al., [14 ] ) (100 items, two-choice): choose the more plausible cause or effect of a premise.
PIQA (Bisk et al., [1 ] ) (1,838 items, two-choice): choose the more sensible solution to a physical task.
Language understanding. Narrative coherence, coreference and the use of broad context.
HellaSwag (Zellers et al., [43 ] ) (10,042 items, four-choice): choose the most plausible continuation of a partial narrative.
WinoGrande (Sakaguchi et al., [31 ] ) (1,267 items, two-choice): fill a blank with one of two candidates so that the sentence is coherent.
LAMBADA (Paperno et al., [28 ] ) (5,153 passages): predict the final word of a passage that requires broad discourse context.
Reading comprehension. Questions answered from a given passage or argument.
BoolQ (Clark et al., [6 ] ) (3,270 items, yes/no): answer a binary question about a short passage.
AGIEval LSAT-RC, LSAT-LR and SAT-EN (Zhong et al., [45 ] ) (268, 510 and 206 items, four-choice): LSAT reading-comprehension and logical-reasoning questions and SAT English questions.
Complete main results
Tables 13–27 give every metric of every sub-network in Table 2 , one table per scale and tier, and Figure 9 –Figure 11 show the training curves of each scale:
Figure 9. Training curves at the 119M–285M scale (Table 2 ). Columns are the five tiers, from Tier 1 (Low, about 119M parameters) to Tier 5 (Max, about 285M); rows are the train loss, the validation loss and 5-shot accuracy on ARC-Easy, HellaSwag and PIQA. Lines are means over three runs, with shaded bands of ±1 standard deviation; conventions in Appendix § 15 .
Figure 11. Training curves at the 675M–1.69B scale (Table 2). Columns are the five tiers, from Tier 1 (Low, about 675M parameters) to Tier 5 (Max, about 1.69B); rows are the train loss, the validation loss and 5-shot accuracy on ARC-Easy, HellaSwag and PIQA. Each line is a single run; conventions in Appendix G.
Table 13: Per-task results at the 119M–285M scale, Tier 1 (Low, about 119M parameters). Sub-network width 384 for Standalone, sampled standalone and the fully elastic model, FFN hidden width 512 at D m o d e l = 512 D_{\mathrm{model}} = 512 D model = 512 for MatFormer, and 512 for SHELLELASTIC. Mean over three runs, with the standard deviation as a subscript.
Table 13.
Table 17: Per-task results at the 119M–285M scale, Tier 5 (Max, about 285M parameters). Sub-network width 640 for Standalone, sampled standalone and the fully elastic model, FFN hidden width 3840 at D m o d e l = 512 D_{\mathrm{model}} = 512 D model = 512 for MatFormer, and 1024 for SHELLELASTIC. Mean over three runs, with the standard deviation as a subscript.
Table 17.
Table 18: Per-task results at the 375M–906M scale, Tier 1 (Low, about 375M parameters). Sub-network width 832 for Standalone, sampled standalone and the fully elastic model, FFN hidden width 1024 at D m o d e l = 1024 D_{\mathrm{model}} = 1024 D model = 1024 for MatFormer, and 1024 for SHELLELASTIC. Mean over three runs, with the standard deviation as a subscript.
Table 18.
Figure 10. Training curves at the 375M–906M scale (Table 2 ). Columns are the five tiers, from Tier 1 (Low, about 375M parameters) to Tier 5 (Max, about 906M); rows are the train loss, the validation loss and 5-shot accuracy on ARC-Easy, HellaSwag and PIQA. Lines are means over three runs, with shaded bands of ±1 standard deviation; conventions in Appendix § 15 .
Table 22: Per-task results at the 375M–906M scale, Tier 5 (Max, about 906M parameters). Sub-network width 1344 for Standalone, sampled standalone and the fully elastic model, FFN hidden width 6528 at D m o d e l = 1024 D_{\mathrm{model}} = 1024 D model = 1024 for MatFormer, and 2048 for SHELLELASTIC. Mean over three runs, with the standard deviation as a subscript.
Table 22.
Table 23: Per-task results at the 675M–1.69B scale, Tier 1 (Low, about 675M parameters). Sub-network width 832 for Standalone, sampled standalone and the fully elastic model, FFN hidden width 4096 at D m o d e l = 1024 D_{\mathrm{model}} = 1024 D model = 1024 for MatFormer, and 1024 for SHELLELASTIC. Single runs.
Table 23.
Table 27. Per-task results at the 675M–1.69B scale, Tier 5 (Max, about 1.69B parameters). Sub-network width 1344 for Standalone, sampled standalone and the fully elastic model, FFN hidden width 14592 at D m o d e l = 1024 D_{\mathrm{model}} = 1024 D model = 1024 for MatFormer, and 2048 for SHELLELASTIC. Single runs.
Tables. Each table gives the parameter count, the train loss (cross-entropy without the z z z -loss, mean over the last 500 steps), the validation loss at the last step, and the 5-shot accuracy (%) on each of the 13 downstream tasks of Appendix F, grouped by field as there (LSAT-RC, LSAT-LR and SAT-EN are from AGIEval), with their average (the accuracy of Table 2 ). At the 119M–285M and 375M–906M scales, entries are the mean over three runs of the same configuration and seed, with the standard deviation as a subscript; at the 675M–1.69B scale, every entry is a single run. Standalone† is five separately trained models, each trained for the full number of steps, which together take 5 × 5 \times 5 × the optimizer steps of any other column. Bold marks the best entry among the four methods that train all five sizes within one run.
Curves. Each figure has one column per tier and plots, against the global training step, the train loss (the logged means over 50-step intervals), the validation loss, and 5-shot accuracy on ARC-Easy, HellaSwag and PIQA, the three benchmarks evaluated during training. Sampled standalone, MatFormer and the fully elastic model sample one sub-network uniformly at random per step, SHELLELASTIC updates all sizes at every step, and Standalone trains each size separately for the full number of steps (5 × 5 \times 5 × the steps). Values are plotted as logged, without smoothing or clipping, and y-axes are shared within each row.
Table 14: Per-task results at the 119M–285M scale, Tier 2 (Medium, about 153M parameters). Sub-network width 448 for Standalone, sampled standalone and the fully elastic model, FFN hidden width 1152 at D m o d e l = 512 D_{\mathrm{model}} = 512 D model = 512 for MatFormer, and 640 for SHELLELASTIC. Mean over three runs, with the standard deviation as a subscript.
Table 14.
Table 15. Per-task results at the 119M–285M scale, Tier 3 (High, about 192M parameters). Sub-network width 512 for Standalone, sampled standalone and the fully elastic model, FFN hidden width 1920 at D m o d e l = 512 D_{\mathrm{model}} = 512 D model = 512 for MatFormer, and 768 for SHELLELASTIC. Mean over three runs, with the standard deviation as a subscript.
Table 16. Per-task results at the 119M–285M scale, Tier 4 (Extra, about 236M parameters). Sub-network width 576 for Standalone, sampled standalone and the fully elastic model, FFN hidden width 2816 at D m o d e l = 512 D_{\mathrm{model}} = 512 D model = 512 for MatFormer, and 896 for SHELLELASTIC. Mean over three runs, with the standard deviation as a subscript.
Table 19: Per-task results at the 375M–906M scale, Tier 2 (Medium, about 486M parameters). Sub-network width 960 for Standalone, sampled standalone and the fully elastic model, FFN hidden width 2176 at D m o d e l = 1024 D_{\mathrm{model}} = 1024 D model = 1024 for MatFormer, and 1280 for SHELLELASTIC. Mean over three runs, with the standard deviation as a subscript.
Table 19.
Table 20: Per-task results at the 375M–906M scale, Tier 3 (High, about 611M parameters). Sub-network width 1088 for Standalone, sampled standalone and the fully elastic model, FFN hidden width 3456 at D m o d e l = 1024 D_{\mathrm{model}} = 1024 D model = 1024 for MatFormer, and 1536 for SHELLELASTIC. Mean over three runs, with the standard deviation as a subscript.
Table 20.
Table 21: Per-task results at the 375M–906M scale, Tier 4 (Extra, about 750M parameters). Sub-network width 1216 for Standalone, sampled standalone and the fully elastic model, FFN hidden width 4864 at D m o d e l = 1024 D_{\mathrm{model}} = 1024 D model = 1024 for MatFormer, and 1792 for SHELLELASTIC. Mean over three runs, with the standard deviation as a subscript.
Table 21.
Table 24: Per-task results at the 675M–1.69B scale, Tier 2 (Medium, about 882M parameters). Sub-network width 960 for Standalone, sampled standalone and the fully elastic model, FFN hidden width 6144 at D m o d e l = 1024 D_{\mathrm{model}} = 1024 D model = 1024 for MatFormer, and 1280 for SHELLELASTIC. Single runs.
Table 24.
Table 25. Per-task results at the 675M–1.69B scale, Tier 3 (High, about 1.12B parameters). Sub-network width 1088 for Standalone, sampled standalone and the fully elastic model, FFN hidden width 8704 at D m o d e l = 1024 D_{\mathrm{model}} = 1024 D model = 1024 for MatFormer, and 1536 for SHELLELASTIC. Single runs.
Table 26. Per-task results at the 675M–1.69B scale, Tier 4 (Extra, about 1.39B parameters). Sub-network width 1216 for Standalone, sampled standalone and the fully elastic model, FFN hidden width 11520 at D m o d e l = 1024 D_{\mathrm{model}} = 1024 D model = 1024 for MatFormer, and 1792 for SHELLELASTIC. Single runs.
Additional transfer results
Figure 12 –Figure 14 repeat the sweeps of Figure 3 for each of the five sub-networks of MatFormer, the fully elastic model and SHELLELASTIC. Lines, stars and Δ \Delta Δ val. loss are as in Figure 3 , with the loss of each sub-network in place of the mean over the five; the proxy line is repeated in every column, and the five panels of a row share one y-range. Two observations emerge:
Figure 12. Per-sub-network sweeps for MatFormer. The sweeps of Figure 3 for each sub-network, from the smallest (Low) to the largest (Max; widths in Table 7 ), with the loss of each sub-network in place of the mean over the five.
Figure 14. Per-sub-network sweeps for SHELLELASTIC , as in Figure 12 .
μ \mu μ -ELASTIC transfers to every sub-network. Under μ \mu μ -ELASTIC, the optimal η 0 \eta_0 η 0 of every sub-network lies between 10 − 3 10^{-3} 1 0 − 3 and 3.3 × 10 − 3 3.3 \times10^{-3} 3.3 × 1 0 − 3 and the optimal σ 0 \sigma_0 σ 0 at 3.3 × 10 − 3 3.3 \times10^{-3} 3.3 × 1 0 − 3 or 10 − 2 10^{-2} 1 0 − 2 , and the base values of § 4.1 are within 0.005 nats of the optimum of every sub-network at the 119M–285M and 375M–906M scales.
The gap between SP and μ \mu μ -ELASTIC is largest at the narrow widths. The gap is larger at the smaller sub-networks at both scales, for example 0.022 nats at Low and 0.007 at Max for SHELLELASTIC in the η 0 \eta_0 η 0 sweep at the 119M–285M scale, as in Table 3 , and 0.015 at Low and 0.003 at Max at the 375M–906M scale.
Weight decay. Figure 15 sweeps the weight decay λ 0 \lambda_0 λ 0 over seven values for the proxy and for SHELLELASTIC at the 119M–285M scale, with η 0 \eta_0 η 0 and σ 0 \sigma_0 σ 0 at the base values of § 4.1 , and Figure 16 shows each sub-network. Two observations emerge:
Figure 16. Per-sub-network weight-decay sweeps. The sweeps of Figure 15 for each sub-network of SHELLELASTIC, from the smallest (Low) to the largest (Max); lines and Δ \Delta Δ val. loss as there, with the loss of each sub-network in place of the mean over the five, and one y-range for all panels.
Weight decay transfers under μ \mu μ -ELASTIC. From λ 0 = 10 − 3 \lambda_0 = 10^{-3} λ 0 = 1 0 − 3 to 10 − 1 10^{-1} 1 0 − 1 , the mean loss of SHELLELASTIC under μ \mu μ -ELASTIC varies by at most 0.003 nats, the same flat range as the proxy’s, and both rise from 3.3 × 10 − 1 3.3 \times10^{-1} 3.3 × 1 0 − 1 on; the base value is within 0.001 nats of the best μ \mu μ -ELASTIC value.
μ \mu μ -ELASTIC is lower than SP at every swept value. From 3.3 × 10 − 3 3.3 \times10^{-3} 3.3 × 1 0 − 3 to 10 − 1 10^{-1} 1 0 − 1 , where SP is also flat (within 0.009 nats), the gap is 0.018–0.028 nats in the mean and again largest at
Figure 13. Per-sub-network sweeps for the fully elastic model , as in Figure 12 .
the narrow widths, 0.023–0.032 nats at Low against 0.010–0.020 at Max. SP also degrades at 10 − 3 10^{-3} 1 0 − 3 , where the gap grows to 0.039 nats, and the gap shrinks to 0.010 and 0.005 nats at 3.3 × 10 − 1 3.3 \times10^{-1} 3.3 × 1 0 − 1 and 1, where both degrade.
Table 28. Effect of μ \mu μ -ELASTIC on each elastic model at the 119M–285M and 375M–906M scales , the values of Table 3 with four decimals.
Architecture comparison and search
This appendix complements § 4.3 : Appendix § 17 .§ 1 gives the per-task results and training curves of StairFormer, and Appendix § 17 .§ 2 details the architecture search at equal parameters and width count.
StairFormer [36 ] nests sub-networks as prefixes of one forward pass with equal-width groups, S = { 1 , … , M } S = \{1,\ldots,M\} S = { 1 , … , M } in our notation; it normalizes over cumulative prefixes Equation (25) and shares one terminal-norm gain and one readout across sub-networks. Our StairFormer baseline has five 208-wide groups (g = 208 g = 208 g = 208 , S = { 1 , 2 , 3 , 4 , 5 } S = \{1,2,3,4,5\} S = { 1 , 2 , 3 , 4 , 5 } ) with d h e a d = 104 d_{\mathrm{head}} = 104 d head = 104 , so that each group holds two complete heads, and an FFN hidden width of 236 per group (e ≈ 1.13 e \approx1.13 e ≈ 1.13 , against e = 1 e = 1 e = 1 for SHELLELASTIC), so that its Max matches that of SHELLELASTIC in parameters. Like SHELLELASTIC, it trains all sub-networks at every step; we give it the data, steps, HPs and loss weights of § 4.1 , and μ \mu μ -ELASTIC with m = 208 / 128 = 1.625 m = 208/128 = 1.625 m = 208/128 = 1.625 (Appendix § 12 ). Table 29 gives its per-task results at every tier, and Figure 17 its training curves next to the methods of Table 2 other than sampled standalone. Two observations emerge:
Only Max is parameter-matched. StairFormer’s Max and that of SHELLELASTIC both have 279.6M parameters, but at Tiers 1–4, StairFormer’s sub-networks are 14–73% smaller (32.6–200.4M against 118.8–233.1M), so these pairs compare sub-networks of different sizes; Figure 4 compares the validation loss and average 5-shot accuracy against parameter count.
At Max, SHELLELASTIC is better on most tasks. At the matched size, SHELLELASTIC is better on 9 of the 13 tasks and worse on 4 (MMLU, SVAMP, WinoGrande and LSAT-RC).
Architecture search at equal parameters and width count
The runs of Figure 4 c and Figure 19 train every supported width at every step with the default recipe and change only S S S . A supported set fixes how many of the M 2 M^2 M 2 blocks of size g × g g \times g g × g a hidden matrix keeps: group G k G_k G k has s k − s k − 1 s_k - s_{k-1} s k − s k − 1 block rows, each reading s k s_k s k input blocks, so
Figure 19. As Figure 4 c, at B = 39 B = 39 B = 39 with six supported widths (core placement S = { 3 , 4 , 5 , 6 , 7 , 8 } \mathcal{S} = \{3, 4, 5, 6, 7, 8\} S = { 3 , 4 , 5 , 6 , 7 , 8 } , black).
B ( S ) = ∑ k = 1 K ( s k − s k − 1 ) s k . (24) B(S) = \sum_{k=1}^{K} (s_k - s_{k-1})s_k. \tag*{(24)} B ( S ) = k = 1 ∑ K ( s k − s k − 1 ) s k . (24)
We compare two families of supported sets (Figure 18 ): five supported widths at B = 42 B = 42 B = 42 , the block count of the default S = { 4 , 5 , 6 , 7 , 8 } S = \{4,5,6,7,8\} S = { 4 , 5 , 6 , 7 , 8 } , and six supported widths at B = 39 B = 39 B = 39 . Every set contains exactly one group wider than g g g , and the sets of a family differ only in where this group sits, from the last shell to the core. A width at or above the wide group has the same number of blocks wherever the group sits, so its parameter count is the same in every set of the family; a width below it keeps only the lower-triangle blocks and has fewer parameters (63.9M at 384, 93.7M at 512, 127.6M at 640; marked † in Table 30 ). The average in Table 30 is taken over the supported widths of each set, so it covers different widths in different rows, and the core placements have no width below the core.
Table 30. Validation loss of every supported width in the architecture search, at step 25,000, as the one group wider than g g g moves from the last shell (first row of each block) to the core (last row, bold). Params: non-zero parameters (M) of each width; †a width below the wide group, which has fewer parameters. Avg.: mean over the supported widths of each set. Bold marks the lowest value in each column.
Ablation studies
All ablations use the supernet of § 4.1 (g = 128 g = 128 g = 128 , S = { 4 , 5 , 6 , 7 , 8 } S = \{4, 5, 6, 7, 8\} S = { 4 , 5 , 6 , 7 , 8 } ) at the 119M–285M scale and change one setting of its recipe at a time. Tables 31 and 32 list all results, numbered as the paragraphs below; each block of rows ends with the default.
Default and run-to-run variation. The default rows average the three SHELLELASTIC runs of Table 2 , whose standard deviation is at most 0.003 nats in the validation loss of any tier, 0.002 nats in the mean validation loss and 0.32 points in the mean 5-shot accuracy; every other row is a single run. A further run of the default on H100 GPUs is within 0.003 nats of this mean at every tier, so we treat differences below 0.003 nats as run-to-run variation.
Hardware and cost. The default runs used A100 GPUs with activation checkpointing on every other block, as did ablations (11) and (12), whereas ablations (1) to (10) used H100 GPUs without it. Step times and peak memory are compared between runs on the same GPUs with the same activation checkpointing; on H100 GPUs, the reference is the loss-weight runs of (2) (37.1 GB peak memory).
(1) Selected sub-networks per step. Besides the default (All), which selects all five sub-networks at every step, we test three rules for the selected set A τ A_{\tau} A τ of Equation (8) :
Table 32. Ablations (7)–(12) of SHELLELASTIC at the 119M–285M scale, in the format of Table 31 .
Table 31. Ablations (1)–(6) of SHELLELASTIC at the 119M–285M scale. Each block changes one setting of the default recipe and ends with the default. Val. loss is taken at step 25,000 for each tier (Low to Max: widths 512 to 1024), and 5-shot acc. averages the 13 downstream tasks over the five tiers. Bold marks the best value of each column within a block.
Max + random : Max and one of the other four;
Random : one of the five sub-networks uniformly at random, as MatFormer and the fully elastic model do.
Observation: The loss of each sub-network follows how often it is trained, and All gives the lowest mean loss. Sandwich and Max + random keep the loss of Max but raise those of the sub-networks they select less often, by up to 0.024 and 0.086 nats, respectively, and Random raises every tier, Max by 0.095 nats.
(2) Loss weights. With all widths selected at every step, we vary the loss weights ω s \omega_s ω s of (8) : the weight of Max rises from 1 to 2, 4 (the default) and 6, and the decaying weights (1, 0.5, 0.3, 0.2, 2) keep the relative weight of Max at 1 / 2 1/2 1/2 and double that of Low.
Observation: The loss weight of a width moves its loss in the same way as how often it is trained. Raising the weight of Max from 1 to 6 lowers its loss monotonically, by 0.015 nats, and raises the mean loss from 3.306 to 3.313, mostly through Low and Medium. The decaying weights match the default at Max and lower the mean loss by 0.005 nats, mostly through Low. Training all widths at every step with weights ( 1 , 1 , 1 , 1 , 4 ) (1,1,1,1,4) ( 1 , 1 , 1 , 1 , 4 ) is thus within 0.005 nats of the best trade-off we found.
(3) Trunk normalization. We compare three trunk normalizations that all preserve the supported prefixes (Appendix § 10 .§ 2 ): group-local normalization over each G k G_k G k (the default), block-local normalization over every g g g coordinates, and a cumulative prefix norm, which normalizes each block of g g g coordinates with the statistics of all coordinates up to the end of that block. With B b = { ( b − 1 ) g + 1 , … , b g } B_b = \{(b-1)g+1,\ldots,bg\} B b = {( b − 1 ) g + 1 , … , b g } the b b b -th block of g g g coordinates, all three apply Equation (3) with the statistics of a coordinate j ∈ G k ∩ B b j \in G_k \cap B_b j ∈ G k ∩ B b taken over
G k (group-local) , B b (block-local) , { 1 , … , b g } (cumulative prefix) . (25) G_k\ \text{(group-local)},\qquad B_b\ \text{(block-local)},\qquad\{1,\ldots,bg\}\ \text{(cumulative prefix)}. \tag*{(25)} G k (group-local) , B b (block-local) , { 1 , … , b g } (cumulative prefix) . (25)
Observation: The three are within 0.001 nats of each other in mean loss and within 0.003 nats at every tier. They differ only in cost: the prefix norm, which needs cumulative statistics for every prefix of blocks, takes 6% more time per step and 23% more memory in our implementation, while block-local normalization costs the same as group-local normalization.
(4) Terminal norm. We compare normalizing all s g sg s g coordinates of sub-network s s s before its readout (the default, Equation (6) ) with normalizing each group separately, as in the trunk.
Observation: The default is better: 0.003 nats lower in mean loss, mostly at Low to High, and about 1 point higher in mean 5-shot accuracy.
(5) Readout. We compare separate readouts U s U_s U s for every width (the default) with one readout U U U shared by all widths, of which width s s s uses the first s g sg s g columns (with the split of Equation (23) ).
Observation: Separate readouts are better at every tier, by 0.006 nats in mean loss and 0.9 points in mean 5-shot accuracy.
(6) In-place distillation. We distill Low to Extra from Max by adding to the loss of each a weighted KL divergence between its output distribution and that of Max over the full vocabulary: forward KL with weights 0.1, 0.5 and 1, and reverse and symmetric KL with weight 0.5.
Observation: Distillation lowers the loss of Low to High, by up to 0.034 nats at Low, but raises that of Max, by up to 0.008 nats. The mean loss falls by up to 0.010 nats, but the mean 5-shot accuracy stays within 0.6 points of the default and a step takes 2.2 to 2.6 times as long, so we do not use it.
(7) Normalization type. We compare RMSNorm (the default) with LayerNorm with a gain and no bias.
Observation: Both give the same mean loss (3.309) and differ by at most 0.005 nats at any tier, so we keep RMSNorm.
(8) Ensembles of the sub-networks. One trunk pass yields the output distributions p s = softmax ( z s ) p_s = \operatorname{softmax}(z_s) p s = softmax ( z s ) of all five sub-networks, so ensembling them costs little beyond the readouts, and nested sub-networks may still err on different tokens. We use per-token ensembles ∑ s π s p s \sum_s \pi_s p_s ∑ s π s p s , whose weights π s \pi_s π s are non-negative and sum to one, in three ways:
Four ensembles of a trained supernet: uniform weights, π s = 1 / 5 \pi_s = 1/5 π s = 1/5 ; confidence weights, π s ∝ max v p s ( v ) \pi_s \propto\max_v p_s(v) π s ∝ max v p s ( v ) ; the most confident readout, which puts all weight on the sub-network with the largest max v p s ( v ) \max_v p_s(v) max v p s ( v ) ; and the best fixed ensemble, whose weights minimize the loss of the tokens it is evaluated on. As an upper bound, an oracle puts all weight on the readout that assigns the target the highest probability.
Learned router: a two-layer MLP (1024 → \to → 256 → \to → 5, SiLU) maps the last-layer hidden state of Max, after its terminal norm, to one logit per sub-network, and a softmax turns the five logits into the per-token weights π s \pi_s π s ; its output layer is initialized to zero, so the weights start uniform. It is trained jointly with the supernet, whose loss becomes the π \pi π -weighted sum of the five losses at every token plus 0.01 times their unweighted mean, which keeps every sub-network trained.
Distillation from ensembles: every sub-network, including Max, adds a forward KL divergence with weight 0.5 toward one of two teacher ensembles, detached from the gradient: the loss-weighted ensemble , whose weights are the loss weights ω s \omega_s ω s of Equation (8) normalized to sum to one (1/2 on Max, 1/8 on each other sub-network), or the soft oracle , π s ∝ p s ( y ) β \pi_s \propto p_s(y)^\beta π s ∝ p s ( y ) β for target y y y , a smooth version of the oracle that favors the sub-networks assigning y y y a high probability, with β \beta β set at every step so that the weights have a mean normalized entropy of 0.7.
Observation: No ensemble beats Max alone (Table 33 ). The best fixed ensemble matches it, uniform and confidence weights are 0.03 nats worse, and the most confident readout is 0.068 nats worse; only the oracle is better, but it needs the target. The router collapses onto Max, which improves by 0.013 nats, while the other sub-networks, trained only through the 0.01 term, lose 0.041 to 0.365 nats. As predictors, the loss-weighted ensemble is 0.012 nats worse than Max and the soft oracle 0.143 nats better, as it uses the target; yet distillation toward them raises the loss of Max by 0.007 and 0.010 nats and lowers that of Low by 0.018 and 0.010 nats, as in-place distillation does in (6) , and a step takes about 2.6 and 3.0 times as long.
Nested sub-networks versus separately trained models (Table 34 , bottom):
Separately trained models ensemble well. Averaging the Max of two supernets trained with the same settings lowers the loss by 0.056 nats, and that of three by 0.077 nats; uniform weights are already the best fixed weights, as the members are equally strong. The oracle over two such Max sub-networks also gains more than that over the five sub-networks, 0.23 against 0.19 nats. For the five sub-networks of one supernet, no fixed weights improve on Max: they share the trunk and are much more alike, and the narrower ones are weaker, so averaging only dilutes Max.
Outlook: Ensembling the sub-networks remains promising for elastic models: the oracle is 0.19 nats below Max alone and picks a narrower sub-network for 71% of held-out tokens (Table 34 ), and a label-free selection better than confidence could turn part of it into a gain at almost no extra cost.
(9) Stage-residual gradient scaling. The logits of width s k s_k s k are a sum of one term per group,
z s k = α s k ∑ j ≤ k h G j ( k ) ( U s k ) : , G j T , h ( k ) = N s k o u t ( x : s k ( L ) ) , (26) z_{s_k} = \alpha_{s_k} \sum_{j \le k} h^{(k)}_{G_j}(U_{s_k})_{:,G_j}^{\mathsf{T}}, \qquad h^{(k)} = N^{\mathrm{out}}_{s_k}(x^{(L)}_{:s_k}), \tag*{(26)} z s k = α s k j ≤ k ∑ h G j ( k ) ( U s k ) : , G j T , h ( k ) = N s k out ( x : s k ( L ) ) , (26)
so the supernet can be viewed as a sequence of stages: the core gives a base prediction, and each shell adds a correction to the terms of the groups before it, as in residual learning [15 ] . To train the shells toward this role, we scale by γ \gamma γ the gradient that the loss of each width sends into the terms of the narrower groups, through the coordinates of the next narrower sub-network:
∂ ℓ s k ∂ h : s k − 1 g ( k ) ← γ ∂ ℓ s k ∂ h : s k − 1 g ( k ) , k = 2 , … , K . (27) \frac{\partial\ell_{s_k}}{\partial h^{(k)}_{:s_{k-1}g}} \leftarrow\gamma\frac{\partial\ell_{s_k}}{\partial h^{(k)}_{:s_{k-1}g}}, \qquad k=2,\ldots,K. \tag*{(27)} ∂ h : s k − 1 g ( k ) ∂ ℓ s k ← γ ∂ h : s k − 1 g ( k ) ∂ ℓ s k , k = 2 , … , K . (27)
Every width has its own readout and terminal norm, which only its own loss trains, so for γ > 0 \gamma>0 γ > 0 Adam, being invariant to the gradient scale, still trains them in full; the scaling only reduces the gradient that these coordinates pass on to the trunk. The forward pass is unchanged, and γ = 1 \gamma=1 γ = 1 is the joint objective of Equation (8) . With γ = 0 \gamma=0 γ = 0 , the loss of each width reaches the last-layer features of its own shell only, which then fit what the narrower groups leave unexplained, while the wider losses still train the narrower groups inside the trunk.
Observation: A γ \gamma γ between 0.3 and 0.8 lowers the loss of Low by up to 0.028 nats but raises those of Extra and Max by up to 0.012 nats and leaves the mean loss within 0.002 nats. With γ = 0 \gamma=0 γ = 0 , Low is 0.003 nats lower, but the wider widths lose more, from 0.036 nats at Medium to 0.071 at Extra and Max, and the mean loss rises by 0.047 nats, as the last-layer features of the narrower groups no longer adapt to the losses of the wider widths. We therefore keep γ = 1 \gamma=1 γ = 1 .
Outlook: Although γ < 1 \gamma<1 γ < 1 does not lower the mean loss here, the stage view matches a property that SHELLELASTIC has but MatFormer and fully elastic models lack: it can grow after training. Since no group reads a later one (Equation (2) ) and every group is normalized on its own (Equation (3) ), a new shell g K + 1 g_{K+1} g K + 1 can be appended to a trained supernet and trained as a new stage, for example on downstream data, while all trained weights stay frozen, so every trained sub-network keeps its exact outputs. MatFormer and fully elastic models cannot grow this way: new FFN units of MatFormer write into the hidden states that its trained layers read, and new channels of a fully elastic model change the inputs of every trained weight in the wider sub-network, so their trained weights would operate on inputs they were not trained on.
(10) Trunk gradient of the narrower widths. We detach the trunk from the losses of Low to Extra, which then train only their terminal norms and readouts on a trunk trained by Max alone.
Observation: Detaching lowers the loss of Max by 0.014 nats but raises those of Low to Extra by 0.049 to 0.520 nats, so keeping their trunk gradients is much better overall.
(11) Base width and head dimension. At the same supported widths 512 to 1024 and the same parameter counts, halving the base width to g = 64 g=64 g = 64 (M = 16 M=16 M = 16 , S = { 8 , 10 , 12 , 14 , 16 } S=\{8,10,12,14,16\} S = { 8 , 10 , 12 , 14 , 16 } ) keeps the 512-wide core and every shell 128 wide, so the groups, their normalization and the μ \mu μ -ELASTIC factors m S m_S m S are unchanged. We also halve the head dimension to d h e a d = 64 d_{\mathrm{head}}=64 d head = 64 , which g = 64 g=64 g = 64 requires.
Observation: With d h e a d = 64 d_{\mathrm{head}} = 64 d head = 64 in both, g = 64 g = 64 g = 64 and g = 128 g = 128 g = 128 define the same model, and their mean losses differ by 0.001 nats. Halving the head dimension lowers the mean loss by 0.003 to 0.004 nats, mostly at Low. The head dimension thus has a small effect near run-to-run variation, and the base width none; we keep g = d h e a d = 128 g = d_{\mathrm{head}} = 128 g = d head = 128 .
(12) Optimization HPs. We vary the gradient clipping (global norm 0.5, 1 and 2), the AdamW ϵ \epsilon ϵ (10 − 6 10^{-6} 1 0 − 6 , 10 − 8 10^{-8} 1 0 − 8 and 10 − 10 10^{-10} 1 0 − 10 ) and the z z z -loss coefficient λ z \lambda_z λ z (10 − 3 10^{-3} 1 0 − 3 and 10 − 2 10^{-2} 1 0 − 2 ) around the defaults of Table 9 : global norm 4, ϵ = 10 − 14 \epsilon= 10^{-14} ϵ = 1 0 − 14 and λ z = 10 − 4 \lambda_z = 10^{-4} λ z = 1 0 − 4 .
Observation: The defaults are within 0.002 nats in mean loss of clipping at 0.5 or 2, ϵ = 10 − 8 \epsilon= 10^{-8} ϵ = 1 0 − 8 or 10 − 10 10^{-10} 1 0 − 10 , and λ z = 10 − 3 \lambda_z = 10^{-3} λ z = 1 0 − 3 or 10 − 2 10^{-2} 1 0 − 2 . Clipping at 1 is 0.005 nats worse and ϵ = 10 − 6 \epsilon= 10^{-6} ϵ = 1 0 − 6 is 0.007 nats worse, so the recipe is robust to these settings except for a large ϵ \epsilon ϵ .