tensorfolk

LoRA, QLoRA and PEFT

Parameter-efficient fine-tuning trains small adapter matrices instead of all weights, cutting memory and cost dramatically.

Stable: this rarely changes. Reviewed 17 Oct 2026.

Key ideas

In code

python
from peft import LoraConfig
cfg = LoraConfig(r=16, lora_alpha=32, lora_dropout=0.05,
                 target_modules=['q_proj','k_proj','v_proj','o_proj'],
                 task_type='CAUSAL_LM')

Common mistakes

Go deeper