distilbert

a distilled version of BERT: smaller, faster, cheaper and lighter

Hugging face, 2019.10

논문 : https://arxiv.org/abs/1910.01108

github : https://github.com/huggingface/transformers/tree/master/examples/distillation

해당 github에서 제안 방법으로 생성한 다른 distil* 모델 소개 (DistilGPT2, DistilRoBERTa, DistilmBERT)

abstract

distilation (knowledge extraction)

Knowledge Distillation [Bucila et al., 2006, Hinton et al., 2015]은 larger model(teacher model)로부터 compact model(student model)을 만들어내는 방법이다. 이게 작은 모델을 바로 학습시키는 것보다 의미있는 이유는 near-zero인 확률들도 학습할 수 있기 때문이다.

모델이 만들어낸 결과 분포가 실제 이미지를 더 풍부하게 표현한다는 것입니다. 즉, 원래 정답 관점에서는 정답 이외에 대한 정보가 없지만, 한번 모델에서 풀어나온 결과는 정답 외에도 다른 물체에 대한 정보를 담고 있게 됩니다. 이렇게 정보가 묻어 나오는 것이 마치 석유의 부산물들이 증류탑에서 나오는 양상과 같기 때문에 이를 지식 증류라고 일컫습니다. 원래 모델이 생각하는 데이터의 정보가 풀어나온 데이터로 새로 학습시키게 되면 간접적으로 선생 모델이 학습한 바를 반영하게 되므로 더 효율적으로 모델을 학습시킬 수 있으며, 새로 배우는 모델(학생 모델)은 상대적으로 더 적은 규모로 구성될 수 있습니다. 이것이 Hinton et al. 이 제시한 지식 증류의 핵심입니다.

distilbert%204df0326400104a55af9ef2076f01cb42/Untitled.png

distilbert

distilbert%204df0326400104a55af9ef2076f01cb42/Untitled%201.png

loss function 무엇?

distil*

참고

Transformer - Harder, Better, Faster, Stronger

🏎 Smaller, faster, cheaper, lighter: Introducing DilBERT, a distilled version of BERT

Distilling the Knowledge in a Neural Network

📃 Distilling the Knowledge in a Neural Network 리뷰