LoRA and Full Fine-Tuning
In this article
- Compute how many values a LoRA adapter trains for one weight matrix, and what share of the matrix that is.
- Compare the storage of full fine-tuning and adapters for several tasks on one base model.
- Predict what merging an adapter does to a setup that serves several tasks.
- Read a held-out table and decide whether to raise the rank, widen the target modules or move to full fine-tuning.
- Terms defined here: full fine-tuning, parameter-efficient fine-tuning, LoRA, adapter.
Overview
You have chosen what the model should learn and you have clean training data. One question of model adaptation is left before the first training run: how many of the model's numbers are you going to change? You can change all of them, or you can freeze the model and train a small add-on next to it. The choice decides how much memory training needs, how many gigabytes you store per task, and how you serve the result.
By the end you can compute what a small add-on trains for one weight grid, compare storage for several tasks, predict what merging does to serving, and read a held-out table to decide when the add-on is not enough.
This article is part of Pro
Pro includes the staff-level and expert articles in every path. It opens after the four core paths are complete.
Still to read in this article
- Changing every weight
- Freezing the base: LoRA
- The adapter in code
- Three tasks, two bills
- Serving: merged or separate
- When the adapter is not enough
- Common mistakes
- In production
- Sources
- Check yourself, 13 questions