Dynamic Inverse Reinforcement Learning for Characterizing Animal Behavior

Zoe Ashwood, Aditi Jha, Jonathan W. Pillow

In neuroscience and psychology, understanding how animals make decisions is a fundamental challenge. Inverse Reinforcement Learning (IRL) is a powerful tool for this; it observes an agent's behavior and works backward to infer its "reward function"—the underlying values driving its actions.

However, traditional IRL has a major flaw when applied to biology: it assumes the reward function is static. In reality, an animal’s internal state is constantly shifting. A mouse might start a maze session motivated by curiosity (an intrinsic reward) but end it motivated by thirst or a desire to return to its home nest (extrinsic or safety rewards). Existing models treat these shifting priorities as "noise" or sub-optimal behavior, failing to capture the true underlying logic of animal exploration.

To address this, researchers have developed Dynamic Inverse Reinforcement Learning (DIRL), a framework that moves beyond the assumption that an agent's goals are fixed. By modeling rewards as a time-varying combination of "goal maps," DIRL successfully captures how animal motivations evolve during complex navigation tasks.

The DIRL Framework

DIRL decomposes the reward function into two distinct components:

  1. Goal Maps ($u$): A small set of spatial maps representing potential objectives. For example, a "water map" might feature a high reward at a water spout, while a "home map" places the reward at the maze entrance.
  2. Time-Varying Weights ($\alpha$): Coefficients that determine how much each goal map influences behavior at any given moment.
DIRL framework illustrating goal maps and time-varying weights

To make this mathematically tractable, the authors use a low-rank representation, assuming only a few distinct goals exist. They also apply a Gaussian random walk prior, which forces the weights to change smoothly over time rather than erratically.

The inference procedure relies on coordinate ascent: it alternates between guessing the goal maps and guessing the weights until it finds the combination that best explains the observed animal trajectories. This is built on top of the Maximum Causal Entropy framework, which assumes animals choose actions that maximize future rewards while maintaining some level of randomness for exploration.

Datasets and Experimental Setup

The paper validates DIRL using three primary sources:

  • Simulated Gridworld: A $5 \times 5$ environment used to prove the algorithm can recover known, ground-truth shifting rewards.
  • Simulated Labyrinth: A complex 127-node maze to test the algorithm's scaling capabilities.
  • Real Mouse Behavioral Data: A dataset featuring two cohorts of mice (water-restricted and water-unrestricted) exploring a 127-node labyrinth for seven hours.
Example trajectories of water-restricted and unrestricted mice in a labyrinth

Key Insights and Results

By applying DIRL to these datasets, the researchers uncovered several critical insights that static models miss:

  • The "Explore" Map: For mice that weren't thirsty, the model discovered an "explore" goal map entirely unsupervised. This map rewarded states far from the home base, providing a concrete, mathematical description of "curiosity."
  • Satiation and Fatigue: In water-restricted mice, the model captured a clear behavioral transition. Early in the session, the "water" goal map dominated. As the mice drank and grew tired, the weight of the "water" map dropped, and the "home" map (representing rest) took over.
  • Beyond "Sub-optimality": Behavior that looks "random" or "dumb" to a static IRL model is often revealed by DIRL to be perfectly rational—it's just that the animal's goals changed mid-stream.

DIRL significantly outperformed standard static IRL and Deep MaxEnt IRL in predicting the movements of held-out mice. Furthermore, despite the complexity of the 127-node environment, the model is highly efficient, inferring reward functions from ~4,000 decisions in about 20 minutes on a standard laptop. Crucially, unlike "black-box" deep learning models, DIRL produces interpretable spatial maps that researchers can immediately recognize as specific physical locations like "the water port" or "the home base."

Limitations and Future Work

While DIRL represents a significant step forward, it has limitations. The framework currently requires a relatively large amount of data (over a hundred trajectories) to accurately infer the shifting weights. Additionally, the current version learns a reward for every single discrete state. While this works for a 127-node maze, it wouldn't scale to high-dimensional or continuous environments without being combined with deep neural networks. Finally, the model assumes animals follow a Boltzmann (softmax) policy; biological decision-making might involve more complex internal dynamics that this policy doesn't fully capture.

Summary updated

BibTeX
@inproceedings{ashwood2022dynamic,
  author = {Zoe Ashwood and Aditi Jha and Jonathan W. Pillow},
  title = {{Dynamic Inverse Reinforcement Learning for Characterizing Animal Behavior}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2022},
}
Figure