How Value Flows Backward
Watching worth ripple through a maze like heat spreading from a warm lamp.
In the last chapter, we stood at a single fork in the road and watched how patience reshapes which future prize feels brighter. That was a simple two-lane choice. Now imagine stepping into a full maze—corridors twisting around walls, dead ends, a shining treasure tucked in one corner, and a glowing hazard lurking in another.
If you try to plan your route by tracing every possible winding path from start to finish, your head spins almost immediately. Even a modest room has thousands of ways to wander around in circles. So how does a smart agent make sense of an entire map without drowning in possibilities?
It flips the question upside down. Instead of starting at your feet and guessing forward into the fog, you let the answer flow backward from the goal.
The Warmth of a Place
Imagine walking down a quiet street on a chilly evening. Around a corner, out of sight, sits a bakery pulling fresh bread from the oven. You haven't reached the doorway yet, and there is no loaf sitting on the sidewalk at your feet—yet the moment you step onto that block, the warm scent tells you that you are standing in a promising spot.
In reinforcement learning, every place on the map carries that same invisible glow. We call it Value: a simple measure of how good it is to stand right here.
- Standing right next to a Golden Goal feels almost as wonderful as touching it—one effortless step and you've won.
- Standing three corners away still feels gently warm, because a clear trail connects you to the prize.
- Standing cornered beside a Trap feels icy cold—unless you have an open corridor leading safely away.
A tile's value is not about whether that tile hands you a treat right now. Most tiles in a maze are completely empty. Value is the promise of what lies ahead—the warmth of the best future you can reach starting from this exact spot.
The One-Step Ripple
Here is the quiet miracle at the heart of planning. To light up an entire maze with the true warmth of every tile, no tile needs to know the whole map. No tile needs to look five moves ahead. Every tile only ever needs to follow one tiny, neighborly rule:
Look at your immediate neighbors—up, down, left, and right. Spot the warmest one, and borrow a slightly dimmed copy of its glow.
At first, the whole maze is pitch dark except for the Goal shining at full brightness. Now run the Ripple Rule once across every tile at the same time:
- Ripple 1: Only the tiles directly touching the Goal see any warmth, so a glowing halo lights up one ring around the prize.
- Ripple 2: Tiles two steps away glance at that newly lit halo and catch a slightly softer glow.
- Ripple 3, 4, 5…: Wave by wave, warmth bends around walls, slips through doorways, and skirts past hazards until every reachable tile on the board has settled into its true brightness.
Textbooks call this spreading wave Value Iteration (part of a family of ideas called Dynamic Programming). The name sounds grand, yet the motion itself is as natural as heat conducting along a metal plate—one tiny local handoff, repeated until the whole room glows.
Try it yourself below. Tap Ripple 1 Step a few times first so you can literally watch each ring of light expand outward around the walls, then hit Auto-Ripple or repaint the maze to see how the glow adapts.
Click Ripple 1 Step to advance the glow one ring at a time, or click tiles on the grid to reshape the maze. Notice how each lit tile immediately sprouts an arrow pointing uphill toward its warmest neighbor.
Try painting a wall right across the middle doorway in the lab above and hitting Reset Glow followed by Auto-Ripple. Watch how the light refuses to pass through stone—instead, it curls patiently around the bottom hallway and illuminates the left side from below.
Once the Glow Settles, Choosing Is Effortless
Pause and look at the arrows that appeared across the maze once the warmth finished spreading. We never wrote a single rule about how to navigate around walls. We never programmed a detour around the trap.
Yet from any lit tile on the board, you now know the best move without thinking ahead at all: simply glance at your four neighbors and step onto the brightest one.
Always stepping toward the warmest neighbor is called greedy following. Normally, being greedy is short-sighted—it only looks one step away. But because Value already carried the wisdom of the entire future backward into every tile, taking the warmest immediate step automatically walks you along the smartest long-term path.
It is just like water rolling downhill—except in reverse. Every ripple sculpted a smooth, glowing hillside peaking at the Golden Goal. Once the terrain exists, gravity does the rest.
Two Goals, One Map
What happens when a maze holds two different sources of warmth?
Suppose on the left side of the room sits a modest Silver Gem—easy to reach, just a few steps away. Far across the room, tucked behind a tall dividing wall, glows a massive Golden Treasure. Both prizes radiate warmth backward through the corridors at the same time.
Where those two waves meet in the middle of the map, each tile faces a simple contest: whose glow arrives brighter here?
This is where the Foresight from Chapter 3 returns in full visual glory. When warmth fades quickly over distance, the distant Golden Treasure dims before it can wrap around the dividing wall—so the middle of the room falls under the pull of the nearby Silver Gem. Turn Foresight up so warmth carries farther, and the Golden Treasure's huge radiance reaches across the hallway and overpowers its smaller rival.
In reinforcement learning, the complete field of directional arrows covering every tile is called a Policy—the agent's full playbook for what to do everywhere in the world. Drag the Foresight slider below and watch the policy reshape itself before your eyes. Click any open tile to drop an explorer and see which prize the arrows carry them to.
Drag Foresight to control how far warmth travels before fading. Blue arrows lead to the nearby Silver Gem; gold arrows lead around the wall to the distant Golden Treasure. Click any open tile to send an explorer!
Watch that invisible dividing line march across the room as you slide from 55% to 93%. Not a single wall moved. Neither prize grew or shrank. Yet simply letting warmth travel a little farther flipped the allegiance of dozens of tiles, turning a short-sighted dash for the silver gem into a patient journey around the wall for the golden treasure.
One Big Catch
Before we celebrate too soon, notice the quiet superpower we used in both labs above: we had a bird's-eye map of the entire world. We already knew where every wall stood, where every treasure hid, and which tile bordered which—so we could ripple warmth across every corridor in our heads without ever taking a single physical step.
Real life is rarely that generous. Drop a robot into a new house, or sit down at a game whose rules you've never been told, and there is no blueprint waiting on the table. You can't ripple warmth through hallways you haven't seen yet. You have to walk out into the dark, bump into a few walls, stumble across a surprise, and slowly build your sense of value from lived experience. That is where we head next.
Key Takeaways
- Value measures how good it is to stand in a spot—not the treat under your feet right now, but the warmth of the best future reachable from here.
- The Ripple Rule (Value Iteration): every tile simply looks at its immediate neighbors and inherits a slightly dimmed copy of the warmest one. Repeat that local handoff, and worth flows backward around walls to light up the whole map.
- Greedy Following: once the value glow settles, long-term planning collapses into a one-step reflex—just always step uphill toward the brightest neighbor.
- A Policy is the complete arrow field that emerges from those values; changing how far warmth reaches can flip whole regions of the map from a nearby prize to a grander, distant one.