注意力引導的知識蒸餾以及多樣性層選擇壓縮BERT模型
顯示簡易詮釋資料 統計資料| 欄位 | 內容 | 語言 |
|---|---|---|
dc.catalog.0080 |
240829 | |
dc.catalog.00818 |
a | |
dc.catalog.00818 |
d | |
dc.catalog.00818 |
| | |
dc.catalog.00818 |
| | |
dc.catalog.0087 |
2023 | |
dc.catalog.020 |
平裝 | |
dc.catalog.041 |
chi | |
dc.catalog.041 |
eng | |
dc.catalog.300c |
30 | |
dc.contributor.advisor |
陳添福 | |
dc.contributor.advisor |
Chen, Tien-Fu | |
dc.contributor.author |
黃炫峰 | |
dc.contributor.author |
Huang, Xuan-Feng | |
dc.contributor.campus |
交大 | |
dc.contributor.college |
資訊學院 | |
dc.contributor.department |
網路工程研究所 | |
dc.contributor.dpcode |
INWEN | |
dc.contributor.idpcode |
3552 | |
dc.contributor.studentid |
310552050 | |
dc.date.NCLavailable |
不公開 | |
dc.date.USTavailable |
不公開 | |
dc.date.etdavailablereason |
產學合作保密協議 | |
dc.date.issued |
2023 | |
dc.date.issuedROC |
112 | |
dc.date.paperavailable |
2026/08/28 | |
dc.date.schoolyear |
112 | |
dc.description.abstract |
近年來,自注意力模型在自然語言的任務上取得重大的成功,雖然其準確度非常高,但是自注意力神經網路的參數量非常巨大,在訓練時需要大量的資料來激勵這些參數,在實際推論時需要耗費大量的計算資源以及記憶體,因此自注意力神經網路的準確度雖然驚人但難以部署到資源受限的裝置上以至於實用性降低。為解決此問題,目前有許多自注意力神經網路模型壓縮的研究,其中知識蒸餾為目前最具代表性的模型壓縮技術之一,該技術能將一個大型教師神經網路知識蒸餾到一個小型的學生網路,使得學生網路在參數量及運算量較小的情況下依然能達到教師網路的準確度。然而,我們觀察到現有的知識蒸餾研究中有兩個缺點:1)缺乏一個利用教師神經網路參數初始化學生神經網路的策略,2)知識蒸餾的訓練過中僅傳遞教師神經網路的中間層特徵以及輸出結果,缺乏教師神經網路自注意力層資訊的傳遞以至於學生網路達不到理想的準確度。另外,我們也觀察到一般知識蒸餾的教師神經網路是針對特定任務作優化並非針對教導學生,因此我們也加入了學生與教師互相學習的方式使得教師神經網路能夠針對教導學生作優化。實驗結果表明,我們提出的基於注意力引導的知識蒸餾以及注意力多樣性的層選擇方法明顯優於傳統的知識蒸餾方法,並且學生神經網路達到接近教師神經網路水準的準確度。此外,我們也將注意力引導的知識蒸餾以及注意力多樣性的層選擇方法套用在多種自注意力模型,進一步證明我們方法的有效性以及通用性。 | |
dc.description.abstract |
In recent years, self-attention models have achieved significant success in natural language processing tasks. While these models exhibit high accuracy, they suffer from a large number of parameters, requiring substantial amounts of data for training. Moreover, their deployment on edge devices is challenging due to the computational and memory requirements during inference. To address this problem, various research efforts have focused on compressing self-attention neural networks, with knowledge distillation being one of the most prominent techniques. knowledge distillation is a technique that enables the transfer of insights from a larger, more complex teacher network to a less complex and smaller student network. The primary benefit of this process is that the student network can reach a similar level of accuracy as the teacher network but with fewer parameters and a lower computational burden.However, existing knowledge distillation approaches have two limitations. Firstly, they lack strategies for initializing the student network using the teacher network's parameters. Secondly, during the training process, they only transfer intermediate layer features and output results from the teacher network, neglecting the importance of self-attention layer information, which iiiprevents the student network from reaching its full potential accuracy. Additionally, we observed that conventional knowledge distillation techniques optimize the teacher neural network for a specific task rather than focusing on teaching the student. Therefore, we introduced a mutual learning approach between the student and teacher networks, allowing the teacher network to optimize itself for teaching the student. Experimental results demonstrate that our proposed methods outperform traditional knowledge distillation approaches, and the student network achieves accuracy levels close to that of the teacher network. Furthermore, we apply the attention-guided knowledge distillation and attention diversity layer selection methods to multiple self-attention models, providing evidence of the effectiveness and versatility of our approach. | |
dc.description.abstractopendate |
2023/08/28 | |
dc.description.degree |
碩士 | |
dc.description.tableofcontents |
摘 要 ............................................................. i ABSTRACT .............................................................. ii Keywords: model compression, BERT, knowledge distillation, natural language tasks, selfattention. ................................................................ iii Table of Contents ......................................................... iii List of Figures............................................................. iv List of Tables ............................................................. vi I. Introduction ......................................................... 1 1.1 Motivation ..............................................................................................................1 1.2 Problem Definition .................................................................................................3 1.3 Main Contributions.................................................................................................4 II. Background and Related Work........................................... 5 2.1 BERT ......................................................................................................................5 2.1.1 Self-Attention .............................................................................................7 2.2 NLP pre-trained model ...........................................................................................8 iv 2.3 Model compression ................................................................................................9 III. BERT-model compression fine-tuning system architecture .................... 11 3.1 System Architecture..............................................................................................12 3.2 Attention-diversity layer selection........................................................................13 3.2.1 Analysis attention map .............................................................................14 3.2.2 Attention diversity layer selection algorithm ...........................................15 3.3 Two stage teacher-student knowledge transfer.....................................................18 3.3.1 Attention-Guided Knowledge Distillation ...............................................19 3.3.2 Intermediate Representation distillation...................................................20 3.3.3 Summary of knowledge distillation..........................................................22 3.4 Mutual learning ....................................................................................................23 IV. Extend and analysis .................................................. 25 4.1 Early Exit..............................................................................................................26 4.2 Analysis Attention map of our methodology........................................................28 V. Evaluation.......................................................... 29 5.1 Evaluation.............................................................................................................29 5.1.1 Datasets.....................................................................................................29 5.1.2 Details and baseline ..................................................................................30 5.2 Results ..................................................................................................................32 5.2.1 Experiment on GLUE...............................................................................32 5.2.2 Early Exit Results.....................................................................................34 VI. Conclusion ......................................................... 35 VII. References ......................................................... 36 | |
dc.identifier.citation |
[1] J. Devlin, M.-W. Chang, K. Lee, and K. Toutanova, ‘BERT: Pre-training of Deep Bidirectional Transformers for Language Understanding’, Oct. 2018. [2] A. R. Openai, K. N. Openai, T. S. Openai, and I. S. Openai, ‘Improving Language Understanding by Generative Pre-Training’. [Online]. Available: https://gluebenchmark.com/leaderboard [3] A. Dosovitskiy et al., ‘An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale’, Oct. 2020. [4] A. Vaswani et al., ‘Attention Is All You Need’, Jun. 2017. [5] Y. Liu et al., ‘RoBERTa: A Robustly Optimized BERT Pretraining Approach’, Jul. 2019. [6] C. Raffel et al., ‘Exploring the Limits of Transfer Learning with a Unified Text-to-Text Transformer’, Oct. 2019. [7] T. B. Brown et al., ‘Language Models are Few-Shot Learners’, May 2020. [8] Z. Sun, H. Yu, X. Song, R. Liu, Y. Yang, and D. Zhou, ‘MobileBERT: a Compact TaskAgnostic BERT for Resource-Limited Devices’, Apr. 2020. [9] X. Jiao et al., ‘TinyBERT: Distilling BERT for Natural Language Understanding’, Sep. 2019. [10] Y. Zhu et al., ‘Aligning Books and Movies: Towards Story-like Visual Explanations by Watching Movies and Reading Books’, Jun. 2015. [11] Z. Lan, M. Chen, S. Goodman, K. Gimpel, P. Sharma, and R. Soricut, ‘ALBERT: A Lite BERT for Self-supervised Learning of Language Representations’, Sep. 2019. 37 [12] Y. Wu et al., ‘Google’s Neural Machine Translation System: Bridging the Gap between Human and Machine Translation’, Sep. 2016. [13] X. P. Qiu, T. X. Sun, Y. G. Xu, Y. F. Shao, N. Dai, and X. J. Huang, ‘Pre-trained models for natural language processing: A survey’, Science China Technological Sciences, vol. 63, no. 10. Springer Verlag, pp. 1872–1897, Oct. 01, 2020. doi: 10.1007/s11431-020- 1647-3. [14] T. Mikolov, K. Chen, G. Corrado, and J. Dean, ‘Efficient Estimation of Word Representations in Vector Space’, Jan. 2013. [15] J. Pennington, R. Socher, and C. D. Manning, ‘GloVe: Global Vectors for Word Representation’. [Online]. Available: http://nlp. [16] J. Howard and S. Ruder, ‘Universal Language Model Fine-tuning for Text Classification’, Jan. 2018. [17] M. E. Peters et al., ‘Deep contextualized word representations’, Feb. 2018. [18] A. Radford, J. Wu, R. Child, D. Luan, D. Amodei, and I. Sutskever, ‘Language Models are Unsupervised Multitask Learners’. [Online]. Available: https://github.com/codelucas/newspaper [19] A. Wang, A. Singh, J. Michael, F. Hill, O. Levy, and S. R. Bowman, ‘GLUE: A MultiTask Benchmark and Analysis Platform for Natural Language Understanding’, 2018. [20] M. A. Gordon, K. Duh, and N. Andrews, ‘Compressing BERT: Studying the Effects of Weight Pruning on Transfer Learning’. [Online]. Available: https://www.tensorflow.org/versions/ [21] G. Hinton, O. Vinyals, and J. Dean, ‘Distilling the Knowledge in a Neural Network’, Mar. 2015. [22] Y. J. Lin, K. Y. Chen, and H. Y. Kao, ‘LAD: Layer-Wise Adaptive Distillation for BERT Model Compression’, Sensors, vol. 23, no. 3, Feb. 2023, doi: 10.3390/s23031483. [23] S. Sun, Y. Cheng, Z. Gan, and J. Liu, ‘Patient Knowledge Distillation for BERT Model Compression’, Aug. 2019. [24] P. Passban, Y. Wu, M. Rezagholizadeh, and Q. Liu, ‘ALP-KD: Attention-Based Layer Projection for Knowledge Distillation’, Dec. 2020 | |
dc.identifier.uri |
https://hdl.handle.net/20.500.14371/271 | |
dc.language.iso |
英文 | |
dc.relation.page |
37 | |
dc.subject.keyword |
神經網路模型壓縮 | |
dc.subject.keyword |
知識蒸餾 | |
dc.subject.keyword |
自然語言任務 | |
dc.subject.keyword |
自注意力模型 | |
dc.subject.keyword |
model compression | |
dc.subject.keyword |
BERT | |
dc.subject.keyword |
knowledge distillation | |
dc.subject.keyword |
natural language tasks | |
dc.subject.keyword |
self-attention | |
dc.title |
注意力引導的知識蒸餾以及多樣性層選擇壓縮BERT模型 | zh-TW |
dc.title |
Enhancing Knowledge Distillation in BERT Model: Attention-Guided Distillation and Layer Selection by Attention Diversity | |
dc.type |
Thesis | zh-TW |
檔案
全文未公開。
所屬典藏: 網路工程研究所
引用此條目
Huang, X.-F. (2023). Enhancing Knowledge Distillation in BERT Model: Attention-Guided Distillation and Layer Selection by Attention Diversity. https://thesis.lib.nycu.edu.tw/handle/20.500.14371/271
引用文字依 APA 第 7 版格式自動產生,使用前請再核對。
分享
永久網址:https://thesis.lib.nycu.edu.tw/handle/20.500.14371/271