Skip to main content
QUICK REVIEW

[Paper Review] LEMON: Lossless model expansion

Yite Wang, Jiahao Su|arXiv (Cornell University)|Oct 12, 2023
Advanced Neural Network ApplicationsComputer Science3 citations
TL;DR

LEMON is a lossless model expansion framework that initializes larger Transformer models using pre-trained smaller models, enabling faster training without performance drop. It achieves 56.7% and 33.2% reduction in computational cost for Vision Transformers and BERT, respectively, compared to training from scratch, by using symmetry-breaking weight initialization and an optimized learning rate scheduler.

ABSTRACT

Scaling of deep neural networks, especially Transformers, is pivotal for their surging performance and has further led to the emergence of sophisticated reasoning capabilities in foundation models. Such scaling generally requires training large models from scratch with random initialization, failing to leverage the knowledge acquired by their smaller counterparts, which are already resource-intensive to obtain. To tackle this inefficiency, we present $ extbf{L}$ossl$ extbf{E}$ss $ extbf{MO}$del Expansio$ extbf{N}$ (LEMON), a recipe to initialize scaled models using the weights of their smaller but pre-trained counterparts. This is followed by model training with an optimized learning rate scheduler tailored explicitly for the scaled models, substantially reducing the training time compared to training from scratch. Notably, LEMON is versatile, ensuring compatibility with various network structures, including models like Vision Transformers and BERT. Our empirical results demonstrate that LEMON reduces computational costs by 56.7% for Vision Transformers and 33.2% for BERT when compared to training from scratch.

Motivation & Objective

  • To address the inefficiency of training large models from scratch by leveraging knowledge from smaller, pre-trained models.
  • To develop a lossless model expansion method compatible with various Transformer architectures, including those with indivisible width and depth increments.
  • To reduce training time and computational cost while preserving model performance.
  • To optimize the training recipe for expanded models, particularly through a tailored learning rate scheduler.

Proposed method

  • LEMON uses a symmetry-breaking initialization strategy where duplicated neurons in expanded layers are assigned unequal fan-out weights to avoid redundancy and enable true capacity gain.
  • It introduces average expansion to handle LayerNorm layers during width expansion, ensuring compatibility even with indivisible width increments (e.g., 512 → 768).
  • The method supports various Transformer variants, including standard and Pre-LN Transformers, by adapting the expansion process to architectural differences.
  • It employs a custom learning rate scheduler that maintains the maximum learning rate used in training from scratch but applies faster decay, improving convergence for expanded models.
  • The framework enables direct weight transfer from a smaller pre-trained model to a larger target model, preserving functional equivalence.
  • Empirical validation confirms that the expanded model achieves performance on par with a model trained from scratch, with significantly reduced training time.

Experimental results

Research questions

  • RQ1Can we expand a pre-trained small Transformer model into a larger one without any performance degradation, even with indivisible width or depth increases?
  • RQ2How can we break symmetry during model expansion to ensure the larger model gains true capacity beyond the source model?
  • RQ3What training recipe—especially learning rate scheduling—is optimal for expanded models to achieve faster convergence?
  • RQ4Can the proposed expansion method be generalized across diverse Transformer architectures, including ViT and BERT?
  • RQ5To what extent does lossless model expansion reduce computational cost compared to training from scratch?

Key findings

  • LEMON reduces computational cost by 56.7% for Vision Transformers and 33.2% for BERT compared to training from scratch.
  • The expanded ViT (12,768) achieves the same performance as a model trained from scratch in only 85 epochs, representing a 28.3% reduction in training time.
  • The method maintains exact functional equivalence to the source model, ensuring no performance drop after expansion.
  • The optimized learning rate scheduler, which uses the same maximum learning rate but faster decay, significantly improves training efficiency for expanded models.
  • The approach is compatible with various Transformer architectures, including ViT, BERT, and Pre-LN variants, even with non-divisible width increments.
  • Empirical results confirm that the expanded model inherits all knowledge from the source model without loss, validating the lossless nature of the expansion.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.