In the world of Reinforcement Learning (RL), the "exploration-exploitation" trade-off is a classic headache. To find a reward in a complex environment, an agent must explore. Traditionally, we've encouraged this by giving agents an "intrinsic reward" for novelty—basically, a bonus for going somewhere they haven't been before. But as any human knows, exploring isn't just about seeing new things; it’s about exploring with purpose.
A new paper from Google Research, "Show me the Way: Intrinsic Motivation from Demonstrations," proposes a shift: instead of hard-coding what "curiosity" looks like, why not learn it from how humans or experts explore?
TL;DR
The authors introduce Show me the Way (SmtW), a method that extracts intrinsic exploration bonuses directly from expert demonstrations using Inverse Reinforcement Learning. Unlike standard novelty-seeking methods, SmtW captures structured exploration "styles," safety constraints, and task-specific priors, allowing agents to solve sparse-reward tasks more efficiently in unseen environments.
What Problem Does This Paper Address?
Standard RL exploration often relies on exhaustive exploration—the agent tries to visit every possible state. While theoretically sound, this fails in the real world for three reasons:
- Scale: State spaces are too large to visit everything.
- Safety: Some "novel" states are dangerous (e.g., a robot jumping off a cliff).
- Efficiency: Humans don't explore randomly; we use priors. If we're looking for a lost key, we check pockets and drawers, not the ceiling.
Current state-of-the-art bonuses like Random Network Distillation (RND) or count-based methods only reward "newness." They can't distinguish between a useful new state and a useless (or dangerous) one. The authors argue that we should treat exploration as a behavior to be imitated, capturing the "intrinsic motivation" that drives an expert's search process.
Methods
The authors frame the problem as Inverse Reinforcement Learning (IRL). They assume an expert is optimizing a total reward consisting of the environment's task reward ($R$) plus their own internal exploration bonus ($B$).
Their proposed architecture, SmtW, uses a two-stage "Cascaded Supervised" approach:
- Behavioral Cloning (BC): They train a neural network (an LSTM) to predict the expert's actions from their trajectories. Crucially, they treat the logits (the unnormalized outputs) of this classifier as implicit Q-values (state-action values).
- Bonus Regression: Using the Bellman optimality equation, they "invert" the logic. Since they know the task reward $R$ and have estimated the Q-values from the BC step, they can solve for the hidden bonus $B$. They train a second network to regress this bonus, which can then be handed to any standard RL agent.
By using LSTMs, the method ensures the bonus is history-dependent, meaning the agent remembers what it has already tried during a specific attempt.
Datasets
The primary benchmark is a procedurally generated environment called KeysDoors.
- The Setup: A grid-world with $N$ keys and $N$ doors. Only one specific key opens one specific door.
- The Challenge: The agent gets a -1 reward for every move (to discourage loitering) and a +100 reward only for opening the correct door.
- Why it's hard: A "lazy" agent will simply stand still to avoid the -1 penalty. To succeed, an agent must persevere through many "failed" attempts of trying different key-door combinations.
- Generalization: The model is trained on one set of layouts and tested on entirely new, unseen layouts to ensure it learned a strategy, not just a map.
Key Insights and Ideas
- Style over Novelty: SmtW doesn't just reward new states; it rewards states that fit the expert's "style." If the expert explores keys from left to right, SmtW will reward the agent for following that same systematic pattern.
- Capturing Constraints: In experiments, SmtW learned that "dropping a key" was a bad move, even if the resulting state was "novel." Standard novelty-seeking methods (RND/Count-based) couldn't make this distinction.
- Overcoming the "Lazy" Trap: Because SmtW provides a structured bonus, it pushes the agent to keep trying even when the environment reward is negative, effectively overcoming the "Pitfall!" problem where agents stop moving to avoid losing points.
- Generalization: The intrinsic bonus learned on a few hundred training maps successfully guided agents on completely new maps, proving that exploration "priors" are transferable.
Key Results
The authors compared SmtW against $\epsilon$-greedy exploration, count-based bonuses, and RND:
- Structured Exploration: SmtW significantly outperformed RND in rewarding "expert-like" trajectories. Interestingly, RND sometimes rewarded random behavior more than expert behavior because random movement creates more "noisy" novelty.
- Task Success: In the KeysDoors(N=5) environment, Q-learning agents using the SmtW bonus solved the task much faster than count-based methods.
- Safety/Priors: SmtW successfully assigned lower rewards to "unsafe" behaviors (like taking unnecessary actions) that the expert avoided, whereas novelty-based methods rewarded those same actions as long as they led to new states.
Limitations and Future Work
- Dependency on Demos: SmtW requires high-quality demonstrations of exploration. If you don't have data on how a human searches, you can't learn the bonus.
- Scaling to High Dimensions: While the method works on visual inputs, it was tested on grid-worlds. Scaling this to complex 3D environments or robotics remains a challenge.
- Hyperparameter Sensitivity: The method introduces a $B_{min}$ heuristic to handle suboptimal actions in the dataset, which may require tuning for different tasks.
The authors suggest that future work could involve behavioral style-transfer, where an agent is taught to solve a task specifically in the "style" of a certain expert (e.g., a cautious style vs. an aggressive style).
Summary updated