Upgrade to Pro — share decks privately, control downloads, hide ads and more …

2020ACL読み会_FastBERT:-a-Self-distilling-BERT-with-Adaptive-Inference-Time

 2020ACL読み会_FastBERT:-a-Self-distilling-BERT-with-Adaptive-Inference-Time

Ikumi Yamashita

August 06, 2020
Tweet

More Decks by Ikumi Yamashita

Other Decks in Technology

Transcript

  1. Abstract • 速度をチューニング可能な BERT ベースのモデル FastBERT を提案 • 推論時の速度を柔軟に変更可能 (adaptive

    inference) であり、冗⻑な計算 を減らしている • 学習時には knowledge distillation の考え⽅をもとにした独⾃の⼿法 self- distillation を⽤いている 1
  2. Introduction • 近年⼤きな成功を収めている pre-trained モデルは計算コストが⾼く推論 も遅いため実⽤的ではない Ø この問題解決のために Knowledge Distillation

    などの⼿法が提案され ている (DistillBERT など) • 多くの NLP のデータセットには様々な難易度のデータが含まれている ü 使⽤する層の数を動的に減らすことのできる FastBERT を提案 ü 学習時の self-distillation と推論時の adaptive inference という⼆つの新し い考え⽅を⽤いて推論速度の向上を図った 2
  3. Model training 1. Backbone Pre-training • BERT モデルの事前学習 • BERT

    ベースのモデルならなんでもいい (RoBERTa, ERNIE など) 2. Fine-tuning for backbone • 最終層の教師分類器の学習 3. Self-distillation for branch • 各層の分類器の学習 • 教師分類器からの self-distillation を⾏なっている 4
  4. Self-distillation for branch • 教師分類器の出⼒をもとに self-distillation を⾏う ! : ⽣徒側の分類器の予測

    " : 教師側の分類器の予測 • 教師分類器の出⼒があれば良いのでラベルなしデータの利⽤が可能 Ø ただしこの論⽂内にラベルなしデータを⽤いたような記述はなし • これまでの蒸留⼿法とは異なり教師側も⽣徒側も同じモデル Ø 他の pre-trained モデルを⽤意する必要がない 5
  5. Settings • Data : Ø 中国語と英語の分類タスクのデータを各 6 種類 Ø Chinese

    : ChnSentiCorp, Book review, Shopping review, Weibo and THUCNews Ø English : Ag.News, Amz.F, DBpedia, Yahoo, Yelp.F and Yelp.P • Model : BERT-base model (Google-research) • Baselines : BERT, DistillBERT • Evaluation Metrics : Ø Accuracy Ø FLOPs (Floating-point operations) 7
  6. Distribution analysis • speed が 0.8 の場合 60 % 程度のデータを最初の層

    のみで処理できている • 低い層では不確かさが⾼いものが多く、低い層の 出⼒結果は⾼い層の出⼒結果によって翻っている かもしれない 11
  7. Ablation study • without distillation : 全分類器を fine-tuning 時に学習 •

    without adaptive inference : 何層で出⼒するかが事前に決められた設 定 • 同じレベルの⾼速化がなされている状態 では self-distillation と adaptive inference の双⽅を使ったモデルのスコアが最も良 い 12
  8. Conclusion • スピードをコントロールして速度を上げられる実⽤的な BERT である FastBERT を提案 • self-distillation と

    adaptive inference の⼆つの新しい⼿法を導⼊ • 結果的に精度を損なわずに速度を上げる(コントロールする)実⽤的な モデルの学習が可能になった 13