This file explains how to run the experiments and evaluations
Note: Some of the python commands might need to be prepended by PYTHONPATH=$PYTHONPATH:/path/to/the/repo/for/specificityplus
(since specificityplus is currently not easily installable)
- git clone this repo https://github.com/jas-ho/specificityplus
- Setup conda enviroment: conda env create -f scripts/environment.yml
- conda activate memit
- set ROOT_DIR by exporting an environment variable: export ROOT_DIR="/disk/scratch/s1785649/specificityplus/" or similar
- python setup_data/download_data.py
- python setup_data/download_hfdata.py
- python setup_data/download_models.py
- set ROOT_DIR by exporting an environment variable: export ROOT_DIR="/disk/scratch/s1785649/specificityplus/" or similar
- python rome/layer_stats.py --model_name gpt2-medium --layers 8 --to_collect mom2 --precision float32 --download 1
- change PATH_TO_REPO variable (to whatever your path is) in experiment-scripts/generate_experiment_file.py
- python experiment-scripts/generate_experiment_file.py
- can edit (to run less parallel) by changing "split_into" variable in experiment-scripts/generate_experiment_file.py, and running the file to generate a new experiment txt
- find lines to run in experiment-scripts/exp_gpt2medium.txt
- Results for gpt2-medium are stored in results/
IF everything works for gpt2-medium, can run gpt2-xl, gpt-J, gpt-neox
- go into setup_data/download_models.py and add the models to the "models" variable
- python setup_data/download_models.py
- python rome/layer_stats.py --model_name gpt2-xl --layers 17 --to_collect mom2 --precision float32 --download 1
- find lines to run in experiment-scripts/exp_gpt2xl.txt (can modify like previously if needed)
- Results for gpt2-xl are stored in results/
- cd git/specificityplus && python rome/layer_stats.py --model_name EleutherAI/gpt-j-6B --layers 5 --to_collect mom2 --precision float32 --download 1
- find lines to run in experiment-scripts/exp_gptJ6B.txt (can modify like previously if needed)
- Results for gpt-J are stored in results/
- cd git/specificityplus && python rome/layer_stats.py --model_name EleutherAI/gpt-neox-20b --layers 15 --to_collect mom2 --precision float32 --download 1
- find lines to run in experiment-scripts/exp_gptneox20b.txt (can modify like previously if needed)
- Results for gpt-NEOX are stored in results/
to be done (eta 30min)