Frozen vs Unfrozen Weights: What Adapters Actually Are in LoRA and QLoRA

· Source: AI on Medium · Field: Technology & Digital — Artificial Intelligence & Machine Learning · Depth: Intermediate, medium

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

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

Topics

Best for: Machine Learning Engineer, NLP Engineer, AI Student

Related on AIssential

Open in AIssential →

Editorial summary, takeaway, and curation by AIssential. Original article published by AI on Medium.