Controlled maximal variability along with reliable performance in recurrent neural networks

Chiara Mastrogiuseppe, Rubén Moreno-BoteNeurIPS 2024

In the world of artificial intelligence, "variability" is often a polite word for noise. When we train a recurrent neural network (RNN) to perform a task, we usually try to squash variability to ensure the output is as reliable and deterministic as possible. Yet, if you look at a professional athlete or a musician, their neural activity and movements are incredibly variable, even when performing "stereotyped" actions.

A new paper from researchers at Universitat Pompeu Fabra, titled "Controlled maximal variability along with reliable performance in recurrent neural networks," suggests we’ve been looking at this the wrong way. Instead of variability being a hindrance to performance, it might be a fundamental goal of the nervous system.

TL;DR

The authors introduce NeuroMOP, a framework that treats neural variability as a feature rather than a bug. By maximizing "future action-state entropy," a neural network can remain highly variable and exploratory while precisely switching to deterministic behavior only when necessary to avoid "dangerous" or terminal states.

What Problem Does This Paper Address?

There is a long-standing tension in neuroscience and AI: How can the brain be so noisy yet so precise?

Most current models assume that variability is something to be used during learning (for exploration) and then discarded. In Reinforcement Learning (RL), for instance, policies are often forced to be deterministic during task execution. However, biological systems maintain high variability even after extensive training.

The challenge is to find a principle that allows a network to be as variable as possible (to explore its full dynamical range) without compromising its ability to succeed at a task. The authors argue that the missing link is a formal objective for "maximal occupancy"—the idea that a system should try to visit as many states as possible while staying "alive."

Methods

The researchers developed NeuroMOP (Neural Maximum Occupancy Principle). Here’s how the "engine" works:

The NeuroMOP architecture, illustrating the interaction between the RNN environment and the forward-predicting controller.
  1. The Architecture: They use a controller (the "agent") that injects currents into a Recurrent Neural Network with fixed random weights (the "environment").
  2. The Objective: Instead of maximizing an external reward (like points in a game), the controller maximizes future action-state entropy. This is an intrinsic motivation: the agent gets a "reward" for choosing actions that are unpredictable, provided those actions don't lead to a dead end.
  3. Terminal States: The authors define "terminal states" as regions where no more entropy can be produced (e.g., the network "dies" or hits a limit). To maximize future entropy, the network must avoid these states.
  4. The Controller: The system uses a value function—approximated by a feedforward neural network—to estimate how much entropy it can produce in the future from its current state. It then samples actions from a Boltzmann distribution based on this value.

Datasets

Because this is a fundamental theoretical study, the authors used synthetic tasks and environments to test the principle:

  • Energy Constraints: The RNN must avoid high-activity states that exceed an energy threshold.
  • Neural Space Constraints: The network is tasked with "drawing" complex shapes (squares, circles, hearts) by confining the activity of specific neurons within boundaries.
  • Cartpole Balancing: A classic control benchmark where the system must balance a pole while maintaining variable movement.
  • Context-Dependent Tasks: A single network was trained to switch between six different boundary shapes based on a context signal.

Key Insights and Ideas

  • Entropy as Survival: The most striking insight is that you don't need an explicit "reward" to make a network perform a task. If you tell a network to maximize its future entropy, it naturally learns to avoid boundaries and dangerous states because entering a terminal state would drop its future entropy to zero.
  • Flexible Switching: NeuroMOP doesn't just stay random. When the network is far from a boundary, it is highly stochastic (random). As it approaches a "dangerous" terminal state, it automatically becomes more deterministic to steer itself back to safety.
  • Null Space Projection: The network learns to project its "noise" into a "null space"—dimensions of activity that don't trigger a failure. It’s like a tightrope walker who can wave their arms wildly to stay balanced, as long as their feet stay on the wire.
  • MOP vs. Standard RL: When compared to a standard reward-maximizing network (an "R network"), NeuroMOP was much better at filling the available "action space."
Activity trajectories of a standard reward-maximizing network (R net), demonstrating how standard RL leads to stereotyped, low-variability behavior.

Standard RL agents tended to become risk-averse and stereotyped, hugging one side of a boundary or repeating the same path, whereas NeuroMOP maintained a rich, exploratory dynamic.

Key Results

  • High Dimensionality: In the energy constraint task, NeuroMOP maintained an effective dimensionality near the maximum when safe, only dropping it slightly when near the threshold.
  • Shape Occupancy: In the "drawing" tasks, NeuroMOP successfully filled the entire interior of complex shapes like hearts and diamonds. The comparison R-network failed to occupy the space, often collapsing into a single repetitive line.
  • Robustness to Noise: The framework held up even when the RNN itself was "noisy" (stochastic dynamics), showing that the principle of maximizing future entropy is robust to internal fluctuations.

Limitations and Future Work

While NeuroMOP is a powerful theoretical framework, the authors acknowledge a few hurdles:

  • Computational Cost: The current implementation relies on an "oracle" to calculate the exact policy, which is computationally expensive for very high-dimensional action spaces.
  • Learning the Boundaries: In these experiments, the "terminal states" were predefined. In a real-world scenario, an agent would need to learn which states are "deadly" through experience.
  • Biological Realism: The model uses rate-based RNNs. The authors suggest that extending this to more realistic spiking neurons or Poisson-like variability is a vital next step for neuroscience applications.

By shifting the goal from "doing the task perfectly" to "staying as variable as possible while surviving," NeuroMOP provides a compelling new theory for why our brains are so noisy—and why that noise might actually be the key to our flexibility.

Summary updated

BibTeX
@inproceedings{mastrogiuseppe2024controlled,
  author = {Chiara Mastrogiuseppe and Rubén Moreno-Bote},
  title = {{Controlled maximal variability along with reliable performance in recurrent neural networks}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2024},
  url = {https://openreview.net/forum?id=yXW2dCTQdi},
}
Figure