2/31
Part 1 of 6 · What LoRA trainsLearn and do
Full fine-tuning trains every weight, and keeps a copy per task
Fine-tuning the usual way updates every weight of a pretrained model. It works, and it gets expensive fast.
- Training keeps a gradient and optimizer state for every weight.
- Every task you fine-tune for leaves you another full copy of the model.
The LoRA paper's example is GPT-3 175B. A separate fine-tuned copy of all 175B parameters for each task is, in its words, prohibitively expensive. Here is what 100 tasks cost to store:
100 full copies
35 TB
one base and 100 adapters
354 GB
The paper's own numbers: 35 TB as full copies, 354 GB as one shared base plus 100 small adapters, about 100 times less.
In the editor, copy_gb is one fine-tuned copy of GPT-3 175B, and adapter_mb is one LoRA adapter. Set full_tb: 100 full copies, in terabytes. Set lora_tb: one shared base plus 100 adapters, in terabytes.