TL;DR
This paper introduces LeTs, a novel method for initializing Vision Transformers (ViTs) of varying sizes. LeTs uses learnable transformation matrices to adapt a compact "learngene" module, allowing for flexible initialization along both model depth and width, significantly outperforming existing methods and reducing training time.
What Problem Does This Paper Address?
Deploying AI models often requires adapting them to diverse computational constraints, from powerful clusters to edge devices. This means needing models of various sizes. While training models from scratch is an option, it's computationally expensive and time-consuming. Existing methods for initializing these variable-sized models, like the "Learngene" approach, have limitations: they often rely on manually designed transformations and primarily focus on increasing model depth, not width. This paper aims to address this by providing a more flexible and efficient way to initialize variable-sized ViTs.
Methods
The core of LeTs is a two-stage process:
- Learning the Transformation: An "Auxiliary Network" (Aux-Net) is constructed. This network combines a compact "learngene" module (a distilled version of a large, pre-trained model) with a set of learnable transformation matrices. This Aux-Net is trained to learn how to effectively expand the learngene in terms of both width (adding neurons) and depth (adding layers). The key innovation here is that these transformations are learned, not manually designed.
- Initialization: For a target variable-sized model (Des-Net), specific parameters are selected from the well-trained transformation matrices learned in stage 1. These selected parameters are then used to transform the learngene module to create the initial weights for the Des-Net. The paper proposes strategies like "continuous selection" and "magnitude-wise selection" for choosing these parameters.
This approach allows for flexible initialization by transforming the learngene along both width and depth dimensions, a capability lacking in prior work.
Datasets
The primary dataset used for training the Aux-Net and evaluating the initialization performance is ImageNet-1K. The method is also evaluated on downstream tasks using datasets like CIFAR-10, CIFAR-100, Food-101, Cars-196, ADE20K, Pascal Context, and Cityscapes.
Key Insights and Ideas
- Learnable Transformations are Key: The most significant insight is that transformation mechanisms for adapting models don't need to be hand-crafted. Learning these transformations from data allows for much greater flexibility and effectiveness.
- Width and Depth are Both Crucial: Prior Learngene methods focused on depth. LeTs demonstrates the importance of learning transformations that can adapt both the width and depth of models, leading to more versatile initialization.
- Parameter Selection Matters: Simply having learned transformation matrices isn't enough. The paper shows that intelligently selecting specific parameters from these matrices (e.g., based on magnitude) is crucial for effective initialization of target models of varying sizes.
- Efficiency Gains: The approach significantly reduces the need for extensive pre-training for each new model size, offering substantial savings in training time and computational resources.
Key Results
- ImageNet-1K Performance: Des-Nets initialized with LeTs achieve better performance than models trained from scratch, even after just 1 epoch of fine-tuning. This is a significant speedup, reducing training costs by approximately 7x for 24 models.
- Downstream Task Performance: LeTs consistently outperforms baselines like "Pre-Fin" (pre-training and fine-tuning) on various image classification and semantic segmentation tasks. For example, on Food-101, LeTs achieves final performance comparable to scratch training in about 10 epochs, making it about 30x faster.
- Parameter Efficiency: LeTs requires significantly fewer initialization parameters compared to methods that transfer entire pre-trained models.
Limitations and Future Work
- Hyperparameter Tuning: The authors acknowledge that they did not extensively tune hyperparameters for the Aux-Net construction and training, nor for the fine-tuning of initialized models.
- Distillation Method: The paper primarily uses prediction-based distillation for training the Aux-Net. Exploring more advanced distillation techniques could potentially improve the quality of the learned learngene and transformation matrices.
- Future Directions: The authors suggest exploring more efficient hyperparameter selection, investigating advanced distillation techniques, and extending LeTs to language tasks. They also propose combining LeTs with other Learngene methods.
Summary updated