-
Notifications
You must be signed in to change notification settings - Fork 0
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
9 forgetting pipeline #18
base: develop
Are you sure you want to change the base?
Conversation
7b122f7
to
2e186da
Compare
b8740ff
to
392151e
Compare
TOFU says it didn't work well
Steals a lot from fine-tuning branch - some placeholder forget configs and config classes - adds a data collator compatible with QAForgetDataset - adapts trainer loading etc. to have option of loading a forgetter instead BUG - Evaluation does not work, likely also needs adapting for expected data input format.
a877f2c
to
ad3522c
Compare
raise NotImplementedError( | ||
"A Forgetter child class implementing compute_loss should be used" | ||
) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just some general comments on the evaluate method here. Does it need to take the dataset as an argument? In the evaluate_model
function in the evaluation branch it takes the config which defines our datasets.
It also takes:
model: torch.nn.Module,
base_truth_ratios_path: str,
tokenizer: transformers.AutoTokenizer,
experiment_config: dict,
random_seed: int,
**generate_kwargs: dict,
So the only requirement beforehand is that the baseline retain model has run the script calculating its truth ratios (all_eval.py
). Then we can point to that directory in the config? I had a look at the configs, can we define a retain_model_path
when running forget experiments? Everything else should be defined in the script running the experiment.
Otherwise, I can adjust the evaluate_model
code, such that it takes as an optional argument eval_dataset
. This can be the output of load_dataset, which contains both splits of the data. Then the evaluate_model
function will be able to parse these using the dictionary keys 'retain'
and 'forget'
.
so they save to yaml nicely
Adds a
Forgetter
class for Gradient Ascent, Gradient Difference, KL, and "I don't know forgetters", which all inherit from the HuggingFaceTrainer
, only modifyingcompute_loss
.Now updated to run with new top level config structure etc. I have successfully run jobs on Baskerville from this branch, but I have not fully verified the outputs are expected. There are runs on
wandb
under thetofu-test
groups, e.g. https://wandb.ai/turing-arc/selective-forgetting/runs/dg1r098f/overviewTODO as part of #25 or in another PR:
eval_dataset
/ any kind of evaluation during training as theevaluate
function in the trainer class doesn't know what to when given 2 data inputs (forget / retain). Theevaluate
function inarcsf.forget.base
need to be implemented to use Jack D's evaluation code (and the trainer should be initialised witheval_dataset
set to whatever our appropriate eval dataset instance is).