In model-based reinforcement learning (MBRL), it is standard practice to separate learning how the world moves (dynamics) from learning what is "good" (rewards). However, this paper demonstrates that if your world model is even slightly flawed, this separation fails. Instead, you must train your reward function to understand the "hallucinated" states your imperfect model creates.
The Problem with Misspecified Models
MBRL is conceptually elegant: learn a model of the environment, then use a planner to "think" through potential actions within that model to find the best path. However, in the real world, our models are almost always misspecified—meaning they are too simple to capture the full complexity of reality.
When a model is flawed, it often generates "hallucinated" states—erroneous configurations that would never occur in the real environment. The standard approach is to learn a reward function based solely on real-world data. But what happens when the planner encounters a hallucinated state? The reward function, having never seen such a state, might assign it a random or "perfect" value that misleads the planner.
For example, if a model fails to draw an explosion when a target is hit, a "perfect" reward function looking for explosions will give zero reward, even if the agent did exactly the right thing. Surprisingly, providing a "perfect" reward function (one that knows the ground-truth rules of the game) can lead to catastrophic failure. If the dynamics model is too flawed to "see" the triggers for those rewards, the perfect reward function becomes useless.
Proposed Method: Hallucinated Reward Training
The author, Erik Talvitie, proposes a shift in how we train reward functions. Instead of just learning from real environment transitions, we should train the reward model to minimize hallucinated reward error.
- Hallucinated Rollouts: The algorithm (an extension of H-DAgger-MC) runs the model and the real environment in parallel.
- The Objective: The reward function is trained to predict the real reward associated with a specific step in the environment, but it uses the hallucinated state from the model as its input.
- Theoretical Bound: The paper introduces a new error bound (Theorem 5) proving that minimizing this hallucinated reward error is more directly tied to actual planning performance than traditional accuracy metrics.
- Algorithm Extension: The author extends the Hallucinated DAgger-MC algorithm to include a reward-learning step that specifically maps these "fake" model states to "real" environment rewards.
Experimental Setup: The Shooter Domain
The paper evaluates the approach using the Shooter domain, a simplified video game environment. The agent controls a ship that moves, fires bullets, and tries to hit targets (bullseyes).
The author tests three specific variations of model misspecification:
- No Model Limitations: A baseline where the model can perfectly represent the world.
- Moving Bullseyes (2nd-order Markov): The bullseyes move, making the environment's state dependent on the previous two frames. Since the model is only 1st-order Markov (it only sees the current frame), it cannot predict movement accurately.
- Flawed Factored Structure: The model only looks at a small local neighborhood (7x5 pixels) to predict the next state of a pixel. This makes it "blind" to bullets hidden behind targets, leading to graphical glitches in its predictions.
Key Insights and Results
The experiments showed that "Hallucinated" reward training consistently outperformed both "Standard" training (training only on real states) and "Perfect" reward functions when the model was flawed.
- Entanglement of Dynamics and Rewards: Dynamics and rewards are inherently entangled when models are imperfect. The reward function must be "specialized" to the specific flaws of the dynamics model to remain useful for planning.
- Consistency over Accuracy: A model doesn't necessarily need to be a perfect replica of reality to be useful. As long as the reward function can consistently map the model's "glitchy" states to the correct utility values, the planner can still make good decisions.
- Performance on Moving Bullseyes: Standard DAgger-MC failed completely. H-DAgger-MC with hallucinated reward training was the only method that achieved a high average discounted return, nearly matching the performance of a perfect model.
- Performance on Flawed Factored Structure: Even when the model generated visually "broken" states, the hallucinated reward training allowed the agent to "understand" those broken states and continue planning effectively. The agent achieved a return of ~10, while the agent with a "perfect" reward function dropped to a return of ~2 (barely better than random).
Limitations and Future Work
- Deterministic Assumption: The theoretical proofs in this paper assume the environment's dynamics are deterministic. While many games fit this, real-world robotics often do not.
- Blind Rollout Policies: The bounds currently rely on "blind" rollout policies (where actions don't depend on the state). Extending this to more complex, state-dependent policies is a logical next step.
- Sparse Rewards: Learning to predict reward sequences might be much harder than predicting state sequences if rewards are very sparse (only happening at the very end of a long task). Future work could explore how to handle these "needle in a haystack" reward signals within hallucinated states.
Summary updated