Offline RL with No OOD Actions: In-Sample Learning via Implicit Value Regularization

Haoran Xu, Li Jiang, Jianxiong Li, Zhuoran Yang, Zhaoran Wang, Victor Wai Kin Chan, Xianyuan Zhan

This paper, presented at ICLR 2023, tackles one of the most persistent headaches in offline reinforcement learning: the "extrapolation error" caused by querying values for actions the agent has never seen. By introducing a new theoretical framework called Implicit Value Regularization (IVR), the authors provide a principled way to learn optimal policies using only the data at hand—no "imaginary" out-of-distribution actions required.

TL;DR

The authors propose the Implicit Value Regularization (IVR) framework, which provides a theoretical foundation for "in-sample" offline RL—learning without ever querying out-of-distribution actions. Based on this, they introduce two new algorithms, Sparse Q-learning (SQL) and Exponential Q-learning (EQL), which achieve state-of-the-art results on challenging benchmarks and show superior robustness in noisy or data-scarce environments.

What Problem Does This Paper Address?

In offline RL, we try to learn a policy from a fixed dataset without further environment interaction. Standard off-policy methods often fail here because they try to maximize Q-values. During training, the policy might pick an action not present in the dataset (an out-of-distribution or OOD action). The Q-function, having never seen this action, might erroneously assign it a massive value. The policy then "exploits" this error, leading to catastrophic failure when deployed.

Previous solutions usually involve pessimism: either explicitly constraining the policy to stay near the behavior policy or penalizing the Q-values of OOD actions (like CQL). However, these methods require a delicate trade-off between being too cautious (poor performance) and too bold (instability).

A newer paradigm called In-sample Learning (exemplified by IQL) avoids this by only using actions already in the dataset. While IQL works well, its theoretical underpinnings regarding distributional shift were somewhat murky. This paper aims to clear that fog and improve upon the approach.

Methods

The authors introduce the Implicit Value Regularization (IVR) framework. They start by adding a general behavior regularizer directly to the RL reward function.

Key technical contributions include:

  • Closed-form Solutions: They prove that for this regularized objective, the optimal policy has a closed-form solution that weights the behavior policy based on the advantage ($Q - V$).
  • Convex Optimization for $V$: They show that finding the state-value function $V$ is equivalent to solving a convex optimization problem using only dataset samples. This bypasses the need to know the behavior policy explicitly.
  • Two New Algorithms:
    • Sparse Q-learning (SQL): Uses $\chi^2$-divergence for regularization. This leads to a "sparse" value function that completely ignores actions with values below a certain threshold.
  • Exponential Q-learning (EQL): Uses Reverse KL-divergence. It is theoretically similar to IQL but derived through the IVR framework.

The training process for both is a simple three-stage supervised learning pipeline: learn $V$, learn $Q$ (using the learned $V$ for targets), and then extract the policy $\pi$.

Datasets

The authors evaluated their methods on several standard and custom benchmarks:

  • D4RL: The standard benchmark for offline RL, including MuJoCo locomotion tasks, AntMaze (which requires "stitching" suboptimal paths), and Adroit/Kitchen tasks.
  • RL Unplugged: High-dimensional, image-based Atari datasets (Breakout, Qbert, Seaquest).
  • Noisy Data Regimes: Custom versions of MuJoCo tasks where expert data is mixed with varying amounts of random, noisy data.
  • Small Data Regimes: Custom AntMaze tasks where transitions near the goal are intentionally discarded to simulate data scarcity.

Key Insights and Ideas

  • The "Why" of In-Sample Learning: The IVR framework explains that in-sample methods are essentially performing implicit value regularization. This provides a bridge between policy-constraint methods and value-regularization methods.
  • Sparsity is a Superpower: The most significant "aha" moment is the benefit of sparsity in SQL. By assigning zero weight to "bad" actions (those with low Q-values), SQL becomes much more robust to noise. In contrast, IQL's "expectile regression" can be dragged down by very poor actions in a noisy dataset.
  • Robustness to Data Scarcity: Because in-sample methods never query OOD actions, they are inherently more stable when data is sparse. The authors show that while out-of-sample methods like CQL see their Bellman error explode as data decreases, SQL remains stable.

Key Results

SQL and EQL demonstrated impressive performance across the board:

  • Benchmark Dominance: SQL or EQL achieved the highest scores in 14 out of 18 D4RL tasks, significantly outperforming IQL and CQL in the difficult AntMaze and Kitchen environments.
  • Noisy Data Resilience: In the Walker2d task with only 5% expert data, SQL and EQL maintained near-100 normalized scores, while IQL's performance plummeted.
  • Efficiency: As shown in Table 1, SQL provides a substantial boost in challenging "stitching" tasks like antmaze-large-diverse.
Table 1: Averaged normalized scores of SQL against other baselines. The scores are taken over the final 10 evaluations with 5 seeds. SQL or EQL achieves the highest scores in 14 out of 18 tasks.

Limitations and Future Work

  • Approximations: The practical version of SQL uses an approximation to avoid training a third neural network (the $U$ network), which might introduce small errors.
  • Gradient Stability: EQL involves an exponential term in its loss function, which can lead to unstable gradients and makes it more sensitive to hyperparameter choices compared to SQL.
  • Scope: The current framework focuses on constraining the action distribution. The authors suggest that future work could extend this to constrain the full state-action distribution ($d^\pi$ vs $d^D$), which might yield even better results. They also see potential for scaling this framework to online RL and offline-to-online fine-tuning.

Summary updated

BibTeX
@inproceedings{xu2023offline,
  author = {Haoran Xu and Li Jiang and Jianxiong Li and Zhuoran Yang and Zhaoran Wang and Victor Wai Kin Chan and Xianyuan Zhan},
  title = {{Offline RL with No OOD Actions: In-Sample Learning via Implicit Value Regularization}},
  booktitle = {International Conference on Learning Representations},
  year = {2023},
  url = {https://openreview.net/forum?id=ueYYgo2pSSU},
}
Figure