Introduction to Reinforcement LearningPart 4 · Beyond value functions

Lecture 11Learning about many things

Learning more from the same stream of experience: general value functions, auxiliary tasks that shape a shared representation, trade-offs between tasks and PopArt, universal value functions, and distributional reinforcement learning.

By the end you should be able to define a GVF by its three knobs, explain what PopArt preserves, and run one step of categorical TD by hand.

Key ideas, one per episode

  • Ep. 43Any useful knowledge can be a prediction.
  • Ep. 44Extra questions build a better shared representation.
  • Ep. 45Normalise the targets, and preserve the outputs.
  • Ep. 46One number hides the shape of the future.

Based on: Deep Reinforcement Learning, Part 2, DeepMind × UCL Reinforcement Learning Lecture Series (2021), by Matteo Hessel. The slides follow that order of topics, in our own words, figures and examples; they are not official material of the original course.

The title slide of Lecture 11: Learning about many things

35 slides, written to be read on your own, with worked examples, “try it” boxes, small simulations and check-yourself questions (answers at the end). PDF, 1.2 MB.

Watch

4 short episodes of ACML Explains for this lecture. Pick one from the list, and open the transcript to read along: each timestamp plays the episode from there. The narration is generated with a voice clone of Teddy, used with his permission.

Episode 43 · 5:14

General value functions

Your state isn't what you see. It's what you expect to happen.

Any useful knowledge can be a prediction.

TranscriptEpisode 43

One number, a narrow picture

Module eleven: learning about many things. So far, our agents chased one number. One reward, one value, one policy. And a narrow goal gives you a narrow picture of the world. A narrow representation can't support good generalisation. The deadly triad and value leakage only make it worse. Think of a ship. If the only thing you ever practised is sailing in a straight line, you'll be lost the day someone asks for a circle. Better: first learn how a ship moves. Then a straight line, a circle, whatever you're asked. Rich knowledge first.

Knowledge as predictions

Remember the reward hypothesis, from the very first lecture? Any goal can be written as maximising a scalar reward. Push it one step further. Maybe all useful knowledge can be written as predictions. Not just about reward. About anything. That's a general value function. Sutton and colleagues, two thousand eleven. Swap the reward for a cumulant, c: any signal you care about. And make two more things flexible. The discount, gamma, can depend on the state. And the policy can be any policy, even a hypothetical one. You've noticed, I'm sure. This course started very mathematical, and slowly became more and more engineering. This is engineering.

Turning the knobs

Let's play with the knobs. Cumulant equals reward, under my own policy, with my usual gamma. That's plain policy evaluation. Nothing new. Cumulant equals reward, and gamma equals zero. Now I only predict the very next reward. Which object did that, earlier in the course? The model. Cumulant equals the next state, or a feature of it, with gamma zero. Given a state and an action, predict where you land. That's the dynamics. Same architecture, same learning rule. Just different questions. You get all of these as a gift, by turning a few knobs. And the policy knob: what would happen if I always walked left? You can learn that answer without ever walking left. That's off-policy learning, and we'll meet it again as an open problem.

A discount per state

Why would gamma depend on the state? Think chess. At the start of the game, how far do you want to look? Far. The game is long. Near the end, you want to finish the job. A short horizon. So a gamma that depends on the state can make sense. And a gamma of zero in some states means: this question ends here. Discount and termination are the same knob. Choose it wisely, and it helps. Choose it badly, and it hurts. And as usual, you mostly find out which one afterwards.

Our corridor, three questions

We tried it. A corridor of seven cells, an agent walking at random. One stream of experience, and three questions learned at the same time. Question one: how much reward is coming, from the right end of the corridor? Gamma point nine. Question two: will I touch the left wall on the very next step? Gamma zero. Question three: how soon will I reach it? Gamma point eight. Twenty thousand steps of plain TD learning, for all three at once. All three ended with an average error below a tenth. Two of them, far below. None of these questions is the task. But together, they say a lot about where the agent is.

Sub-goals, and a boxing story

Cumulants are also a way to add sub-goals. Back to the ship. The main reward: sail in a straight line. Add a few more signals. Don't capsize. Here's a good idea: stop capsizing. And if you sail in a zigzag, fine by me, I'm still happy. A story I like. Two simulated agents, trained to box against each other. One of them found a brilliant move: fall to the floor, and do nothing. The other one had never seen anything like it. It had no idea what to do, and it fell apart. The one lying on the floor won. The fix was a new signal: if you fall on the floor, I'm angry with you. A small cumulant, a very different agent.

Train on one, judge on another

Which brings an important habit. Agents are often trained on one reward, and evaluated on another. In the boxing example, when we evaluate, we only care who wins. Falling or not falling doesn't matter there. Usually the evaluation reward sits inside the training reward. You still want to train in the right direction. The extras are there to help, not to replace.

Predictions as the state

Now a bold idea, from predictive state representations. Littman, Sutton and Singh, two thousand two. Ask a large and diverse set of questions. If the set is rich enough, the answers say everything you need about the state. So use the predictions themselves as the state. Then learn the policy and the values as a simple, linear function of those predictions. Our corridor already shows the spirit. Will I touch the wall now? How soon? How much reward is coming? Three answers, and you can roughly tell where you are, without anyone telling you. Your state is no longer what you see. It's what you expect to happen.

Recap

So: a general value function predicts any cumulant, with any discount, under any policy. Reward prediction, dynamics, policy evaluation: all special cases. And asking many questions builds a richer picture of the world. Next time: put many questions into one network, and let them teach each other. Auxiliary tasks.