둔비의 공부공간
CAMERO: Consistency Regularized Ensemble of Perturbed Language Models with Weight Sharing 본문
CAMERO: Consistency Regularized Ensemble of Perturbed Language Models with Weight Sharing
Doonby 2023. 5. 23. 15:20ACL 2022, Microsoft
https://arxiv.org/abs/2204.06625
CAMERO: Consistency Regularized Ensemble of Perturbed Language Models with Weight Sharing
Model ensemble is a popular approach to produce a low-variance and well-generalized model. However, it induces large memory and inference costs, which are often not affordable for real-world deployment. Existing work has resorted to sharing weights among m
arxiv.org
https://github.com/cliang1453/CAMERO
GitHub - cliang1453/CAMERO: CAMERO: Consistency Regularized Ensemble of Perturbed Language Models with Weight Sharing (ACL 2022)
CAMERO: Consistency Regularized Ensemble of Perturbed Language Models with Weight Sharing (ACL 2022) - GitHub - cliang1453/CAMERO: CAMERO: Consistency Regularized Ensemble of Perturbed Language Mod...
github.com
Ensemble은 성능은 좋지만, memory, inference cost가 비싼 문제가 있다. 이를 해결하기 위해 ensemble member간의 bottom-layer weight를 공유하는 방식을 사용하긴 했으나, weight를 공유하는 순간 ensemble member간의 diversity가 낮아지면서 ensemble의 성능이 하락하는 문제가 있었다. high-level weight는 공유하지 않아도 얼추 다 비슷하기 때문이다.
이를 해결하기위해 저자들은 "CAMERO"라는 consistency-regularized ensemble learning 기법을 제안했다.
CAMERO란, bottom layer를 공유하지만, representation에 다른 perturbations를 적용하여 model의 diversity를 주는 방법이다.
이러한 방법으로, 공유된 weight들은 perturbation된 representation이 들어와도 항상 일정한 output을 내도록 학습된다.
즉, 자연스럽게 맨 마지막에 공유된 weight가, 다양한 모델을 ensemble하여 낮은 분산과 좋은 일반화 성능을 갖게 된다.
이때, diversity로 인한 분산이 shared weight의 최적화를 어렵게 하는 것을 제어하기 위해, prediction consistency regularizer를 전체 perturbed models에 적용하여 각 member들의 output을 일관성있도록 규제했다.
개인모델의 weight + shared weight로 한 prediction의 distribution과 perturbation이 포함된 모델의 prediction을 KD를 주어서 분포의 차이를 비슷하게 만든다.
- perturbation 자체가 diversity를 주지만, 너무 diversity가 심해지는 것을 막기 위해 원래 model과 KD를 loss term에 넣었다고 이해하면 될 것 같다.
결과에 대한 실험은 자연어처리 분야에서 많이 사용하는 understanding, translation benchmark를 사용했다.
single, vanilla(ensemble single), Deep mutual learning, Knowledge distillation via collaborative Learning, On-the-fly native Ensemble Learning을 비교대상으로 삼았다.
Understanding
- finetuning performance on GLUE benchmark
- BERT-base (110M)
- RoBERTa-large (335M)
GLUE bench-mark에서 8-BERT ensemble보다 더 적은 메모리로, 0.7배 더 좋은 성능을 보였다. (114.2M vs 880.6M)
Translation
- Transformer-base NMT model on IWSLT, WMT datasets.
- IWSLT 14 En<->De
- IWSLT 16 En<->Fr
- WMT 14 En<->De