Unlearning Trojans in Large Language Models: A Comparison Between Natural Language and Source Code

Fuente: arXiv
Salvato in:
Dettagli Bibliografici
Autori principali: Kazemi, Mahdi, Hussain, Aftab, Rabin, Md Rafiqul Islam, Alipour, Mohammad Amin, Lin, Sen
Natura: Preprint
Pubblicazione: 2024
Soggetti:
Accesso online:
Tags: Aggiungi Tag
Nessun Tag, puoi essere il primo ad aggiungerne!!
_version_ 1866909293591134208
author Kazemi, Mahdi
Hussain, Aftab
Rabin, Md Rafiqul Islam
Alipour, Mohammad Amin
Lin, Sen
author_facet Kazemi, Mahdi
Hussain, Aftab
Rabin, Md Rafiqul Islam
Alipour, Mohammad Amin
Lin, Sen
contents This work investigates the application of Machine Unlearning (MU) for mitigating the impact of trojans embedded in conventional large language models of natural language (Text-LLMs) and large language models of code (Code-LLMs) We propose a novel unlearning approach, LYA, that leverages both gradient ascent and elastic weight consolidation, a Fisher Information Matrix (FIM) based regularization technique, to unlearn trojans from poisoned models. We compare the effectiveness of LYA against conventional techniques like fine-tuning, retraining, and vanilla gradient ascent. The subject models we investigate are BERT and CodeBERT, for sentiment analysis and code defect detection tasks, respectively. Our findings demonstrate that the combination of gradient ascent and FIM-based regularization, as done in LYA, outperforms existing methods in removing the trojan's influence from the poisoned model, while preserving its original functionality. To the best of our knowledge, this is the first work that compares and contrasts MU of trojans in LLMs, in the NL and Coding domain.
format Preprint
id arxiv_https___arxiv_org_abs_2408_12416
institution arXiv
publishDate 2024
record_format arxiv
spellingShingle Unlearning Trojans in Large Language Models: A Comparison Between Natural Language and Source Code
Kazemi, Mahdi
Hussain, Aftab
Rabin, Md Rafiqul Islam
Alipour, Mohammad Amin
Lin, Sen
Software Engineering
Machine Learning
This work investigates the application of Machine Unlearning (MU) for mitigating the impact of trojans embedded in conventional large language models of natural language (Text-LLMs) and large language models of code (Code-LLMs) We propose a novel unlearning approach, LYA, that leverages both gradient ascent and elastic weight consolidation, a Fisher Information Matrix (FIM) based regularization technique, to unlearn trojans from poisoned models. We compare the effectiveness of LYA against conventional techniques like fine-tuning, retraining, and vanilla gradient ascent. The subject models we investigate are BERT and CodeBERT, for sentiment analysis and code defect detection tasks, respectively. Our findings demonstrate that the combination of gradient ascent and FIM-based regularization, as done in LYA, outperforms existing methods in removing the trojan's influence from the poisoned model, while preserving its original functionality. To the best of our knowledge, this is the first work that compares and contrasts MU of trojans in LLMs, in the NL and Coding domain.
title Unlearning Trojans in Large Language Models: A Comparison Between Natural Language and Source Code
topic Software Engineering
Machine Learning
url https://arxiv.org/abs/2408.12416