Allocation of Parameters in Transformers

Ruoxi Yu, Haotian Jiang, Jingpu Cheng, Penghao Yu, Qianxiao Li, Zhong Li · Submission to ICLR 2026 · Withdrawn

TL;DR

Standard Transformers assign identical attention head counts and head dimensions across all layers, but this one-size-fits-all approach is theoretically suboptimal. This paper proves that early layers require a careful trade-off between head count and head dimension to extract token-level information, while later layers can operate with significantly smaller head dimensions because softmax activations saturate on long sequences. The resulting allocation strategies allow for substantial parameter reduction (up to $4\times$ head compression) with virtually no loss in performance.

What Problem Does This Paper Address?

Modern Large Language Models (LLMs) allocate attention parameters uniformly: if a model has an embedding budget $D$, every layer typically divides it into $H$ attention heads of dimension $d_h = D / H$.

However, interpretability studies have repeatedly demonstrated a distinct "division of labor" across depth:

  • Lower layers act as preprocessors, capturing token-level, surface syntactic dependencies.
  • Higher layers consolidate abstract semantic concepts and often rely on only one or two dominant heads.

Despite this empirical asymmetry, there is little theoretical guidance on how parameters should be split across layers. Does an early layer need many low-dimensional heads or few high-dimensional heads? And can higher layers be made substantially leaner without degrading model capacity?

Methods

The authors analyze parameter allocation through two complementary theoretical lenses:

  1. Information Extraction in Early Layers (Approximation Theory): Modeling early layers as learning linear (convolutional) and nonlinear (Volterra series) combinations of tokens, the authors bound the approximation error under a fixed budget $D = \sum_m H_m d_m$. The error breaks into two competing forces:

  2. A projection error ($\propto \sqrt{1 - d_m/d}$) that decreases when head dimension $d_m$ is large, preserving token features.

  3. An extraction error ($\propto 1/H_m$) that decreases when head count $H_m$ is large, improving functional approximation of relative position kernels. Balancing these two terms yields an explicit optimization problem for choosing $H_m$ and $d_m$.

  4. Softmax Saturation in Later Layers (Jacobian & Low-Rank Analysis): The authors prove that the column-wise Jacobian matrix $J_l$ of the softmax attention operator satisfies $\|J_l\|_2 = \mathcal{O}(1/L)$, where $L$ is the context length. Because the softmax gradient flattens dramatically as sequence length grows, perturbation in the attention logits produces diminishing changes in attention scores. Consequently, using truncated SVD to compress the query/key projection dimension from $d_H$ down to $d_h$ incurs an attention score error of only $\mathcal{O}(\Lambda_h^H / L)$, where $\Lambda_h^H$ is the tail sum of singular values.

  5. Post-Pretraining Compression Strategy: Motivated by the saturation theorem, higher-layer attention heads can be compressed post-hoc: initialize lower-dimensional student heads with the truncated SVD of the teacher’s $W_Q^\top W_K$ matrix, then fine-tune them on attention score matching.

Datasets

The authors validate their theoretical predictions on both synthetic benchmarks and real-world language datasets:

  • Synthetic Linear & 4-gram Tasks: White-noise inputs with additive Gaussian noise where targets are rolling sums of preceding tokens.
  • Synthetic Induction Head Benchmark: Sequence-continuation task (length 128, vocabulary size 10) evaluating multi-step associative memory.
  • WikiText-103: Used for language modeling sweeps on 6-layer GPT-style decoders (using 1% subset, ~1M tokens) and for empirical validation of Jacobian norms and head compression on pretrained models (TinyLlama-1.1B and LiteLlama-460M-1T).

Key Insights and Ideas

  • The Early-Layer Head vs. Dimension Trade-Off: You cannot maximize both expressivity and fidelity simultaneously under a parameter budget. Increasing head dimension preserves raw token features; increasing the number of heads allows the network to track a wider span of relative token positions.
  • Softmax Damps Low-Rank Approximations for Long Contexts: Because the spectral norm of the softmax Jacobian scales as $\mathcal{O}(1/L)$, long-context regimes naturally protect models against projection errors. High-dimensional heads in later layers are mostly redundant.
  • Reducing Dimension Beats Reducing Head Count: Sweeping architectural configurations on WikiText-103 reveals that shrinking the head dimension $d_h$ preserves perplexity far better than pruning the number of heads $H$.

Key Results

  • Exact Match with Theory on $n$-gram Tasks: For an embedding budget $D = 256$ and token dimension $d = 8$, the theoretical optimization bound predicts an optimal configuration of $M = 4$ groups with $H_m = d_m = 8$. Empirical grid search on a 4-gram synthetic task reaches minimum mean squared error (MSE) at precisely this predicted point.
  • Jacobian $\mathcal{O}(1/L)$ Decay: Empirically verified on TinyLlama-1.1B: the spectral norm of the attention softmax Jacobian drops monotonically from $\approx 0.35$ at $L=4$ to $<0.05$ at $L=1024$.
  • Up to $4\times$ Single-Head Compression: In LiteLlama-460M (Layer 5, Head 0), compressing head dimensions from $d_H = 64$ down to $d_h = 16$ yields an attention weight MSE of less than $3 \times 10^{-5}$.
  • Full Decoder Validation: In a 6-layer GPT decoder, decreasing head dimensions down to $16$ caused virtually no penalty on training or validation loss, whereas decreasing head count triggered rapid performance degradation.

Limitations and Future Work

  • Isolated Layer Analysis: The approximation theory primarily treats early layers and late layers in modular stages (preprocessing vs. compression) rather than modeling cross-layer optimization dynamics end-to-end.
  • Positional Encoding Assumptions: Proofs rely on specific assumptions regarding relative positional encodings (e.g., ALiBi-style exponential decays) and bounded inputs.
  • Large-Scale Pretraining from Scratch: While the authors validated head compression post-hoc and on small 6-layer models, validating non-uniform parameter allocation schedules (e.g., wide heads early, narrow heads late) in 7B+ scale pretraining runs remains an open direction for future engineering efforts.

Summary updated

BibTeX
@misc{yu2025allocation,
  author = {Ruoxi Yu and Haotian Jiang and Jingpu Cheng and Penghao Yu and Qianxiao Li and Zhong Li},
  title = {{Allocation of Parameters in Transformers}},
  year = {2025},
  eprint = {2510.03784},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2510.03784},
}
Figure