If you've been following the world of Large Language Models (LLMs), one term you have likely come across is fine-tuning. But what actually happens under the hood? What does it do to the LLM?
In this article, you'll first start by understanding what an LLM actually outputs. Then you'll learn how fine-tuning works. The method you'll focus on here is LoRA (Low-Rank Adaptation) which is one of the most popular approaches to fine-tuning.
Throughout the article, you'll follow one small example to understand how everything works. You don't need to have any prior machine learning or math background to follow along.
Table of Contents
How an LLM Picks the Next Token
What Is Fine-Tuning?
How LoRA Works Low-Rank Factorization
How LoRA Uses This Idea
How to Fine-Tune intern-llm with LoRA How to Prepare the Dataset
The Fine-Tuning Loop
The Adapter and Scaling
Conclusion
Take-Home Exercise
How an LLM Picks the Next Token
First, what's at the core of an LLM's behavior?…