Benchmarking risk-aware reinforcement learning on Gymnasium's FrozenLake 8x8. Compares SARSA, Q-Learning, and ERM Q-Learning (Entropic Risk Measure, Su et al. 2025) across three grid configurations designed to isolate the effects of stochasticity and topology on learned policies.
By @audrey-dv & @leopoldch
Three 8x8 grids with increasing risk levels:
- baseline — 5% slip, 7 holes. Low-risk reference grid.
- slippery — 30% slip, same 7 holes. Tests the effect of stochasticity alone.
- riskDilemma — 30% slip, 28 holes. Constrained topology that forces a choice between a safe detour and a risky shortcut.
30,000 episodes, 20 seeds, 95% CI. Smoothed with a 200-episode window.
SARSA converges to ~66% success with a low fall rate; Q-Learning stays around 31% success and falls into holes twice as often.
On the constrained grid, ERM Q-Learning reaches 70% success vs ~54% for SARSA and ~41% for Q-Learning, with shorter successful trajectories.
SARSA takes a cautious detour; ERM finds a more direct path while keeping a comparable fall rate.
| SARSA | ERM |
|---|---|
![]() |
![]() |
| Environment | Algorithm | Success (%) | Fall (%) |
|---|---|---|---|
| baseline | SARSA | 64.27 ± 0.47 | 23.48 ± 0.72 |
| baseline | Q-Learning | 29.95 ± 0.73 | 58.49 ± 1.29 |
| baseline | ERM | 59.67 ± 4.01 | 37.30 ± 3.38 |
| riskDilemma | SARSA | 38.15 ± 2.36 | 23.75 ± 1.16 |
| riskDilemma | Q-Learning | 39.59 ± 6.67 | 31.64 ± 4.78 |
| riskDilemma | ERM | 66.30 ± 2.21 | 31.08 ± 1.25 |
uv sync
source .venv/bin/activatepython main.py --env <ENV> --strategy <STRATEGY> --episodes <N> --iterations <N> [--plot] [--render]
| Argument | Default | Description |
|---|---|---|
--env |
random |
baseline, slippery, riskDilemma, corridor, random |
--strategy |
random |
sarsa, qlearning, erm, random |
--episodes |
60000 |
Training episodes |
--iterations |
20 |
Independent runs (different seeds) |
--plot |
off | Save training curves and policy maps |
--render |
off | Display the environment live |
--window |
200 |
Smoothing window for curves |
--save-dir |
figures |
Output directory for plots |
# Full benchmark run python main.py --env riskDilemma --strategy erm --episodes 30000 --iterations 20 --plot # Quick test python main.py --env baseline --strategy sarsa --episodes 5000 --iterations 5 --plot # Visual mode python main.py --env baseline --episodes 5 --render
uv run black .



