Offline Reinforcement Learning (RL) holds the promise of moving AI from simulators to the real world. By allowing agents to learn from static, pre-collected datasets—such as medical records, driving logs, or robotic demonstrations—offline RL avoids the risk and expense of real-time trial and error. However, the field has long been haunted by extrapolation error: the tendency for value functions to provide wildly optimistic estimates for actions the agent has never actually seen.
In their ICLR 2022 paper, researchers from Tsinghua University introduce Value-based Episodic Memory (VEM), a framework that sidesteps the pitfalls of traditional offline RL by fundamentally rethinking how we estimate value.
The Problem: Distribution Shift and Extrapolation Error
The central challenge in offline RL is distribution shift. Standard RL algorithms learn a $Q$-function, $Q(s, a)$, which estimates the return for taking action $a$ in state $s$. During training, the algorithm often queries $Q(s, a)$ for actions that do not exist in the dataset. Because the neural network hasn't seen these state-action pairs, it often produces erroneous, overly optimistic values. These errors are then magnified through bootstrapping, leading to a total collapse of the learning process.
Existing solutions usually involve "pessimism"—explicitly penalizing unknown actions (like CQL) or constraining the agent to stay close to the behavior policy (like BCQ). However, these constraints can be too restrictive, preventing the agent from discovering the optimal policy hidden within a sub-optimal dataset.
The VEM Framework: Rethinking Value Estimation
VEM addresses the extrapolation error by learning state-value functions ($V$) instead of state-action functions ($Q$), effectively confining the learning process to the dataset's support.
The framework introduces two primary innovations to solve the offline RL bottleneck:
1. Expectile V-Learning (EVL)
Instead of learning a $Q$-function, the authors propose learning a $V$-function, $V(s)$. Since $V(s)$ only depends on states that actually appear in the dataset, the agent is naturally protected from the "unseen action" problem.
To make $V(s)$ useful for RL, they use an expectile operator. By adjusting a hyperparameter $\tau$, the learning objective can smoothly interpolate between:
- Imitation Learning ($\tau = 0.5$): Learning the average value of the behavior policy.
- Optimal RL ($\tau \to 1$): Learning the value of the best possible actions found within the dataset.
2. Implicit Memory-Based Planning
Learning via one-step bootstrapping (looking only one step ahead) is notoriously slow, especially in "sparse-reward" tasks where the agent only gets a signal at the very end of a long sequence.
VEM treats the offline dataset as an Episodic Memory. It performs "implicit planning" by looking ahead along the actual trajectories recorded in the data. It recursively updates the value of a state by taking the maximum of its current estimate and the discounted returns of future states in that same trajectory. This allows value information to "teleport" across long time horizons much faster than standard methods.
Finally, the policy is trained using Advantage-Weighted Regression (AWR), where the agent learns to favor actions that resulted in returns higher than the learned $V(s)$.
Key Insights and Results
The authors evaluated VEM on the D4RL benchmark, the industry standard for offline RL, which includes complex tasks like AntMaze (sparse-reward navigation), Adroit (high-dimensional robotic hands), and MuJoCo (standard locomotion).
- Staying Within the Support: The most elegant part of VEM is that by focusing on $V(s)$, it fundamentally avoids the need to guess the value of actions it hasn't seen. It "stays within the support" of the data by design.
- AntMaze Mastery: VEM shines brightest in difficult, sparse-reward scenarios. On the "Large-Maze" tasks, VEM significantly outperformed baselines like CQL. For example, in
antmaze-large-diverse, VEM scored 58.0, while CQL scored only 14.9. - Robustness to Sparse Rewards: Because of the implicit planning module, VEM is much better at stitching together sub-optimal trajectories to find a path to a distant goal without requiring a learned "world model."
- Adroit Success: In high-dimensional tasks with narrow human data, VEM maintained stability where $Q$-based methods often suffered from value explosions.
Limitations and Future Work
While VEM is a powerful step forward, it has a few limitations:
- Deterministic Bias: The theoretical proofs for VEM's convergence rely on the environment being deterministic. Its performance in highly stochastic environments remains an open question.
- Hyperparameter Tuning: The $\tau$ parameter is critical. Finding the right balance between "learning from the best" and "cloning the average" is still a non-trivial task for new domains, despite suggested auto-tuning methods.
- Memory Overhead: Maintaining and planning over an episodic memory of trajectories is more computationally expensive than simply sampling random transitions from a standard replay buffer.
Ultimately, VEM represents a significant step toward making offline RL more reliable. It proves that sometimes the best way to handle the unknown is to stop trying to guess what it looks like, and instead fully leverage the memory of what is already known.
Summary updated