# Causal Repair of Learning-enabled Cyber-physical Systems

arXiv: https://arxiv.org/abs/2304.02813 · HTML: https://mlsanity.com/paper/2304.02813/

## Key facts

- No citing papers in the map yet (data through 14 Oct 2026).
- Builds on 10 of its 36 references that are in the map.
- First posted on arXiv 6 Apr 2023.

## Builds on (most cited first, 10 of 10)

- [OpenAI Gym](https://mlsanity.com/paper/1606.01540/) (2016)
- [Learning to Track at 100 FPS with Deep Regression Networks](https://mlsanity.com/paper/1604.01802/) (2016)
- [Repairing Deep Neural Networks: Fix Patterns and Challenges](https://mlsanity.com/paper/2005.00972/) (2020)
- [ART: Abstraction Refinement-Guided Training for Provably Correct Neural Networks](https://mlsanity.com/paper/1907.10662/) (2019)
- [Safe-by-Repair: A Convex Optimization Approach for Repairing Unsafe Two-Level Lattice Neural Network Controllers](https://mlsanity.com/paper/2104.02788/) (2021)
- [Confidence Composition for Monitors of Verification Assumptions](https://mlsanity.com/paper/2111.03782/) (2021)
- [Reasoning about Safety of Learning-Enabled Components in Autonomous Cyber-physical Systems](https://mlsanity.com/paper/1804.03973/) (2018)
- [Local Repair of Neural Networks Using Optimization](https://mlsanity.com/paper/2109.14041/) (2021)
- [Interpretable Run-Time Prediction and Planning in Co-Robotic Environments](https://mlsanity.com/paper/2109.03893/) (2021)
- [Automated Repair of Neural Networks](https://mlsanity.com/paper/2207.08157/) (2022)

## Abstract (arXiv)

Models of actual causality leverage domain knowledge to generate convincing diagnoses of events that caused an outcome. It is promising to apply these models to diagnose and repair run-time property violations in cyber-physical systems (CPS) with learning-enabled components (LEC). However, given the high diversity and complexity of LECs, it is challenging to encode domain knowledge (e.g., the CPS dynamics) in a scalable actual causality model that could generate useful repair suggestions. In this paper, we focus causal diagnosis on the input/output behaviors of LECs. Specifically, we aim to identify which subset of I/O behaviors of the LEC is an actual cause for a property violation. An important by-product is a counterfactual version of the LEC that repairs the run-time property by fixing the identified problematic behaviors. Based on this insights, we design a two-step diagnostic pipeline: (1) construct and Halpern-Pearl causality model that reflects the dependency of property outcome on the component's I/O behaviors, and (2) perform a search for an actual cause and corresponding repair on the model. We prove that our pipeline has the following guarantee: if an actual cause is found, the system is guaranteed to be repaired; otherwise, we have high probabilistic confidence that the LEC under analysis did not cause the property violation. We demonstrate that our approach successfully repairs learned controllers on a standard OpenAI Gym benchmark.
