peft (parameter-efficient fine-tuning)
Parameter-Efficient Fine-Tuning (PEFT) adapts large models by training minimal parameters. **Core motivation**: Full fine-tuning of LLMs requires prohibitive GPU memory (70B model needs 280GB+ for optimizer states). PEFT trains 0.01-1% of parameters while achieving 90-99% of full fine-tuning quality. **Major methods**: LoRA (low-rank weight matrices), QLoRA (quantized base + LoRA), prompt tuning (learned soft prompts), prefix tuning (learned activations), adapters (small bottleneck layers), IA3 (learned rescaling). **Benefits**: Train on consumer GPUs, store tiny checkpoints per task, easily switch between tasks, avoids catastrophic forgetting. **When to use each**: LoRA for general fine-tuning, QLoRA when memory constrained, prompt tuning for multi-task with shared base, adapters for efficient ensemble. **Tools**: Hugging Face PEFT library, axolotl, llama-factory. **Trade-offs**: Slightly lower quality than full fine-tuning for some tasks, method selection requires experimentation. PEFT democratized LLM customization, enabling fine-tuning on single GPUs.