Anatomical Heterogeneity in Transformer Language Models
Organizations: Independent Researcher, Wroclaw, Poland
Abstract
Current transformer language models are trained with uniform computational budgets across all layers, implicitly assuming layer homogeneity. We challenge this assumption through empirical analysis of SmolLM2-135M, a 30-layer, 135M-parameter causal language model, using five diagnostic metrics: weight predictability (R2), ablation degradation, recovery speed, weight manipulation robustness, and structural analysis. We find profound anatomical heterogeneity: (1) Layer weights follow strong mathematical regularity (R2 = 0.91) with a universal oscillatory delta pattern (correlation ~= -0.50), yet predicted weights cause catastrophic failure due to nonlinear error accumulation. (2) Layer importance spans a 10^7 range, from a critical core (L8-11, up to +63,419% PPL degradation) to anti-layers (L14, L17) whose removal improves performance. (3) Recovery speed correlates with layer importance, indicating differential training requirements. (4) Only weight scaling (alpha = 0.9) preserves model quality among five tested manipulation strategies. (5) Growth Transformer Training, allocating budget by layer importance, achieves ~54% cost reduction. A proof-of-concept experiment confirms this: 4.7x lower validation loss than uniform training at identical parameter count, while being 13% faster.
Figures & tables
| Layer | Degradation (%) | Category | Functional Role |
|---|---|---|---|
| L0 | Redundant | Embedding boundary | |
| L1 | Critical | Input parser | |
| L2 | Critical | Input parser | |
| L3 | Redundant | Padding | |
| L4 | Minor | Feature extraction | |
| L5 | Redundant | Padding |
| Component | Avg | Best | Interpretation |
|---|---|---|---|
| mlp.gate_proj | 0.909 | 0.993 | Highly predictable |
| mlp.down_proj | 0.895 | 0.995 | Highly predictable |
| self_attn.q_proj | 0.824 | 0.989 | Highly predictable |
| self_attn.k_proj | 0.745 | 0.978 | Predictable |
| mlp.up_proj | 0.716 | 0.985 | Predictable |
| self_attn.o_proj | 0.079 | 0.941 | Weakly predictable |
| Component | Avg delta correlation | Pattern |
|---|---|---|
| mlp.down_proj | Oscillatory | |
| mlp.gate_proj | Oscillatory | |
| mlp.up_proj | Oscillatory | |
| self_attn.k_proj | Oscillatory | |
| self_attn.o_proj | Oscillatory | |
| self_attn.q_proj | Oscillatory |
| Strategy | PPL | Degradation |
|---|---|---|
| Baseline (original) | 22.60 | |
| Scale | 26.95 | |
| Scale | 928.22 | |
| Blend (1/distance, 2 layers) | 31,333 | |
| Scale | 86,505 | |
| Skip/Zero (2 layers) | 969,198 |
| Layer | Category | PPL+noise | Final PPL | |||
|---|---|---|---|---|---|---|
| L14 | Redundant | 19.4 | 0 | 0 | 0 | 18.2 |
| L17 | Redundant | 18.5 | 0 | 0 | 0 | 17.6 |
| L5 | Redundant | 21.2 | 0 | 0 | 10 | 19.6 |
| L23 | Important | 26.5 | 0 | 0 | 150 | 19.7 |
| L24 | Critical | 26.8 | 0 | 0 | 110 | 19.6 |
| L3 | Redundant | 27.3 | 0 | 10 | 200 | 27.3 (no conv.) |
| Layer | Role | FFN mult. | Params |
|---|---|---|---|
| L0 | redundant | 459,264 | |
| L1 | critical | 1,049,088 | |
| L2 | critical | 1,049,088 | |
| L3 | redundant | 459,264 | |
| L4 | critical | 1,049,088 | |
| L5 | critical | 1,049,088 |
| Phase | Name | Layers trained | Epochs |
|---|---|---|---|
| 1 | Gastrulation | Core (L4, L5) | 30 |
| 2 | Neurulation | Parser (L1, L2); clone L4 L1, L5 L2 | 20 |
| 3 | Organogenesis | Output (L8, L9); clone L4 L8, L5 L9 | 20 |
| 4 | Growth | Minor (L7, L10); clone L5 L7, L9 L10 | 12 |
| 5 | Connective | Redundant (L0,L3,L6,L11); clone + scale FFN | 6 |
| 6 | Maturation | All layers (fine-tune) | 15 |
| Configuration | Steps | Val loss | Time | vs. Uniform 100% |
|---|---|---|---|---|
| Uniform 100% | 656 | 0.599 | 59.6s | baseline |
| Growth 50% | 416 | 0.279 | – | better, fewer steps |
| Growth 100% | 656 | 0.127 | 52.0s | better, faster |
| Prompt | Growth 100% | Uniform 100% |
|---|---|---|
| the capital of france is | paris | paris. on. |
| cats are | popular pets around the world | popular pets around the world |
| python is a | popular programming language | popular programming language |
| the earth orbits | around the sun every year | around the sun every year |
| water boils at | one hundred degrees celsius | one hundred degrees celsius |
| artificial intelligence | is transforming the way we live | can learn from data |
| Layer Group | Layers | Budget ratio | Justification |
|---|---|---|---|
| Anti-layers | L14, L17 | 0.00 | Prune/randomise; harm performance |
| Instant-recovery redund. | L3, L5, L6, L12, L19 | 0.00–0.05 | 0–10 steps to converge |
| Minor layers | L4, L7, L13, L15–16, L18, L20–22, L25–26 | 0.30–0.50 | Incremental refinement |
| Critical output | L23–24, L27–28 | 0.80–1.00 | Critical; fast recovery |
| Critical core + input | L1–2, L8–11 | 1.00 | Full budget; slow or impossible recovery |
| Boundary layers | L0, L29 | 0.15–0.20 | Anomalous recovery patterns |
Transformer
Transformers are neural architectures that use attention to model relationships among sequence elements in language, vision, and scientific data.
See all 528 papers