Fine-tuning Code Generation models on separate clients holding different datasets, then applying federated learning techniques to learn global fine-tuned model
experiments/
This folder contains all of the Google Colab notebooks within which we conducted our model experiments.
CodeParrot Experiments.ipynb: experiments on CodeParrot models w/ IBM Project CodeNet and StarCoder datasetsCodeGen Experiments.ipynb: experiments on CodeGen model w/ IBM Project CodeNet datasetMDPP Eval Dataset.ipynb: experiments on DeciCoder model w/ MBPP datasetData and Visualizations [for Exp2].ipynb: creating visualizations for usage in report (loss functions, etc)Aggregate and Save.ipynb: for testing with aggregating the modelIBM Data Preview.ipynb: for investigation of IBM datasetmodel_sizes.ipynb: for computing the size of models before/after quantization, and trainable params before/after lora
helpers/
This folder contains the helper functions used across our experiments.
We standardized commonly used code (training loop, filtered generations, etc)
Please reference docstrings of functions themselves for more details.
train.py: main training loop which trains and saves models to local directories.train_alt.py: alternative version of training loopfl_impl.py: our implementation of FedAvg on provided clientsevaluation.py: contains helper functions for generations, humaneval, rouge, etc.
- CodeParrot-Small: https://huggingface.co/codeparrot/codeparrot-small
- CodeParrot: https://huggingface.co/codeparrot/codeparrot
- CodeGen: https://huggingface.co/Salesforce/codegen-2B-mono
- DeciCoder: https://huggingface.co/Deci/DeciCoder-1b
- StarCoder: https://huggingface.co/bigcode/starcoder
- IBM Project CodeNet: https://developer.ibm.com/exchanges/data/all/project-codenet/
- HumanEval: https://github.com/openai/human-eval
- MBPP: https://huggingface.co/datasets/mbpp