A Study of State Aliasing in Structured Prediction with RNNs

Layla El Asri, Adam Trischler

Introduction

Recurrent Neural Networks (RNNs) trained with policy gradient methods often encounter a critical failure mode known as state aliasing. This occurs when the network maps distinct environmental situations to the identical internal representation simply because those situations share the same optimal action. This paper demonstrates that while value-based methods like Deep Q-Networks (DQN) are naturally resistant to this problem, policy gradient agents require specific regularization—such as entropy-based exploration—to avoid representational collapse.

The Challenge of State Aliasing

In fields like Natural Language Generation (NLG) and dialogue systems, researchers frequently use Reinforcement Learning (RL) to fine-tune RNNs. A common issue in these systems is a failure to learn complex, multi-step strategies, often resulting in repetitive outputs.

The authors investigate state aliasing as a root cause. When a model conflates two or more distinct states in its hidden representation space, it loses the ability to distinguish between them. Consequently, it cannot learn an optimal policy that might eventually require different behaviors in those situations. The core question is: Why do RNNs struggle with this when trained via policy gradients, and how can we fix it?

Experimental Setup and Environments

To diagnose the problem, the authors compared two major classes of RL algorithms across LSTM and GRU architectures:

  1. Policy Gradient (REINFORCE): These methods directly optimize the probability of taking an action.
  2. Value-Based (DQN): These methods estimate the expected reward (value) of state-action pairs.

The study utilizes three progressively complex environments, starting with McCallum’s Simple Maze, a classic 3-state Markov Decision Process (MDP) specifically designed to trigger aliasing.

McCallum's Simple Maze

The environments scale up to a Structured Prediction Maze (mimicking language tasks) and TextWorld, a complex text-based game framework where agents must perform different actions based on game history. Throughout training, the authors monitored the Euclidean distance between the RNN's hidden states. A drop to near zero for two different states indicates that aliasing has occurred.

Key Insights

  • The "Output-Driven" Trap: Policy gradient methods are inherently "output-driven." If the target output (the optimal action) is identical for State A and State B, backpropagation naturally pulls their internal representations together.
  • DQN as a Solution: Value-based methods are "reward-driven." Even if the optimal action is the same for two states, their expected future rewards usually differ. To accurately predict these distinct values, the network is forced to maintain separate state representations.
  • RNN-Specific Vulnerability: Simpler models like MLPs or Logistic Regression did not suffer from state aliasing in these tests, suggesting the problem is uniquely linked to how RNNs build representations over time.
  • The Role of Entropy: Adding an entropy penalty rewards the agent for keeping its action distribution diverse. This prevents the model from becoming over-confident too early, keeping hidden states from collapsing before the agent explores the different consequences of its actions.

Results and Representational Collapse

The impact of state aliasing is stark. In the simple maze, LSTMs trained with basic REINFORCE failed to find the optimal policy 28% of the time. When switched to DQN, the failure rate dropped to just 4%.

Visualizing the distance between hidden states reveals the mechanics of this failure. In failed runs, the distance between distinct states plummets to zero almost immediately, leading to a zero probability of taking the optimal action. In successful runs, the agent manages to maintain or recover distance between hidden states, allowing it to learn the optimal policy.

Distance between hidden states and probability of optimal action for failed (top) and successful (bottom) runs

This pattern held in the complex TextWorld environment. An agent using both entropy exploration and a baseline achieved a mean score of 10.16 (with only 3 failures). Removing entropy exploration caused the failure rate to skyrocket to 45 out of 50 runs, with the agent consistently aliasing distinct stages of the quest.

Conclusion and Future Work

The authors highlight a curious phenomenon: even after an agent successfully learns the optimal policy, it sometimes begins to alias the states after the fact because it no longer visits the "wrong" paths. The implications of this "post-learning aliasing" for long-term stability remain an open question for future research. Ultimately, the paper recommends that researchers training RNN-based agents move away from standard policy gradients in favor of value-based or heavily regularized methods.

Summary updated

Abstract

End-to-end reinforcement learning agents learn a state representation and a policy at the same time. Recurrent neural networks (RNNs) have been trained successfully as reinforcement learning agents...
BibTeX
@inproceedings{asri2019study,
  author = {Layla El Asri and Adam Trischler},
  title = {{A Study of State Aliasing in Structured Prediction with RNNs}},
  booktitle = {DeepRLStructPred @ ICLR},
  year = {2019},
  url = {https://openreview.net/forum?id=Ye9FydFzC3U},
}
Figure