DynaBERT: Dynamic BERT with Adaptive Width and Depth
Lu Hou, Zhiqi Huang, Lifeng Shang, Xin Jiang, Xiao Chen, Qun Liu
Abstract
The pre-trained language models like BERT, though powerful in many natural language processing tasks, are both computation and memory expensive. To alleviate this problem, one approach is to compress them for specific tasks before deployment. However, recent works on BERT compression usually compress the large BERT model to a fixed smaller size. They can not fully satisfy the requirements of different edge devices with various hardware performances. In this paper, we propose a novel dynamic BERT model (abbreviated as Dyn-aBERT), which can flexibly adjust the size and latency by selecting adaptive width and depth. The training process of DynaBERT includes first training a width-adaptive BERT and then allowing both adaptive width and depth, by distilling knowledge from the full-sized model to small sub-networks. Network rewiring is also used to keep the more important attention heads and neurons shared by more sub-networks. Comprehensive experiments under various efficiency constraints demonstrate that our proposed dynamic BERT (or RoBERTa) at its largest size has comparable performance as BERT BASE (or RoBERTa BASE ), while at smaller widths and depths consistently outperforms existing BERT compression methods. Code is available at https://github.com/huawei-noah/ Pretrained-Language-Model/tree/master/DynaBERT .
Ask Lune
Know this paper in minutes, not an afternoon.
Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.
93 top-tier papers have cited it since. Know what they found before your reviewers do.
Lune can draw on
the full paper · the top-tier papers that cite it · related work
Free to start. No credit card required.
Lineage
- TinyBERT: Distilling BERT for Natural Language Understanding cites ALBERT: A Lite BERT for Self-supervised Learning of Language Representations
- TinyBERT: Distilling BERT for Natural Language Understanding cites Q-BERT: Hessian Based Ultra Low Precision Quantization of BERT
- TinyBERT: Distilling BERT for Natural Language Understanding cites Reducing Transformer Depth on Demand with Structured Dropout
- Structured Pruning Learns Compact and Accurate Models cites TinyBERT: Distilling BERT for Natural Language Understanding
- Structured Pruning Learns Compact and Accurate Models cites Q-BERT: Hessian Based Ultra Low Precision Quantization of BERT
- Structured Pruning Learns Compact and Accurate Models cites Reducing Transformer Depth on Demand with Structured Dropout
- TernaryBERT: Distillation-aware Ultra-low Bit BERT cites TinyBERT: Distilling BERT for Natural Language Understanding
- TernaryBERT: Distillation-aware Ultra-low Bit BERT cites ALBERT: A Lite BERT for Self-supervised Learning of Language Representations
- TernaryBERT: Distillation-aware Ultra-low Bit BERT cites Q-BERT: Hessian Based Ultra Low Precision Quantization of BERT
- TernaryBERT: Distillation-aware Ultra-low Bit BERT cites Reducing Transformer Depth on Demand with Structured Dropout
- Sheared LLaMA: Accelerating Language Model Pre-training via Structured Pruning cites TinyBERT: Distilling BERT for Natural Language Understanding
- Sheared LLaMA: Accelerating Language Model Pre-training via Structured Pruning cites Structured Pruning Learns Compact and Accurate Models
- Sheared LLaMA: Accelerating Language Model Pre-training via Structured Pruning cites Once-for-All: Train One Network and Specialize it for Efficient Deployment
- Confident Adaptive Language Modeling cites Q-BERT: Hessian Based Ultra Low Precision Quantization of BERT
- Confident Adaptive Language Modeling cites Reducing Transformer Depth on Demand with Structured Dropout
- LLM-Pruner: On the Structural Pruning of Large Language Models cites TinyBERT: Distilling BERT for Natural Language Understanding
- LLM-Pruner: On the Structural Pruning of Large Language Models cites Structured Pruning Learns Compact and Accurate Models
- LLM-Pruner: On the Structural Pruning of Large Language Models cites ALBERT: A Lite BERT for Self-supervised Learning of Language Representations
- LLM-Pruner: On the Structural Pruning of Large Language Models cites Reducing Transformer Depth on Demand with Structured Dropout
Cited by top-tier papers93
- LLM-Pruner: On the Structural Pruning of Large Language ModelsXinyin Ma, Gongfan Fang, Xinchao WangNeurIPS 2023 · 994 citations
- Sheared LLaMA: Accelerating Language Model Pre-training via Structured PruningMengzhou Xia, Tianyu Gao, Zhiyuan Zeng, Danqi ChenICLR 2024 · 453 citations
- Confident Adaptive Language ModelingTal Schuster, Adam Fisch, Jai Gupta, Mostafa Dehghani et al.NeurIPS 2022 · 394 citations
- Structured Pruning Learns Compact and Accurate ModelsMengzhou Xia, Zexuan Zhong, Danqi ChenACL 2022 · 236 citations
- TernaryBERT: Distillation-aware Ultra-low Bit BERTWei Zhang, Lu Hou, Yichun Yin, Lifeng Shang et al.EMNLP 2020 · 147 citations
Builds on12
- ALBERT: A Lite BERT for Self-supervised Learning of Language RepresentationsZhenzhong Lan, Mingda Chen, Sebastian Goodman, Kevin Gimpel et al.ICLR 2020 · 7,418 citations
- TinyBERT: Distilling BERT for Natural Language UnderstandingXiaoqi Jiao, Yichun Yin, Lifeng Shang, Xin Jiang et al.EMNLP Findings 2020 · 1,787 citations
- Once-for-All: Train One Network and Specialize it for Efficient DeploymentHan Cai, Chuang Gan, Tianzhe Wang, Zhekai Zhang et al.ICLR 2020 · 1,522 citations
- Reducing Transformer Depth on Demand with Structured DropoutAngela Fan, Edouard Grave, Armand JoulinICLR 2020 · 695 citations
- Q-BERT: Hessian Based Ultra Low Precision Quantization of BERTSheng Shen, Zhen Dong, Jiayu Ye, Linjian Ma et al.AAAI 2020 · 656 citations
Related papers
- NAS-BERT: Task-Agnostic and Adaptive-Size BERT Compression with Neural Architecture SearchJin Xu, Xu Tan, Renqian Luo, Kaitao Song et al.KDD 2021 · 49 citations
- MobileBERT: a Compact Task-Agnostic BERT for Resource-Limited DevicesZhiqing Sun, Hongkun Yu, Xiaodan Song, Renjie Liu et al.ACL 2020 · 660 citations
- EBERT: Efficient BERT Inference with Dynamic Structured PruningZejian Liu, Fanrong Li, Gang Li, Jian ChengACL Findings 2021 · 31 citations
- FastBERT: a Self-distilling BERT with Adaptive Inference TimeWeijie Liu, Peng Zhou, Zhiruo Wang, Zhe Zhao et al.ACL 2020 · 257 citations
- EfficientBERT: Progressively Searching Multilayer Perceptron via Warm-up Knowledge DistillationChenhe Dong, Guangrun Wang, Hang Xu, Jiefeng Peng et al.EMNLP Findings 2021 · 20 citations
