Skip to main content
QUICK REVIEW

[논문 리뷰] BiBERT: Accurate Fully Binarized BERT

Haotong Qin, Yifu Ding|arXiv (Cornell University)|2022. 03. 12.
Multimodal Machine Learning ApplicationsComputer Science인용 수 34
한 줄 요약

BiBERT는 Bi-Attention과 Direction-Matching Distillation를 도입하여 정확한 완전 이진화 BERT(1-bit 가중치, 임베딩 및 활성화)로 큰 FLOPs 및 모델 크기 절약을 가능하게 하고 GLUE에서 기존의 초저비트 양자화 BERT보다 앞선 성능을 발휘합니다.

ABSTRACT

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.

연구 동기 및 목표

  • 가중치, 임베딩 및 활성화를 1-bit로 엔드 투 엔드 이진화할 때의 성능 격차를 동기 부여하고 해결한다.
  • 주요 병목으로 주의(attention)에서의 정보 저하와 증류(distillation) 중 최적화 방향 불일치를 확인한다.
  • 이진화된 주의에서 정보 엔트로피를 최대화하기 위한 Bi-Attention과 최적화 방향을 맞추기 위한 Direction-Matching Distillation (DMD)을 제안한다.
  • BiBERT가 GLUE 벤치마크에서 초저비트 하에서 최첨단 양자화된 BERT를 능가하고 대규모 FLOPs 및 크기 절감을 제공함을 보여준다.

제안 방법

  • 완전 이진화 BERT 기준선을 정의하고 순전파(주목 정보 손실)와 역전파(증류 방향) 전파에서의 병목을 분석한다.
  • Bi-Attention: 이진화된 주의에서 정보 엔트로피를 최대화하기 위해 엔트로피 최대화 이진 표현과 소프트맥스 기반 주의를 대체하는 비트 단위 AFFINE 행렬 곱셈(BAMM) 연산자를 사용한다.
  • Direction-Matching Distillation (DMD): 증류된 활성화(Q, K, V)를 재선정하고 유사도 패턴 행렬 P_Q, P_K, P_V를 구성하여 향상된 최적화 방향 정렬과 함께 증류를 안내한다.
  • 정보 이론 및 방향 불일치 분석에 대한 이론적 정당화를 GLUE 태스크에서의 실험적 제거 연구로 뒷받침한다.

실험 결과

연구 질문

  • RQ1완전 이진화 BERT(1-bit 가중치, 임베딩 및 활성화)가 경쟁력 있는 NLP 성능을 달성할 수 있는가?
  • RQ2BERT를 이진화할 때 순전파와 역전파에서의 주요 병목은 무엇이며 어떻게 완화될 수 있는가?
  • RQ3Bi-Attention과 Direction-Matching Distillation이 성능을 향상시키고 GLUE 벤치마크에서 효율성을 유지하는가?
  • RQ4BiBERT는 정확도와 자원 사용에서 최첨단 초저비트 양자화 BERT 모델과 어떻게 비교되는가?

주요 결과

  • BiBERT는 GLUE 과제에서 기준선인 완전 이진화 BERT 및 기존의 초저비트 양자화 BERT를 능가한다.
  • Bi-Attention은 이진화된 주의에서의 정보 저하를 크게 완화하고 소프트맥스를 제거하여 표현 엔트로피를 향상시킨다.
  • DMD는 증류를 상류 Q/K/V 및 유사도 패턴 행렬 쪽으로 재정렬함으로써 최적화 방향 불일치를 감소시키고 수렴을 개선한다.
  • BiBERT는 전체 정밀도 BERT에 비해 최대 56.3× FLOPs 및 31.2× 모델 크기 절감의 상당한 효율 향상을 달성한다.
  • 데이터 증강 없이 GLUE에서 BiBERT는 여러 Baseline을 능가하고 여러 태스크에서 경쟁력 있는 성능을 달성하며, 증강을 사용하면 SST-2에서 거의 풀 정밀도 결과에 근접한다.

이 논문 읽기

누빈트 뷰어에서 원문을 열고, 읽으면서 궁금한 곳을 바로 물어보세요.

누빈트에서 이 논문 읽기

이 리뷰는 AI가 논문 원문을 바탕으로 만들었습니다. 인용하기 전에 원문을 확인해 주세요.