A dynamical systems approach to optimal foraging

Siddharth Chaturvedi, Ahmed M. El‐Gazzar, Marcel van Gerven

Abstract

Foraging for resources in an environment is a fundamental activity that must be addressed by any biological agent. Modelling this phenomenon in simulations can enhance our understanding of the characteristics of natural intelligence. In this work, we present a novel approach to model foraging in-silico using a continuous coupled dynamical system. The dynamical system is composed of three differential equations, representing the position of the agent, the agent’s control policy, and the environmental resource dynamics. Crucially, the control policy is implemented as a parameterized differential equation which allows the control policy to adapt in order to solve the foraging task. Using this setup, we show that when these dynamics are coupled and the controller parameters are optimized to maximize the rate of reward collected, adaptive foraging emerges in the agent. We further show that the internal dynamics of the controller, as a surrogate brain model, closely resemble the dynamics of the evidence accumulation mechanism, which may be used by certain neurons of the dorsal anterior cingulate cortex region in non-human primates, for deciding when to migrate from one patch to another. We show that by modulating the resource growth rates of the environment, the emergent behaviour of the artificial agent agrees with the predictions of the optimal foraging theory. Finally, we demonstrate how the framework can be extended to stochastic and multi-agent settings.

Introduction

Foraging—the act of searching for and consuming resources—is one of the most fundamental challenges any biological organism faces. In ecology, the Marginal Value Theorem (MVT) provides a mathematical "gold standard" for when an animal should quit its current resource patch and move to the next: it should leave when the instantaneous rate of return drops below the average rate of the entire environment.

While we have elegant theories like MVT and various Reinforcement Learning (RL) models, there is a gap in understanding how these behaviors emerge from the continuous, real-time interaction between a brain and its world. Traditional models often rely on discrete time steps or fixed decision rules. This research explores whether a minimal, "first-principles" model can be built where foraging behavior emerges purely from the physics of a coupled dynamical system.

Methods

The researchers modeled the entire agent-environment loop using three coupled ordinary differential equations (ODEs):

  1. The Body (Position Model): A "double-integrator" particle moving on a 2D torus (a donut-shaped map to avoid edge effects).
  2. The Environment (Resource Model): Based on Lotka-Volterra equations, where resources in specific patches grow and decay over time, and are depleted when the agent is nearby.
  3. The Brain (Control Model): The controller is a Neural Differential Equation (NDE)—specifically a modern interpretation of the Wilson-Cowan model. It is a continuous-time recurrent neural network (CTRNN) where the "synaptic weights" are learnable parameters.
The agent-environment setup, showing the mapping from a 3D torus to a flattened 2D coordinate system.

Instead of traditional RL, the authors used Truncated Backpropagation-Through-Time (t-BPTT) and automatic differentiation to optimize the brain's parameters. The goal was to maximize resource consumption while minimizing the energy spent on movement. The authors created a synthetic toroidal environment with two resource patches, modulating the "growth rate" (0.8, 1.0, and 1.2) to test how the agent’s strategy shifted under different ecological pressures.

Key Insights and Results

  • Emergent Foraging: The agent naturally learned to oscillate between patches, depleting one just enough before moving to the next to allow the first to regenerate, without being explicitly programmed to migrate.
  • Evidence Accumulation: A striking finding is that the artificial neurons in the NDE brain began to function as "evidence accumulators." In neuroscience, this is a process where a decision variable "ramps up" until it hits a threshold, triggering an action. The agent’s internal states closely resembled the firing patterns of neurons in the dorsal anterior cingulate cortex (dACC) of primates.
  • Alignment with Ecology: The model's behavior matched the predictions of Optimal Foraging Theory. When the environment was "poor" (low resource growth), the agent stayed in patches longer—a phenomenon known as "overstaying" observed in nature. For example, at a growth rate of 0.8, the agent stayed for an average of 143 time-steps, whereas at 1.2, it stayed for only 101.4 time-steps.
  • Neural Ramping: Specific neurons showed clear ramping activity. When the "slope" of this ramping was steeper, the agent left the patch sooner, providing a direct link between internal dynamics and external behavior.

Limitations and Future Work

While the model is an elegant proof-of-concept, it is intentionally minimal. The current setup assumes the agent has perfect, noise-free information about its position and the resources, whereas real-world foraging involves sensory noise and uncertainty. Additionally, the study focuses on a single agent, while animals often compete for resources.

Future directions include extending the framework to include Stochastic Differential Equations (SDEs) to model noise and exploring multi-agent "evolutionary" pressures where the differential equations themselves evolve over time. By treating the brain and the world as a single mathematical object, this research provides a powerful tool for both AI researchers and neuroscientists seeking to explain the mechanics of decision-making.

Summary updated

BibTeX
@inproceedings{chaturvedi2024dynamical,
  author = {Siddharth Chaturvedi and Ahmed M. El‐Gazzar and Marcel van Gerven},
  title = {{A dynamical systems approach to optimal foraging}},
  booktitle = {PLOS},
  year = {2024},
  doi = {10.1371/journal.pcsy.0000018},
}
Figure