This is the code base for the paper CoBo: Collaborative Learning via Bilevel optimization
Install dependencies:
pip install -r requirements.txt
If you want to generate datasets before running fine-tuning:
python ./src/gen_dataset.py <dataset_name>
The code consists two parts:
- Personalized vision models
- Personalized collaborative learning which is based on the code base for Personalized Collaborative Fine-tuning
Here's the base command for running an experiment for collaborative training of language models on Wiki40b:
python ./personalized-collaborative-llms/src/main.py --trust cobo --trust_freq 1 \
--pretraining_rounds 0 --iterations 500 --num_clients 4 --eval_freq 5 \
--dataset wiki40b --config_format lora --use_pretrained gpt2 --lora_mlp \
--lora_causal_self_attention --lora_freeze_all_non_lora --no_compile
And this is the base command for running an experiment for collaborative training of modles on Cifar100:
python ./personalized-vision-models/run.py --bs_train 128 --bs_test 500 --workers 2 2 2 2 \
--gpus 1 --rho 0.05 --lr 0.1 --train_method cobo --iterations 40000 --run_name <run-name>