modulabs / beyondBERT

11.5기의 beyondBERT의 토론 내용을 정리하는 repository입니다.
MIT License
60 stars 6 forks source link

FastBERT: a Self-distilling BERT with Adaptive Inference Time #20

Closed seopbo closed 4 years ago

seopbo commented 4 years ago

어떤 내용의 논문인가요? 👋

간략하게 어떤 내용의 논문인지 작성해 주세요! (짧게 1-2줄 이어도 좋아요!)

Distillation 방법과 Adaptive Inference 기술을 사용하여, 적은 accuracy loss로도 추론의 속도를 컨트롤 할 수 있는 BERT 만들었다.


Abstract (요약) 🕵🏻‍♂️

논문의 abstract 원본을 적어주세요!

Pre-trained language models like BERT have proven to be highly performant. However, they are often computationally expensive in many practical scenarios, for such heavy models can hardly be readily implemented with limited resources. To improve their efficiency with an assured model performance, we propose a novel speed-tunable FastBERT with adaptive inference time. The speed at inference can be flexibly adjusted under varying demands, while redundant calculation of samples is avoided. Moreover, this model adopts a unique self-distillation mechanism at fine-tuning, further enabling a greater computational efficacy with minimal loss in performance. Our model achieves promising results in twelve English and Chinese datasets. It is able to speed up by a wide range from 1 to 12 times than BERT if given different speedup thresholds to make a speed-performance trade-off.


이 논문을 읽어서 무엇을 배울 수 있는지 알려주세요! 🤔

이 논문을 제대로 읽었을 때 어떤 지식을 얻을 수 있을까요?

1. Introduction & Related Works

3. Methodology

구성

훈련과정

추론단계(Adaptive inference)

예를 들어, Speed = 0.5 인 경우, Uncertainty0.5 보다 낮을 때만 다음 층으로 넘어간다.

  1. 빠른 추론 case: "This book is really good!"

    fastbert-inference1

  2. 늦은 추론 case: "Excellent! but a bit difficult to understand"

    fastbert-inference3

4. Experimental result

4.1 FLOPs analysis

4.2 Baseline and dataset

4.3 Performance comparison

table2

fig3

4.4 LUHA hypothesis verification

4.5 In-depth study

  1. the distribution of exit layer

    fig5

    • figure5 추론 speed를 높일 수록(uncertainty가 상대적으로 높아도 판단하게끔 만듬) 거의 첫번째 layer에서 결론을 도출하는 모습을 확인할 수 있다.
  2. the distribution of sample uncertainty

    fig6

    • figure6 각 speed에 따른 sample distribution, 빨간선은 Speed Threshold이며 해당 선 왼쪽부분 샘플은 바로 결론을 내림, 오른쪽 부분의 샘플은 다음 층으로 넘어감
    • (a): 모든 층을 통과했을 때를 보면 높은 층(깊은 층)에서 더 결정력있는(decisive) 모습을 보여줌, 모든 샘플들이 층을 지나갈 수록 Uncertainy가 0으로 수렴
  3. the convergence during self-distillation

    fig7

    • figure7 Self-Distillation 단계는 Teacher-Classifier의 offloading을 가능케하는 중요한 단계다.
      • Computation offloading is the transfer of resource intensive computational tasks to a separate processor - wikipedia
    • Self-Distillation 단계에서 Accuracy는 거의 줄어들지 않으면서 FLOPs가 확연하게 줄어든 것을 확인할 수 있다.

4.6 Ablation study

table3


기타 고려해볼만한 것들

GitHub에서 코드 다운받아서 pretrained된거 해보려고 했지만...중국 클라우드에 올려서 접근이 안된다... 451 error... 다만 아이디어는 간단한 편이라서 금방 구현해볼 수 있을 것 같다.


같이 읽어보면 좋을 만한 글이나 이슈가 있을까요?

만약에 있다면 자유롭게 작성해 주세요!

레퍼런스의 URL을 알려주세요! 🔗

markdown 으로 축약하지 말고, 원본 링크 그대로 그냥 적어주세요!

Beomi commented 4 years ago

[질문] Q. 단순히 BERT+Liner layer 하나 붙이는 모델도 epoch늘릴수록 Uncertainty 줄어드는데 (더 확실히 틀리는 경향) 이 모델에서도 epochs를 늘리면 그냥 uncertainty 줄어들어서 아래 layer에서 끝나지 않을까요....?