Module 2 · Supervised and preference fine-tuning · Lesson 3
SFT with LoRA on a free GPU
Fine-tune a small open-weight model for one agent step with QLoRA on a free GPU, budget its memory and time before launch, run and monitor it from Claude Code, read the curves, and pick a checkpoint without fooling yourself.
By the end of this lesson you can
- Estimate the VRAM and wall time of a QLoRA run from the model's shape, LoRA rank, batch size and token count, and decide whether it fits a free GPU session
- Configure QLoRA for a small model (adapters on every linear layer, rank, alpha, a learning rate about ten times full fine-tuning, assistant-only loss) and justify each setting
- Launch, monitor and retrieve a remote training run from Claude Code with the Kaggle CLI or Hugging Face Jobs, and recover when a run stalls or the quota runs out
- Read training loss, dev loss and token accuracy, and select a checkpoint from dev agent runs with paired statistics while allowing for best-of-k selection noise
- Choose between TRL, Unsloth and Axolotl, and recognise libraries that are unmaintained or pinned behind the current release