Skip to main content
QUICK REVIEW

[Paper Review] Deep Transformer Q-Networks for Partially Observable Reinforcement Learning

Kevin Esslinger, Robert Platt|arXiv (Cornell University)|Jun 2, 2022
Neural Networks and Reservoir ComputingComputer Science14 citations
TL;DR

This paper introduces Deep Transformer Q-Networks (DTQN), a novel reinforcement learning architecture that uses self-attention mechanisms in a transformer decoder to model an agent's history in partially observable environments. By training on intermediate Q-values across the entire observation history, DTQN achieves faster and more stable learning than recurrent baselines, outperforming them in success rate and generalization across multiple POMDP benchmarks.

ABSTRACT

Real-world reinforcement learning tasks often involve some form of partial observability where the observations only give a partial or noisy view of the true state of the world. Such tasks typically require some form of memory, where the agent has access to multiple past observations, in order to perform well. One popular way to incorporate memory is by using a recurrent neural network to access the agent's history. However, recurrent neural networks in reinforcement learning are often fragile and difficult to train, susceptible to catastrophic forgetting and sometimes fail completely as a result. In this work, we propose Deep Transformer Q-Networks (DTQN), a novel architecture utilizing transformers and self-attention to encode an agent's history. DTQN is designed modularly, and we compare results against several modifications to our base model. Our experiments demonstrate the transformer can solve partially observable tasks faster and more stably than previous recurrent approaches.

Motivation & Objective

  • To address the challenge of partial observability in reinforcement learning, where agents lack full state information due to noisy or incomplete observations.
  • To overcome the training instability and fragility commonly associated with recurrent neural networks (RNNs) like LSTMs and GRUs in partially observable domains.
  • To explore whether transformers, known for superior sequence modeling in NLP, can effectively encode agent history and improve learning in POMDPs.
  • To design a modular, interpretable, and robust architecture that outperforms existing RNN-based approaches in partially observable environments.
  • To provide a reusable, extensible codebase for future research on transformer-based RL in partially observable settings.

Proposed method

  • DTQN employs a transformer decoder with learned positional encodings to process the agent’s history of observations and actions, enabling long-range dependency modeling.
  • The model uses causal masking to ensure autoregressive generation, preventing future observation leakage during inference.
  • A novel training regime called intermediate Q-value prediction trains the network on Q-values generated at every timestep in the history, not just the final step.
  • The architecture incorporates gated skip connections and identity map reordering to improve training stability and gradient flow.
  • Positional encodings are learned end-to-end rather than fixed (e.g., sinusoidal), allowing the model to adapt to environment-specific temporal dynamics.
  • During inference, only the final timestep’s Q-values are used to select actions, while training leverages all intermediate predictions for stronger supervision.

Experimental results

Research questions

  • RQ1Can a transformer-based architecture outperform RNN-based methods in learning partially observable reinforcement learning tasks?
  • RQ2Does intermediate Q-value prediction improve training stability and final performance compared to standard single-step prediction?
  • RQ3How do different positional encoding strategies—learned, sinusoidal, or none—affect performance in POMDP environments?
  • RQ4Can self-attention mechanisms in DTQN learn to attend to semantically relevant past observations, as evidenced by attention visualization?
  • RQ5Does the modular design of DTQN allow for effective ablation and comparison of architectural components?

Key findings

  • DTQN achieved a 75.2% success rate on the GridVerse memory 7x7 environment, outperforming the baseline RNN approach and all ablated variants.
  • In the memory cards domain, DTQN reached 89.8% success rate, significantly outperforming the variant without intermediate Q-value prediction (9.0% success rate).
  • The variant without positional encodings performed poorly in memory cards (70.8%) and was outperformed by learned and sinusoidal encodings, indicating positional encoding is crucial for performance.
  • The model with intermediate Q-value prediction achieved an average success rate of 87.77%, compared to 52.69% without it, demonstrating the training regime’s critical role in performance.
  • Attention visualization in GridVerse showed strong attention to the green beacon observation, confirming the model learned to attend to task-critical information.
  • DTQN’s performance was competitive or superior across all evaluated environments, including Hallway and GridVerse, with consistent improvements in learning speed and stability.

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.