Measuring Layer-wise Intrinsic Dimensionality of FFNs in LLMs via PCA

Daehee Kim

TL;DR

Almost every modern Large Language Model (LLM) gives every single layer the exact same feed-forward network (FFN) width, silently assuming that early, middle, and late layers all do equally complex work. By measuring the actual "intrinsic dimensionality" of activations across 58 open-weight models using Principal Component Analysis (PCA), this paper reveals that LLMs naturally develop a "middle-heavy" capacity appetite—and shows that reallocating parameters to match this curve makes pruned models significantly smarter on the exact same parameter budget.

What Problem Does This Paper Address?

Since the original 2017 Transformer, LLM architects have defaulted to uniform layer widths: if layer 1 has an FFN intermediate size of 14,336, so does layer 16, and so does layer 32. It is tidy for hardware, sure, but mechanistically suspicious. Years of interpretability research tell us that early layers handle surface-level syntax, middle layers retrieve factual associations, and late layers format predictions.

If layers do qualitatively different jobs, do they really need the exact same representational capacity? Until now, we lacked a simple, data-agnostic way to measure how much width each layer actually uses at scale—and proof that breaking the uniform-width convention actually buys better performance.

Methods

To measure how hard each layer is working, the author hooks into the activation vector right before the FFN's final down-projection (the bottleneck just before information merges back into the residual stream). Passing a small unlabeled text sample through the model, they run standard PCA on each layer's activations.

Here is the clever twist: standard PCA thresholds rely on explained variance (magnitude). However, Transformer layers normalize activations right after they hit the residual stream, washing away magnitude and propagating information primarily via direction. So instead of variance, the author defines a layer's intrinsic dimensionality ($d_\theta$) as the minimum number of principal components needed to reconstruct the activation vector to a 0.99 cosine similarity ($\theta = 0.99$). To summarize how unevenly a model spreads this capacity across depth, they take the standard deviation of relative layer widths, calling this single scalar layer-wise dispersion ($\sigma_{99}$).

To prove $d_\theta$ isn't just a mathematical curiosity, they run a controlled Minitron-style pruning and knowledge distillation (KD) experiment. Given a fixed FFN parameter budget, they compare three student architectures distilled from the same teacher:

  1. PCA-guided: Each layer gets width proportional to its measured $d_\theta$.
  2. UNIFORM: Every layer gets the exact same average width (standard practice).
  3. INVERTED: A mirror-image adversarial control that starves middle layers and bloats the edges.
Three width allocations under matched FFN budgets across four teacher models.

Datasets

No new benchmarks are introduced; the study relies on established corpora to test cross-domain and cross-lingual stability:

  • PCA Calibration & Distillation: SlimPajama (100K tokens for PCA; ~1.57B tokens for KD), plus MMLU, ARC-Challenge (ARC-C), HellaSwag, WikiText (English), and SkyPile (Chinese) to test calibration robustness.
  • Downstream SFT & Evaluation: tulu-3-100k for supervised fine-tuning. Models are evaluated via lm-eval-harness on MMLU, ARC-C, HellaSwag, WinoGrande, PIQA, and GSM8K.

Key Insights and Ideas

  • LLMs have a "middle-heavy" belly: Across 76% of the 58 scanned models (70M to 72B parameters across 14 families), middle layers demand substantially more principal directions than edge layers. A randomly initialized model is flat—this middle-heavy profile is actively learned.
  • It’s in the weights, not the prompt: Measuring Qwen3-8B on English commonsense vs. Chinese web text yields a per-layer Pearson correlation $\ge 0.941$. The capacity profile is an intrinsic signature of the model's weights, not an artifact of calibration data.
Figure 1: Calibration robustness on Qwen3-8B. Per-layer cosine similarity between hl and its rank-d PCA reconstruction at width fractions d/Dl ∈{10%, 20%, . . . , 90%}, measured on six 100K- token calibration corpora: five English (SlimPajama, MMLU, ARC-C, HellaSwag, WikiText) and Chinese SkyPile. Red dashed line marks the θ = 0.99 threshold. All six panels show the same dip at middle layers when d/Dl is small, indicating that more principal directions are required to faithfully reconstruct middle-layer activations. Pairwise per-layer Pearson r on the extracted dθ,l/Dl profiles: five English corpora min 0.953, mean 0.975; English ↔Chinese min 0.941, mean 0.973; all 15 pairs ≥0.941, with the minimum occurring between Chinese SkyPile and HellaSwag.
  • Pretraining sculpts it; fine-tuning freezes it: Tracking pretraining checkpoints shows $\sigma_{99}$ climbing early as layers specialize (and weirdly shrinking post-peak in families like OLMo-2 and BLOOM, while staying flat in Pythia). Once pretraining ends, SFT, math, or code post-training shifts $\sigma_{99}$ by at most 10%.
  • Model families have distinct signatures: Dispersion ($\sigma_{99}$) clusters tightly by model family—Qwen and Gemma-3 are highly uneven ($\sigma_{99} \approx 0.19$), while LLaMA-3 and OLMo-2 are surprisingly flat ($\sigma_{99} \approx 0.06\text{–}0.11$).
Figure 2: σ99 by model family. Each column is one family, ordered by median σ99; markers are individual models of 2B parameters or more, labeled by size. Among the plotted models, σ99 shows a substantial association with model family. Within most families, σ99 also tends to rise with scale, although Qwen2.5 drops at 72B, the largest scanned model.

Key Results

  • Monotonic 3-way victory: Across all four teachers (Qwen3-8B, Qwen2.5-3B, Gemma-3-4B, LLaMA-3-8B), PCA > UNIFORM > INVERTED holds on the 5-task average at matched parameter budgets. Notably, UNIFORM actually beats PCA at step 0 right after pruning, meaning PCA's advantage emerges dynamically during distillation.
  • Dispersion predicts the payoff: On high-$\sigma_{99}$ teachers, PCA beats UNIFORM by +2.28 pp (Qwen3-8B) and +2.50 pp (Qwen2.5-3B), crushing INVERTED by up to +5.52 pp (including a massive +14.32 pp gap on MMLU). On flatter teachers like LLaMA-3-8B ($\sigma_{99}=0.105$), the gain gracefully shrinks to +0.52 pp.
  • Gains survive SFT: After 2 epochs of instruction tuning on Qwen3-8B students, PCA widens its lead over UNIFORM to +11.01 pp on ARC-C, +4.92 pp on MMLU, and +3.03 pp on GSM8K.

Limitations and Future Work

  • Training scale: Distillation runs covered 1.57B–4.2B tokens; whether Uniform catches up over massive Minitron-scale runs (70B–100B tokens) remains untested.
  • The hardware tax: GPU kernels love uniformity. In a vLLM test, the non-uniform PCA student ran 5.3% slower in throughput than the UNIFORM baseline despite virtually identical parameter counts.
  • Confounded recipes: Because open-weight models vary in data and hyperparameters, the author cannot yet isolate why Qwen develops high $\sigma_{99}$ while LLaMA stays flat. Future work aims to test reshaping models via continued pretraining without a teacher, or selectively adding parameters only to starved middle layers.

Summary updated

BibTeX
@inproceedings{kim2026measuring,
  author = {Daehee Kim},
  title = {{Measuring Layer-wise Intrinsic Dimensionality of FFNs in LLMs via PCA}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2026},
  url = {https://openreview.net/forum?id=UpWBgsC6IR},
}
Figure