Shortcut or shelter?
The policy boundary in a noisy maze
An exposed route is shorter. A protected route is slower. I solve for the reliability at which the preference changes, then test whether Q-learning, SARSA, and Expected SARSA recover the boundary implied by the objective they learn.
THE WORLD
One fork, two routes.
I chose a small environment because its states, transitions, and rewards can be enumerated, and its optimal policy can be computed before training begins.
The agent starts at a fork. EAST enters a short corridor with hazards on both sides. SOUTH begins a longer route protected by a wall and the edge of the grid. The same actuator noise applies everywhere; the southern route is safer because of its geometry, not because its controls are more reliable.
Research question. How reliable must the world be before the shortcut is worth taking?
The purpose is not to rank the algorithms. It is to locate a policy change, explain why it occurs, and test whether finite training recovers the predicted boundary.
Figure 1. EAST enters the exposed corridor; SOUTH begins the protected route. Intended actions execute with probability p.
The central corridor reaches the goal in eight eastward moves. The southern route is four moves longer under perfect control. Every movement costs, reaching the goal adds , and future rewards are discounted by .
I keep the geometry fixed and change the consequence law. A recoverable hazard adds and the episode continues. A lethal hazard adds , ends the episode, and removes the chance to reach the goal.
THE VALUE
The quantity being learned.
A policy maps a state to a distribution over actions. Its return from time is the discounted sum of future rewards:
The action value is the expected return after one action and the policy that follows:
THE BOUNDARY
A boundary in reliability.
Let be the start. Define the start-state action gap
Positive values favor the corridor; negative values favor the shelter. The policy boundary is the zero crossing.
Because the transition and reward model are known, the optimal values satisfy the Bellman equation and can be solved directly:
EXACT-MODEL CALCULATION · NOT A LEARNED RESULT
| Hazard law | Continuation policy | Boundary |
|---|---|---|
| Recoverable | Greedy | ≈ 0.806Corridor above the boundary |
| Recoverable | ε = 0.10 soft | ≈ 0.848Continued exploration moves the boundary |
| Lethal | Greedy | ≈ 0.989A narrow transition near perfect execution |
| Lethal | ε = 0.10 soft | No crossingShelter remains preferred through p = 1 |
Value iteration stops at a Bellman residual of 10−10. The displayed boundaries are numerical zero crossings, rounded to three decimal places.
The lethal boundary is compressed close to perfect execution because the corridor is not a single gamble. It requires repeated exposed decisions. In a simplified passage requiring clean movements, a clean run scales as . The full maze is solved exactly rather than reduced to that expression, but the compounding mechanism remains.
TWO RANDOMNESSES
World noise is not agent exploration.
Reliability belongs to the environment. An intended action executes correctly with probability ; otherwise it slips left or right with probability each.
Exploration belongs to the behavior policy. Here,
Lowering changes the dynamics. Raising changes the continuation policy being valued. The distinction survives even at : perfect actuation cannot prevent an exploratory policy from selecting a bad action.
In the lethal maze, persistent exploration is costly enough that the exact epsilon-soft solution prefers the shelter even under perfect actuation. Frozen-greedy deployment and continued online exploration are different decision problems.
THE BACKUPS
Three rules, two continuation objectives.
All three methods update an action value by
They differ in the target . Here is one only for a true terminal transition; the continuation value is then zero.
OFF-POLICY
Q-learning
Bootstraps toward the best next action. Its control target is greedy.
ON-POLICY
SARSA
Uses the next action actually selected, including the consequences of continued exploration.
ON-POLICY · EXPECTED
Expected SARSA
Integrates over the next-action distribution. At the same state, transition, Q-table, and behavior policy, its conditional expected target matches SARSA's while removing next-action sampling noise.
Under persistent exploration, Q-learning should approach the greedy boundary, while SARSA and Expected SARSA should approach the epsilon-soft boundary. The difference is the continuation value inside the update.
THE PROTOCOL
The training unit is an interaction.
Shelter-taking policies produce longer episodes. Equal episode counts would give them more transitions and more updates, so every primary trial receives the same 100,000-interaction budget.
Episodes are capped at 250 steps. Time-limit truncation resets the rollout but does not suppress the bootstrap; true termination does. The exact-model reference is the corresponding discounted infinite-horizon MDP, so truncation frequency is one of the empirical checks rather than an unspoken equivalence.
Numerical reference solutions determined where the reliability grids required resolution. Small pilot runs then calibrated coverage, learning rate, and budget. The full configurations were fixed after that calibration. This is a prespecified full-run design, not a claim of preregistration.
- Training budget
- 100,000 transitions
- Learning rate
- α = 0.05
- Discount
- γ = 0.98
- Exploration
- ε = 0.10
- Initial values
- Q(s, a) = 8
- Independent units
- 20 seeds per condition
- Checkpoints
- Every 2,500 transitions
- Held-out evaluation
- 25 greedy + 25 behavior episodes
Uniform optimistic initialization is a declared coverage device. The primary learned estimand is the fraction of independent seeds whose final greedy start action is EAST. A tie, NORTH, or WEST remains classified as other; it is not silently converted into one of the expected routes.
Training seeds carry the uncertainty. Evaluation episodes within one trained policy are repeated measurements, not additional replicates.
PREDICTIONS
Predictions before analysis.
- Q-learning should place its finite-budget route transition near the greedy model boundary.
- SARSA and Expected SARSA should place theirs nearer the persistent-epsilon model boundary.
- At a common Q-table, state, transition, and behavior policy, SARSA and Expected SARSA targets agree in conditional expectation; Expected SARSA removes the next-action component of target variance.
- When exploration anneals to zero, all three methods should move toward the same greedy route where the two exact objectives disagree.
The fourth prediction is the important check. If the methods do not converge toward the common greedy route, the continuation-objective explanation is incomplete. Insufficient optimization, poor coverage, constant-step-size behavior, or the training budget would still need to be considered.
EMPIRICAL RESULTS
VALIDATION IN PROGRESS
Empirical figures are still withheld.
All 1,992 planned trials reached succeeded manifest states, with zero recorded failures. I am checking completeness, evaluation pairing, and late-training stability before reporting the learned boundaries.
The empirical figures remain unpublished until these checks pass:
- artifact and manifest integrity;
- exactly 100,000 interactions in every trial;
- matched held-out evaluation seeds across policy modes;
- late-training route stability at calibration endpoints;
- the frequency of 250-step truncations;
- explicit reporting of nonmonotone learned curves;
- right-censoring when a 50% boundary is absent from the grid;
- confirmation that no Quick-mode output enters the analysis.
At each reliability value, a trained greedy policy makes a discrete start-state choice. The final fraction will describe disagreement across independently trained policies; it is not a stochastic mixture used by one policy.
LIMITS
What the evidence can support.
The final result will be conditional on the topology, reward law, discount, exploration rule, initialization, and 100,000-transition budget. It will not establish that SARSA is universally safer, that Q-learning is inherently reckless, or that one method is generally superior.
The EAST/SOUTH summary is also restricted to the plotted high-reliability domain. At sufficiently poor control, NORTH or WEST can become exact-optimal.
REPRODUCIBILITY
Code, configurations, and run identifiers.
The full runs were produced from clean Git commit:
3b53a22323ae44ef776c931648d9f13fa2346a66
Environment, agents, exact solvers, protocol, versioned configurations, and the generated analysis notebook are public. Raw Protocol-v2 artifacts remain local while validation is underway; the published record will include curated tables, figures, manifests, provenance, and compact data sufficient to reconstruct every reported statistic.
Open the repositoryFull run identifiers
shortcut_or_shelter_recoverable-dea8b3bb98-20260818T165653.284759Zshortcut_or_shelter_lethal-c224eb9e19-20260818T184221.884416Zshortcut_or_shelter_annealed-7a6ceda8a8-20260818T200356.410162Z