Fine Tuning LlaMA2 - SoojungHong/Riding_LLaMA-and-Fine-Tuning GitHub Wiki
reference
https://www.datacamp.com/tutorial/fine-tuning-llama-2
Fine Tuning LLM
Fine-tuning in machine learning is the process of adjusting the weights and parameters of a pre-trained model on new data to improve its performance on a specific task. It involves training the model on a new dataset that is specific to the task at hand while updating the model's weights to adapt to the new data.
Parameter-efficient fine-tuning techniques
The Colab T4 GPU has a limited 16 GB of VRAM. That is barely enough to store Llama 2–7b's weights, which means full fine-tuning is not possible, and we need to use parameter-efficient fine-tuning techniques like LoRA or QLoRA.
We will use the QLoRA technique to fine-tune the model in 4-bit precision and optimize VRAM usage. For that, we will use the Hugging Face ecosystem of LLM libraries: transformers, accelerate, peft, trl, and bitsandbytes.