NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Investigating Action Encodings in Recurrent Neural Networks in Reinforcement Learning

Matthew Kyle Schlegel, Volodymyr Tkachuk, Adam M White, Martha White

In the world of Reinforcement Learning (RL), building a "state"—a internal representation of the world based on past observations—is the difference between an agent that wanders aimlessly and one that masters complex tasks. While Recurrent Neural Networks (RNNs) are the go-to tool for this, a surprisingly fundamental question has remained under-explored: How exactly should we feed an agent's previous actions back into its "brain"?

A new paper from the University of Alberta, published in TMLR, dives deep into this architectural choice, revealing that the standard way we do things might be holding our agents back.

TL;DR

This paper investigates how action information should be incorporated into RNN-based RL agents. The authors demonstrate that multiplicative (second-order) action encodings significantly outperform standard additive encodings (concatenation) by allowing actions to directly transform the state transition logic, leading to better performance in partially observable environments.

What Problem Does This Paper Address?

Most RL agents operating in the real world face partial observability—they can’t see the whole state of the world at once (think of a robot with a camera that can't see behind itself). To solve this, agents use RNNs to build a "hidden state" that summarizes the history of observations and actions.

Standard practice is to simply concatenate the previous action to the current observation and shove it into the RNN. This is an additive approach. However, the authors argue that actions aren't just "more data"; they are the primary drivers of state transitions. If you turn left, the "rules" for how your next observation relates to your last one change entirely. The paper asks: Is there a better mathematical way to represent this relationship?

Methods

The authors compare two broad categories of architectural designs:

  1. Additive Encodings: The standard approach where the action is concatenated to the observation. They also test a Deep Additive version that processes the action through several layers first.
  2. Multiplicative Encodings: Inspired by "second-order RNNs," this method uses the action to effectively "select" or "weight" the transition matrix of the RNN. Mathematically, this involves a tensor product where the action acts as a gate for the state update.
  3. Factored Multiplicative: Since full multiplicative tensors have a massive number of parameters, the authors evaluate a low-rank approximation (Factored) version that provides the benefits of multiplicative interaction with a much smaller memory footprint.

The study evaluates these across two popular RNN cells: the simple RNN and the Gated Recurrent Unit (GRU).

Datasets

The authors used a series of illustrative environments designed to test specific aspects of memory and action-contingent transitions:

  • Ring World: A simple cycle of states where the agent must count steps from a landmark.
  • TMaze & Directional TMaze: Classic memory tasks where an agent sees a cue at the start and must remember it to make a choice at a distant T-junction. The "Directional" version adds orientation, making the meaning of observations highly dependent on previous rotation actions.
  • Image Directional TMaze: A version of the above using MNIST-style image observations to test if these insights scale to high-dimensional inputs.
  • Lunar Lander (OpenAI Gym): A more complex, continuous-state control task.

Key Insights and Ideas

  • Actions as Transformers, not Features: The "aha moment" is that multiplicative updates allow the action to change the dynamics of the state update. In additive models, the action is just another feature the network has to learn to ignore or use; in multiplicative models, the action dictates how the state evolves.
  • Robustness to Truncation: Multiplicative models are much more resilient to short "Truncated Backpropagation Through Time" (BPTT). They can learn long-term dependencies even when the gradient is only flowing back a few steps, likely because the architecture itself enforces a clearer relationship between actions and state changes.
  • The "Action-Focus" Trap: Through TSNE visualizations, the authors found that additive agents often become "hyper-focused" on the action itself, failing to cluster internal states based on the actual environment. Multiplicative agents, conversely, successfully grouped states by their environmental meaning while keeping action-histories distinct.

Key Results

  • Directional TMaze Dominance: In the Directional TMaze, where orientation is key, multiplicative variants (MARNN/MAGRU) reached near 100% success, while additive models struggled to break 60-70% even with extensive hyperparameter tuning.
  • Parameter Efficiency: The Factored Multiplicative models performed nearly as well as the full versions but with significantly fewer parameters, proving this isn't just a "bigger model wins" scenario.
  • Lunar Lander: Multiplicative agents learned faster and achieved higher total rewards compared to standard GRUs, suggesting these benefits translate to more "standard" RL benchmarks.

Limitations and Future Work

  • The Online Gap: While multiplicative models shine when using Experience Replay, the performance gap narrows (though MARNN remains strong) in purely online, incremental settings. The authors note that initialization and learning rates become much more volatile here.
  • Action Space Scaling: The current multiplicative approach works best for discrete actions. Scaling this to high-dimensional continuous action spaces (like humanoid robotics) would require more complex tensor factorization or embedding strategies.
  • Learned Encodings: The authors briefly explored "learning" the best encoding via a gating mechanism (Softmax combined cells), but found that simply using the multiplicative architecture was usually superior to trying to learn when to use it.

Check out the full paper for the detailed tensor math and TSNE plots: Investigating Action Encodings in Recurrent Neural Networks in Reinforcement Learning

Summary updated

BibTeX
@article{schlegel2022investigating,
  author = {Matthew Kyle Schlegel and Volodymyr Tkachuk and Adam M White and Martha White},
  title = {{Investigating Action Encodings in Recurrent Neural Networks in Reinforcement Learning}},
  journal = {Accepted by TMLR},
  year = {2022},
  url = {https://openreview.net/forum?id=K6g4MbAC1r},
}

Loading related content...

Figure