Fine-Tuning and RL for Agents
Train a small open model for one agent step with supervised fine-tuning, preference optimisation and reinforcement learning, and prove with your eval suite whether it beats an optimised prompt.
3 modules · 8 lessons~38 hoursUpdated 2026-11-01Certificate included
- Lessons8
- Quizzes8
- Sources54
- Of study~38h
About this course
About this course
Once prompts and optimisers stop paying, the next lever is the model itself. This course is the practical side of post-training for engineers: deciding whether an agent step should be trained at all, turning traces and eval failures into training data without leaking your test set, QLoRA fine-tuning and preference optimisation of a small open-weight model on a free GPU, and reinforcement learning with verifiable and rubric rewards in a multi-turn tool environment. It ends where it should: catching reward hacking and regressions, and comparing the trained model with the optimised prompt on cost and quality before a ship or no-ship call. Claude Code writes, launches and monitors the training code on your subscription, while training runs on free Kaggle or Colab GPUs.
About the running example
The examples follow Quillmoor, a fictional company that sells project-management software, and the triage step of its support agent. For each incoming ticket the step looks up the account and searches the help centre through stub tools, then returns a category, a priority, the account id, whether a human must take over, a short reason and a reply outline. Most fields can be checked by code, and the free-text ones need a rubric judge. Every ticket is synthetic, and training data comes from open-weight models whose terms allow it, never from Claude's outputs.
What you'll learn.
- 1Decide, with a written cost and quality case, whether an agent step should be prompted, prompt-optimised or trained, and name what fine-tuning can't fix
- 2Build supervised, preference and RL datasets from agent traces and eval failures without leaking the frozen test split or training on outputs a provider's terms forbid
- 3Fine-tune a small open-weight model with QLoRA and with DPO or KTO on a free GPU, launched and monitored from Claude Code, and read its training curves
- 4Turn graders and a calibrated judge into verifiable and rubric rewards, train with GRPO-family RL in a multi-turn tool environment, and diagnose stalled groups, length bias and instability
- 5Detect reward hacking and capability or safety regressions with held-out graders and trace review
- 6Compare the trained model with the optimised-prompt baseline on cost per completed task and paired quality with negative flips, and make a ship or no-ship call
3 modules, 8 lessons.
10h 55m of lessons
Module 1 · 2 lessons · 2h 35m
Decide and prepare
Whether training is the right lever, what it costs, and how to turn traces and eval failures into training data without fooling yourself.
- 1Prompt, optimise or train?When changing a model's weights beats prompts and optimisers and when it doesn't, what fine-tuning one agent step really costs, where you can still train in late 2026, and whose outputs provider terms let you train on.1h 15m8-question quiz7 sources
- 2Training data from tracesTurning agent trajectories, grader verdicts and eval failures into a supervised fine-tuning set, with chat templates and loss masks, rejection sampling and corrected failures, open-weight teachers whose terms allow it, balance by failure mode, and a leakage audit against the frozen test split.1h 20m8-question quiz7 sources
Module 2 · 2 lessons · 2h 45m
Supervised and preference fine-tuning
Get a small open model to do the step at all with supervised fine-tuning, then shape its judgement with preference data.
- 3SFT with LoRA on a free GPUFine-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.1h 25m8-question quiz6 sources
- 4Preference optimisationWhen you have comparisons or thumbs rather than gold outputs, train on them with DPO, KTO, ORPO or SimPO, build the pairs from your own model's samples ranked by a calibrated open-weight judge, and catch the model when it learns to please the judge instead of the user.1h 20m7-question quiz6 sources
Module 3 · 4 lessons · 5h 35m
Reinforcement learning for agents
Graders become rewards, tool stubs become an environment, and the eval suite decides whether RL helped or just learned to cheat.
- 5GRPO in practiceRun reinforcement learning with verifiable rewards on a small open model, from configuring TRL's GRPO trainer and its loss variants to keeping groups informative, reading the training curves and telling sharpening from new capability.1h 25m8-question quiz7 sources
- 6Designing rewardsTurn code graders and a calibrated judge into a reward a policy can't cheaply satisfy, with weights priced from what each error costs, rubric and relative-ranking judges, and tests of the reward itself before any GPU time is spent.1h 20m7-question quiz7 sources
- 7Multi-turn RL environmentsHow to turn an agent's tools into a reinforcement learning environment: what the trainer runs per rollout, which tokens the policy is trained on, how one final reward is shared across several tool-calling turns, what a run costs, and how to choose a framework or hosted trainer.1h 20m7-question quiz7 sources
- 8Reward hacking, regressions and shippingCatch a policy that games its training reward, find out what else training changed, compare the trained model with a frontier-model baseline on paired outcomes and cost per completed case, and serve adapters you can version and roll back.1h 30m8-question quiz7 sources
Train a triage model, then decide whether to ship it
Take one agent step from an optimised-prompt baseline to a trained small open model and back to a decision. Measure the baseline and fix the bar, build leak-free training data from an open-weight teacher, fine-tune with QLoRA, train with GRPO in a multi-turn tool environment against a priced reward, hunt the hack you plant, and compare paired, with pass^k, intervals, negative flips and cost per completed case, before writing a ship or no-ship memo.
Finish it. Get certified.
Complete every lesson of Fine-Tuning and RL for Agents and you get a certificate with your name on it. Free, like the course.
- A public page with a certificate ID anyone can check
- Download it as a PDF
- Add it to LinkedIn in one click
Fine-Tuning and RL for Agents, answered.
Is Fine-Tuning and RL for Agents free?
Yes, for everyone: all 8 lessons, 8 quizzes, the capstone brief and the certificate are free, with no card and no trial. The hands-on exercises need the tools listed under Prerequisites.
Do I get a certificate?
Yes. Finish every lesson of Fine-Tuning and RL for Agents and you get a certificate with your name and a certificate ID, on a public page anyone can check. Finishing every course in a learning path earns the path certificate too. You can download each one as a PDF and add it to LinkedIn. They're certificates of completion from the Coders In Hoods AI Academy, not an accredited qualification.
How long does Fine-Tuning and RL for Agents take?
About 38 hours: 3 modules and 8 lessons, at your own pace. Your progress is saved to your account, on every device.
Which roles is it for?
It's on the Machine Learning Engineer roadmap: the courses those jobs ask for, in the order to take them.
What do I need before I start?
Evaluating and Scoring Agents (graders, calibrated judges, paired statistics) and Prompt and Context Optimisation (an optimised, versioned prompt to use as the baseline). LLMs for Engineers, especially Post-training an assistant; recommended: Human Feedback at Scale and Agent Benchmarks and Simulations. Comfortable reading and writing Python. Claude Code on a Claude subscription, a free Kaggle or Colab account, and an OpenRouter key or local Ollama for open-weight teacher and judge models; a few dollars of rented GPU time is optional.
More in Evaluation and Optimisation.
- IntermediateAI agents · Evals
Evaluating and Scoring Agents
Turn "it seems better" into numbers you can defend: error analysis, code graders, calibrated LLM judges and honest statistics.
7 lessons ~20hFree - IntermediateResearch methods · Evals
Think Like a PhD Student
Ask a question, design the experiment, annotate the data, doubt the result, write it up and get it reviewed: the research discipline for AI agent work.
10 lessons ~26hFree - AdvancedAI agents · Evals
Agent Benchmarks and Simulations
Evaluate multi-turn, stateful agents with simulated users and real environments, and build benchmarks whose numbers survive an audit.
9 lessons ~32hFree - AdvancedPrompt engineering · DSPy and GEPA
Prompt and Context Optimisation
Treat prompts, examples, tool descriptions and skills as versioned, measured artefacts, and improve them by hand, by optimiser and in production without breaking what already works.
7 lessons ~17hFree - AdvancedEvals · Human feedback
Human Feedback at Scale
Collect, measure and trust the judgements of reviewers and users: study design, rater agreement, preference rankings, real-use signals and quality estimates from a few labels.
7 lessons ~28hFree
