NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

AutoTinyBERT: Automatic Hyper-parameter Optimization for Efficient Pre-trained Language Models

Yichun Yin, Cheng Chen, Lifeng Shang, Xin Jiang, Xiao Chen, Qun Liu

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.

The AutoTinyBERT framework: (1) One-shot learning of a SuperPLM, (2) Evolutionary search for optimal sub-models, and (3) Further training of the final architecture.
  1. 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.
  2. 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).
  3. 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.

Comparison of GLUE score vs. Speedup. AutoTinyBERT (red) consistently maintains higher accuracy than standard BERT scaling and other NAS-based approaches at various speedup levels.
  • 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

BibTeX
@inproceedings{yin2021autotinybert,
  author = {Yichun Yin and Cheng Chen and Lifeng Shang and Xin Jiang and Xiao Chen and Qun Liu},
  title = {{AutoTinyBERT: Automatic Hyper-parameter Optimization for Efficient Pre-trained Language Models}},
  booktitle = {Annual Meeting of the Association for Computational Linguistics},
  year = {2021},
  doi = {10.18653/v1/2021.acl-long.400},
}
Figure