Skip to main content
QUICK REVIEW

[논문 리뷰] You Only Compress Once: Towards Effective and Elastic BERT Compression via Exploit-Explore Stochastic Nature Gradient

Shaokun Zhang, Xiawu Zheng|arXiv (Cornell University)|2021. 06. 04.
Topic Modeling참고 문헌 33인용 수 11
한 줄 요약

YOCO-BERT는 재학습 없이 다양한 하드웨어 제약 조건에서 탄력적인 배포가 가능한, BERT용 새로운 일회성 압축 프레임워크를 제안한다. $10^{13}$개의 아키텍처 검색 공간에서 확률적 자연 경사 최적화를 통해 이용-탐색 균형을 확보함으로써, 최신 기술 대비 평균 GLUE 성능 향상 2.1–4.5%를 달성하고, $N$대의 장치를 지원하기 위해 $\mathcal{O}(1)$의 학습 비용으로 초과 모델에서 직접 가중치를 상속함으로써 학습 비용을 획기적으로 절감한다.

ABSTRACT

Despite superior performance on various natural language processing tasks, pre-trained models such as BERT are challenged by deploying on resource-constraint devices. Most existing model compression approaches require re-compression or fine-tuning across diverse constraints to accommodate various hardware deployments. This practically limits the further application of model compression. Moreover, the ineffective training and searching process of existing elastic compression paradigms[4,27] prevents the direct migration to BERT compression. Motivated by the necessity of efficient inference across various constraints on BERT, we propose a novel approach, YOCO-BERT, to achieve compress once and deploy everywhere. Specifically, we first construct a huge search space with 10^13 architectures, which covers nearly all configurations in BERT model. Then, we propose a novel stochastic nature gradient optimization method to guide the generation of optimal candidate architecture which could keep a balanced trade-off between explorations and exploitation. When a certain resource constraint is given, a lightweight distribution optimization approach is utilized to obtain the optimal network for target deployment without fine-tuning. Compared with state-of-the-art algorithms, YOCO-BERT provides more compact models, yet achieving 2.1%-4.5% average accuracy improvement on the GLUE benchmark. Besides, YOCO-BERT is also more effective, e.g.,the training complexity is O(1)for N different devices. Code is availablehttps://github.com/MAC-AutoML/YOCO-BERT.

연구 동기 및 목표

  • 기존 BERT 압축 방법이 새로운 하드웨어 제약 조건에 맞춰 항상 미세조정 또는 재압축이 필요로 하는 문제를 해결하기 위해.
  • 신경망 아키텍처 검색에서 순수한 이용(예: DynaBERT) 또는 순수한 탐색(예: NAS-BERT)의 한계를 극복하기 위해.
  • 다양한 자원 제약이 있는 장치에 대해 '한 번 압축하고 어디서나 배포'할 수 있는 통합 압축 파이프라인을 개발하기 위해.
  • 큰 구조적 검색 공간에서 아키텍처 탐색과 이용의 균형을 통해 배포 시 성능 저하를 최소화하기 위해.

제안 방법

  • 너무나도 넓은 BERT 구성, 즉 너비, 깊이, 헤드 변형을 포함한 거의 모든 BERT 구성이 포함된 거대한 $10^{13}$개의 아키텍처 검색 공간을 구축한다.
  • 이용-탐색 확률 분포의 가중치와 파rameter를 동시에 최적화하기 위한 '이용-탐색 스토하스틱 자연 경사(EE-SNG)' 최적화 기법을 도입한다.
  • 완전한 모델을 위한 '슈퍼 모드' 학습 단계와 타겟 장치를 위한 경량 기반 적응 단계로 과정을 분리한다.
  • 성능 피드백에 기반해 학습 도중 탐색과 이용의 균형을 동적으로 조절할 수 있는 학습 가능한 컨트롤러를 사용한다.
  • 미세조정 없이 슈퍼-BERT 모델에서 직접 가중치를 상속함으로써 타겟 하위 아키텍처에 대해 배포 비용을 $\mathcal{O}(1)$로 낮춘다.
  • 스토하스틱 자연 경사를 사용해 연속적인 가능도 최대화 문제로 NAS 과정을 재구성함으로써, 미분 가능하고 효율적인 검색을 가능하게 한다.
Figure 1: The proposed YOCO-BERT. We separate YOCO-BERT into two stages. Given expanded training space, we first propose a EE-SNG to optimize the probability distribution $P_{\theta}$ and super-BERT. In the second stage, searching algorithm is supervised by the optimized $P_{\theta}$ to obtain the o
Figure 1: The proposed YOCO-BERT. We separate YOCO-BERT into two stages. Given expanded training space, we first propose a EE-SNG to optimize the probability distribution $P_{\theta}$ and super-BERT. In the second stage, searching algorithm is supervised by the optimized $P_{\theta}$ to obtain the o

실험 결과

연구 질문

  • RQ1통합 BERT 압축 프레임워크가 재압축 또는 미세조정 없이 다양한 하드웨어 제약 조건에서 높은 성능을 달성할 수 있는가?
  • RQ2BERT 압축을 위한 신경망 아키텍처 검색에서 이용-탐색 균형을 효과적으로 모델링하고 최적화할 수 있는가?
  • RQ3크고 구조화된 검색 공간과 함께 미분 가능한 최적화를 사용할 경우, 무작위나 진화적 탐색보다 더 나은 하위 아키텍처를 도출할 수 있는가?
  • RQ4슈퍼-BERT 모델에서 직접 가중치를 상속하는 것이 압축된 BERT 배포에서 미세조정된 하위 네트워크보다 얼마나 뛰어나게 성능을 높일 수 있는가?

주요 결과

  • YOCO-BERT는 최신 기술 대비 GLUE 벤치마크에서 평균 2.1%에서 4.5%까지의 정확도 향상을 달성한다.
  • 0.75배 압축 비율의 RTE 작업에서 YOCO-BERT는 순수 탐색 기반 베이스라인보다 9.8%포인트 높은 성능을 보인다.
  • 그림 3에서 보듯이 제안된 EE-SNG 최적화는 무작위 탐색과 진화적 탐색보다 더 빠르게 수렴하고 더 높은 정확도를 달성한다.
  • 검색 후 하위 아키텍처를 미세조정해도 유의미한 성능 향상이 없으며, 경우에 따라 성능 저하가 발생하여 RTE에서 최대 5.4%의 정확도 감소가 관찰된다.
  • 다양한 $N$대의 장치를 지원하기 위한 학습 복잡도가 $\mathcal{O}(1)$로 감소하였으며, 이는 오직 한 번의 슈퍼 모델 학습만 필요하기 때문이다.
  • 이 방법은 비용이 많이 드는 재학습이 필요 없이 최적화된 확률 분포에서 직접 고성능 하위 아키텍처를 성공적으로 식별하였다.
Figure 2: Comparison of parameters, FLOPs between YOCO-BERT and previous works under different datasets. We use accuracy as the metric for the three datasets. Since YOCO-BERT does not use external data, Dyanbert’s results are obtained without using data augmentation (DA).
Figure 2: Comparison of parameters, FLOPs between YOCO-BERT and previous works under different datasets. We use accuracy as the metric for the three datasets. Since YOCO-BERT does not use external data, Dyanbert’s results are obtained without using data augmentation (DA).

더 나은 연구,지금 바로 시작하세요

논문 읽기부터 검토까지, 연구 시간을 획기적으로 줄여보세요.

카드 등록 없음 · 무료 플랜 제공

이 리뷰는 AI가 만들고, 인간 에디터가 검토했습니다.