Partially-Random Initialization: A Smoking Gun for Binarization Hypothesis of BERT

Arash ArdakaniEMNLP 2022

Introduction

Large Language Models (LLMs) like BERT have revolutionized natural language processing but remain computationally prohibitive for edge devices. Binarization—compressing weights and activations to 1-bit—offers a potential 32x reduction in model size and massive speedups via bitwise operations. However, 1-bit BERT models typically suffer from significant performance degradation. This paper identifies a counter-intuitive "smoking gun": the standard practice of initializing binary models with full-precision pre-trained weights actually hinders performance.

The Binarization Bottleneck

Traditional binarization methods attempt to "force" a pre-trained, full-precision BERT into a binary format. The authors argue that the binary representation is too restrictive to maintain the complex information learned during pre-training. Instead of providing a helpful starting point, these pre-trained weights act as a "bad" initialization in the binary space, trapping the model in poor local optima.

SGBERT: Partially-Random Initialization

To overcome this, the authors propose SGBERT (Smoking Gun BERT), which utilizes a strategy called Partially-Random Initialization.

  1. Selective Initialization: SGBERT retains pre-trained weights only for the embedding layer, which captures fundamental vocabulary information. The encoder layers (Multi-Head Attention and Feed-Forward Networks) and the classifier are randomly initialized.
  2. Knowledge Distillation (KD): To guide the learning of the partially random model, a full-precision BERT-base acts as a teacher. The binary student model is trained to mimic the teacher's embeddings, hidden states, and final predictions using Root Mean Squared Error (RMSE) and Soft Cross-Entropy.
  3. Hardware-Friendly Computation: The architecture incorporates specialized boolean functions for attention, ensuring the model remains efficient for hardware deployment.
The SGBERT framework illustrating the knowledge distillation process from a full-precision teacher to a fully-binary student model.

The "Smoking Gun" Evidence

The core insight is the "Freedom to Learn" hypothesis: by starting with random weights in the encoder, the binary model is free to find a new, binary-friendly local minimum that effectively mimics the teacher.

The authors validated this by testing various initialization configurations ($r$). As shown in the training loss curves, configurations that include random initialization for the encoder layers (higher $r$ values) consistently achieve lower total training loss across multiple GLUE tasks compared to fully pre-trained initializations.

Total training loss over iterations for different initialization strategies across CoLA, MRPC, RTE, and STS-B tasks.

Performance and Efficiency

SGBERT establishes a new state-of-the-art for fully binarized BERT models:

  • GLUE Benchmark: SGBERT achieved an average accuracy of 72.9, a 15% improvement over the previous best (BiBERT at 63.2).
  • SQuAD v2.0: It reached an F1 score of 55.2, significantly outperforming BiBERT's 49.9.
  • Resource Savings: SGBERT is approximately 31x smaller (13.4 MB) and requires 56x fewer FLOPs (0.4G) than a standard BERT-base, making it highly suitable for resource-constrained environments.

Conclusion

SGBERT demonstrates that for binary models, "less is more" when it comes to pre-training. By selectively using random initialization, researchers can unlock the potential of 1-bit architectures. While a gap still exists between binary and full-precision models, SGBERT represents a major step toward deploying powerful language understanding capabilities on the edge.

Summary updated

BibTeX
@inproceedings{ardakani2022partially,
  author = {Arash Ardakani},
  title = {{Partially-Random Initialization: A Smoking Gun for Binarization Hypothesis of BERT}},
  booktitle = {Conference on Empirical Methods in Natural Language Processing},
  year = {2022},
  doi = {10.18653/v1/2022.findings-emnlp.191},
}
Figure