| 研究生: |
林哲宇 Lin, Zhe-Yu |
|---|---|
| 論文名稱: |
基於權重重置、分層微調與注意力調控的視覺轉換器機器遺忘研究 Machine Unlearning in Vision Transformers via Weight Resetting, Layer-wise Fine-tuning, and Attention-based Modulation |
| 指導教授: |
廖文宏
Liao, Wen-Hung |
| 口試委員: |
陳駿丞
Cheng, Jun-Cheng 彭彥璁 Peng, Yan-Tsung |
| 學位類別: |
碩士
Master |
| 系所名稱: |
資訊學院 - 資訊科學系 Department of Computer Science |
| 論文出版年: | 2026 |
| 畢業學年度: | 114 |
| 語文別: | 中文 |
| 論文頁數: | 65 |
| 中文關鍵詞: | 機器遺忘 、視覺轉換器 、權重重置 、模型操弄 |
| 外文關鍵詞: | Machine Unlearning, Vision Transformer, Weight Reset, Model Manipulation |
| 相關次數: | 點閱:8 下載:0 |
| 分享至: |
| 查詢本校圖書館目錄 查詢臺灣博碩士論文知識加值系統 勘誤回報 |
視覺轉換器(Vision Transformer, ViT)已廣泛應用於影像分類任務,但當模型需要回應資料移除請求時,如何降低特定訓練樣本對模型輸出行為的影響,仍是一項實務問題。歐盟《一般資料保護規範》(GDPR)中的「被遺忘權」提供了機器遺忘的應用背景;然而,對 ViT 而言,若每次遺忘請求皆以從頭重新訓練(retraining from scratch)處理,將帶來高昂的計算成本。因此,本研究聚焦於近似機器遺忘(Approximate Unlearning),探討如何在降低遺忘資料影響的同時,盡量維持模型在保留資料上的分類性能。
基於上述問題,本研究聚焦於 ViT 之近似機器遺忘問題,針對其知識儲存可能分散於不同層級注意力頭(Attention Head)與權重參數的特性,從「模型操弄」(Model Manipulation) 角度出發,設計並比較三類不同粒度的機器遺忘策略: (1)權重重置 (Weight Resetting),針對與遺忘資料相關之權重參數進行選擇性操作,並比較基於權重大小(Magnitude)、梯度(Gradient)及注意力頭相關梯度(Attention-Head )等不同重要性評估準則; (2) 分層遺忘 (Layer-wise Unlearning),探討在不同結構層級下進行模型操弄時,對遺忘效果與保留性能之影響; (3) 注意力導向遺忘(Attention-Targeted Unlearning),直接針對 ViT 的自注意力機制,透過辨識遺忘集與保留集之間響應差異較大的注意力路徑,施加縮放或擾動,以觀察較低侵入性操作的可行性。
為評估上述策略,本研究建立多面向評估框架,除保留集準確率(Retain Accuracy, RA)與遺忘集準確率(Forget Accuracy, FA)外,亦納入零重訓遺忘分數(Zero-Retrain Forgetting, ZRF)與黃金標準模型之對齊分數(Alignment),以量化遺忘效果、輸出行為偏移程度及與理想重訓模型之接近程度。此外,本文亦結合特徵表徵空間與輸出分佈分析,以觀察不同遺忘策略對模型內部行為的影響。實驗以 CIFAR-100 資料集為基礎,主要在不同遺忘規模與權重重置設定下,比較各類方法之遺忘強度、保留效能與內部表徵變化。結果顯示,在本研究設定下,Magnitude Reset 與 Gradient Reset 等細粒度權重重置方法,在微調後可於將 FA 壓低至 0% 的同時,維持約 73%–76% 的 RA,整體上在遺忘強度與保留性能之間呈現較穩定的平衡;相較之下,注意力導向遺忘方法較能維持保留集性能,但其遺忘效果仍明顯弱於權重重置方法。此外,random 與 similar forget classes 的補充實驗顯示,遺忘類別組成可能影響 RA 與 ZRF,但不改變細粒度權重重置方法較穩定的整體趨勢。綜合而言,本研究將 ViT 近似機器遺忘視為不同操作粒度之間的權衡問題,並指出細粒度權重重置較能兼顧遺忘強度與保留性能。
With the widespread adoption of large deep learning models, particularly Vision Transformers (ViT), data privacy protection and model maintainability have become increasingly important issues. Regulations such as the General Data Protection Regulation (GDPR) grant users the “Right to be Forgotten,” requiring the influence of specific training data to be effectively removed from trained models rather than merely deleting the original data. However, for ViT models, which involve large parameter counts and rely heavily on global self-attention mechanisms, the conventional retraining-from-scratch approach is often impractical due to its high computational cost. Therefore, developing efficient and reliable approximate unlearning techniques that can reduce the influence of specific data while preserving the primary utility of the model has become an important research problem.
This study focuses on approximate machine unlearning in ViT and investigates the problem from a model manipulation perspective, considering that knowledge in ViT may be distributed across attention heads and weight parameters at different layers. We design and compare three types of machine unlearning strategies at different granularities: (1) Weight Resetting, which selectively modifies parameters associated with the forgetting data and compares different importance criteria, including magnitude-based, gradient-based, and attention-head-related gradient measures; (2) Layer-wise Unlearning, which examines how model manipulation at different structural levels affects forgetting effectiveness and retained performance; and (3) Attention- Targeted Unlearning, which directly intervenes in the self-attention mechanism by identifying attention pathways that exhibit larger response differences between the forget set and the retain set, and then applying scaling or perturbation to these components to explore the feasibility of less invasive operations.
To evaluate these strategies, this study establishes a multi-dimensional assessment framework. In addition to Retain Accuracy and Forget Accuracy, we adopt the Zero- Retrain Forgetting (ZRF) score and the Alignment score with a gold-standard retrained model to quantify forgetting effectiveness, output-distribution shift, and proximity to the gold-standard retrained model. Furthermore, we analyze feature representation space and output distributions to examine the internal behavioral differences induced by different unlearning strategies. Experiments are conducted on the CIFAR-100 dataset, primarily under different forgetting scales and weight-reset settings, to compare forgetting strength, retained utility, and internal representation changes across methods.
The results show that, under the current experimental setting, fine-grained weight- resetting methods such as Magnitude Reset and Gradient Reset can reduce Forget Accuracy to 0% after fine-tuning while maintaining approximately 73%–76% Retain Accuracy, achieving a more stable balance between forgetting strength and retained performance. In contrast, attention-targeted methods better preserve retained utility, but their forgetting effectiveness remains weaker than that of weight-resetting methods. Additional experiments on random and similar forget classes further show that the composition of the forget set may affect Retain Accuracy and ZRF, while the overall stability of fine-grained weight resetting remains consistent. Overall, this study frames approximate unlearning in ViT as a trade-off among intervention granularity, forgetting strength, and retained utility.
謝誌 I
摘要 II
Abstract III
目次 V
圖次 VII
表次 VIII
第一章 緒論 1
1.1 研究背景與動機 1
1.2 研究目的與貢獻 2
1.3 論文架構 3
第二章 技術背景與相關研究 4
2.1 機器遺忘 4
2.1.1 精確遺忘 4
2.1.2 近似遺忘 4
2.2 機器遺忘評估指標 6
2.3 Transformer 架構下的機器遺忘研究 7
2.3.1 Vision Transformer 上的機器遺忘方法 7
2.3.2 討論與研究缺口 8
第三章 研究方法 10
3.1 資料集與模型架構 10
3.2 機器遺忘方法 11
3.2.1 權重重置 12
3.2.2 分層遺忘 13
3.2.3 注意力導向遺忘 13
3.3 特徵分佈與權重變化分析方法 14
3.3.1 內部表徵空間分析 14
3.3.2 權重變化量化分析 15
3.3.3 輸出行為與預測分佈分析 16
第四章 實驗結果與分析 17
4.1 實驗設定 17
4.2 權重重置實驗結果 18
4.2.1 不同重置策略與模式比較 18
4.2.2 重置比例與重置策略的影響 19
4.2.3 重置後的微調效果 22
4.2.4 權重重置方法之參數變化量分析 24
4.3 分層遺忘實驗設計與結果 26
4.3.1 標準策略:不同作用範圍的影響 27
4.4 注意力導向遺忘實驗設計與結果 29
4.4.1 三種 Attention-Targeted 遺忘方法 29
4.4.2 三種 Attention-Targeted 方法之結果分析 30
4.5 注意力導向遺忘 vs 權重重置遺忘 32
4.6 補充結果整理與整體比較 33
4.6.1 代表性設定下各方法之時間比較 33
4.6.2 不同遺忘類別規模摘要 34
4.6.3 不同遺忘類別選取方式之影響 35
4.7 特徵分佈與模型內部變化分析 37
4.7.1 特徵表徵空間的變化 37
4.7.2 輸出分佈與行為差異 40
4.7.3 不同重置策略在內部變化上的綜合比較 43
第五章 結論與未來工作 45
參考文獻 48
附錄A: Magnitude Reset 不同作用範圍結果 50
附錄B: Attention Head Reset 不同作用範圍結果 51
附錄C: 特徵空間補充圖 52
附錄D: 輸出分佈補充圖 59
[1] P. P. Ray,“ChatGPT: A comprehensive review on background, applications, key challenges, bias, ethics, limitations and future scope,”Science Direct, 2023.
[2] L. Caruccio, S. Cirillo, G. Polese, G. Solimando, S. Sundaramurthy, G. Tortora, “Claude 2.0 large language model: Tackling a real-world classification problem with a new iterative prompt engineering approach,”Science Direct, 2024.
[3] G. T. Google,“Gemini: A Family of Highly Capable Multimodal Models,” arXiv, 2023.
[4] “Grok 4,”xAI, 2025. [線上]. Available: https://x.ai/news/grok-4.
[5] “General Data Protection Regulation,”2018. [線上]. Available: https://gdpr- info.eu/.
[6] “California Consumer Privacy Act (CCPA),”2020. [ 線上]. Available: https://www.consumerprivacyact.com/california/.
[7] O. o. t. P. C. o. Canada, “The Personal Information Protection and Electronic Documents Act (PIPEDA),” 2018. [ 線 上 ]. Available: https://www.priv.gc.ca/en/privacy-topics/privacy-laws-in-canada/the-personal- information-protection-and-electronic-documents-act-pipeda/.
[8] W. Wang, Z. Tian, C. Zhang, S. Yu,“Machine Unlearning: A Comprehensive Survey,” arXiv, 2024.
[9] A. Dosovitskiy, L. Beyer, A. Kolesnikov, D. Weissenborn, X. Zhai, T. Unterthiner, M. Dehghani, M. Minderer, G. Heigold, S. Gelly, J. Uszkoreit, N. Houlsby,“An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale,” ICLR, 2021.
[10] L. Bourtoule, V. Chandrasekaran, C. A. Choquette-Choo, H. Jia, A. Travers, B. Zhang, D. Lie, N. Papernot,“Machine Unlearning,”IEEE Symposium on Security and Privacy (S&P), 2021.
[11] E. Chien, H. Wang, Z. Chen, P. Li,“Langevin Unlearning: A New Perspective of Noisy Gradient Descent for Machine Unlearning,”NeurIPS, 2024.
[12] A. K. Tarun, V. S. Chundawat, M. Mandal, M. Kankanhalli, “Fast Yet Effective Machine Unlearning,”IEEE Transactions on Neural Networks and Learning 48 Systems, 2024.
[13] S. Neel, A. Roth, S. Sharifi-Malvajerdi,“Descent-to-Delete: Gradient-Based Methods for Machine Unlearning,”ALT (PMLR), 2021.
[14] A. Warnecke, L. Pirch, C. Wressnegger, K. Rieck,“Machine Unlearning of Features and Labels,”NDSS, 2023.
[15] Soumya Roy, S. Banerjee, V. Verma, S. Dasgupta, D. Gupta, P. Rai, “NOVO: Unlearning-Compliant Vision Transformers,” arXiv, Jul. 4 2025.
[16] I. Cho, C. Park, J. Hockenmaier,“ViT-MUL: A Baseline Study on Recent Machine Unlearning Methods Applied to Vision Transformers,” arXiv, Jul. 2 2024.
[17] Y. Tong, T. Zhang, J. Yuan, Y. Wang, C. Hu,“LetheViT: Selective Machine Unlearning for Vision Transformers via Attention-Guided Contrastive Learning,” arXiv, Aug. 3 2025.
[18] S. Poppi, S. Sarto, M. Cornia, L. Baraldi, R. Cucchiara,“Unlearning Vision Transformers Without Retaining Data via Low-Rank Decompositions,”ICPR, 2024.