Frozen vs Unfrozen Weights: What Adapters Actually Are in LoRA and QLoRA
Summary
The article clarifies the distinction between "frozen" and "unfrozen" weights in neural networks, particularly within LoRA and QLoRA fine-tuning methods. Frozen weights remain constant during training, while unfrozen weights are updated by the optimizer. In full fine-tuning, all parameters, such as the 32 billion in a 32B LLM, are unfrozen, leading to high memory costs due to optimizer state tracking. LoRA, or Low-Rank Adaptation, addresses this by freezing the entire original base model and injecting small, new "adapter" matrices, typically into attention projections. Only these new adapter weights are unfrozen and trainable, significantly reducing memory and preventing catastrophic forgetting. QLoRA extends LoRA by storing the frozen base model in 4-bit precision instead of 16-bit, further optimizing memory without altering the frozen/unfrozen mechanism. This distinction directly impacts memory cost, model behavior drift, and portability.
Key takeaway
For Machine Learning Engineers optimizing LLM fine-tuning, understanding the frozen vs. unfrozen weight distinction is crucial. If you are struggling with VRAM limitations or catastrophic forgetting, you should prioritize LoRA or QLoRA. These methods allow you to train small, portable adapter files while preserving the base model's core capabilities and significantly reducing memory footprint compared to full fine-tuning.
Key insights
Frozen weights are static during training; unfrozen weights are updated, defining fine-tuning approaches like LoRA and QLoRA.
Principles
- Frozen weights protect original model capabilities.
- Optimizer state drives memory cost for unfrozen weights.
- Low-rank adaptation approximates full weight updates efficiently.
Method
LoRA injects small, new adapter matrices alongside frozen base model layers, training only these adapters. QLoRA adds 4-bit quantization to the frozen base.
In practice
- Use LoRA/QLoRA to reduce VRAM for fine-tuning.
- Employ adapters for smaller, portable model updates.
- Prevent catastrophic forgetting with frozen base models.
Topics
- LoRA
- QLoRA
- Fine-tuning
- Neural Network Weights
- Parameter Efficient Fine-tuning
- Large Language Models
Best for: Machine Learning Engineer, NLP Engineer, AI Student
Related on AIssential
See Counsel's argued verdicts on the open AI decisions leaders are weighing →
Editorial summary, takeaway, and curation by AIssential. Original article published by AI on Medium.