arXiv:2610.19701cs.AIOct 2026

Manuscript Offprint

arXiv:2610.19701

Runtime Monitoring of Supermartingale Certificates

Mirco Giacobbe, Thomas A. Henzinger, Konstantin Kueffner, Emily Yu, Đorđe Žikelić

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Abstract

Supermartingale certificates formally guarantee temporal properties of discrete and continuous-time stochastic dynamical systems. However, these guarantees rely on a mathematical model of the world, leaving a sim-to-real gap that can invalidate them for the deployed system. We formulate the runtime monitoring problem for supermartingale certificates, in which a monitor observes a single system trajectory and raises an alarm when there is sufficient statistical evidence that the supermartingale certificate has been violated during execution. We present an algorithm to automatically construct a monitor using betting-based sequential tests that bound the probability of ever raising a false alarm at a user-specified level. Within this betting framework, we formulate strategies that allow the monitor to exploit spatial regularity to improve detection power while preserving this statistical guarantee. We demonstrate the efficacy of our approach on supermartingale certificate benchmarks from the literature.

1 Introduction

Supermartingale certificates guarantee that probabilistic, potentially infinite-state systems satisfy temporal properties of their intended behaviour, making them a powerful tool for assuring sequential decision-making under uncertainty. Applications include the automated control of unmanned vehicles, manufacturing processes, and financial systems, where rigorous guarantees of safety and security are paramount. Supermartingale certificates are real-valued functions of system states whose expected values decrease along system executions in a manner determined by the specification of interest. They are the probabilistic analogues of Lyapunov and barrier functions in control systems (Kushner, 1965), and of inductive invariants and progress measures in software systems (Floyd, 1967; Chakarov and Sankaranarayanan, 2013). A supermartingale certificate reduces reasoning about a global temporal property of system behaviour—such as reachability, safety, reach-avoidance, stability, reactivity—to verifying a local expected-decrease condition at each individual step of the system.

The algorithmic construction of supermartingale certificates has traditionally relied on rigorous symbolic reasoning methods (Prajna and Jadbabaie, 2004; Chatterjee et al., 2016), with more recent work turning to neural representations and certified learning-based approaches (Abate et al., 2021; Lechner et al., 2022; Zikelic et al., 2023a; Neustroev et al., 2025). Yet, the formal guarantees provided by the existing methods are contingent on a given model of the world, fixed at design time. If the behaviour of the environment in which the controller is deployed deviates from this assumed model, the certificate may no longer satisfy the supermartingale conditions, invalidating its guarantees. Such deviations may arise, for example, from environmental changes, distribution shifts, or unmodelled physical conditions, and are commonly associated with what is known in control theory and robotics as the sim-to-real gap (Jakobi et al., 1995; Tobin et al., 2017; Zhao et al., 2020).

This raises a fundamental question: when the true environment is not fully known and can only be interacted with at runtime as a black box, how can we determine whether a certificate remains valid after deployment? This is the central question we address in this work: we propose for the first time a framework for the runtime monitoring of supermartingale certificates upon deployment. Given a supermartingale certificate computed at design time and a a black-box stochastic deployment environment, our method observes a single stream of system states, continually tests whether the supermartingale certificate satisfies its defining expected-decrease condition, and raises an alarm once it has gathered sufficient statistical evidence that the supermartingale certificate is invalid.

Runtime monitoring of a supermartingale certificate requires detecting violations from a single stream of observations. Because the environment is stochastic, an increase (resp. decrease) in the certificate value at any individual step does not necessarily indicate a violation (resp. satisfaction) of the expected-decrease condition. To address this challenge, our monitor accumulates statistical evidence over successive state observations, seeking to determine when the observed changes in certificate value become sufficiently inconsistent with the expected-decrease condition to signal a violation. This evidence is accumulated using a betting-based sequential testing method (Ramdas et al., 2023; Waudby-Smith and Ramdas, 2024). The monitor plays a betting game: it starts with an initial wealth and, for each pair of successive state observations, converts the change in certificate value into a normalised score and chooses a stake based on the observations seen so far. A positive score increases the monitor's wealth, while a negative score decreases it, with the magnitude of either change determined by the chosen stake. Crucially, while the expected-decrease condition holds, no admissible betting strategy can increase the monitor's wealth in expectation. Sustained wealth growth therefore constitutes statistical evidence against this condition. Once the wealth exceeds a threshold calibrated to control the false-alarm probability, the monitor signals a violation.

We implemented our method and evaluated betting strategies that either weight past observations uniformly or favour recent observations and those from nearby states across a wide range of benchmarks. Our results show that the framework effectively detects certificate violations under changes in deployment dynamics, and that exploiting temporal and spatial regularity in the betting strategy improves the detection of local violations.

Our contribution is threefold. First, we present the first framework for runtime verification of supermartingale certificates. Our framework is agnostic to the temporal property being certified, applies to both discrete- and continuous-time stochastic systems, and encompasses the existing supermartingale certificates (see Section 2). Second, we introduce an algorithm for automatically constructing monitors based on betting games, with a user-specified bound on the false-alarm probability that holds uniformly over an unbounded monitoring horizon. This bound allows users to control the monitor's conservativeness and avoid unnecessary intervention (see Section 3). Finally, we empirically demonstrate the effectiveness of our method in detecting certificate violations under changed deployment dynamics (see Section 4).