Projective simulation with generalization

Alexey A. Melnikov, Adi Makmal, Vedran Dunjko, Hans J. BriegelarXiv 2015 · arXiv

Abstract

This paper introduces an autonomous generalization mechanism for Projective Simulation (PS), a physically-motivated framework for reinforcement learning. By dynamically creating "wildcard clips" that represent abstract features, the agent can learn to navigate environments where it encounters unique stimuli at every single time step—a scenario where traditional tabular learning fails completely. We demonstrate that treating generalization as a structural evolution of memory provides a transparent and flexible alternative to traditional function approximation.

Introduction

In reinforcement learning (RL), an agent typically learns by associating specific states (percepts) with rewarding actions. However, real-world environments rarely present the exact same stimulus twice. If an agent treats every minor variation as a distinct state, it falls victim to the "curse of dimensionality," leading to a failure to learn or generalize.

While standard solutions often involve coupling RL algorithms with "black-box" function approximators like deep neural networks, we argue for a "homogeneous" approach. In this model, generalization capability is built directly into the agent’s internal memory structure. This maintains transparency and provides a clear path toward physical and quantum implementations of autonomous agents.

Methods: The Wildcard Mechanism

The core of our approach builds upon the Projective Simulation (PS) model, where an agent's memory is represented as a directed graph of "clips" (percepts and actions). Decision-making is modeled as a random walk through this network, starting from a triggered percept clip and ending at an action clip.

To enable generalization, we introduce the Wildcard Mechanism, which allows the network to evolve structurally:

  1. Dynamic Clip Creation: Upon encountering a new stimulus, the agent generates a new percept clip and compares its features to existing memory.
  2. Abstraction via Wildcards: If multiple percepts share a common feature (e.g., color or shape), the agent creates a "wildcard clip" (denoted by #) representing that abstract category. For instance, if the agent sees different green shapes, it may create a (#, green) clip.
  3. Layered Hierarchy: These wildcard clips form intermediate layers between raw percepts and actions. The random walk can then transition from a specific percept to an abstract category, and finally to an action.
  4. Flexible Learning: Using standard PS reward rules, the agent updates the transition weights ($h$-values) of the edges. If a specific abstraction (like "redness") consistently leads to rewards, the edges connected to that wildcard clip are strengthened.
Figure 2: The structural evolution of the memory network. As the agent encounters new stimuli, it dynamically creates intermediate wildcard clips (#) to represent abstract features, building a hierarchy that facilitates generalization.

Benchmarking Environments

We evaluated the generalization-capable PS agent in two primary synthetic scenarios:

  • The Driver Scenario: A multi-phase task requiring the agent to adapt to changing rules. For example, the agent might initially need to stop for red lights, but later must ignore color and follow arrow directions instead.
  • The Neverending-Color Scenario: A challenging task where the agent is presented with a unique background color at every time step. To succeed, the agent must learn to ignore the infinite variety of colors and focus on the relevant feature, such as an arrow's direction.

Key Results

In the "Neverending-Color" task, traditional tabular RL agents are limited to random guessing ($1/n$ success rate) because they never encounter the same state twice. In contrast, the PS agent with generalization achieves significantly higher success by converging on the relevant abstract features.

Our results in the multi-phase Driver Scenario demonstrate the agent's flexibility. As shown in the performance curves, the agent can "unlearn" outdated generalizations and adapt its internal structure to new environmental rules. When a rule change occurs (indicated by the sharp drops in reward), the agent's memory network reconfigures, allowing it to regain high performance through new abstractions.

Figure 3: Average reward over 4000 time steps in a multi-phase environment. The agent successfully adapts to rule changes at intervals (i-iv), demonstrating the flexibility of the structural generalization mechanism.

Discussion and Future Work

This structural approach to generalization offers several unique insights. First, we observe a "More is Better" paradox: having a larger set of potential (even irrelevant) categories can improve asymptotic performance by providing a richer pool of candidate abstractions. Second, because PS is based on stochastic random walks, it is naturally suited for quantization using quantum walks, potentially offering a quadratic speedup in deliberation time.

Future work will address the computational challenge of combinatorial explosion in wildcard clips. We are currently developing "clip-deletion" mechanisms to prune rarely used abstractions, ensuring the memory structure remains efficient. Additionally, we aim to extend this model to unstructured data, such as raw pixels, which may require a preprocessing step to factor percepts into discrete categories.

Summary updated

Abstract

The ability to generalize is an important feature of any intelligent agent. Not only because it may allow the agent to cope with large amounts of data, but also because in some environments, an agent with no generalization capabilities cannot learn. In this work we outline several criteria for generalization, and present a dynamic and autonomous machinery that enables projective simulation agents to meaningfully generalize. Projective simulation, a novel, physical approach to artificial intelligence, was recently shown to perform well in standard reinforcement learning problems, with applications in advanced robotics as well as quantum experiments. Both the basic projective simulation model and the presented generalization machinery are based on very simple principles. This allows us to provide a full analytical analysis of the agent's performance and to illustrate the benefit the agent gains by generalizing. Specifically, we show that already in basic (but extreme) environments, learning without generalization may be impossible, and demonstrate how the presented generalization machinery enables the projective simulation agent to learn.
BibTeX
@misc{melnikov2015projective,
  author = {Alexey A. Melnikov and Adi Makmal and Vedran Dunjko and Hans J. Briegel},
  title = {{Projective simulation with generalization}},
  year = {2015},
  eprint = {1504.02247},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1504.02247},
}
Figure