Log inStart free
LESSON 18.14 · 6 STAGES · 3 CONTROLS · 3 CHECKSPRO · PREVIEW

Constrained MDPs

Watch a budget on lava entries turn into a price the agent learns.


Pro lesson. Stage 1 is free to watch. Pro opens all 6 stages, 3 controls and 3 checks, in this lesson and every other.

Go Pro · $8.25/mo
EXPLAINER · 18.14 · SAFETY BAYSHORTEST M 6 · C 3 · SAFEST M 10
01
Stage 1 of 6 · Two signals
Each move gives a reward of −1. A separate cost signal adds 1 for each lava entry.
Explain it simply

You see the lava grid again, with two paths. Each move gives a reward of minus 1, so a shorter path scores better. A second signal, the cost, counts every lava entry and stays apart from the reward. The straight path costs 3 in 6 moves, and the safe path costs 0 in 10 moves.

Two rows per path: a reward of minus 1 per move and a cost per move. The shortest path: 6 moves, cost 3. The safest path: 10 moves, cost 0.

agentlava, costbudget d, price λgoal, policies, moves
startgoallavasafest: 10 moves, 0 entriesshortest: 6 moves, 3 entriesshortest pathrcsum: reward −6, cost 3−1−1−1−1−1−1011100safest pathrcsum: reward −10, cost 0−1−1−1−1−1−1−1−1−1−10000000000the gridthe two signalsstartgoallavasafest: 10 moves, 0 entriesshortest: 6 moves, 3 entriesshortest pathrcsum: reward −6, cost 3−1−1−1−1−1−1011100safest pathrcsum: reward −10, cost 0−1−1−1−1−1−1−1−1−1−10000000000the gridthe two signals
Toy: the 7 × 7 lava grid of 18.13, exact plans, 60 price steps
STAGE 1 / 6
MATH · STAGE 1HOVER A SYMBOL OR A SHAPE
rt=−1,ct=1[ st+1∈lava ]\sy{r}{out}{r_t} = -1,\quad \sy{c}{grad}{c_t} = \mathbb{1}[\,s_{t+1} \in \text{lava}\,]
∑rt=−6, ∑ct=3\textstyle\sum r_t = -6,\ \sum c_t = 3

Each move costs one reward point; a lava entry adds one cost point.

Common mix-ups

MYTHThe best constrained policy always follows one fixed path.

The fix, and 1 more mix-up with the diagram to show them, come with Pro.

Predict, then reveal
3 CHECKS · PRO
Q01If the budget drops to 0, what does the best policy do?

Make your guess, then test it in the diagram. All 3 checks come with Pro.

PRO LESSON · YOU WATCHED STAGE 1 OF 6
Unlock the full explainer
  • 5 more stages and 3 live controls
  • 2 mix-up cards and 3 predict-then-reveal checks
  • Watch it as a narrated video, in three voices
  • Every Pro lesson and capstone · 656 in total

$99 a year, or $15 a month. Cancel any time.