QLoRA is all you need (Fast and lightweight model fine-tuning)
From sentdex · · 23 min

The player loads from YouTube only when you click. It uses YouTube's privacy-enhanced mode.
If the video does not play, the owner may have turned off embedding. Watch it on YouTube instead.
Description
Learning and sharing my process with QLoRA (quantized low rank adapters) fine-tuning. In this case, I use a custom-made reddit dataset, but you can use anything you want.
I referenced a LOT of stuff in this video, I will do my best to link everything, but let me know if I forget anything.
Resources: WSB-GPT-7B Model: https://huggingface.co/Sentdex/WSB-GPT-7B WSB-GPT-13B Model: https://huggingface.co/Sentdex/WSB-GPT-13B WSB Training data: https://huggingface.co/datasets/Sentdex/wsb_reddit_v002
Code: QLoRA Repo: https://github.com/artidoro/qlora qlora.py: https://github.com/artidoro/qlora/blob/main/qlora.py Simple qlora training notebook: https://colab.research.google.com/drive/1VoYNfYDKcKRQRor98Zbf2-9VQTtGJ24k?usp=sharing qlora merging/dequantizing code: https://gist.github.com/ChrisHayduk/1a53463331f52dca205e55982baf9930
Referenced Research Papers: Intrinsic Dimensionality Explains the Effectiveness of Language Model Fine-Tuning: https://arxiv.org/abs/2012.13255 LoRA: Low-Rank Adaptation of Large Language Models: https://arxiv.org/abs/2106.09685 QLoRA: Efficient Finetuning of Quantized LLMs: https://arxiv.org/abs/2305.14314
Yannic's GPT-4chan model: https://huggingface.co/ykilcher/gpt-4chan Condemnation letter: https://docs.google.com/forms/d/e/1FAIpQLSdh3Pgh0sGrYtRihBu-GPN7FSQoODBLvF7dVAFLZk2iuMgoLw/viewform https://www.youtube.com/watch?v=efPrtcLdcdM
Contents:
0:00 - Why QLoRA? 0:55 - LoRA/QLoRA Research 4:13 - Fine-tuning dataset 11:10 - QLoRA Training Process 15:02 - QLoRA Adapters 17:10 - Merging, Dequantizing, and Sharing 19:34 - WSB QLoRA fine-tuned model examples
Neural Networks from Scratch book: https://nnfs.io Channel membership: https://www.youtube.com/channel/UCfzlCWGWYyIQ0aLC5w48gBQ/join Discord: https://discord.gg/sentdex Reddit: https://www.reddit.com/r/sentdex/ Support the content: https://pythonprogramming.net/support-donate/ Twitter: https://twitter.com/sentdex Instagram: https://instagram.com/sentdex Facebook: https://www.facebook.com/pythonprogramming.net/ Twitch: https://www.twitch.tv/sentdex