What Effects the Generalization in Visual Reinforcement Learning: Policy Consistency with Truncated Return Prediction

Shuo Wang, Zhihao Wu, Xiaobo Hu, Jinwen Wang, Youfang Lin, Kai Lv

Introduction

Visual Reinforcement Learning (RL) agents often suffer from severe overfitting, where an agent trained in a specific environment (e.g., a lab with a blue background) fails when visual conditions change slightly (e.g., a red background or a dynamic video). This failure stems from the agent's tendency to rely on "task-irrelevant" high-dimensional visual information rather than the underlying state. While data augmentation is a common remedy, it often lacks a rigorous theoretical foundation. This work introduces Truncated Return Prediction (TRP), a method designed to ensure policy consistency across diverse visual domains.

Theoretical Foundation

The researchers establish a theoretical upper bound for generalization error in RL, identifying two primary drivers:

  1. Policy Divergence: The degree to which an agent's behavior shifts when the environment's appearance changes.
  2. Bellman Error: The accuracy of the agent's value estimations for its actions.

By minimizing these factors, the agent can achieve more robust performance in unseen environments.

Methods: Truncated Return Prediction (TRP)

To address policy divergence and Bellman error, the authors propose TRP as an auxiliary task integrated into the RL training loop.

Overview of the TRP architecture, highlighting the parameter-sharing encoder and the auxiliary return prediction task.

The Auxiliary Task

The agent is trained to predict the "truncated return"—the sum of rewards over a short future window—given an initial observation and a sequence of future actions.

Cross-Domain Consistency

Consistency is enforced by requiring the agent to make identical return predictions for both original and augmented images (e.g., images with randomized textures). This forces the encoder to ignore background noise and extract features relevant only to the task's reward structure.

Transformer-Based Predictor

Unlike traditional MLPs or RNNs, TRP utilizes a Transformer architecture. Transformers are better equipped to model the complex temporal relationships between the initial state and subsequent actions, and they are less susceptible to forgetting the initial observation that defines the starting state.

Key Insights and Ideas

The core innovation lies in shifting the focus from finding a single robust policy to maintaining consistency across the entire policy space.

Conceptual comparison between previous methods (policy shift) and the proposed approach (policy consistency).

By utilizing historical trajectories from a replay buffer, the agent learns that expected rewards should remain invariant to visual "style" changes, regardless of the specific policy being followed at the time. Furthermore, by enforcing value consistency, the method implicitly stabilizes the policy, as values and policies are fundamentally linked in RL.

Experimental Results

The TRP method was evaluated on the DeepMind Control Generalization Benchmark (DMControl-GB) and various robotic manipulation tasks.

  • State-of-the-Art Performance: TRP outperformed six major baselines, including SVEA and SODA, in the majority of DMControl environments.
  • Robotic Manipulation: In the complex PegBox task, TRP achieved a remarkable 253% to 275% improvement over competing methods in specific test scenarios.
  • Sample Efficiency: Beyond generalization, TRP demonstrated superior sample efficiency, reaching higher rewards with fewer environment interactions during the training phase.

Conclusion and Future Work

TRP provides a theoretically grounded approach to visual RL generalization by enforcing policy consistency through value prediction. While highly effective, its performance is currently tied to the diversity of the replay buffer. Future work may explore methods to further diversify simulated policies or extend this theoretical framework to gradient-based RL algorithms.

Summary updated

BibTeX
@inproceedings{wang2024what,
  author = {Shuo Wang and Zhihao Wu and Xiaobo Hu and Jinwen Wang and Youfang Lin and Kai Lv},
  title = {{What Effects the Generalization in Visual Reinforcement Learning: Policy Consistency with Truncated Return Prediction}},
  booktitle = {AAAI Conference on Artificial Intelligence},
  year = {2024},
  doi = {10.1609/aaai.v38i6.28369},
}
Figure