Home Knowledge Base LoRA (Low-Rank Adaptation)

LoRA (Low-Rank Adaptation) is the parameter-efficient fine-tuning technique that adapts large language models to specific tasks by injecting small trainable low-rank matrices into frozen pre-trained weight matrices — training only 0.1-1% of the total parameters while achieving fine-tuning quality comparable to full parameter updates, enabling single-GPU fine-tuning of models that would otherwise require multi-GPU setups for full fine-tuning.

The Core Idea

Instead of updating a large weight matrix W (d × d, millions of parameters), LoRA freezes W and adds a low-rank update: W' = W + BA, where B is d×r and A is r×d, with rank r << d (typically r=8-64). Only B and A are trained — r×d + d×r = 2×d×r trainable parameters vs. d² for full fine-tuning.

Why Low-Rank Works

Research showed that the weight updates during fine-tuning have low intrinsic dimensionality — the meaningful changes live in a low-dimensional subspace. A rank-16 LoRA adaptation of a 4096×4096 weight matrix trains 131K parameters (2×4096×16) instead of 16.7M — a 128× reduction — while capturing the essential task-specific adaptation.

Implementation Details

QLoRA (Quantized LoRA)

Combines LoRA with aggressive quantization: the base model weights are quantized to 4-bit NormalFloat (NF4) format while LoRA adapters remain in FP16/BF16. This enables fine-tuning a 65B parameter model on a single 48GB GPU:

Multi-LoRA Serving

Multiple LoRA adapters (for different tasks or users) can share the same base model in memory. At inference, the appropriate adapter is selected and applied dynamically. S-LoRA and Punica frameworks efficiently serve thousands of LoRA adapters simultaneously, batching requests across different adapters with minimal overhead.

Comparison with Other PEFT Methods

MethodTrainable ParamsInference OverheadQuality
Full Fine-tuning100%NoneBest
LoRA (r=16)0.1-1%None (merged)Near-best
QLoRA0.1-1%Quantization penaltyGood
Prefix Tuning<0.1%Slight (prefix tokens)Good
Adapters1-5%Slight (extra layers)Good

LoRA is the democratization of LLM fine-tuning — the technique that made it possible for researchers and small teams to customize billion-parameter models on consumer hardware, turning fine-tuning from a datacenter-scale operation into a single-GPU afternoon task.

lora low rank adaptationpeft parameter efficientadapter fine tuningqlora quantized lorafine tuning efficient

Explore 500+ Semiconductor & AI Topics

From EUV lithography to CUDA optimization — search the full knowledge base or chat with our AI assistant.