Evolving Subnetwork Training for Large Language Models

Hanqi Li, Lu Chen, Da Ma, Zijian Wu, Su Zhu, Kai Yu

Abstract

Training Large Language Models (LLMs) requires immense computational resources and financial investment. While over-parameterization is a known characteristic of these models, traditional training methods utilize the full parameter set throughout the entire process. This paper discusses Evolving Subnetwork Training (EST), a novel paradigm that reduces training costs by up to 26% while simultaneously improving model generalization. By sampling and evolving subnetworks across multiple architectural dimensions, EST avoids the pitfalls of previous incremental training methods and achieves superior performance on standard benchmarks.

Introduction

The environmental and financial costs of training state-of-the-art LLMs have become a significant barrier to research and development. For instance, the training of GPT-3 is estimated to have cost $4.6 million and consumed hundreds of GPU-years. Despite this scale, research suggests that LLMs are often over-parameterized, containing significant redundancy.

Previous attempts to mitigate these costs through "incremental training"—starting with a small model and gradually increasing its size—have often struggled to match the performance of models trained at full scale from the outset. These methods typically prioritized a "loss-preserving property," attempting to make the transition between model sizes as smooth as possible. EST challenges this convention, suggesting that intentional disruptions in the training dynamics can actually lead to better optimization and generalization.

Methodology: Evolving Subnetworks

Evolving Subnetwork Training (EST) departs from full-model training by sampling a subnetwork to update at each training step. This sampling occurs across three primary dimensions of the Transformer architecture:

  1. Attention Heads: Only a subset of Multi-Head Attention (MHA) heads are activated.
  2. MLP Intermediate Size: Only a fraction of the neurons in the Feed-Forward Network (FFN) layers are utilized.
  3. Transformer Layers: Specific layers are skipped entirely, a technique reminiscent of Stochastic Depth.

To manage the transition from small subnetworks to the full model, the authors implement a Practical Sampling Scheduler divided into three distinct stages:

  • Stage 1 (High Acceleration): Subnetworks are aggressively sampled across all three dimensions (heads, neurons, and layers) to maximize computational savings during early training.
  • Stage 2 (Moderate Acceleration): All layers are activated, but subnetworks are still sampled within the MHA and MLP modules.
  • Stage 3 (Full Training): The complete model is trained without sampling to ensure final convergence and stability.

To maintain consistency in the output distribution when switching between subnetwork sizes, EST employs a scaling factor similar to Dropout, ensuring that the magnitude of activations remains stable regardless of the number of active parameters.

Experimental Setup

The efficacy of EST was validated across two different model scales:

  • GPT-2 (117M parameters): Pre-trained on the OpenWebText corpus. Performance was measured using the GLUE benchmark for general language understanding, SQuAD for question answering, and LAMBADA for word prediction.
  • TinyLlama (1.1B parameters): Pre-trained on a 130-billion token subset of SlimPajama and Starcoder. Evaluation was conducted using the GPT4All benchmark, which encompasses seven common-sense reasoning datasets.

Key Results and Efficiency Gains

EST demonstrated significant improvements in both computational efficiency and downstream task performance:

  • Computational Savings: EST achieved a 26.7% reduction in Floating Point Operations (FLOPs) for GPT-2 and a 25.0% reduction for TinyLlama.
  • Wall-Clock Acceleration: On NVIDIA A100 GPUs, these FLOP reductions translated to a 1.22x speedup in actual training time.
  • Performance Improvements: Despite using fewer resources, the EST-trained GPT-2 achieved an average GLUE score of 80.66, surpassing the baseline model's score of 79.84. TinyLlama showed similar gains across the GPT4All reasoning benchmarks.
  • Convergence: The final pre-training loss for models trained with EST was nearly identical to, or slightly better than, models trained using standard full-parameter methods.

Theoretical Insights: Why EST Works

The success of EST can be attributed to several unique properties of the training process:

Breaking the Loss-Preserving Property

Unlike previous methods that sought smooth transitions, EST intentionally allows the loss to drop sharply when the subnetwork size increases. This "break" in training dynamics helps the model escape sharp local minima that can hinder generalization in standard training.

Loss Landscape Flatness

Using Hessian matrix analysis, the researchers found that EST guides the model toward "flatter" regions of the loss landscape. In deep learning theory, flatter minima are strongly correlated with better generalization on unseen data, explaining why EST models often outperform their fully-trained counterparts on downstream tasks.

Structural Dropout as Regularization

The process of randomly sampling subnetworks acts as a form of structural dropout. This forces the model to learn robust, redundant representations, as it cannot rely on any specific subset of parameters being available at all times.

Limitations and Future Directions

While EST represents a significant step forward in efficient training, certain challenges remain. The theoretical FLOP savings do not always translate linearly to wall-clock time due to hardware bottlenecks; GPUs are optimized for large, dense matrix multiplications, and reduced parameter sets can sometimes lead to memory access overhead. Additionally, while the three-stage scheduler is effective, future research could explore automated, dynamic schedulers that adjust subnetwork sizes based on real-time training metrics. Finally, while this study focused on Transformers, the underlying logic of evolving subnetworks may be applicable to other architectures, such as state-space models like Mamba.

Summary updated

BibTeX
@inproceedings{li2024evolving,
  author = {Hanqi Li and Lu Chen and Da Ma and Zijian Wu and Su Zhu and Kai Yu},
  title = {{Evolving Subnetwork Training for Large Language Models}},
  booktitle = {International Conference on Machine Learning},
  year = {2024},
  url = {https://openreview.net/forum?id=DbMm8pmoAP},
}
Figure