LoRA Mathematics › Summary

Michael BrenndoerferDecember 1, 20252 min read
Language AI HandbookAll chapters
Part 35 of 67Parameter-Efficient Fine-tuning
Chapter 256LoRA Mathematics › Summary
Reading section 11 of 12 · Summary · 2 minSection 11 of 12 · 2 min

Book contents

Section 11 of 12 · 2 min read

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: W=W0+αrBAW = W_0 + \frac{\alpha}{r}BA expresses weight updates as a product of two smaller matrices, constraining updates to rank at most rr. The factorized form enables efficient computation by working through the bottleneck z=Axz = Ax 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-rr 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 rr controls the expressiveness-efficiency trade-off. Ranges of rr 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 rr, suggesting the optimizer naturally discovers minimum-rank solutions.

  • Initialization: BB starts at zero while AA 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: AA and BB co-evolve during training through coupled gradient formulas. AA receives zero gradients initially but learns as BB moves away from zero. The total gradient computation costs O(r(d+k))O(r(d+k)) operations, matching the parameter count and achieving optimal efficiency.

  • Weight merging: Trained LoRA adapters can be exactly merged into the base weights (Wmerged=W0+αrBAW_{\text{merged}} = W_0 + \frac{\alpha}{r}BA), 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.