그라디언트 개선 및 명시적 정규화를 통한 심층 모델 압축에 관한 연구

Abstract

학위논문(박사) -- 서울대학교대학원 : 융합과학기술대학원 융학과학부, 2022.2. 김장호Deep Neural Network (DNN)은 빠르게 발전하여 컴퓨터 비전, 자연어 처리 및 음성 처리를 포함한 많은 영역에서 놀라운 성능을 보여 왔다. 이러한 DNN의 발전에 따라 edge IoT 장치와 스마트폰에 DNN을 구동하는 온디바이스 DNN에 대한 수요가 증가하고 있다. 그러나 DNN의 성장과 함께 DNN 매개변수의 수가 급격히 증가했다. 이로 인해 DNN 모델을 리소스 제약이 있는 에지 장치에 구동하기가 어렵다. 또 다른 문제는 에지 장치에서 DNN의 전력 소비량이다 왜냐하면 에지 장치의 전력용 배터리가 제한되어 있기 때문이다. 위의 문제를 해결하기 위해서는 모델 압축이 매우 중요하다. 이 논문에서 우리는 지식 증류, 양자화 및 가지치기를 포함한 모델 압축의 세 가지 새로운 방법을 제안한다. 먼저, 지식 증류라고 불리는 방법으로써, 교사 네트워크의 추가 정보를 사용하여 학생 모델을 학습시키는 것을 목표로 한다. 이 프레임워크를 사용하면 주어진 매개변수를 최대한 활용할 수 있으며 이는 장치의 리소스가 제한된 상황에서 중요하다. 기존 지식 증류 프레임워크와 달리 네트워크 구조, 배치 무작위성 및 초기 조건과 같은 교사와 학생 간의 고유한 차이가 적절한 지식을 전달하는 데 방해가 될 수 있으므로 피쳐에서 요소를 추출하여 지식을 간접적으로 증류하는 데 중점을 둔다. 둘째, 양자화를 위한 정규화 방법을 제안한다. 양자화된 모델은 자원이 제한된 에지 장치에 중요한 전력 소모와 메모리에 이점이 있다. 파라미터 분포를 양자화 친화적으로 만들기 위해 훈련 시간에 모델의 기울기를 불균일하게 재조정한다. 우리는 그라디언트의 크기를 재조정하기 위해 position-based scaled gradient (PSG)를 사용한다. Stochastic gradient descent (SGD) 와 비교하여, 우리의 position-based scaled gradient descent (PSGD)는 모델의 양자화 친화적인 가중치 분포를 만들기 때문에 양자화 후 성능 저하를 완화한다. 셋째, 중요하지 않은 과잉 매개 변수화 모델을 제거하기 위해, 가지치기된 가중치의 대략적인 기울기에 Straight-Through-Estimator (STE)를 활용하여 훈련 중에 다양한 희소성 패턴을 찾으려고 하는 동적 가지치기 방법이 등장했다. STE는 동적 희소성 패턴을 찾는 과정에서 제거된 파라미터가 되살아나도록 도울 수 있다. 그러나 이러한 거친 기울기 (coarse gradient)를 사용하면 STE 근사의 신뢰할 수 없는 기울기 방향으로 인해 훈련이 불안정해지고 성능이 저하된다. 이 문제를 해결하기 위해 우리는 이중 전달 경로를 형성하여 제거된 파라미터 (pruned weights)를 업데이트하기 위해 정제된 그라디언트를 제안한다. 가지치기에 거친 기울기를 사용하지 않기 위해 Dynamic Collective Intelligence Learning (DCIL)을 제안한다. 마지막으로 제안된 방법들을 이용하여 통합 모델 압축 훈련 프레임워크로서 결합한다. 이 방법은 극도로 희소하고 양자화 친화적인 모델을 훈련할 수 있다.Deep neural network (DNN) has been developed rapidly and has shown remarkable performance in many domains including computer vision, natural language processing and speech processing. The demand for on-device DNN, i.e., deploying DNN on the edge IoT device and smartphone in line with this development of DNN has increased. However, with the growth of DNN, the number of DNN parameters has risen drastically. This makes DNN models hard to be deployed on resource-constraint edge devices. Another challenge is the power consumption of DNN on the edge device because edge devices have a limited battery for the power. To resolve the above issues model compression is very important. In this dissertation, we propose three novel methods in model compression including knowledge distillation, quantization and pruning. First, we aim to train the student model with additional information of the teacher network, named as knowledge distillation. This framework makes it possible to make the most of a given parameter, which is essential in situations where the device's resources are limited. Unlike previous knowledge distillation frameworks, we focus on distilling the knowledge indirectly by extracting the factor from features because the inherent differences between the teacher and the student, such as the network structure, batch randomness, and initial conditions, can hinder the transfer of appropriate knowledge. Second, we propose the regularization method for quantization. The quantized model has advantages in power consumption and memory which are essential to the resource-constraint edge device. We non-uniformly rescale the gradient of the model in the training time to make a weight distribution quantization-friendly. We use position-based scaled gradient (PSG) for rescaling the gradient. Compared with the stochastic gradient descent (SGD), our position-based scaled gradient descent (PSGD) mitigates the performance degradation after quantization because it makes a quantization-friendly weight distribution of the model. Third, to prune the unimportant overparameterized model dynamic pruning methods have emerged, which try to find diverse sparsity patterns during training by utilizing Straight-Through-Estimator (STE) to approximate gradients of pruned weights. STE can help the pruned weights revive in the process of finding dynamic sparsity patterns. However, using these coarse gradients causes training instability and performance degradation owing to the unreliable gradient signal of the STE approximation. To tackle this issue, we propose refined gradients to update the pruned weights by forming dual forwarding paths. We propose a Dynamic Collective Intelligence Learning (DCIL) to avoid using coarse gradients for pruning. Lastly, we combine proposed methods as a unified model compression training framework. This method can train a drastically sparse and quantization-friendly model.Abstract i Contents iii List of Tables vii List of Figures x 1 Introduction 1 1.1 Motivation 1 1.2 Tasks 4 1.3 Contributions and Outline 7 2 Related work 11 2.1 Knowledge Distillation 11 2.2 Quantization 13 2.2.1 Sparse training 14 2.3 Pruning 15 3 Factor Transfer (FT) for Knowledge Distillation 17 3.1 Introduction 17 3.2 Proposed method 19 3.2.1 Teacher Factor Extraction with Paraphraser 20 3.2.2 Factor Transfer with Translator 21 3.3 Experiments 23 3.3.1 CIFAR-10 24 3.3.2 CIFAR-100 26 3.3.3 Ablation Study 28 3.3.4 ImageNet 29 3.3.5 Object Detection 29 3.3.6 Discussion 31 3.4 Conclusion 31 4 Position based Scaled Gradients (PSG) for Quantization 33 4.1 Introduction 33 4.2 Proposed method 37 4.2.1 Optimization in warped space 38 4.2.2 Position-based scaled gradient 39 4.2.3 Target points 43 4.2.4 PSGD for deep networks 44 4.2.5 Geometry of the Warped Space 45 4.3 Experiments 50 4.3.1 Implementation details 51 4.3.2 Pruning 53 4.3.3 Quantization 56 4.3.4 Knowledge Distillation 58 4.3.5 Various architectures with PSGD 60 4.3.6 Adam optimizer with PSG 60 4.4 Discussion 61 4.4.1 Toy Example 61 4.4.2 Weight Distributions 62 4.4.3 Quantization-aware training vs PSGD 64 4.4.4 Post-training with PSGD-trained model 65 4.5 Conclusion 65 5 Dynamic Collective Intelligence Learning (DCIL) for Pruning 69 5.1 Introduction 69 5.2 Proposed method 73 5.2.1 Backgrounds 73 5.2.2 Dynamic Collective Intelligence Learning 74 5.2.3 Convergence analysis 79 5.3 Experiments 80 5.3.1 Experiment Setting 81 5.3.2 Experiment Results 84 5.3.3 Differences between Dense and pruned model 87 5.3.4 Analysis of the stability 87 5.3.5 Cost of training 90 5.3.6 Fast convergence of DCIL 92 5.3.7 Tendency of warm-up 93 5.3.8 CIFAR10 94 5.3.9 ImageNet 94 5.3.10 Analysis of training and inference overheads 95 5.4 Conclusion 96 6 Deep Model Compression via KD, Quantization and Pruning (KQP) 97 6.1 Method 97 6.2 Experiment 98 6.3 Conclusion 102 7 Conclusion 103 7.1 Summary 103 7.2 Limitations and Future Directions 105 Abstract (In Korean) 118 감사의 글 120박

    Similar works