
How to Design a Reinforcement Learning Environment
Most beginners assume the algorithm is the hard part of reinforcement learning. Pick the right one, tune it well, and the agent will learn. Then they spend…
Read tutorialFind out whether an agent is actually learning: design environments, choose metrics, diagnose failure, compare baselines, and test generalization.
Tutorials
Follow the learning path in order or jump directly to the RL concept or experiment you need.

Most beginners assume the algorithm is the hard part of reinforcement learning. Pick the right one, tune it well, and the agent will learn. Then they spend…
Read tutorial
Your agent just nailed an episode. It reached the goal, collected a beautiful stream of rewards, and you felt that rush of validation. Then you rerun it,…
Read tutorial
Your agent runs. The loop completes. No exceptions are raised. And yet the reward curve sits there like a flatline—or climbs promisingly for two hundred…
Read tutorial
Your agent is doing one of two things: nothing, or the wrong thing. When rewards never arrive, it wanders forever without learning. When rewards arrive too…
Read tutorial
A shaped agent learns faster, the curve looks great, and the final policy is subtly wrong. The shaping term did not speed up learning; it quietly rewrote…
Read tutorial
"Shaping speeds up learning without changing the optimal policy." That claim is true, and it is also the most misread sentence in reinforcement learning.…
Read tutorial
You changed two things at once. The agent got better. And now you have no idea which change earned the improvement.
Read tutorial
Most people start reinforcement learning the wrong way. They install a deep RL library, copy a DQN or PPO example, watch the agent fail—or worse, behave…
Read tutorial
Two knobs. One update rule. If you are starting out in reinforcement learning, it is tempting to treat the learning rate and discount factor as twin dials…
Read tutorial
Your Q-learning agent trains beautifully for ten thousand steps. The loss curve dips, the reward trend climbs, and you start to believe the hard part is…
Read tutorial
Your agent crushes its training level. Every episode, the same flawless path, the same high score, the same satisfying convergence curve. Then you move one…
Read tutorial
Your agent keeps walking into walls. It selects skills still on cooldown, tries to buy items it cannot afford, and bumps against the grid edge like a moth…
Read tutorial
An offline RL agent can report a sky-high value for an action it never actually tried. The critic is extrapolating into territory the dataset never…
Read tutorial
Imagine training an offline agent and watching its Q-values climb steadily. The critic grows more confident. The policy selects actions with increasing…
Read tutorial
A policy that scores perfectly in simulation is not a policy that works in the real world. It is a policy that solved the simulator.
Read tutorial
You have a new policy that looks promising. The next step feels obvious: deploy it, watch it interact with the real environment, and measure what happens.…
Read tutorial
A higher estimated value is not proof of improvement. It is a hypothesis about actions the dataset may never have supported.
Read tutorial
You train an offline agent on a fixed dataset. The final score looks strong. The learning curves climb. You feel the quiet satisfaction of a result that…
Read tutorial
You have a dataset of logged trajectories collected under one policy, and you want to know what a different policy would have earned. The naive…
Read tutorial
A penalty is a price. A constraint is a wall. Most RL safety problems fail because practitioners build walls out of prices and then act surprised when the…
Read tutorial
Your agent proposes an action that crosses a hard safety boundary. You can block it, replace it, or fall back to a known-safe controller. The naive…
Read tutorial
A shield that rejects unsafe actions every run can still support no safety claim at all.
Read tutorial
Your agent keeps taking an action you already know is wrong. You add a shield. Now you cannot tell whether it is helping or quietly starving the learner.
Read tutorial
Two policies can share the exact same expected return and still feel completely different to the person who has to live with the outcomes. One delivers…
Read tutorial
Two policies. Same expected return. One of them occasionally produces an episode so bad you would never deploy it. The mean cannot tell them apart — not…
Read tutorial
Two policies. One wins on average. The other wins on the days you actually have to survive. If your selection rule can't tell them apart, you're not…
Read tutorial
A novelty bonus can make your agent look busy without making it look smart. The intrinsic-reward curve climbs, the state-visitation heatmap fills in, and…
Read tutorial
Two estimators, one dataset, two different answers. That gap is not a bug in the math — it is the most useful signal you will get about whether your logs…
Read tutorial
A hand-picked penalty weight can look fine in one run and drift over budget in the next. The weight was never told what the budget is — so it can't respect…
Read tutorial
Your policy scores well on the training environment. You change one parameter, run it again, and the score falls off a cliff. Is that a transfer failure,…
Read tutorial
You write down the problem cleanly: maximize expected reward, keep expected cost under a budget. Then you freeze, because there is no obvious place to put…
Read tutorial
Your policy scored well in simulation. On the target system, it behaves differently. All you have is two logs of the same episode — one from each system —…
Read tutorial
A candidate policy that looks better on paper is not the same as a candidate policy that is better. Here is one small, honest rule for telling the…
Read tutorial
Everyone repeats that the deadly triad diverges. Almost nobody watches it happen. So let's build a predictor small enough to update by hand, then watch the…
Read tutorial
You have a log of episodes from one policy, a candidate policy you have never deployed, and a single number that claims to be the candidate's value. The…
Read tutorial
Two algorithms. Five seeds each. A forty-point gap in mean return. Someone asks which one to ship, and the honest answer is: you do not know yet. Not…
Read tutorial
A policy scores well on a handful of held-out levels. The write-up says it "generalizes to unseen environments." Then deployment happens, and the policy…
Read tutorial