Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
franciscoliu committed May 17, 2024
1 parent e21d3ae commit fe08be1
Showing 1 changed file with 16 additions and 7 deletions.
23 changes: 16 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down

0 comments on commit fe08be1

Please sign in to comment.