Skip to main content
QUICK REVIEW

[Paper Review] Generalization, Mayhems and Limits in Recurrent Proximal Policy Optimization

Marco Pleines, Matthias Pallasch|arXiv (Cornell University)|May 23, 2022
Adversarial Robustness in Machine LearningComputer Science10 citations
TL;DR

This paper provides a detailed guide for correctly implementing recurrent Proximal Policy Optimization (PPO) with truncated backpropagation through time, emphasizing proper data handling, hidden state management, and loss masking. It introduces two novel environments—Mortar Mayhem and Searing Spotlights—that test memory beyond capacity and distraction, demonstrating strong generalization in Mortar Mayhem with increased training seeds, but failure on Searing Spotlights, highlighting inherent limitations of recurrent PPO under high-distractibility.

ABSTRACT

At first sight it may seem straightforward to use recurrent layers in Deep Reinforcement Learning algorithms to enable agents to make use of memory in the setting of partially observable environments. Starting from widely used Proximal Policy Optimization (PPO), we highlight vital details that one must get right when adding recurrence to achieve a correct and efficient implementation, namely: properly shaping the neural net's forward pass, arranging the training data, correspondingly selecting hidden states for sequence beginnings and masking paddings for loss computation. We further explore the limitations of recurrent PPO by benchmarking the contributed novel environments Mortar Mayhem and Searing Spotlights that challenge the agent's memory beyond solely capacity and distraction tasks. Remarkably, we can demonstrate a transition to strong generalization in Mortar Mayhem when scaling the number of training seeds, while the agent does not succeed on Searing Spotlights, which seems to be a tough challenge for memory-based agents.

Motivation & Objective

  • To address the critical yet under-documented engineering challenges in integrating recurrence into Proximal Policy Optimization (PPO) for partially observable environments.
  • To provide a fully documented, production-ready implementation of recurrent PPO with truncated BPTT for visual observation and discrete action spaces.
  • To introduce novel environments—Mortar Mayhem and Searing Spotlights—that test memory beyond capacity and distraction, enabling deeper evaluation of memory-based agents.
  • To investigate the limits of recurrent PPO in handling high-distractibility and long-horizon memory tasks, particularly under dynamic, noisy conditions.
  • To examine the impact of hidden state staleness and advantage normalization on training stability and performance in on-policy RL.

Proposed method

  • Employ truncated backpropagation through time (TBPTT) to efficiently train recurrent PPO with long sequences, enabling gradient flow over extended temporal contexts.
  • Structure the neural network forward pass to process sequences with proper hidden state initialization and recurrence across time steps.
  • Use sequence padding with masking during loss computation to prevent gradient updates on padded timesteps, ensuring training stability.
  • Sample hidden states at sequence beginnings using a consistent initialization strategy, avoiding gradient vanishing or data leakage.
  • Design custom environments—Mortar Mayhem and Searing Spotlights—where agents must maintain and update memory over long horizons, with tasks requiring both memory retention and dynamic memory updating.
  • Implement a baseline training pipeline with 5 random seeds per experiment and 10 novel seeds per evaluation, enabling robust generalization analysis.

Experimental results

Research questions

  • RQ1What are the critical implementation details required to correctly and efficiently integrate recurrence into Proximal Policy Optimization (PPO) with visual inputs and discrete actions?
  • RQ2How does scaling the number of training seeds affect generalization performance in memory-intensive environments like Mortar Mayhem?
  • RQ3To what extent can recurrent PPO generalize to novel, unseen environments when trained on diverse seeds, particularly in comparison to existing benchmarks like the ballet environment?
  • RQ4What are the inherent limitations of recurrent PPO when faced with high-distractibility tasks, such as those in the Searing Spotlights environment?
  • RQ5Does refreshing stale hidden states and advantages improve training stability or performance in recurrent PPO, especially in on-policy settings?

Key findings

  • Strong generalization in Mortar Mayhem emerges when scaling the number of training seeds, indicating that diverse experience improves zero-shot generalization to novel seeds.
  • The agent fails to solve Searing Spotlights even in simplified versions, suggesting that randomly moving spotlights create a noise regime too challenging for standard recurrent PPO.
  • Refreshing stale hidden states and advantages did not yield performance improvements, indicating no benefit from this computational overhead in the tested setup.
  • The baseline implementation with proper masking, sequence handling, and TBPTT achieves stable training and correct behavior, validating the engineering pipeline.
  • The ballet environment shows high performance on training seeds but worse-than-chance performance on novel seeds, indicating weak generalization, in contrast to Mortar Mayhem.
  • The results suggest that transformer-based episodic memory, such as Hierarchical Chunk Attention Memory, may be necessary to overcome the limitations of recurrent PPO in highly distracting environments.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.