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).
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 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