I Learn Better If You Speak My Language: Understanding the Superior Performance of Fine-Tuning Large Language Models with LLM-Generated Responses
This project includes training scripts, evaluation tools, and datasets for the paper I Learn Better If You Speak My Language: Understanding the Superior Performance of Fine-Tuning Large Language Models with LLM-Generated Responses. It builds upon the LLAMA-FACTORY project to train and test language models effectively.
- Training Scripts: Customizable training scripts leveraging LLAMA-FACTORY.
- Evaluation Tools: Unified prediction functions for seamless evaluation.
- Datasets Included: All necessary datasets are provided within the project.
- Perplexity Calculation: (Coming soon) Scripts for perplexity calculations will be added.
-
Prerequisites
- Python 3.10
-
Set Up LLAMA-FACTORY Directory
Modify the
LLAMA_FACTORY_DIRECTORY_new
variable in your scripts to point to your LLAMA-FACTORY directory:LLAMA_FACTORY_DIRECTORY_new = '/path/to/your/LLAMA-FACTORY'
-
Install Dependencies
Install the required Python packages:
pip install -r requirements.txt
To train the model:
-
Modify the Training Script
In
utils/train.py
, locate thetrain_llama_factory
function and update the model path:
To evaluate the trained model:
-
Modify the Evaluation Script
In
evaluation/eval.py
, find thedo_predict_llama_factory_unify
function and set your model path:
All datasets required for training and evaluation are available in the datasets/
directory.
Note: The perplexity calculation scripts will be added soon.
For the best experience:
-
Create Custom Training Scripts
- Start by creating your own training scripts based on the provided templates.
- Customize them according to your project's needs.
-
Train Your Model
- Use the modified training scripts to train your model.
- Ensure all paths and configurations point to your directories and models.
-
Evaluate the Model
- After training, use the evaluation scripts to assess your model's performance.
- Merge or adapt the evaluation scripts into your project as needed.
- LLAMA-FACTORY: This project builds upon the excellent work done in the LLAMA-FACTORY project.