LoRA Mathematics › Summary
Language AI HandbookAll chapters LoRA Mathematics › SummaryOne section · Sections in this chapter11 / 12 ↓
Reading tools Definitions & inline links
Choose your expertise level to adjust how many terms are explained. Beginners see more tooltips, experts see fewer to maintain reading flow. Hover over underlined terms for instant definitions.
Article links
Make inline references clickable
This chapter covered the mathematical foundations of LoRA in depth, connecting abstract formulas to concrete computation and intuition:
-
Core formulation: expresses weight updates as a product of two smaller matrices, constraining updates to rank at most . The factorized form enables efficient computation by working through the bottleneck rather than materializing the full update matrix.
-
Low-rank approximation: SVD theory through the Eckart-Young-Mirsky theorem guarantees that truncated SVD gives the best rank- approximation in Frobenius norm. Empirical studies of fine-tuning updates show rapid singular value decay, confirming that the low-rank hypothesis captures real structure in how models adapt.
-
Intrinsic dimensionality: Despite millions of parameters, fine-tuning solutions live in surprisingly small subspaces. Pre-training captures general representations, and fine-tuning makes targeted adjustments that are naturally low-rank. This explains why LoRA works empirically even though it is not guaranteed by theory alone.
-
Rank selection: The rank controls the expressiveness-efficiency trade-off. Ranges of from 4 to 64 achieve over 100x compression while maintaining adaptation quality for typical NLP tasks. The effective rank of trained adapters is often lower than the specified , suggesting the optimizer naturally discovers minimum-rank solutions.
-
Initialization: starts at zero while is randomly initialized. This ensures training begins from pre-trained behavior with zero disruption. The asymmetric initialization also avoids rank-dependent perturbation magnitudes that would complicate hyperparameter transfer across different rank choices.
-
Gradient flow: and co-evolve during training through coupled gradient formulas. receives zero gradients initially but learns as moves away from zero. The total gradient computation costs operations, matching the parameter count and achieving optimal efficiency.
-
Weight merging: Trained LoRA adapters can be exactly merged into the base weights (), eliminating any inference overhead. This makes LoRA-trained models identical in speed to the original model after deployment.
The next chapter covers practical implementation patterns for applying LoRA to transformer architectures and integrating it with existing training pipelines, including the PEFT library and common training frameworks.