Hindsight Value Function for Variance Reduction in Stochastic Dynamic Environment

Jiaming Guo, Rui Zhang, Xishan Zhang, Shaohui Peng, Qi Yi, Zidong Du, Xing Hu, Qi Guo, Yunji Chen

Abstract

Policy gradient methods in Reinforcement Learning (RL) are frequently hindered by high variance, particularly in stochastic dynamic environments where future random events can obscure the quality of an agent's actions. This paper proposes the Hindsight Value Function (HVF), which incorporates future trajectory information into the baseline to filter out environmental noise. By enforcing independence between hindsight information and the agent's actions through mutual information minimization, the HVF maintains an unbiased policy gradient while significantly reducing variance. We evaluate HVF on several stochastic tasks, demonstrating its superiority in stability and convergence over standard state value functions.

Introduction

In Reinforcement Learning, policy gradient methods like A2C or PPO optimize strategies by comparing observed rewards against a baseline, typically the state value function $V(s)$. However, in environments with significant stochasticity—such as a robotic arm operating in shifting winds—$V(s)$ cannot account for random perturbations occurring after an action is taken. This leads to high variance in gradient updates, as the agent may incorrectly attribute "bad luck" to its own policy. The authors address this by allowing the agent to "look back" at future outcomes to better evaluate past actions.

Methodology

The core innovation is the Hindsight Value Function ($v^h$), which leverages "hindsight vectors" ($h^+$) containing distilled information about future states and rewards.

HVF Architecture

As shown in Figure 1, the architecture uses a neural network $F_{\theta_f}$ to encode these vectors and an LSTM to process them backward through the trajectory. This allows the agent to aggregate the "distilled essence" of the future to evaluate an action taken in the past. To ensure the baseline remains unbiased, the authors utilize a dual information-theoretic constraint:

  1. Mutual Information (MI) Minimization: Forcing the hindsight vector to be independent of the agent's specific action so the baseline cannot "cheat."
  2. MI Maximization: Ensuring the hindsight vector contains maximum information about environmental transitions and rewards.

Experimental Evaluation

The method was tested on environments designed to test stochasticity, including GridTrack (a target-tracking task) and MuJoCo robotics simulations (a 3-DoF Target Tracker and a 7-DoF Thrower). These environments involve randomly moving targets or noisy reward signals that typically destabilize standard RL agents.

Key Results

The primary benefit of HVF is a substantial reduction in variance. In the GridTrack environment, the HVF achieved a significantly lower critic loss (mean square error) compared to the standard state value function (SVF), as illustrated in Figure 2.

Critic Loss Comparison

This reduction in noise translated directly to more robust learning. In complex tasks like the 7-DoF Thrower, HVF led to higher rewards and faster convergence than standard PPO or A2C, even when those methods were augmented with advanced techniques like Generalized Advantage Estimation (GAE). Furthermore, HVF proved robust in high-noise scenarios where standard algorithms failed to converge entirely, effectively "subtracting" the randomness of the environment to leave a clearer learning signal.

Conclusion

The Hindsight Value Function provides a mathematically sound and effective framework for variance reduction in stochastic environments. By allowing agents to learn from introspection of future outcomes without introducing bias, HVF enables more efficient training in unpredictable worlds. While it introduces additional computational overhead due to backward processing, it represents a significant step toward applying RL to complex, real-world dynamics.

Summary updated

BibTeX
@inproceedings{guo2021hindsight,
  author = {Jiaming Guo and Rui Zhang and Xishan Zhang and Shaohui Peng and Qi Yi and Zidong Du and Xing Hu and Qi Guo and Yunji Chen},
  title = {{Hindsight Value Function for Variance Reduction in Stochastic Dynamic Environment}},
  booktitle = {International Joint Conference on Artificial Intelligence},
  year = {2021},
  doi = {10.24963/ijcai.2021/341},
}
Figure