Skip to main content
>_ supraj.dev
TOPIC AI
LoRA & QLoRA fine-tuning models on consumer hardware
IN 10 SECONDS

Low-Rank Adaptation. Freezes the base model weights and injects small, trainable adapters (rank decomposition matrices) into attention layers, reducing training memory by 90%+.

GOTCHA Merging multiple adapters at inference can lead to model confusion or performance degradation if training data conflicts.
HOW ADAPTER TRAINING FLOWS
01 Base model freeze locks all pre-trained weights to prevent costly changes.
02 Adapter injection inserts small parallel layers (LoRA weight matrices) into neural layers.
03 Forward / Backward routes inputs through both; updates only the small adapter weights.
04 Weight merging adds adapter parameters back into base model for fast zero-overhead serving.
POKE IT YOURSELF
peft-convert --base llama-3 --adapter ./lora — merge adapter weights