Abstract
Pre-trained Language Models (PLMs) like BERT have set new standards in NLP but remain difficult to deploy on resource-constrained devices due to their immense size. AutoTinyBERT addresses this by introducing an automated framework for designing highly efficient "tiny" BERT models using one-shot Neural Architecture Search (NAS). By challenging standard architectural heuristics, AutoTinyBERT achieves state-of-the-art performance on GLUE and SQuAD benchmarks while delivering up to a 30x speedup over BERT-base.
The Problem: Suboptimal Heuristics for Small Models
While various compressed versions of BERT exist, most follow the architectural ratios established by the original BERT-base model. Specifically, the "rule of thumb" dictates that the intermediate dimension of the feed-forward network ($d^f$) should be exactly four times the hidden dimension ($d^m$).
Research suggests that these ratios, optimized for large-scale models, are suboptimal for smaller architectures. However, searching for the ideal tiny architecture is traditionally cost-prohibitive, as training thousands of candidate models from scratch is computationally unfeasible.
The AutoTinyBERT Framework
To overcome the search cost, the authors propose a three-stage framework that leverages weight-sharing and evolutionary algorithms.
- One-shot Learning (SuperPLM): The authors train a single "SuperPLM" containing numerous smaller sub-models. They utilize Identical Layer Structure (ILS) and Sub-matrix Extraction (SME) to ensure that any sub-model pulled from the SuperPLM is functional and high-performing from the start.
- Evolutionary Search: Using an evolutionary algorithm, the framework searches the SuperPLM for the best sub-model architecture that fits a specific latency constraint (e.g., a 10x speedup).
- Further Training: The discovered architecture is extracted and undergoes a final round of training—either via standard pre-training or knowledge distillation—to reach its peak performance.
Key Insights: Debunking the "4x Ratio"
The most significant finding of this research is that the standard $d^f = 4d^m$ ratio is inefficient for tiny models. The search results revealed a new "Fast Development Rule": for small-scale models, the optimal ratio actually falls between $1.6d^m$ and $1.9d^m$. This insight allows developers to build superior models without performing a full NAS process.
Additionally, initializing a tiny model with weights extracted from the SuperPLM allows it to converge twice as fast as training from scratch, proving that weight-sharing is a powerful tool for both search and initialization.
Results and Performance
AutoTinyBERT consistently outperforms existing state-of-the-art compressed models like DistilBERT, TinyBERT, and MobileBERT across the GLUE benchmark suite.
- Efficiency: The AutoTinyBERT-S4 variant achieved a 31x speedup over BERT-base while maintaining a GLUE score of 72.9, significantly higher than a standard BERT scaled to the same size (70.9).
- Development Speed: By applying the "Fast Rule," the authors created AutoTinyBERT-Fast, which reached a GLUE score of 77.6 in only half the training time required for conventional tiny models.
Conclusion
AutoTinyBERT demonstrates that the architectural requirements for efficient, small-scale models differ fundamentally from their larger counterparts. By combining one-shot NAS with specific structural constraints like ILS, the framework provides a path toward deploying high-performance NLP capabilities on mobile and edge devices without the prohibitive costs of traditional architecture search.
Summary updated