Bhavinrathava/UnRLearning

Python

0

4 commits

updated Aug 8, 2025

See the code

README

Machine Unlearning Research Project

The main aim of this project is to explore the possiblity in the realm of machine unlearning through various techniques. For the scope of the project, we will focusing on finding the effectiveness of various techniques to make an LLM essentially forget a subset of dataset.

Why is Machine Unlearning important ?

Having the ability to make the Model "forget" a subset of dataset it was originally trained on has several benefits and real life use cases.

  • Copy Right Claim remediation : Imagine a situation where the original training data of the LLM consisted of a part of the dataset whose use as training material was disputed by the original creater of the data. In this case, the model can either be completely retrained on a dataset that strictly excludes the contested subset of data (less than 1% of actual training data). But this can turn costly as training the model is an expensive operation.

  • Guardrail model outputs derived from specific datapoints : Imagine the model training dataset has certain datapoints that are, for varying reasons best left out of the model training simply on the account of the information it adds to the model's language understanding. Examples could be Propaganda material, Hate Speech and any other type of objectionable content.

How do we approach the Machine Unlearning problem ?

There are certain key avenue which we can explore the Machine Unlearning problem and look for potential ways of making the model "forget" datasets.

  • Output Filtering : This is the most basic form of censorship for trained models, where instead of interfering with the existing training of the model, we try and fix the issue at the inference stage. This involves putting guardrails and logic traps at inference to omit / rephrase certain tokens in output to limit the model's response from using certain tokens / reference to parts of dataset.

  • Simple Finetuning : We can attempt to finetune the model on intentially distored dataset to make the model spit out garbage when questions / prompts are related to the exclusion dataset.

  • RL Finetuning : A more comprehesive approach to the simple finetuning where instead of sabotaging the model outputs, we teach the model to think about its responses and make it actively give vague (non-exclusion dataset related) responses that do not refer to the exclusion dataset directly.

How do we measure the model performance within various approaches ?

  • We will be using a N gram matching metric which measure the overlap between current model response and the response of a regular baseline model. The closer these responses are, the worse the score for the model in question.

Bhavinrathava/UnRLearning

Python

0

4 commits

updated Aug 8, 2025

See the code

README

Machine Unlearning Research Project

The main aim of this project is to explore the possiblity in the realm of machine unlearning through various techniques. For the scope of the project, we will focusing on finding the effectiveness of various techniques to make an LLM essentially forget a subset of dataset.

Why is Machine Unlearning important ?

Having the ability to make the Model "forget" a subset of dataset it was originally trained on has several benefits and real life use cases.

  • Copy Right Claim remediation : Imagine a situation where the original training data of the LLM consisted of a part of the dataset whose use as training material was disputed by the original creater of the data. In this case, the model can either be completely retrained on a dataset that strictly excludes the contested subset of data (less than 1% of actual training data). But this can turn costly as training the model is an expensive operation.

  • Guardrail model outputs derived from specific datapoints : Imagine the model training dataset has certain datapoints that are, for varying reasons best left out of the model training simply on the account of the information it adds to the model's language understanding. Examples could be Propaganda material, Hate Speech and any other type of objectionable content.

How do we approach the Machine Unlearning problem ?

There are certain key avenue which we can explore the Machine Unlearning problem and look for potential ways of making the model "forget" datasets.

  • Output Filtering : This is the most basic form of censorship for trained models, where instead of interfering with the existing training of the model, we try and fix the issue at the inference stage. This involves putting guardrails and logic traps at inference to omit / rephrase certain tokens in output to limit the model's response from using certain tokens / reference to parts of dataset.

  • Simple Finetuning : We can attempt to finetune the model on intentially distored dataset to make the model spit out garbage when questions / prompts are related to the exclusion dataset.

  • RL Finetuning : A more comprehesive approach to the simple finetuning where instead of sabotaging the model outputs, we teach the model to think about its responses and make it actively give vague (non-exclusion dataset related) responses that do not refer to the exclusion dataset directly.

How do we measure the model performance within various approaches ?

  • We will be using a N gram matching metric which measure the overlap between current model response and the response of a regular baseline model. The closer these responses are, the worse the score for the model in question.