Uppsats

Regularization Techniques to mitigate and measure Catastrophic Forgetting in Large Language Models and Neural Networks : An Experimental study

Master-uppsats

Luleå tekniska universitet/Institutionen för system- och rymdteknik

Publicerad: 2025

Språk: Engelska

Sammanfattning

This experimental study investigated how regularization techniques could be used to measure and mitigate Catastrophic Forgetting (CF) in Large Language Models (LLMs) and neural networks. CF refers to the phenomenon in which artificial neural networks rapidly forget previous information when new data are fed to them. There are a number of regularization techniques, where Elastic Weight Consolidation (EWC) relies on penalizing changes made to key parameters for learning previous tasks when learning new tasks. Online EWC differs from regular EWC in that it updates the Fisher information as a gliding sum into an accumulated Fisher matrix, rather than keeping separate matrices for each task. Rotation EWC rotates the weight parameters into a new coordinate system. Synaptic Intelligence (SI) measures how important each parameter is in order to remember previous tasks, and penalizes later tasks if these parameters are changed too much. Regularization techniques have remained an established and computationally efficient strategy to mitigate CF. However, the majority of research on regularization techniques has been done in simplified conditions using relatively small and imbalanced datasets. Furthermore, the application of regularization techniques in LLMs remains underexplored. For this reason, regularization-based methods were the focus of this study. The aim was further specified into two research questions, the first being How can Catastrophic Forgetting be measured and mitigated through regularization techniques in NLP tasks in LLMs? And the second being How can Catastrophic Forgetting be measured and mitigated through regularization techniques in realistic datasets in neural networks? To answer the research questions, two experiments were designed. In the two experiments, five cases were compared: a baseline case with no regularization, and four cases with regularization, namely EWC, Online EWC, Rotation EWC, and SI. In the first experiment, data from the GLUE dataset was used, and five (5) tasks were performed: MRPC, SST-2, RTE, QNLI, and CoLA. A distilBERT LLM was loaded and progressively trained on the different tasks to simulate incremental learning. The model was trained on one task and then tested on all tasks before training on the next task to measure CF. The second experiment used data from the Tiny Imagenet library and trained on three (3) tasks. Similar to the first experiment, the neural network was trained on one task before being tested on all tasks before moving on. The performance was measured using five metrics: Omega-base (accuracy of the prior (or first) task after the training of a later task has been completed), Omega-new (accuracy of the current task), Omega-all (average accuracy of all the tasks after the training of all tasks has been completed), Average accuracy (mean accuracy across all tasks) and Average Forgetting (the difference of a task’s performance when it was first learned and after the final training). The results of the GLUE experiment showed an Average Accuracy and Omega-all of 0.74-0.85 and 0.79-0.88, respectively. In the Tiny Imagenet experiment, an Average Accuracy and Omega-all of 0.30-0.35 and 0.42-0.49, respectively, was achieved. The measurement for forgetting shows a similar pattern, as it ranged from 0.14-0.21 in the GLUE dataset to rise steeply to 0.79-0.88 in the Tiny Imagenet dataset. Given the results, the study concluded that regularization techniques on their own are not enough to fully eliminate CF. Hence, future studies should explore hybrid techniques, and is also recommended to incorporate the Omega metrics.

Information

Lärosäte / institution
Luleå tekniska universitet/Institutionen för system- och rymdteknik
Publiceringsdatum
2025
Uppsatstyp
Master-uppsats
Språk
Engelska

Utforska vidare

Liknande uppsatser

Uppsatser med liknande ämnen och nyckelord.