Course / 09
AI Agents
Systems that act: from the classical agent and its environment, search and Markov decision processes, through reinforcement learning, to language-model agents that reason, use tools, remember, plan, write code and operate computers, and how they are trained, evaluated and kept safe.
Before you start: the NLP course up to instruction tuning and tool use, which in turn builds on Deep Learning and Machine Learning. Reinforcement learning is developed here from the start. Every note ends with a Code section in Python with NumPy that runs on a laptop in seconds; where a real language model would be called, the code uses a small scripted stand-in so that it runs offline, and says what changes with a real model.
- 01
Agents and Environments
What an agent is, and how it plans when it knows how the world works.
After this section: Describe a task as an environment with percepts, actions and a performance measure, solve it by search when the world is known and deterministic, and as a Markov decision process when outcomes are uncertain.
4 of 4 notes published - 02
Reinforcement Learning
Learning to act from rewards when the world is unknown.
After this section: Implement Q-learning and a policy-gradient method, explain what replay, target networks, baselines and clipping fix, and say when a learned model of the world pays off.
4 of 4 notes published - 03
Language Models as Agents
A language model becomes an agent when its text is read as actions.
After this section: Write the loop that turns a language model into an agent: prompt it to reason, let it call tools through a schema, feed the observations back, and decide when it stops.
4 of 4 notes published - 04
Memory, Planning and Reflection
What an agent needs to work on a task longer than one context window.
After this section: Manage what an agent keeps in its context and memory, break a task into a plan, use feedback to correct mistakes, and choose between a fixed workflow and an open-ended agent.
4 of 4 notes published - 05
Agents at Work
Agents that write code, use a computer, do research and work in teams.
After this section: Explain how coding, computer-use and research agents see their environment and act in it, and when several agents beat one.
4 of 4 notes published - 06
Training Agents
Reinforcement learning applied to language models, from single answers to long tasks.
After this section: Derive the objective that RLHF, GRPO and RL with verifiable rewards optimize, explain how reasoning models trade compute at inference for accuracy, and set up multi-turn training for an agent.
3 of 3 notes published - 07
Evaluation and Safety
How to know whether an agent works, and how to keep it from doing harm.
After this section: Measure an agent with the right benchmark and statistic, defend it against prompt injection with isolation and least privilege, and recognize reward hacking and the oversight it calls for.
4 of 4 notes published