5100: Parameter-Efficient Fine-Tuning - Prerequisites¶
For: 5101-LoRA-Logic.md
What You Should Know Before Starting¶
Essential Concepts¶
1. Neural Network Training
- Forward pass: input → output
- Backward pass: gradients
- Weight updates via gradient descent
2. Model Parameters
- Weights and biases
- Millions/Billions of parameters
- Full fine-tuning updates all parameters
3. Computational Constraints
- GPU memory limitations
- Training time and cost
- Storage for model checkpoints
Quick Refresher¶
The Problem LoRA Solves¶
Full Fine-Tuning:
Model: 7B parameters
Update: All 7B parameters
Memory: ~28 GB (FP32) + gradients
Time: Hours to days
Storage: Full model checkpoint
LoRA Fine-Tuning:
Model: 7B parameters (frozen)
Update: ~4M parameters (LoRA adapters)
Memory: ~16 GB (much less!)
Time: Minutes to hours
Storage: Only adapter weights
Key Intuition¶
Think of LoRA like this:
Base model = General knowledge (frozen)
LoRA adapter = Specific task (trainable)
Example:
Base model: Knows about cars
LoRA adapter: Learns about YOUR specific car data
Result: Best of both worlds!
Learning Resources¶
If you're new to these concepts:
-
Neural Network Training (45 min):
- Neural Networks: Zero to Hero
- Understand backpropagation
-
Fine-Tuning Concepts (30 min):
- Fine-Tuning Explained
- Understand why we fine-tune
-
GPU Memory (20 min):
- Read 4101-GGUF-Physics.md
- Understand memory constraints
What You'll Learn¶
After completing 5101-LoRA-Logic.md, you'll understand:
- ✅ LoRA (Low-Rank Adaptation) mathematics
- ✅ Why LoRA works (low-rank approximation)
- ✅ Implementing LoRA in code
- ✅ Hyperparameter tuning (rank, alpha)
- ✅ Comparing LoRA vs full fine-tuning
Readiness Check¶
Answer these questions:
- What is gradient descent?
- Why does fine-tuning need lots of GPU memory?
- What does "low-rank" mean in matrices?
If unsure: Review the quick refresher above.
Ready to start? → 5101-LoRA-Logic.md
Estimated Time to Complete: 2-3 hours
Difficulty: ⭐⭐⭐ Advanced