Potential-based reward shaping (PBRS) does not change the optimal policy, but how much it speeds up learning depends on the potential and on effects outside this guarantee. We analyse how PBRS changes the one-step reward while it preserves the discounted return: a per-step (γ−1)Φ term, the terminal-state rule, a constant shift of the potential, and positive cycles in a bonus that is not potential-based. We then measure these consequences in pre-registered experiments with a PPO agent. The agent has a limited egocentric view and is tested on two MiniGrid navigation tasks (160 runs, 10 seeds per condition). On LavaCrossing, a geodesic (BFS) potential learned faster than both the sparse baseline and a Euclidean potential with a 7x7 and a 5x5 view (AUC difference +0.27 to +0.39, Holm p between 0.007 and 0.0499). The Euclidean potential did not differ from the baseline. In 20 runs with a non-potential bonus, none of the agents learned the task. The Euclidean potential caused more than twice as many deaths in lava during early training. View size did not detectably change the benefit of shaping. With a 5x5 view on SimpleCrossing, some BFS runs got stuck in loops and never learned; shifting the potential did not remove this, so the per-step term alone does not explain it.
Figures & tables
Condition
Bonus or potential
Tasks
View
Sparse (baseline)
none
both
7 × 7, 5 × 5
Euclidean
Φ=−d/D
both
7 × 7, 5 × 5
BFS (geodesic)
Φ=−b/B
both
7 × 7, 5 × 5
Euclidean + lava
ΦE−c on cells next to lava, c=1/D≈0.118
Lava
7 × 7
Naive control
F=max(0,Φ(s′)−Φ(s)) , Euclidean Φ
both
7 × 7
Shifted BFS
Φ=1−b/B (exploratory)
Simple
5 × 5
Table 1: Conditions. Every cell of the design has 10 seeds.
Comparison
Task
7 × 7 view
5 × 5 view
BFS − Euclidean
Lava
+0.39 [ +0.18 , +0.60 ], p=0.014
+0.34 [ +0.15 , +0.54 ], p=0.010
BFS − sparse
Lava
+0.27 [ +0.09 , +0.48 ], p=0.0499
+0.35 [ +0.18 , +0.54 ], p=0.007
Euclidean − sparse
Lava
−0.12 [ −0.39 , +0.16 ], p=1.0
+0.02 [ −0.23 , +0.26 ], p=0.91
Euclidean − sparse
Simple
+0.02 [ −0.06 , +0.09 ], p=1.0
−0.12 [ −0.16 , −0.07 ], p=0.002
BFS − sparse
Simple
−0.01 [ −0.11 , +0.09 ], p=1.0
−0.29 [ −0.57 , −0.02 ], p=0.22
BFS − Euclidean
Simple
−0.02 [ −0.12 , +0.06 ], p=1.0
−0.17 [ −0.46 , +0.09 ], p=0.42
Table 2: Pre-registered comparisons: AUC difference [95% bootstrap interval] and Holm-corrected p (10 vs. 10 runs).
Figure 1: AUC of every run (points) and the condition mean (bar); panels are task × view (Simple: SimpleCrossing, Lava: LavaCrossing). Each condition has 10 runs.
Figure 2: LavaCrossing: death rate (left) and success rate (right) of training episodes by training phase; 7 × 7 view at the top, 5 × 5 view at the bottom. Each line is the mean of 10 runs; the remaining share is timeouts.
Figure 3: SimpleCrossing, 5 × 5 view: greedy loop rate (share of evaluation episodes with a loop) and final success of the stochastic policy for every run (sparse, BFS and shifted BFS; 10 runs each). Points in the lower right corner are runs that never learned: 3 with BFS and 2 with shifted BFS.
Appendix figures & tables3 assets
Supplementary material from the paper’s appendix.
Appendix
Parameter
Value
Algorithm
PPO (Stable-Baselines3)
Hyperparameters
RL Zoo, MiniGrid
Parallel environments
8
n_steps , batch, epochs
128, 64, 10
Learning rate
2.5×10−4
γ , λ , clip
0.99, 0.95, 0.2
Appendix
Table 3: PPO and evaluation settings, identical in all conditions.
Task, view
Condition
AUC
Final
Never
Death
mean ± SD
success
learn
500k
Simple 7 × 7
Sparse
0.89 ± 0.10
1.00
0
—
Simple 7 × 7
Euclidean
0.90 ± 0.08
0.97
0
—
Simple 7 × 7
BFS
0.88 ± 0.13
0.98
0
—
Simple 7 × 7
Naive
0.00 ± 0.00
0.00
10
—
Lava 7 × 7
Sparse
0.56 ± 0.32
0.76
1
0.225
Appendix
Table 4: Every cell has 10 runs. “Never learn”: final success below 0.1. “Death 500k”: share of training episodes that end in lava during the first 500k steps. Source: results/tables/exp020_runs.csv and exp022_runs.csv (the latter also contains the EXP-012 and EXP-021 runs).
Work
Environment
Distance or potential
Exact PBRS?
Observation
Algorithm
Limitation
Trott et al. (2019)
Continuous 2D point maze, Ant U-maze
Distance to goal, mostly at episode end (ignores walls)
No
Full state (agent and goal coordinates)
PPO
Agent falls into local optima
Laidlaw et al. (2023)
MiniGrid and other environments
Distance that ignores walls (fewest steps without obstacles)
Yes ( γ=1 )
Not stated
PPO, DQN
Distance ignores obstacles
Wang et al. (2023)
Discrete gridworlds and continuous mazes
Learned representation distance
No
Agent (x,y) position
DQN (discrete)
Distance is learned, not BFS
Veviurko et al. (2024)
Gymnasium-Robotics Maze (continuous)
Shortest-path distance (discretised)
No (max-reward RL)
State vector (position, velocity)
PPO, TD3
Result depends on maze layout
Zhang et al. (2026)
Drone, continuous 3D
Dijkstra distance
No (progress reward)
Actor: depth image + proprioception; critic: exact state
PPO (asymmetric actor-critic)
Reward form and distance effect not separated
Ying et al. (2025)
Multi-agent search, cluttered
A ∗ distance (on agent’s internal map)
Yes ( γ=0.99 )
Partial: limited field of view, LiDAR, local map
MAPPO
Preprint, different task
Appendix
Table 5: Work on distance-based shaping compared with this study.
Department of Engineering Design, Indian Institute of Technology, Madras. · Center for Cyber-Physical Systems, Indian Institute of Science (IISc), Bengaluru.