Scenario-Guided Temporal Prototypes in Reinforcement Learning
Abstract
1. Introduction
- Global layer (scenarios): SBX discovers a small number of recurring scenarios that describe how the system typically behaves over longer time spans.
- Local layer (temporal prototypes): within this structure, temporal prototypes explain individual actions based on short recent histories: “this window looks like prototype #3, so we reduce consumption at these nodes”.
- In CarRacing, a continuous-control domain with high-dimensional pixel-based observations, we show that temporal prototypes can preserve task fidelity while providing intuitive examples (e.g. turning right/turning left),
- In a real-world voltage-control problem for power networks, we demonstrate how temporal prototypes reveal different operating regimes and local control patterns.
- We introduce a framework that combines SBX for scenario discovery with temporal prototypes for exemplar-based explanations of DRL policies.
- We provide a set of evaluation metrics that assess fidelity (task reward and action-level discrepancy) and prototype locality (nearest-neighbor coherence in an encoder embedding space).
- We empirically validate the approach in continuous control and power-network voltage control, showing that it provides logical global structure and local explanations.
2. Related Work
3. Deep Reinforcement Learning Background
4. SBX
4.1. Embedding and Clustering
4.2. Human-Facing Summaries
5. Prototypes
5.1. Markov Setting and Notation
5.2. Prototype-Wrapper Architecture
5.3. Training Objective
6. Scenario-Guided Temporal Prototypes (SGTP)
6.1. Data Preparation and Latent Extraction
6.2. Temporal Prototype Policy
6.3. SBX Prototype Selection
6.4. Inference and Explanations
- Scenario-level explanations (global): SBX-obtained medoids summarize typical behaviors.
- Temporal prototype-level explanations (local): per-prototype nearest trajectories illustrate characteristic action trajectories.
7. Experiments
7.1. Experimental Process
- Task fidelity: task reward on held-out episodes; action-level discrepancy (mean-squared error for continuous actions or accuracy for discrete actions) between the prototype policy and ,
- Scenario quality: clustering quality and per-scenario support; qualitative inspection of scenario summaries (mean ± std of state/action trajectories),
- Prototype locality: average embedding-space distance between prototypes and their top-N nearest trajectories; visual nearest-neighbor aggregates to assess exemplar quality.
7.2. CarRacing
7.3. Power Network Voltage Control
8. Discussion
- Temporal prototype policies can approximate a strong black-box policy while exposing which prototypical patterns influence each decision.
- SBX-derived scenarios reveal a compact global structure of behavior (e.g., straight vs. cornering segments; distinct daily regimes in the power grid), which helps domain experts reason about the policy at a higher level.
- Prototype neighborhoods in latent space provide a systematic way to check whether the explanations are grounded in frequently occurring behaviors rather than isolated examples.
9. Conclusions
Author Contributions
Funding
Data Availability Statement
Acknowledgments
Conflicts of Interest
References
- Alharin, A.; Doan, T.N.; Sartipi, M. Reinforcement Learning Interpretation Methods: A Survey. IEEE Access 2020, 8, 171058–171077. [Google Scholar] [CrossRef]
- Li, H.; Sahrani, S.; Sarker, M.R.; Xiao, Y. State-of-the-Art on IoV-Based Deep Learning Framework for Enhanced Driving Behavior Recognition: Recent Progress, Technology Updates, Challenges, and Future Direction. IEEE Access 2025, 13, 135969–135989. [Google Scholar] [CrossRef]
- Dobravec, B.; Žabkar, J. Explaining Voltage Control Decisions: A Scenario-Based Approach in Deep Reinforcement Learning. In Foundations of Intelligent Systems; Springer: Cham, Switzerland, 2024; pp. 216–230. [Google Scholar]
- Kenny, E.M.; Tucker, M.; Shah, J.A. Towards Interpretable Deep Reinforcement Learning with Human-Friendly Prototypes. In Proceedings of the ICLR, Kigali, Rwanda, 1–5 May 2023. [Google Scholar]
- Milani, S.; Topin, N.; Veloso, M.; Fang, F. Explainable Reinforcement Learning: A Survey and Comparative Review. ACM Comput. Surv. 2024, 56, 1–36. [Google Scholar] [CrossRef]
- Puiutta, E.; Veith, E.M.S.P. Explainable Reinforcement Learning: A Survey. arXiv 2020, arXiv:2005.06247. [Google Scholar] [CrossRef]
- Simonyan, K.; Vedaldi, A.; Zisserman, A. Deep Inside Convolutional Networks: Visualising Image Classification Models and Saliency Maps. arXiv 2013, arXiv:1312.6034. [Google Scholar]
- Sequeira, P.; Gervasio, M.T. Interestingness Elements for Explainable Reinforcement Learning: Understanding Agents’ Capabilities and Limitations. Artif. Intell. 2019, 288, 103367. [Google Scholar] [CrossRef]
- Guo, W.; Wu, X.; Khan, U.; Xing, X. EDGE: Explaining Deep Reinforcement Learning Policies. In Advances in Neural Information Processing Systems; Ranzato, M., Beygelzimer, A., Dauphin, Y., Liang, P., Vaughan, J.W., Eds.; Curran Associates, Inc.: New York, NY, USA, 2021; Volume 34, pp. 12222–12236. [Google Scholar]
- Madumal, P.; Miller, T.; Sonenberg, L.; Vetere, F. Explainable Reinforcement Learning through a Causal Lens. In Proceedings of the AAAI Conference on Artificial Intelligence (AAAI), New York, NY, USA, 7–12 February 2020; pp. 2493–2500. [Google Scholar]
- Greydanus, S.; Koul, A.; Dodge, J.; Fern, A. Visualizing and Understanding Atari Agents. In Proceedings of the 35th International Conference on Machine Learning (ICML), Stockholm, Sweden, 10–15 July 2018; pp. 1787–1796. [Google Scholar]
- Chen, C.; Li, O.; Tao, C.; Barnett, A.; Rudin, C.; Su, J. This Looks Like That: Deep Learning for Interpretable Image Recognition. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), Long Beach, CA, USA, 15–20 June 2019; pp. 8930–8939. [Google Scholar]
- Nauta, M.; van Bree, S.; Seifert, C. Neural Prototype Trees for Interpretable Fine-Grained Image Recognition. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), Nashville, TN, USA, 20–25 June 2021; pp. 14933–14943. [Google Scholar]
- Yarats, D.; Fergus, R.; Lazaric, A.; Pinto, L. Reinforcement Learning with Prototypical Representations. In 38th International Conference on Machine Learning, Proceedings of Machine Learning Research, Virtual, 18–24 July 2021; PMLR: Cambridge MA, USA, 2021. [Google Scholar]
- Wang, J.; Zhang, Q.; Mu, Y.; Li, D.; Zhao, D.; Zhuang, Y.; Luo, P.; Wang, B.; Hao, J. Prototypical Context-Aware Dynamics for Generalization in Visual Control With Model-Based Reinforcement Learning. IEEE Trans. Ind. Inform. 2024, 20, 10717–10727. [Google Scholar] [CrossRef]
- Kim, B.; Wattenberg, M.; Gilmer, J.; Cai, C.; Wexler, J.; Viegas, F.; Sayres, R. Interpretability Beyond Feature Attribution: Quantitative Testing with Concept Activation Vectors (TCAV). In Proceedings of the 35th International Conference on Machine Learning (ICML), Stockholm, Sweden, 10–15 July 2018; pp. 2673–2682. [Google Scholar]
- Ghorbani, A.; Wexler, J.; Zou, J.; Kim, B. Towards Automatic Concept-Based Explanations. In Proceedings of the Advances in Neural Information Processing Systems (NeurIPS), Vancouver, BC, Canada, 8–14 December 2019; pp. 9273–9282. [Google Scholar]
- Ragodos, R.; Wang, T.; Lin, Q.; Zhou, X. ProtoX: Explaining a Reinforcement Learning Agent via Prototyping. In Advances in Neural Information Processing Systems; Koyejo, S., Mohamed, S., Agarwal, A., Belgrave, D., Cho, K., Oh, A., Eds.; Curran Associates, Inc.: New York, NY, USA, 2022; Volume 35, pp. 27239–27252. [Google Scholar]
- Christiano, P.F.; Leike, J.; Brown, T.; Martic, M.; Legg, S.; Amodei, D. Deep Reinforcement Learning from Human Preferences. In Advances in Neural Information Processing Systems; Guyon, I., Luxburg, U.V., Bengio, S., Wallach, H., Fergus, R., Vishwanathan, S., Garnett, R., Eds.; Curran Associates, Inc.: New York, NY, USA, 2017; Volume 30. [Google Scholar]
- Zhang, K.; Xu, P.; Zhang, J. Explainable AI in Deep Reinforcement Learning Models: A SHAP Method Applied in Power System Emergency Control. In Proceedings of the 2020 IEEE 4th Conference on Energy Internet and Energy System Integration (EI2), Wuhan, China, 30 October–1 November 2020; pp. 711–716. [Google Scholar] [CrossRef]
- Zhang, K.; Zhang, J.; Xu, P.D.; Gao, T.; Gao, D.W. Explainable AI in Deep Reinforcement Learning Models for Power System Emergency Control. IEEE Trans. Comput. Soc. Syst. 2022, 9, 419–427. [Google Scholar] [CrossRef]
- Schulman, J.; Wolski, F.; Dhariwal, P.; Radford, A.; Klimov, O. Proximal Policy Optimization Algorithms. arXiv 2017, arXiv:1707.06347. [Google Scholar] [CrossRef]
- SIST EN 50160; Voltage Characteristics of Electricity Supplied by Public Distribution Networks. iTeh Standard: San Francisco, CA, USA, 2007.
- Wang, J.; Xu, W.; Gu, Y.; Song, W.; Green, T.C. Multi-Agent Reinforcement Learning for Active Voltage Control on Power Distribution Networks. IEEE Trans. Power Syst. 2021, 34, 3271–3284. [Google Scholar] [CrossRef]
- Tehrani, K. A smart cyber physical multi-source energy system for an electric vehicle prototype. J. Syst. Archit. 2020, 111, 101804. [Google Scholar] [CrossRef]





| Policy | Mean | Std | Median | Min | Max | Rel to Base (%) |
|---|---|---|---|---|---|---|
| Base Policy | 100.0 | |||||
| PW-Net Policy | 99.0 | |||||
| SGTP | 95.0 |
| Approach | Pre Hoc | Temporal | Case-Based | Global Regimes |
|---|---|---|---|---|
| Saliency/attribution (post hoc) | – | ∼ | – | – |
| Concept-based explanations | – | ∼ | ∼ | – |
| PW-Net-style prototypes (state) | ✓ | – | ✓ | ∼ |
| SBX (scenario summaries) | – | ✓ | ✓ | ✓ |
| SGTP (ours) | ✓ | ✓ | ✓ | ✓ |
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |
© 2026 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license.
Share and Cite
Dobravec, B.; Žabkar, J. Scenario-Guided Temporal Prototypes in Reinforcement Learning. Mach. Learn. Knowl. Extr. 2026, 8, 21. https://doi.org/10.3390/make8010021
Dobravec B, Žabkar J. Scenario-Guided Temporal Prototypes in Reinforcement Learning. Machine Learning and Knowledge Extraction. 2026; 8(1):21. https://doi.org/10.3390/make8010021
Chicago/Turabian StyleDobravec, Blaž, and Jure Žabkar. 2026. "Scenario-Guided Temporal Prototypes in Reinforcement Learning" Machine Learning and Knowledge Extraction 8, no. 1: 21. https://doi.org/10.3390/make8010021
APA StyleDobravec, B., & Žabkar, J. (2026). Scenario-Guided Temporal Prototypes in Reinforcement Learning. Machine Learning and Knowledge Extraction, 8(1), 21. https://doi.org/10.3390/make8010021

