Event-driven temporal models for explanations - ETeMoX: explaining reinforcement learning

Juan Marcelo Parra-Ullauri, Antonio García‐Domínguez, Nelly Bencomo, Changgang Zheng, Zhen Chen, Juan Boubeta‐Puig, Guadalupe Ortiz, Shufan YangSoftware 2021

Abstract

Modern software systems are increasingly expected to show higher degrees of autonomy and self-management to cope with uncertain and diverse situations. As a consequence, autonomous systems can exhibit unexpected and surprising behaviours. This is exacerbated due to the ubiquity and complexity of Artificial Intelligence (AI)-based systems, particularly in Reinforcement Learning (RL). This paper presents ETeMoX, an architecture based on temporal models to keep track of the decision-making processes of RL systems. By integrating complex event processing (CEP), the architecture detects matches to event patterns that need to be stored, significantly reducing storage requirements while providing model-agnostic, real-time explanations.

Introduction: The Transparency Gap in RL

Reinforcement Learning (RL) agents are famously effective but notoriously opaque. As these "black box" systems move into critical autonomous software—managing everything from 5G networks to drone swarms—the need for transparency becomes critical. The underlying decision-making criteria may become opaque to users who require explanations about the system’s reasoning.

The core challenge in eXplainable Reinforcement Learning (XRL) is a three-way trade-off between detail, real-time performance, and generalizability. Most existing tools are either model-specific (working only for one algorithm) or post-hoc (analyzing results only after the fact).

Taxonomy of explainability methods, categorizing approaches by time of extraction and scope.

The ETeMoX Architecture

ETeMoX (Event-driven Temporal Models for eXplanations) aims to provide an online, model-agnostic approach for XRL. It monitors the standard RL loop—where an agent interacts with an environment via states, rewards, and actions—to maintain a history of the decision-making process.

The Reinforcement Learning framework monitored by ETeMoX, showing the interaction between the agent (policy and value function) and the environment.

The architecture is built on four pillars:

  • Translator: A decoupled component that converts raw execution traces from the RL agent into structured JSON, ensuring the system remains model-agnostic.
  • Filter (CEP Engine): Using the Esper engine, this component applies patterns to the live data stream. Instead of saving everything, it captures "situations of interest," such as when an agent chooses to explore a new path.
  • Temporal Model (TGDB): Filtered events are stored in a Temporal Graph Database. This allows for "time-travel" queries, where developers can inspect the state of the system at any specific point in the past.
  • Explainer: A query interface where developers use Epsilon Object Language (EOL) to extract insights, presented as visual analytics like plots and heatmaps.

Case Study: Mobile Communications

The researchers evaluated ETeMoX using a swarm of autonomous airborne base stations (drones) simulated to maximize 5G coverage for 1,050 users. To prove agnosticism, they tested the system against three distinct RL variants: Q-Learning, SARSA, and Deep Q-Network (DQN). The full history consisted of 40,000 model versions across multiple episodes and iterations.

Key Results and Insights

  • Massive Storage Savings: By sampling the history (e.g., every 10 steps), the database size dropped by 85-88% (from ~130 MB to ~15 MB), with negligible loss in explanation accuracy.
  • Query Speedup: Running a query on the full history took roughly 43 seconds, whereas the sampled history returned results in less than 0.1 seconds.
  • Behavioral Discovery: The system successfully identified rare events. For instance, in the Q-learning model, "exploration" steps occurred in only 1.41% of the timeline; ETeMoX pinpointed these moments precisely.
  • Causal Connectivity: Because the data is stored in a graph, the system shows relationships between metrics, such as how a drop in signal strength directly led to a specific movement decision.

Conclusion and Future Work

ETeMoX demonstrates that real-time, history-aware explanations are possible without drowning in data. While current configurations require manual setup of parsers and query patterns, future work aims to automate these components and translate technical graph queries into natural language for non-technical stakeholders, further enhancing the trustworthiness of autonomous AI systems.

Summary updated

Abstract

Abstract Modern software systems are increasingly expected to show higher degrees of autonomy and self-management to cope with uncertain and diverse situations. As a consequence, autonomous systems can exhibit unexpected and surprising behaviours. This is exacerbated due to the ubiquity and complexity of Artificial Intelligence (AI)-based systems. This is the case of Reinforcement Learning (RL), where autonomous agents learn through trial-and-error how to find good solutions to a problem. Thus, the underlying decision-making criteria may become opaque to users that interact with the system and who may require explanations about the system’s reasoning. Available work for eXplainable Reinforcement Learning (XRL) offers different trade-offs: e.g. for runtime explanations, the approaches are model-specific or can only analyse results after-the-fact. Different from these approaches, this paper aims to provide an online model-agnostic approach for XRL towards trustworthy and understandable AI. We present ETeMoX, an architecture based on temporal models to keep track of the decision-making processes of RL systems. In cases where the resources are limited (e.g. storage capacity or time to response), the architecture also integrates complex event processing, an event-driven approach, for detecting matches to event patterns that need to be stored, instead of keeping the entire history. The approach is applied to a mobile communications case study that uses RL for its decision-making. In order to test the generalisability of our approach, three variants of the underlying RL algorithms are used: Q-Learning, SARSA and DQN. The encouraging results show that using the proposed configurable architecture, RL developers are able to obtain explanations about the evolution of a metric, relationships between metrics, and were able to track situations of interest happening over time windows.
BibTeX
@inproceedings{parraullauri2021event,
  author = {Juan Marcelo Parra-Ullauri and Antonio García‐Domínguez and Nelly Bencomo and Changgang Zheng and Zhen Chen and Juan Boubeta‐Puig and Guadalupe Ortiz and Shufan Yang},
  title = {{Event-driven temporal models for explanations - ETeMoX: explaining reinforcement learning}},
  booktitle = {Software},
  year = {2021},
  doi = {10.1007/s10270-021-00952-4},
}
Figure