Introduction
Large Language Models (LLMs) like BERT have revolutionized natural language processing but present significant deployment challenges due to their immense computational requirements. Knowledge Distillation (KD) is the standard technique for compressing these "teacher" models into smaller, more efficient "student" models. However, traditional KD is often a manual, rigid process. Researchers must hand-design student architectures for specific hardware, and any change in the target computational budget requires repeating the entire distillation process.
Neural Architecture Search (NAS) has been proposed to automate this design. Standard NAS typically trains a single "SuperLM"—a weight-sharing supernet containing millions of sub-networks. However, this approach suffers from "weight-sharing interference," where the optimal weights for very small models conflict with those for larger ones, degrading the performance of all candidates.
The AutoDistil Framework
AutoDistil addresses these limitations through a "few-shot" task-agnostic NAS approach. Instead of a single massive search space, it partitions the architecture space into $K$ compact sub-spaces (e.g., Tiny, Small, and Base) based on inductive biases like depth-to-width ratios. This partitioning minimizes co-adaptation interference, allowing each sub-space to specialize in a specific size range.
Methodology
The framework operates in three distinct stages:
- Search Space Partitioning: The search space is divided into $K$ partitions. This "few-shot" strategy ensures that sub-networks within a partition share similar architectural characteristics, reducing the performance gap between the supernet and its stand-alone sub-networks.
- Task-Agnostic SuperLM Training: Each partition's SuperLM is trained on unlabeled data (English Wikipedia and BookCorpus). AutoDistil employs Multi-head Self-attention Relation Distillation, where students learn to mimic the internal relationships between queries (Q), keys (K), and values (V) in the teacher's attention heads, rather than just the final outputs.
- Lightweight Search: Once trained, the SuperLMs provide a pool of optimized candidates. Users can perform a Task-agnostic search (ranking by distillation loss) or a Task-proxy search (fine-tuning on a representative task like MNLI) to identify the best architecture for a specific FLOP or parameter budget.
Experimental Results
AutoDistil was evaluated on the GLUE benchmark, covering tasks like sentiment analysis and natural language inference. The framework demonstrates a superior Pareto front compared to existing task-agnostic and NAS-based compression methods.
Key Findings
- Efficiency Gains: AutoDistil achieved a 62.4% reduction in FLOPs and a 59.7% reduction in parameters compared to state-of-the-art models like MiniLM and TinyBERT, while maintaining competitive accuracy.
- Performance Stability: The
AutoDistil-Agnosticvariant, despite using 80% fewer FLOPs than BERT-Base, showed only a 2.6-point drop on the GLUE average. - Search Flexibility: By decoupling search from heavy training, AutoDistil allows for rapid deployment across diverse hardware targets. Once a generalist student is found for a specific budget, it can be fine-tuned for any downstream task.
Conclusion and Future Work
AutoDistil provides a scalable and automated solution for LLM compression. By leveraging few-shot NAS and attention-based relation distillation, it overcomes the interference issues of traditional supernets. Future research may explore automated layer-to-layer mapping between teachers and students to further optimize the distillation process and reduce the initial computational overhead of training multiple SuperLMs.
Summary updated