Temporal shift reinforcement learning

Deepak-George Thomas, Tichakorn Wongpiromsarn, Ali Jannesari

Abstract

Temporal Shift Reinforcement Learning (TSRL) is a zero-parameter technique designed to imbue Deep Reinforcement Learning (DRL) agents with temporal awareness directly from pixel inputs. By shifting a fraction of feature channels across the temporal dimension within a standard Convolutional Neural Network (CNN), TSRL enables agents to learn motion and timing without increasing computational overhead or parameter count. Evaluated on Atari benchmarks, TSRL consistently outperforms traditional frame-stacking heuristics and state-of-the-art latent flow methods.

Introduction

In image-based Reinforcement Learning (RL), agents must derive optimal policies from visual observations. While standard Convolutional Neural Networks (CNNs) excel at extracting spatial features (identifying where objects are), they often struggle to capture temporal dynamics (understanding how objects move). The conventional solution, frame stacking, concatenates the most recent frames into a single input tensor. However, this "early fusion" approach forces the network to learn complex temporal relationships from scratch. More advanced alternatives, such as 3D CNNs or optical flow estimation, are often too computationally intensive for the high-throughput requirements of real-time RL training.

Methodology: Temporal Shift Reinforcement Learning

The authors introduce Temporal Shift Reinforcement Learning (TSRL), adapting the Temporal Shift Module (TSM) from video classification for the RL domain. TSRL provides a "plug-and-play" architecture that enhances temporal awareness without adding extra parameters or significant latency.

The Shift Mechanism

The core of TSRL is a simple memory manipulation. For a given layer in the CNN, a specific fraction ($1/s$) of the feature channels is shifted forward by one timestep. Consequently, the feature map at time $t$ incorporates information inherited from time $t-1$.

The TSRL architecture shifts feature map channels across timesteps to provide temporal context without adding parameters.

Unlike the original TSM, which employs a "residual shift" (adding shifted features back to the original), TSRL utilizes an in-place shift. While this directly modifies the spatial data of the current frame, the authors demonstrate that the resulting temporal gains significantly outweigh the minor spatial distortion.

Integration and Architecture

TSRL is integrated into a Double DQN with Prioritized Experience Replay (DDQN-PER) framework. The implementation uses a shallow three-layer CNN—a standard choice for many RL tasks—demonstrating that the technique is effective even within constrained, non-ResNet architectures.

Experimental Setup

The algorithm was evaluated on the OpenAI Gym Atari benchmark suite, focusing on four games with distinct temporal requirements:

  • Freeway: Requires precise timing and rhythm.
  • Asterix: Involves complex multi-directional movement.
  • River Raid: Demands continuous navigation and shooting.
  • Pong: Features high-speed object tracking.
Sample environments from the Atari benchmark: (c) River Raid and (d) Pong.

Key Insights

  • Zero-Parameter Learning: TSRL requires no additional weights, making it highly efficient for hardware implementation.
  • Multi-Level Fusion: Unlike frame stacking at the input or latent flow at the output, TSRL can be applied at every CNN layer. This allows the agent to learn temporal features across multiple scales, from low-level motion edges to high-level trajectories.
  • Shift Ratio Trade-off: There is a critical balance between spatial and temporal learning. Shifting too many channels degrades spatial clarity, while shifting too few limits motion perception. Optimal performance was found at a shift ratio of 1/5 to 1/3, notably higher than the 1/8 typically used in video recognition.

Results and Discussion

TSRL demonstrated significant performance improvements over both the standard DDQN-PER baseline (using frame stacking) and the state-of-the-art (SOTA) "Flare" algorithm, which utilizes latent flow.

TSRL outperformed the baseline in all four environments and surpassed Flare in three (Freeway, River Raid, and Pong). For instance, in River Raid, TSRL achieved a sum of average rewards of 41,850.3, compared to the baseline's 34,849.2. In Pong, TSRL reached a score of 7,892.17, while Flare struggled to achieve a positive score in the same implementation.

Limitations and Future Work

Despite its success, TSRL faces some limitations. The optimal shift ratio is currently environment-dependent, requiring per-task tuning. Additionally, the in-place shift causes some spatial degradation; future iterations could explore "residual shifts" to preserve spatial integrity. Finally, expanding the evaluation to 3D environments like MuJoCo would further validate the technique's robustness for robotics.

Summary updated

BibTeX
@inproceedings{thomas2022temporal,
  author = {Deepak-George Thomas and Tichakorn Wongpiromsarn and Ali Jannesari},
  title = {{Temporal shift reinforcement learning}},
  booktitle = {EuroMLSys@EuroSys},
  year = {2022},
  doi = {10.1145/3517207.3526968},
}
Figure