Run-Time Optimization for Learned Controllers Through Quantitative Games

Guy Avni, Roderick Bloem, Krishnendu Chatterjee, Thomas A. Henzinger, Bettina Könighofer, Stefan Pranger

Abstract

Reinforcement Learning (RL) has become a standard approach for developing controllers in complex environments like traffic management. However, these controllers are often "black boxes" that lack formal guarantees and struggle with out-of-distribution scenarios. This paper presents a framework for "quantitative shields"—mathematically synthesized wrappers that optimize the outputs of pre-trained controllers in real-time. By modeling the interaction as a stochastic game, the authors demonstrate that these shields can improve performance in untrained scenarios, resolve liveness bugs, and enable post-hoc feature injection (such as emergency vehicle priority) without retraining the underlying neural network.

Introduction

The deployment of learned controllers in safety-critical or high-efficiency systems is hindered by several factors. First, neural networks are inherently difficult to verify formally. Second, they are often brittle, failing when faced with traffic patterns or environmental conditions not seen during training. Finally, modifying their behavior to include new constraints typically requires a complete and computationally expensive retraining cycle.

To address these issues, this research proposes a shielding layer that sits between the controller and the system. Unlike previous "safety shields" that only enforced Boolean constraints, these quantitative shields optimize for performance metrics and efficiency.

Methodology: From Simulation to Synthesis

The core of the approach lies in treating the learned controller as a black box and the system it manages as a stochastic environment. The synthesis of a quantitative shield follows a four-step pipeline:

  1. Abstraction: The physical system is modeled as a Markov Decision Process (MDP). For a traffic junction, this involves abstracting continuous vehicle positions into discrete queue lengths.
  2. Quantitative Specification: Using Weighted Automata, the authors define a Behavioral Score (measuring system performance like wait times) and an Interference Score (measuring the frequency of shield overrides).
  3. Game Theoretic Formulation: The interaction is modeled as a two-player stochastic game. The Shield (Player 2) aims to minimize a weighted combination of these scores, while the Controller (Player 1) is treated as an adversary to ensure robustness against worst-case outputs.
  4. Synthesis: An optimal strategy is computed and exported as a compact look-up table, ensuring minimal run-time overhead.
Mapping a concrete traffic simulation to a formal state-transition model for shield synthesis.

Experimental Evaluation

The framework was tested using the SUMO (Simulation of Urban MObility) simulator, a standard tool for traffic research.

The SUMO traffic simulation environment used for evaluation.

Researchers trained a Deep Q-Network (DQN) on various road networks and evaluated the performance of the shielded vs. unshielded controller across several scenarios, including asymmetric "rush-hour" traffic and varying ratios of main-road to side-road traffic.

Key Results

  • Robustness and Efficiency: The shield significantly reduced vehicle waiting times in scenarios the RL agent had not encountered during training. Interestingly, the shield also improved performance in trained scenarios by smoothing out erratic decisions.
  • Feature Injection: By adjusting the behavioral score to penalize waiting buses, the authors added bus priority to a pre-trained controller without modifying its weights.
  • Minimal Overhead: The synthesized shields are extremely lightweight (approx. 60 KB), compared to the multi-megabyte neural networks they manage.
  • Liveness Guarantees: The shield successfully detected and corrected "stuck" states where a controller would fail to change a light, ensuring the system remained functional.

Discussion and Limitations

While modeling the controller as an adversary provides strong robustness, it can be overly conservative. Future work may explore cooperative models where the shield and controller are assumed to have aligned goals. Additionally, the effectiveness of the shield is tied to the quality of the MDP abstraction; overly simplistic models may not capture all nuances of the physical system. Despite these challenges, quantitative shielding represents a significant step toward making learned controllers more reliable and adaptable in real-world applications.

Summary updated

BibTeX
@inproceedings{avni2019run,
  author = {Guy Avni and Roderick Bloem and Krishnendu Chatterjee and Thomas A. Henzinger and Bettina Könighofer and Stefan Pranger},
  title = {{Run-Time Optimization for Learned Controllers Through Quantitative Games}},
  booktitle = {CAV},
  year = {2019},
  doi = {10.1007/978-3-030-25540-4\_36},
}
Figure