Coders In Hoods
  • Courses
  • Roles
  • Blog
  • Setup

Coders In Hoods AI Academy

Every course is free. Sign in to start, and your progress, quiz scores and bookmarks follow you.

AI Academy

  • Courses
  • Paths
  • Setup guides
  • How we teach

Role roadmaps

  • AI Engineer
  • Forward Deployed Engineer
  • Machine Learning Engineer
  • All roles

Coders In Hoods

  • The agency
  • Coaching for teams
  • Blog
  • LinkedIn
  • X (Twitter)

Contact

codersinhoods@gmail.com

© Coders In Hoods · since 2019

Course overview

Fine-Tuning and RL for Agents

Free · sign in to start and track progress

1 · Decide and prepare

  • 1Prompt, optimise or train?
  • 2Training data from traces

2 · Supervised and preference fine-tuning

  • 3SFT with LoRA on a free GPU

    Exercise answers

    • Answer: Fine-tune the triage adapter on a free GPU
    • Answer: A three-run sweep and the noise in picking its winner
  • 4Preference optimisation

3 · Reinforcement learning for agents

  • 5GRPO in practice
  • 6Designing rewards
  • 7Multi-turn RL environments
  • 8Reward hacking, regressions and shipping
CapstoneTrain a triage model, then decide whether to ship itReference implementation

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.

85 min 1 video 3 exercises 8-question quiz Answers
Setup for the exercises:Install Claude CodePython with uvFree GPUs on KaggleHugging Face account and CLI

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

On this page

  • Intuition: margin notes in a small-print handbook
  • What gets trained in a trace
  • QLoRA, briefly, and the settings that matter
  • Budget the run before you launch it
  • Launch, monitor and retrieve from Claude Code
  • When a run stalls or the quota runs out
  • Read the curves
  • Choose a checkpoint without fooling yourself
  • Which library
  • Connections
  • Summary
  • Sources & further reading
  • Quiz

In this lesson

  1. 01Intuition: margin notes in a small-print handbook
  2. 02What gets trained in a trace
  3. 03QLoRA, briefly, and the settings that matter
  4. 04Budget the run before you launch it
  5. 05Launch, monitor and retrieve from Claude Code
  6. 06Read the curves
  7. 07Choose a checkpoint without fooling yourself
  8. 08Which library
  9. 09Connections
  10. 10Summary

Sources & further reading

  • QLoRA: Efficient Finetuning of Quantized LLMsPaper · Dettmers, Pagnoni, Holtzman, Zettlemoyer · 2023NeurIPS 2023. Section 3 defines the three pieces this lesson budgets with, 4-bit NormalFloat, double quantization (0.127 bits per parameter of overhead instead of 0.5) and paged optimizers.
  • LoRA Learns Less and Forgets LessPaper · Biderman, Portes, Gonzalez Ortiz et al. · 2024TMLR. On code and maths, LoRA underperforms full fine-tuning on the target task but keeps more of the base model's other abilities. The honest framing for an adapter that only has to do one step well.
  • LoRA Without RegretLab research · John Schulman and Thinking Machines · Thinking Machines · 2025The best current evidence on LoRA hyperparameters. LoRA matches full fine-tuning on small and medium datasets when it isn't capacity-limited, the best learning rate is consistently about 10x full fine-tuning's, MLP layers matter more than attention, and LoRA tolerates large batches less well. Read the sections on learning rate and layer placement.
  • SFT TrainerDocs · Hugging FaceTRL v1.17.1. Dataset formats including tool calls, assistant_only_loss and the chat templates TRL patches for it, QLoRA through quantization_config and peft_config, and the metrics it logs.
  • Train Models on JobsDocs · Hugging FaceThe paid alternative to a free GPU, and good advice for any remote run - smoke-test with a step cap, estimate the full run from train_steps_per_second, and push outputs before the container's disk is discarded.
  • Unsloth requirementsDocs · UnslothMinimum VRAM by model size for QLoRA and 16-bit LoRA, and the GPUs Unsloth supports (CUDA capability 7.0 and up, which includes the T4). Treat the figures as floors, as the page itself says.
Free · sign in to start

Sign in to keep reading.

Free, no card. We use your account to save progress, quiz scores, bookmarks and occasionally send updates from our team.

  • 10 more sections
  • 3 hands-on exercises
  • A 8-question quiz
  • Progress, quiz scores and bookmarks