Abstract
Deploying Large Language Models (LLMs) on edge devices requires balancing performance with strict hardware constraints. This paper introduces Multistage Low-rank Fine-tuning of Super-transformers (MLFS), a method that combines supernet training with parameter-efficient fine-tuning (PEFT). MLFS enables the creation of a "palette" of high-quality sub-models of varying sizes from a single training run. Our results demonstrate that MLFS can produce encoders at 1/4 the original size with 1/3 the latency while maintaining competitive accuracy, and significantly speeds up the training of decoder models for edge deployment.
Introduction
The deployment of LLMs on edge hardware—such as mobile phones and IoT devices—presents a significant challenge due to hardware diversity and dynamic resource availability. Traditional approaches involve training separate models for each target device, which is computationally expensive. Supernet training offers a solution by training a single large model from which smaller subnets can be extracted. However, full-parameter supernet training is costly, and standard Parameter-Efficient Fine-Tuning (PEFT) methods like LoRA are often incompatible with the weight-sharing requirements of supernets.
Methodology: Multistage Low-rank Fine-tuning (MLFS)
MLFS addresses these challenges by integrating supernet principles with PEFT through a three-stage training process:
- Stage 0: The full-sized "teacher" model is fine-tuned using LoRA.
- Stage 1: The teacher is frozen, and new low-rank adapters are trained while sampling subnets of varying widths (hidden dimensions).
- Stage 2: Training continues with sampling across both widths and depths (number of layers).
To ensure smaller subnets converge effectively, the authors implemented a novel Gradient Scaling scheme that weights the gradients of smaller subnets more heavily. Additionally, a Shared Feature Distillation loss is used, employing a "slicing" projection matrix approach to allow all subnets to share projection parameters, minimizing the memory footprint.
Experimental Results
The researchers evaluated MLFS on both encoder (BERT-base) and decoder (Santacoder, CodeLlama) architectures.
Encoder Performance on GLUE
On the GLUE benchmark, MLFS-produced encoders achieved significant compression. As shown in the figures below, MLFS maintains high accuracy across a wide range of latencies and model sizes, often outperforming or matching specialized distillation methods like TinyBERT and DynaBERT.
Decoder Efficiency
For decoder models, MLFS demonstrated a "warm-start" advantage. Slicing a smaller model from a pre-trained teacher and fine-tuning it proved much faster than training from scratch. On Python coding tasks (HumanEval), a 0.7B Santacoder model trained via MLFS achieved 75% of the teacher's performance using less than 2% of the training data.
Discussion and Conclusion
MLFS provides a practical framework for industrial LLM deployment, offering a "palette" of models for the cost of one training run. While encoders show remarkable compressibility (up to 4x), decoders remain more resistant to extreme shrinking, typically maintaining performance down to roughly 2/3 of the teacher's size. Future research will explore alternative PEFT structures to further enhance the compressibility of generative models for edge applications.
Summary updated