A and B are small (low-rank) trainable matrices. Because A and B are orders of magnitude smaller than W, storage and compute for training are drastically reduced. Other practical advantages include much smaller adapter checkpoints (easier to store and share) and the capability to maintain multiple task-specific adapters without duplicating the entire model.
Comparison: LoRA vs Full Fine-Tuning
Important caveats:
- LoRA does not inherently speed up inference. Inference latency remains the same unless adapters are merged into the base weights or specialized runtime optimizations are applied.
- LoRA does not automatically improve instruction-following capability beyond what the fine-tuning objective provides. It merely enables efficient training of the adapter parameters that learn task-specific behavior.
- Merging adapters into the base model can yield a single fast inference model, but doing so creates a new full-weight checkpoint.
LoRA excels when you need to fine-tune large models on limited GPU resources: train and store only the small adapter matrices instead of the entire model.
- Hu et al., “LoRA: Low-Rank Adaptation of Large Language Models” — https://arxiv.org/abs/2106.09685
- Practical guides and implementations: Hugging Face LoRA examples and adapters documentation.