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:
- Mean Shift: The average distance tokens move.
- Gromov-Wasserstein Distortion: How much the relational structure (pairwise distances) between tokens changes.
- 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).
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.
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