Skip to main content
QUICK REVIEW

[Paper Review] BiT: Robustly Binarized Multi-distilled Transformer

Zechun Liu, Barlas Oğuz|arXiv (Cornell University)|May 25, 2022
Topic ModelingComputer Science22 citations
TL;DR

BiT demonstrates fully binarized transformer models with elastic activations and multi-distillation, achieving near full-precision accuracy on GLUE with data augmentation and strong baselines.

ABSTRACT

Modern pre-trained transformers have rapidly advanced the state-of-the-art in machine learning, but have also grown in parameters and computational complexity, making them increasingly difficult to deploy in resource-constrained environments. Binarization of the weights and activations of the network can significantly alleviate these issues, however, is technically challenging from an optimization perspective. In this work, we identify a series of improvements that enables binary transformers at a much higher accuracy than what was possible previously. These include a two-set binarization scheme, a novel elastic binary activation function with learned parameters, and a method to quantize a network to its limit by successively distilling higher precision models into lower precision students. These approaches allow for the first time, fully binarized transformer models that are at a practical level of accuracy, approaching a full-precision BERT baseline on the GLUE language understanding benchmark within as little as 5.9%. Code and models are available at: https://github.com/facebookresearch/bit.

Motivation & Objective

  • Motivate the need for highly efficient transformer models in resource-constrained settings.
  • Develop a robust binarization framework for weights and activations in transformers.
  • Propose a multi-distillation schedule to progressively train from higher to lower precision.
  • Show that elastic activation binarization significantly improves performance.
  • Evaluate BiT on GLUE and SQuAD to establish state-of-the-art baselines for binary transformers.

Proposed method

  • Introduce a two-set binarization scheme separating activations after Softmax/ReLU (non-negative) from other activations (mixed-sign).
  • Apply layer-wise activation scaling factors to minimize binarization error.
  • Propose elastic binarization with learnable scale α and threshold β using straight-through estimator for gradients.
  • Use simplified knowledge distillation with L_logits and L_reps losses, avoiding complex two-step distillation.
  • Adopt a multi-distillation strategy that successively distills from higher-precision teachers to binary students following a quantization schedule (e.g., W32A32 → W1A2 → W1A1).
  • Evaluate on GLUE and SQuAD to compare against full-precision BERT and prior binarization efforts.

Experimental results

Research questions

  • RQ1Can a fully binarized transformer achieve practical accuracy on NLP benchmarks like GLUE and SQuAD?
  • RQ2Do two-set binarization and elastic binarization improve the optimization and final performance of binary transformers?
  • RQ3Does a multi-distillation curriculum help bridge the gap between binary and full-precision models more effectively than single-step distillation?
  • RQ4What is the impact of data augmentation on quantized transformer performance on GLUE tasks?
  • RQ5How do learned activation scales distribute across layers and components (e.g., attention vs. feed-forward) in a BiT model?

Key findings

  • BiT achieves competitive GLUE results with fully binary weights and 1–2 bit activations, significantly closing the gap to full-precision baselines.
  • Elastic binarization boosts GLUE average accuracy by a substantial margin (up to ~15.7% in ablations) over strong baselines.
  • Multi-distillation further improves GLUE performance, adding ~2.5 points in the reported setup.
  • With data augmentation, BiT reduces the average GLUE gap to 5.9 points from over 15 points in prior work.
  • On SQuAD, BiT remains behind the full-precision baseline but shows meaningful improvements over prior binary methods (e.g., BiT 63.1 EM / 74.9 F1 vs BERT base 82.6/89.7).
  • Learned activation scaling factors vary by layer; attention-related scales tend to be smaller, while query/key scales are larger, with up to 200x range between extremes.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.