Week 3 · Day 19/30

Fine-tuning Fundamentals

LoRA, QLoRA, kedy fine-tunuť vs prompt engineer

📅 2026-03-22 ⏱️ 6-7 hodín 📊 Security & Production
Celkový progres 63%

🎯 Cieľ dňa

Pochopiť kedy a prečo fine-tuniť, ovládnuť LoRA/QLoRA techniky, a spustiť prvý fine-tuning experiment.

theory practice

📚 Study Resources

🤗

Hugging Face — LoRA and PEFT: Efficient Fine-Tuning

Comprehenzívny tutorial: LoRA fundamenty, PEFT knižnica, implementácia.

course
📖

Phil Schmid — Fine-tune LLMs in 2025

Aktuálny script-based guide s rôznymi PEFT metódami a optimization technikami.

guide
💻

Hugging Face — Fine-Tuning Your First LLM

Hands-on: od nuly po fine-tuned model s PyTorch a Hugging Face.

tutorial
📊

MLflow — QLoRA Fine-Tuning Tutorial

QLoRA s MLflow tracking. Notebook tutorial s sql-create-context dataset.

tutorial

💡 Key Concepts

LoRA (Low-Rank Adaptation) — Injektuje trainable low-rank updates do linear layers. ~90% redukcia trainable parametrov.
QLoRA — LoRA + 4-bit quantization. Fine-tune 7B model na consumer GPU (16GB VRAM).
Kedy Fine-tune — Keď prompt engineering nestačí: custom format, domain vocabulary, consistent style, latency requirements.
Kedy NIE Fine-tune — Keď stačí few-shot, keď nemáš quality training data, keď sa model mení často.
Training Data Quality — Garbage in, garbage out. 100 quality examples > 10,000 noisy examples.

🔧 Praktické cvičenie

Spusti prvý LoRA fine-tuning experiment.

  1. Vyber malý model (Qwen 2.5 0.5B alebo 1.5B — máš v Ollama)
  2. Priprav 50-100 kvalitných training examples pre tvoj use case
  3. Setup LoRA config: rank, alpha, target modules
  4. Trénuj s Hugging Face SFTTrainer
  5. Evaluuj: porovnaj base vs fine-tuned na 10 test casov
  6. Exportuj a otestuj cez Ollama