Skip to main content
QUICK REVIEW

[논문 리뷰] MobileBERT: a Compact Task-Agnostic BERT for Resource-Limited Devices

Zhiqing Sun, Hongkun Yu|arXiv (Cornell University)|2020. 04. 06.
Topic ModelingComputer Science참고 문헌 50인용 수 90
한 줄 요약

MobileBERT는 모바일 디바이스용으로 설계된 태스크에 구애받지 않는 작고 간결한 BERT 변형이다; BERT-BASE보다 4.3배 작고 5.5배 빠르면서 GLUE와 SQuAD 벤치마크에서도 경쟁력을 유지한다.

ABSTRACT

Natural Language Processing (NLP) has recently achieved great success by using huge pre-trained models with hundreds of millions of parameters. However, these models suffer from heavy model sizes and high latency such that they cannot be deployed to resource-limited mobile devices. In this paper, we propose MobileBERT for compressing and accelerating the popular BERT model. Like the original BERT, MobileBERT is task-agnostic, that is, it can be generically applied to various downstream NLP tasks via simple fine-tuning. Basically, MobileBERT is a thin version of BERT_LARGE, while equipped with bottleneck structures and a carefully designed balance between self-attentions and feed-forward networks. To train MobileBERT, we first train a specially designed teacher model, an inverted-bottleneck incorporated BERT_LARGE model. Then, we conduct knowledge transfer from this teacher to MobileBERT. Empirical studies show that MobileBERT is 4.3x smaller and 5.5x faster than BERT_BASE while achieving competitive results on well-known benchmarks. On the natural language inference tasks of GLUE, MobileBERT achieves a GLUEscore o 77.7 (0.6 lower than BERT_BASE), and 62 ms latency on a Pixel 4 phone. On the SQuAD v1.1/v2.0 question answering task, MobileBERT achieves a dev F1 score of 90.0/79.2 (1.5/2.1 higher than BERT_BASE).

연구 동기 및 목표

  • 리소스가 제한된 장치에서 BERT 유사 모델의 배치를 동기 부여하고 가능하게 한다.
  • 성능을 보존하는 벤로드가 구조를 가진 딥하고 좁은 Transformer 변형을 설계한다.
  • 병목 구조의 학생-교사 지식 전달을 통해 얇은 MobileBERT를 inverted-bottleneck 교사로부터 학습시킨다.
  • 모바일 추론 지연을 줄이기 위한 운영 측면을 최적화한다.
  • 표준 NLP 벤치마크에서 태스크-무관한 파인튜닝 가능성을 입증한다.

제안 방법

  • 깊이는 유지하되 폭을 좁히는 병목 및 inverted-bottleneck 블록을 도입한다.
  • 레이어당 4개의 쌓인 FFN을 사용해 MHA와 FFN 매개변수 분포를 재균형한다.
  • 512 피처 맵을 가진 딥한 교사 IB-BERT-LARGE를 학습시키고 층별로 MobileBERT로 증류한다.
  • 레이어별 지식 전달 목표로 피처 맵 전달 및 어텐션 전달을 적용한다.
  • MLM, NSP, KD 손실을 결합한 프리트레이닝 증류를 포함한다.
  • 보조, 공동, 발전적 지식 전달 등의 훈련 전략을 탐색하고, 하위 층의 선택적 미세 조정으로 층을 점진적으로 학습한다.
  • 임베딩 차원을 128로 축소하고 1D 컨볼루션을 적용해 512-dim 출력을 회복하는 인자분해를 삽입한다.
  • 실행 최적화: LayerNorm을 NoNorm으로, gelu를 ReLU로 대체해 지연을 줄인다.

실험 결과

연구 질문

  • RQ1 inverted bottlenecks를 가진 교사로부터의 층별 지식 전달로 학습될 때 깊고 좁은 BERT-유사 모델이 표준 NLP 벤치마크에서 경쟁력 있는 성능을 유지할 수 있는가?

주요 결과

  • MobileBERT는 BERT-BASE 대비 4.3x 모델 크기 감소와 5.5x 빠른 추론 속도를 달성한다.
  • GLUE에서 MobileBERT는 77.7의 GLUE 점수를 달성하며 BERT-BASE보다 0.6포인트 낮고 Pixel 4에서 레이턴시는 62 ms이다.
  • SQuAD v1.1/v2.0에서 MobileBERT의 개발자 F1 점수는 각각 90.0/79.2로, v1.1/v2.0에서 BERT-BASE보다 각각 1.5/2.1 포인트 높다.
  • MobileBERT-TINY 및 양자화된 변형은 정확도 손실 최소 또는 없음으로 크기를 더 줄이고, 사후 학습 양자화는 추가 압축과 함께 미미한 감소를 보인다.
  • 운영 최적화(NoNorm 및 ReLU)는 FLOPs를 감소시키지 않아도 실제 지연을 크게 줄이며 FLOPs와 실제 지연 간의 차이를 강조한다.
  • 진행적 지식 전달은 보조나 공동 전략보다 일관되게 더 나은 GLUE 및 SQuAD 결과를 보인다.

이 논문 읽기

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

누빈트에서 이 논문 읽기

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