둔비의 공부공간

DYNAMIC MODEL PRUNING WITH FEEDBACK 본문

Papers/Compression

DYNAMIC MODEL PRUNING WITH FEEDBACK

Doonby 2023. 3. 16. 01:53

ICLR 2020

https://arxiv.org/abs/2006.07253

 

Dynamic Model Pruning with Feedback

Deep neural networks often have millions of parameters. This can hinder their deployment to low-end devices, not only due to high memory requirements but also because of increased latency at inference. We propose a novel model compression method that gener

arxiv.org

 

미루고 미루다가 3개월이 지나버렸다.

분명 읽고 리뷰했다고 생각했는데 기억이 나질 않는다! 

 

 

Abstract

논문에서는 over-head없이 sparse training된 모델을 생성하는 새로운 모델 압축 방법을 제안한다.

  1. sparse pattern을 dynamic하게 변경하고
  2. feedback signal을 통합하여 pruning된 weight을 살려서, one single training pass에서 성능 좋은 sparse model을 얻는다.

기존 pruning 성능은 뛰어 넘고, CIFAR10, ImageNet에서 SOTA dense model의 거의 근접한 sparse model을 얻을 수 있었다.

 

 

Introduction

One-shot pruning strategies는 pretrained model을 갖고 sparsity mask를 찾는 방법이다.

다만, 이 방법들은 약간의 정확도 손실로 network의 크기를 줄일 수 있지만, 계산 비용이 많이 들고(dense training, refinement), 다양한 sparsity mask를 찾는 알고리즘보다 성능이 떨어진다.

 

Dynamic pruning 방법은, 다양한 criteria를 통해 학습과정에서 sparsity mask를 계속 조정하는 것을 말한다.

하지만, fine-tuning과 많은 hyperparameters가 필요하다.

 

이 논문의 압축 방식은 training 전반에 걸쳐 네트워크에서 중요한 가중치를 식별하는 방법을 사용해 마스크를 찾는다.

또한, pruned sparse model을 학습시키면서, dense model도 같이 학습한다.

 

다양한 task에서 generalization성능이 좋았다. 

 

Contributions.

  • one training pass에서 sparse model을 찾으며 error feedback을 자연적으로 통합하는 참신한 dynamic pruning을 제안했다.
  • SOTA performance(accuracy, sparsity)를 입증하며, 기존 pruning 성능을 뛰어 넘었다.
  • 추가 인사이트를 제공하는 ablation study와 convex, non-convex objectives에 대한 수렴 분석으로 결과를 보완했다.

 

Method

SGD weight update rule

pruning은 weight $w$에 mask $m \in \{0, 1\}^{d}$를 곱해서 sparse model을 만든다.

 

dynamic pruning에 대해서 시작하기에 앞서, pruning의 주요 3가지 방법에 대해서 알아보자.

3가지 방법 요약

 

Pruning before training

  • 초기 weight갖고 mask $m_{0}$를 구해서, 이를 학습시키는 것인데 초반에 mask 선택이 성능에 영향이 너무 크다.

Pruning after training (one-shot pruning)

  • dense model을 학습하고, mask를 구해서 pruning후에 약간의 fine-tuning을 하면서 성능 향상을 시킨다.

Pruning during training (incremental and dynamic pruning)

  • 학습중에 mask $m_{t}$를 특정 or 매 iteration마다 변경하는 방법이다. (기준은 weights or gradients)
  • Incremental 방식은, sparse mask를 증가시키는 것이고, dynamic pruning방법은 지워졌던 weights도 다시 살려가면서 진행하는 것이다.
  • 기존 휴리스틱한 방법으로 $m_{t}$를 조정했던 방식과 다르게, 다음과 같은 더 간단한 방식을 논문에서 제안한다.

 

 

Dynamic pruning with feedback (DPF)

gradient를 전체 모델에 대해서 적용하면 'error'로 부터 weight가 살아날 수 있다. 즉, 중요한 가중치를 조기에 masking하는 것을 복구할 수 있다는 뜻이다.

DPF수식

위에서 보인 수식을 아래 수식처럼 다시 쓸 수 있다. $e_{t}$란 masked $w_{t}$ - weight $w_{t}$를 말한다.

 

 

 

16 iteration마다, unstructured magnitude pruning을 진행해서 mask $m$을 만든다.

mask $m$에 weight $t$를 곱해서 gradient를 계산하고 업데이트한다.

최종적으로 weight와 프루닝된 weight를 구할 수 있다.

Comments