Geometry-Guided Layerwise FFN Width Allocation in Transformers

Timur Mudarisov, Mikhail Burtsev, Radu StatearXiv 2026

This paper, "Geometry-Guided Layerwise FFN Width Allocation in Transformers," presents a data-driven alternative to the architectural convention of keeping Feed-Forward Network (FFN) widths constant across all layers of a Transformer.

TL;DR

Researchers demonstrate that the "geometric work" performed by FFN layers is not uniform across a Transformer's depth. By measuring this work in pretrained models and reallocating the parameter budget accordingly, they achieve significantly lower validation loss than both uniform-width models and hand-designed "tapered" architectures.

What Problem Does This Paper Address?

In standard Transformer architectures (like GPT-4 or Llama), the intermediate dimension of the FFN layers ($d_{ff}$) is usually constant. This assumes that every layer requires the same amount of non-linear capacity. However, we know that representations evolve as they move through a network—early layers might focus on local features while later layers handle more abstract concepts.

Previous work on "Tapered Language Models" (TLMs) showed that manually shrinking later layers (a cosine taper) improves performance. But these tapers are hand-designed hyperparameters. This paper asks: Can we measure how much "work" each layer actually does and use that to automatically design the optimal architecture?

Methods

The authors propose measuring Geometric Work ($W_\ell$)—the change an FFN induces in the "cloud" of token representations. They evaluate this using three different statistical lenses:

  1. Mean Shift: The average distance tokens move.
  2. Gromov-Wasserstein Distortion: How much the relational structure (pairwise distances) between tokens changes.
  3. Persistent Homology: Changes in the topological structure (e.g., the creation or destruction of "loops" in the data cloud).

Crucially, they compare these metrics across three geometries: Raw Euclidean (which is sensitive to the absolute scale of activations), Spherical (normalized), and Hyperbolic.

To turn these measurements into a width schedule, they derive a Budget-Optimal Width formula. This optimizer considers the measured work, the sensitivity of the layer to perturbations, and the intrinsic dimension of the data at that depth (estimated using the TwoNN algorithm).

Figure 1: Diagnostics for the allocation surrogate. (a) Joint perturbation losses are associated with the sum of the corresponding single-layer losses. (b) Small rank-removal perturbations are approximately linear in the removed rank fraction. (c) TwoNN intrinsic dimension varies smoothly with relative depth. These experiments diagnose the local surrogate; they do not directly calibrate geometric work to an error-width coefficient.

Datasets

  • Diagnostics: The authors analyzed seven major pretrained models: Llama 3.1 (8B), Llama 3.2 (1B, 3B), Gemma 2 (2B, 9B), Gemma 3 (1B), and Mistral 7B v0.3.
  • Training: New models (128M, 256M, and 440M parameters) were trained from scratch on the OpenWebText corpus using byte-level BPE tokenization.

Key Insights and Ideas

  • Work is Front-Loaded: When metrics are scale-normalized (Spherical/Hyperbolic), a clear pattern emerges: the most significant geometric transformation happens in the early layers. Raw Euclidean metrics hide this because they are dominated by the growing norm of residual states in later layers.
  • Normalization is Key: Raw metrics suggest putting more parameters at the end of the network, but this actually hurts performance. Normalized metrics suggest "front-loading" capacity, which consistently helps.
  • Geometry vs. Tapering: While a simple cosine taper captures the general "front-loading" trend, geometry-guided profiles can capture local peaks and plateaus specific to a model's data distribution that a smooth curve would miss.
FFN work profiles across depth. Note how raw metrics (left column) rise toward the end, while normalized metrics (middle/right) show that the real work is front-loaded.

Key Results

  • Superior to Hand-Tuning: In a 440M parameter experiment, the Topological/Hyperbolic allocation reduced mean validation loss by 0.019 relative to a uniform baseline. This improvement is roughly 6.3x larger than the reduction achieved by the hand-designed cosine taper (-0.003).
  • Validation at Scale: The 128M and 256M screens showed that almost all schedules based on normalized geometry outperformed uniform width.
  • Anti-Topological Control: To prove the metric matters, they tested an "anti-topological" schedule (reversing the suggested allocation). This performed worse than the uniform baseline, confirming that the measured layer order is vital.

Limitations and Future Work

  • Reference Dependency: The method currently requires a "reference" model (a standard uniform-width model) to be partially trained or available to measure the work profile before the optimized model can be built.
  • Scaling Limits: While the results at 440M are strong, the authors note that the "paired-difference uncertainty" needs more seeds for definitive inferential claims at even larger scales (e.g., 7B+).
  • Discrete Constraints: The current optimizer treats width as continuous; future work could better integrate hardware-specific constraints (like block sizes for GPU kernels) directly into the optimization loop.

Summary updated

BibTeX
@misc{mudarisov2026geometry,
  author = {Timur Mudarisov and Mikhail Burtsev and Radu State},
  title = {{Geometry-Guided Layerwise FFN Width Allocation in Transformers}},
  year = {2026},
  eprint = {2608.02064},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2608.02064},
}
Figure