All models

Episodic Transformer Memory

An actor-critic PPO agent whose memory is a Transformer-XL encoder reading cached states through a sliding window.

Reinforcement learning and control · 121 operations Checked

100%

Showing the top corner; full diagram not loaded yetShowing a small copy; full diagram not loaded yetLarge diagram, not loaded yet

Open SVG

Loading diagram (8 KB)

Open in a new tab

Click or tap a spot to read it up close. Scroll or drag inside the diagram to move through it. Zoom with + and − or Ctrl and scroll. Press 0 for the whole graph. Swipe inside the diagram to move through it. Use + and − to zoom.

At a glance

Parameters
3.9M
Operations
121
Framework
PyTorch
Recurrent
No
Published
JMLR (arXiv 2023)
Cited by
0 (as of 28 October 2026)
Authors
Marco Pleines, Matthias Pallasch, Frank Zimmer, Mike Preuss
License
MIT
Checked
Passed: the trace was replayed operation by operation and matched the model's own output for this input.

Files

The diagram is a drawing of a TorchLens trace of the source code. It contains no code or weights.

Details
Stable ID
m16455
Graph hash
d2c65d57dd78958405392fc27d871be933103e74be9d4d2fe56488cbb7dabb4d
Skeleton hash
da57f22e81105d3c694326ac903ba660fa4e122ab7dc3b10e7748746ac04828b
Architecture hash
a451a83dcdad1d62b8d2af8c240b3d9f6f85c7bfeb656d97d5547df67968f50d
Diagram SHA-256
2a324397b39edf40116386faaab46c5088f8726d368c41d169dcfb8b1e3c7969
TorchLens version
2.36.0
Renderer
graphviz 2.43.0+pyvips 3.2.0+libvips 8.18.7+render-opts@06c1f0d3
Check
Forward pass replayed in PyTorch

What it is

This model is an actor-critic agent trained with Proximal Policy Optimization (PPO) that uses TransformerXL (TrXL) as its episodic memory. Its authors contributed it as a baseline because, they write, transformer-based deep reinforcement learning implementations were unavailable.

Visual observations of shape 84 × 84 × 3 are encoded by the Atari CNN, and a policy head and a value head read the output of the memory encoder. The transformer is adapted to a sequence-to-one model that keeps only the encoder. Instead of stacking raw frames, it attends over cached past outputs of the embedding module and of each preceding layer, which are stored in the agent's episodic memory. A sliding memory window of fixed length selects the input sequence, so that potentially endless episodes stay computable. Gradients are not back propagated through the episodic memory. The block uses pre layer normalization and the identity map reordering, and the gating mechanism of GTrXL is supported as an option.

In the Memory Gym experiments, the paper reports that TrXL was more effective than GRU on the finite environments only when an auxiliary loss to reconstruct observations was used. In all endless tasks, GRU consistently outperformed TrXL.

Key idea. The authors built a baseline that integrates Transformer-XL with Proximal Policy Optimization, using the transformer as episodic memory read through a sliding window.

  • TrXL-PPO
  • Episodic Transformer Memory
  • TransformerXL episodic memory
  • PPO with transformer memory
  • Memory Gym
  • memory-based reinforcement learning
  • partially observable environments
  • actor-critic

AI-written summary, based on the paper and checked automatically against it; not reviewed by a person. Corrections welcome.

Cite the paper

@misc{pleines2025memorygymendlesstasks,
      title={Memory Gym: Towards Endless Tasks to Benchmark Memory Capabilities of Agents}, 
      author={Marco Pleines and Matthias Pallasch and Frank Zimmer and Mike Preuss},
      year={2025},
      eprint={2309.17207},
      archivePrefix={arXiv},
      primaryClass={cs.LG},
      url={https://arxiv.org/abs/2309.17207}, 
}