Configuring LoRA and QLoRA in train.yaml

Why LoRA beats full fine-tuning for agent tasks

Full fine-tuning updates billions of weights and requires massive multi-GPU rigs. LoRA freezes the base model and trains tiny rank-decomposed adapter matrices (often < 1% of parameters), cutting VRAM by 4–8x while preserving general intelligence.

Example

# train.yaml — clean LoRA starter config
model: Qwen/Qwen2.5-3B-Instruct
dataset:
  train: data/train.jsonl
  eval: data/val.jsonl
method: lora
lora:
  r: 16
  alpha: 32
  dropout: 0.05
training:
  epochs: 3
  learning_rate: 2e-4
  batch_size: 4
  eval_steps: 50
  save_steps: 100
output_dir: ./checkpoints/support-router

Example explained

  • r: 16 / alpha: 32 — Standard LoRA rank and scaling ratio (alpha = 2 * r) for reliable instruction and JSON tuning.
  • epochs: 3 — Enough passes to learn format without memorizing your small dataset.
  • eval_steps: 50 — Tracks validation loss mid-run so you spot overfitting immediately.

How to read train vs validation loss

If training loss drops while validation loss starts rising, your model is overfitting. Stop early using the best checkpoint, lower epochs from 3 to 2, or add more diverse training rows.

Example

# Inspect resolved defaults before launching GPU compute
praisonai train --config train.yaml --dry-run

Example explained

  • –dry-run — Prints the resolved model, dataset paths, and hyperparameters without starting training.

Common pitfall: setting learning_rate too high

A learning rate like 1e-2 destroys pre-trained weights and produces gibberish. Keep LoRA learning rates in the 5e-5 to 2e-4 range.

Reference: documentation