From fe08be14794e438b2bc10d45894655b94e2ede4b Mon Sep 17 00:00:00 2001 From: Frank Liu <62361017+franciscoliu@users.noreply.github.com> Date: Sat, 18 May 2024 07:03:29 +0800 Subject: [PATCH] Update README.md --- README.md | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 5ffee09..eaf2ebe 100644 --- a/README.md +++ b/README.md @@ -1,25 +1,34 @@ -## Selective Knowledge negation Unlearning (SKU) +# Selective Knowledge negation Unlearning (SKU) -### Instructions + +## Environment Setup +Create an environment from the yml file using: + +```bash +conda env create -f llm_unlearn.yml +``` + + +## Instructions We conduct our experiments on OPT2.7b, llama2-7b and llama2-13b model. -### GPU requirements +## GPU requirements Since task vector would require state_dict deduction and addition between two models, we conduct our OPT model experiments on 3 A100 GPUs (80GiB), and llama model experiments on 4 A100 GPUs (80GiB). -### Dataset +## Dataset We use the TruthfulQA dataset (avilable on github, one can simply use ```wget``` command to pull the data) as the normal data. And we use PKU-SafeRLHF (avilable on Huggaingface) as the harmful data. -### Unlearn +## Unlearn We can perform the unlearning by run the following command. Here we show an example of how to unlearn harmfulness learned from the pretrained OPT2.7B. -#### Before Unlearn +### Before Unlearn After downloading the data, create a directory called ```dataloader``` to store the data. Then, create a directory named ```logs``` in harmful_unlearn directory to store the log files. -#### Unlearn process +### Unlearn process ```bash python unlearn_harm_new.py --bad_weight 2.5 --random_weight 2.5 --normal_weight 1 --lr 2e-4 --max_unlearn_steps 1000 --model_name=facebook/opt-2.7b