[Paper Review] BiBERT: Accurate Fully Binarized BERT
BiBERT introduces Bi-Attention and Direction-Matching Distillation to enable an accurate fully binarized BERT (1-bit weights, embeddings, and activations) with major FLOPs and model-size savings while outperforming prior ultra-low-bit quantized BERTs on GLUE.
The large pre-trained BERT has achieved remarkable performance on Natural Language Processing (NLP) tasks but is also computation and memory expensive. As one of the powerful compression approaches, binarization extremely reduces the computation and memory consumption by utilizing 1-bit parameters and bitwise operations. Unfortunately, the full binarization of BERT (i.e., 1-bit weight, embedding, and activation) usually suffer a significant performance drop, and there is rare study addressing this problem. In this paper, with the theoretical justification and empirical analysis, we identify that the severe performance drop can be mainly attributed to the information degradation and optimization direction mismatch respectively in the forward and backward propagation, and propose BiBERT, an accurate fully binarized BERT, to eliminate the performance bottlenecks. Specifically, BiBERT introduces an efficient Bi-Attention structure for maximizing representation information statistically and a Direction-Matching Distillation (DMD) scheme to optimize the full binarized BERT accurately. Extensive experiments show that BiBERT outperforms both the straightforward baseline and existing state-of-the-art quantized BERTs with ultra-low bit activations by convincing margins on the NLP benchmark. As the first fully binarized BERT, our method yields impressive 56.3 times and 31.2 times saving on FLOPs and model size, demonstrating the vast advantages and potential of the fully binarized BERT model in real-world resource-constrained scenarios.
Motivation & Objective
- Motivate and address the performance gap when binarizing BERT end-to-end at 1-bit for weights, embeddings, and activations.
- Identify information degradation in attention and optimization-direction mismatch during distillation as primary bottlenecks.
- Propose Bi-Attention to maximize information entropy in binarized attention and Direction-Matching Distillation (DMD) to align optimization directions.
- Demonstrate that BiBERT surpasses state-of-the-art quantized BERTs under ultra-low bit-width on GLUE benchmarks and delivers large FLOPs and size savings.
Proposed method
- Define a fully binarized BERT baseline and analyze its bottlenecks in forward (attention information loss) and backward (distillation direction) propagation.
- Bi-Attention: maximize information entropy in binarized attention by using entropy-maximizing binarized representations and a bitwise AFFINE matrix multiplication (BAMM) operator to replace softmax-based attention.
- Direction-Matching Distillation (DMD): reselect distilled activations (Q, K, V) and construct similarity-pattern matrices P_Q, P_K, P_V to guide distillation with improved optimization direction alignment.
- Provide theoretical justification (information theory and direction-mismatch analyses) supported by empirical ablations on GLUE tasks.
Experimental results
Research questions
- RQ1Can fully binarized BERT (1-bit weights, embeddings, and activations) achieve competitive NLP performance?
- RQ2What are the main bottlenecks in forward and backward propagation when binarizing BERT, and how can they be mitigated?
- RQ3Do Bi-Attention and Direction-Matching Distillation improve performance and maintain efficiency on GLUE benchmarks?
- RQ4How does BiBERT compare to state-of-the-art ultra-low-bit quantized BERT models in accuracy and resource usage?
Key findings
- BiBERT outperforms baseline fully binarized BERT and existing ultra-low-bit quantized BERTs on GLUE tasks.
- Bi-Attention significantly mitigates information degradation in binarized attention and eliminates softmax, improving representation entropy.
- DMD reduces optimization-direction mismatch by reorienting distillation toward upstream Q/K/V and similarity-pattern matrices, improving convergence.
- BiBERT achieves substantial efficiency gains with up to 56.3× FLOPs and 31.2× model-size savings compared to full-precision BERT.
- On GLUE without data augmentation, BiBERT surpasses several baselines and achieves competitive performance on multiple tasks, and with augmentation attains close to full-precision results on SST-2.
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.