-
Couldn't load subscription status.
- Fork 104
Add gru component #83
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
yuuee-www
wants to merge
7
commits into
locuslab:main
Choose a base branch
from
yuuee-www:gru
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 5 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
192abbc
add gru component
yuuee-www d2bb6cd
Cleaned up code: removed unnecessary print statements
yuuee-www d36c45c
Merge branch 'locuslab:main' into gru
yuuee-www 567b503
Refactor GRU trainer for enhanced readability and add 'forget_loss_ty…
yuuee-www d2bfbbc
Merge branch 'locuslab:main' into gru
yuuee-www 85add42
Merge branch 'locuslab:main' into gru
yuuee-www 911e52a
Clean up formatting and update GRU README (results still running)
yuuee-www File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,49 @@ | ||
| # TITLE | ||
|
|
||
| - **Paper Title**: GRU: Mitigating the Trade-off Between Unlearning and Retention for Large Language Models | ||
| - **Authors**: Yue Wang, Qizhou Wang, Feng Liu, Wei Huang, Yali Du, Xiaojiang Du, Bo Han | ||
| - **Links**: [arXiv:2503.09117](https://arxiv.org/abs/2503.09117) | ||
|
|
||
|
|
||
| Provide a concise summary of your method details and its contributions. Please avoid using images to keep the repository size manageable. | ||
|
|
||
| # Setup | ||
|
|
||
| Please include the experimental setup such as | ||
|
|
||
| - [ ] **Hyperparameters & Search Space:** Specify key hyperparameters, their search ranges, number of trials etc. | ||
| - [ ] **Computational Setup:** Mention the type and number of GPUs used. | ||
| - [ ] **DeepSpeed Configuration:** If any modifications were made to the default DeepSpeed config, specify them here. (You may include the config as a code block.) | ||
| - [ ] **Other Details:** Any additional setup details crucial for reproducing your method. | ||
|
|
||
|
|
||
| ## Computational Setup | ||
|
|
||
|
|
||
| - **GPU Details**: NVIDIA A100 80GB | ||
| - **GPU Count**: The code for our method currently supports single GPU execution. We plan to enhance the codebase in the future to support multi-GPU configurations. | ||
|
|
||
|
|
||
| # Results | ||
|
|
||
| To replicate your results, provide a `run.sh` script that contains all necessary commands to reproduce the final results. Ensure the script is well-documented. | ||
molereddy marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| It would be appreciated if you can upload the final unlearned model(s) along with their `evals` folders to HuggingFace and provide the link(s) here. As the evaluations are updated, this would help us re-evaluate your model(s). | ||
|
|
||
| # Citation | ||
|
|
||
|
|
||
| If you use this work, please cite: | ||
|
|
||
| ```bibtex | ||
|
|
||
| @misc{wang2025grumitigatingtradeoffunlearning, | ||
| title={GRU: Mitigating the Trade-off between Unlearning and Retention for Large Language Models}, | ||
| author={Yue Wang and Qizhou Wang and Feng Liu and Wei Huang and Yali Du and Xiaojiang Du and Bo Han}, | ||
| year={2025}, | ||
| eprint={2503.09117}, | ||
| archivePrefix={arXiv}, | ||
| primaryClass={cs.LG}, | ||
| url={https://arxiv.org/abs/2503.09117}, | ||
| } | ||
| ``` | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,45 @@ | ||
| #!/bin/bash | ||
|
|
||
| # GRU with GradAscent | ||
| CUDA_VISIBLE_DEVICES=0 python src/train.py \ | ||
| --config-name=unlearn.yaml \ | ||
| experiment=unlearn/tofu/default \ | ||
| forget_split=forget10 \ | ||
| retain_split=retain90 \ | ||
| trainer=GRU \ | ||
| task_name=gru_ga_forget10 \ | ||
| trainer.method_args.forget_loss_type=GradAscent \ | ||
| trainer.args.gradient_accumulation_steps=16 \ | ||
| trainer.args.per_device_train_batch_size=4 | ||
|
|
||
| # Evaluation for GRU with GradAscent | ||
| CUDA_VISIBLE_DEVICES=0 python src/eval.py \ | ||
| experiment=eval/tofu/default.yaml \ | ||
| forget_split=forget10 \ | ||
| model=Llama-3.2-1B-Instruct \ | ||
| task_name=gru_ga_forget10 \ | ||
| model.model_args.pretrained_model_name_or_path=saves/unlearn/gru_ga_forget10 \ | ||
| paths.output_dir=saves/unlearn/gru_ga_forget10/evals \ | ||
| retain_logs_path=saves/eval/tofu_Llama-3.2-1B-Instruct_retain90/TOFU_EVAL.json | ||
|
|
||
| # GRU with NPO | ||
| CUDA_VISIBLE_DEVICES=0 python src/train.py \ | ||
| --config-name=unlearn.yaml \ | ||
| experiment=unlearn/tofu/default \ | ||
| forget_split=forget10 \ | ||
| retain_split=retain90 \ | ||
| trainer=GRU \ | ||
| task_name=gru_npo_forget10 \ | ||
| trainer.method_args.forget_loss_type=NPO \ | ||
| trainer.args.gradient_accumulation_steps=16 \ | ||
| trainer.args.per_device_train_batch_size=4 | ||
|
|
||
| # Evaluation for GRU with NPO | ||
| CUDA_VISIBLE_DEVICES=0 python src/eval.py \ | ||
| experiment=eval/tofu/default.yaml \ | ||
| forget_split=forget10 \ | ||
| model=Llama-3.2-1B-Instruct \ | ||
| task_name=gru_npo_forget10 \ | ||
| model.model_args.pretrained_model_name_or_path=saves/unlearn/gru_npo_forget10 \ | ||
| paths.output_dir=saves/unlearn/gru_npo_forget10/evals \ | ||
| retain_logs_path=saves/eval/tofu_Llama-3.2-1B-Instruct_retain90/TOFU_EVAL.json |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| defaults: | ||
| - finetune | ||
|
|
||
| handler: GRU | ||
| method_args: | ||
| gamma_gru: 0.8 | ||
| forget_loss_type: GradAscent |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.