Book a call: https://calendly.com/shawhintalebi
This is the 5th video in a series on using large language models (LLMs) in practice. Here, I discuss how to finetune an existing LLM for a particular use case and walk through a concrete example with Python code.
Series Playlist: • Large Language Models (LLMs)
Read more: https://towardsdatascience.com/finet...
Example code: https://github.com/ShawhinT/YouTubeB...
Final Model: https://huggingface.co/shawhin/distil...
Dataset: https://huggingface.co/datasets/shawh...
More Resources
[1] Deeplearning.ai Finetuning Large Langauge Models Short Course: https://www.deeplearning.ai/shortcou...
[2] arXiv:2005.14165 [cs.CL] (GPT3 Paper)
[3] arXiv:2303.18223 [cs.CL] (Survey of LLMs)
[4] arXiv:2203.02155 [cs.CL] (InstructGPT paper)
[5] PEFT: ParameterEfficient FineTuning of BillionScale Models on LowResource Hardware: https://huggingface.co/blog/peft
[6] arXiv:2106.09685 [cs.CL] (LoRA paper)
[7] Original dataset source — Andrew L. Maas, Raymond E. Daly, Peter T. Pham, Dan Huang, Andrew Y. Ng, and Christopher Potts. 2011. Learning Word Vectors for Sentiment Analysis. In Proceedings of the 49th Annual Meeting of the Association for Computational Linguistics: Human Language Technologies, pages 142–150, Portland, Oregon, USA. Association for Computational Linguistics.
Homepage: https://shawhintalebi.com/
Socials
/ shawhin
/ shawhintalebi
/ shawhint
/ shawhintalebi
The Data Entrepreneurs
YouTube: / @thedataentrepreneurs
Discord: / discord
Medium: / thedata
Events: https://lu.ma/tde
Newsletter: https://thedataentrepreneurs.ck.pag...
Support ❤
https://www.buymeacoffee.com/shawhint
Intro 0:00
What is Finetuning? 0:32
Why Finetune 3:29
3 Ways to Finetune 4:25
Supervised Finetuning in 5 Steps 9:04
3 Options for Parameter Tuning 10:00
LowRank Adaptation (LoRA) 11:37
Example code: Finetuning an LLM with LoRA 15:40
Load Base Model 16:02
Data Prep 17:44
Model Evaluation 21:49
Finetuning with LoRA 24:10
Finetuned Model 26:50