[논문 리뷰] Structured Pruning of a BERT-based Question Answering Model
해당 논문은 태스크-특정 구조적 가지치기와 증류를 결합해 BERT/RoBERTa QA 모델을 압축하고, 재학습 없이도 상당한 정확도 손실 없이 상당한 속도 향상을 얻을 수 있음을 보여준다.
The recent trend in industry-setting Natural Language Processing (NLP) research has been to operate large %scale pretrained language models like BERT under strict computational limits. While most model compression work has focused on "distilling" a general-purpose language representation using expensive pretraining distillation, less attention has been paid to creating smaller task-specific language representations which, arguably, are more useful in an industry setting. In this paper, we investigate compressing BERT- and RoBERTa-based question answering systems by structured pruning of parameters from the underlying transformer model. We find that an inexpensive combination of task-specific structured pruning and task-specific distillation, without the expense of pretraining distillation, yields highly-performing models across a range of speed/accuracy tradeoff operating points. We start from existing full-size models trained for SQuAD 2.0 or Natural Questions and introduce gates that allow selected parts of transformers to be individually eliminated. Specifically, we investigate (1) structured pruning to reduce the number of parameters in each transformer layer, (2) applicability to both BERT- and RoBERTa-based models, (3) applicability to both SQuAD 2.0 and Natural Questions, and (4) combining structured pruning with distillation. We achieve a near-doubling of inference speed with less than a 0.5 F1-point loss in short answer accuracy on Natural Questions.
연구 동기 및 목표
- 산업 환경에서 재학습 없이 대형 QA 모델의 계산 부담을 줄이는 것을 동기로 삼는다.
- BERT-base 및 RoBERTa QA 시스템에 대해 태스크-특정 구조적 가지치기를 개발하고 평가한다.
- 구조적 가지치기와 증류를 결합해 정확도 손실을 최소화하면서 속도 향상을 극대화하는지 조사한다.
- 데이터셋(SQuAD 2.0 및 Natural Questions)과 모델(BERT 및 RoBERTa) 간 가지치기 기법의 전달 가능성을 평가한다.
- 트랜스포머 기반 QA 모델의 게이트 배치 및 가지치기 전략에 대한 가이드라인을 제공한다.
제안 방법
- 각 트랜스포머 계층에 학습 가능한 게이트 마스크를 삽입해 주의(attention) 헤드와 피드포워드 활성화를 선택적으로 비활성화한다.
- 게이트 결정 전략을 포함해 무작위, 헤드 중요도 증가, 하드-컨크리트 분포를 이용한 L0 정규화를 탐구한다.
- 게이트를 적용하고 남은 매개변수들을 증류 여부에 상관없이 재학습시켜 Attention 헤드와 피드포워드 구성요소를 가지치한다.
- 가지치기 후 태스크-특정 학습을 계속 진행하며 표준 재학습 또는 unpruned 교사 모델로부터의 증류 중 하나를 선택한다.
- BERT 기반 QA 시스템과 RoBERTa 기반 QA 시스템 모두에 가지치기를 적용하고 SQuAD 2.0 및 Natural Questions에서 평가한다.
- 똑같지 않은 계층별 가지치기 구조가 나타날 수 있음을 보여준다(끝 부분은 가볍고 중간은 더 복잡하다).
실험 결과
연구 질문
- RQ1QA 작업에서 BERT-base에서 BERT-large으로 태스크-특정 구조적 가지치기가 전달될 수 있는가?
- RQ2BERT 기반 QA를 위해 개발된 구조적 가지치기 기법이 RoBERTa 및 Natural Questions로 전달될 수 있는가?
- RQ3구조적 가지치기와 증류의 결합이 가지치기나 증류만 사용하는 경우보다 더 나은 속도/정확도 트레이드오프를 제공하는가?
- RQ4QA 트랜스포머를 가지치기하기 위한 효과적인 게이트 결정 전략은 무엇인가(무작위, 이득, L0)?
- RQ5가지치기가 SQuAD 2.0 및 Natural Questions의 장-답변 vs 단답변 성능에 어떤 영향을 미치는가?
주요 결과
- L0 규제 가지치기는 SQuAD 2.0에서 5 F1 포인트 미만의 손실로 약 48%의 주의 헤드와 약 70%의 피드포워드 활성화를 포함한 상당한 가지치를 가능하게 한다.
- 가지치기와 지속적인 재학습의 조합은 정확도의 상당 부분을 회복하고 SQuAD 2.0에서 디코딩 속도를 거의 두 배로 증가시킨다.
- Natural Questions에서 RoBERTa-large 가지치기는 적은 F1 손실로 주목할 만한 속도 향상을 달성하고 증류의 이점을 얻는다.
- 가지치기 이후의 증류는 추가 이득을 가져와 더 큰 기준선에 가까운 성능을 유지하면서도 추론 속도를 유지한다.
- 가지치기된 모델은 층 간 비대칭 구조를 나타내는 경향이 있으며 중간 층을 끝부분보다 더 많이 보유하는 경향으로 비균일한 가지치기 패턴을 시사한다.
- 가지치기 기법은 RoBERTa와 NQ로 전달되며 모델 및 데이터셋에 구애받지 않는 접근의 강건함을 시사한다.
더 나은 연구,지금 바로 시작하세요
연구 설계부터 논문 작성까지, 연구 시간을 획기적으로 줄여보세요.
카드 등록 없음 · 무료 플랜 제공
이 리뷰는 AI가 만들고, 인간 에디터가 검토했습니다.