[Paper Review] Optimal Subarchitecture Extraction For BERT
This paper proposes Bort, an optimal subarchitecture extracted from BERT using a fully polynomial-time approximation scheme (FPTAS) that jointly optimizes for model size, inference speed, and accuracy. Bort achieves 5.5% of BERT-large's effective parameter count and 16% of its net size, trains in just 288 GPU hours (1.2% of RoBERTa-large), and outperforms BERT-large by 0.3% to 31% on multiple NLU benchmarks while being 7.9x faster on CPU.
We extract an optimal subset of architectural parameters for the BERT architecture from Devlin et al. (2018) by applying recent breakthroughs in algorithms for neural architecture search. This optimal subset, which we refer to as "Bort", is demonstrably smaller, having an effective (that is, not counting the embedding layer) size of $5.5\%$ the original BERT-large architecture, and $16\%$ of the net size. Bort is also able to be pretrained in $288$ GPU hours, which is $1.2\%$ of the time required to pretrain the highest-performing BERT parametric architectural variant, RoBERTa-large (Liu et al., 2019), and about $33\%$ of that of the world-record, in GPU hours, required to train BERT-large on the same hardware. It is also $7.9$x faster on a CPU, as well as being better performing than other compressed variants of the architecture, and some of the non-compressed variants: it obtains performance improvements of between $0.3\%$ and $31\%$, absolute, with respect to BERT-large, on multiple public natural language understanding (NLU) benchmarks.
Motivation & Objective
- To address the inefficiency and high computational cost of large BERT models in inference and pretraining.
- To overcome the arbitrary and suboptimal architectural choices in prior BERT compression methods.
- To develop a principled, algorithmically guaranteed method for extracting a minimal yet high-performing BERT subarchitecture.
- To demonstrate that the optimal subarchitecture can outperform full-sized BERT variants in accuracy while being significantly smaller and faster to train.
- To validate the effectiveness of the FPTAS-based method through pretraining and fine-tuning on standard NLU benchmarks.
Proposed method
- Applies a fully polynomial-time approximation scheme (FPTAS) to search for the optimal combination of BERT’s architectural hyperparameters: depth, number of attention heads, and hidden/intermediate layer sizes.
- Proves that BERT satisfies the strong $AB^nC$ property, enabling the FPTAS to provide optimal solutions with theoretical guarantees across inference latency, parameter count, and error rate.
- Uses knowledge distillation to fine-tune the extracted subarchitecture (Bort) to convergence, leveraging a pre-trained RoBERTa-large as a teacher model.
- Employs Agora, a convergence-proven optimization algorithm, to ensure stable and effective fine-tuning of Bort on downstream tasks.
- Applies a balanced sampling strategy to mitigate class imbalance in fine-tuning, particularly on datasets like MultiRC and ReCoRD.
- Prunes large datasets (e.g., RACE) by randomly removing half the passages to reduce training time without sacrificing performance.
Experimental results
Research questions
- RQ1Can an algorithmic approach based on FPTAS yield a BERT subarchitecture that is simultaneously smaller, faster to train, and more accurate than existing variants?
- RQ2Does the optimal subarchitecture extracted via FPTAS generalize well across diverse NLU benchmarks, including those with long-context and reasoning-intensive tasks?
- RQ3To what extent does the pre-training efficiency of the extracted subarchitecture depend on the choice of teacher model and distillation strategy?
- RQ4How does the performance of the FPTAS-extracted architecture compare to both compressed and full-sized BERT variants across multiple metrics (accuracy, latency, parameter count) on standard benchmarks?
- RQ5Can the FPTAS-based method produce a model that outperforms even RoBERTa-large, despite being significantly smaller and faster to pre-train?
Key findings
- Bort is 16% the size of BERT-large and 5.5% of its effective parameter count (excluding the embedding layer), making it substantially more parameter-efficient.
- Bort requires only 288 GPU hours to pre-train—just 1.2% of the 24,576 GPU hours needed for RoBERTa-large and 25% of BERT-large’s 1,153 GPU hours—demonstrating a dramatic reduction in pretraining cost.
- On the GLUE benchmark, Bort achieves absolute improvements of 0.3% to 31% over BERT-large, with the highest gains on long-context and reasoning tasks.
- On the RACE dataset, Bort outperforms BERT-large by 9–10% on both RACE-H (high school) and RACE-M (middle school) subsets, achieving 85.9% and 80.7% accuracy respectively.
- Bort is 7.9x faster than BERT-large on CPU inference, significantly improving real-time deployment feasibility.
- Despite using a simple linear classifier and standard fine-tuning, Bort achieves state-of-the-art performance on multiple benchmarks, indicating strong generalization and robustness to hyperparameter choices.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.