Stability Analysis of Switched Linear Systems with Neural Lyapunov Functions

Virginie Debauche, Alec Edwards, Raphaël M. Jungers, Alessandro Abate

Abstract: Neural-based, data-driven analysis and control of dynamical systems have been recently investigated and have shown great promise, e.g. for safety verification or stability analysis. Indeed, not only do neural networks allow for an entirely model-free, data-driven approach, but also for handling arbitrary complex functions via their power of representation (as opposed to, e.g. algebraic optimization techniques that are restricted to polynomial functions). Whilst classical Lyapunov techniques allow to provide a formal and robust guarantee of stability of a switched dynamical system, very little is yet known about correctness guarantees for Neural Lyapunov functions, nor about their performance (amount of data needed for a certain accuracy). We thus formally introduce neural Lyapunov functions for the stability analysis of switched linear systems: we benchmark them on this paradigmatic problem, which is notoriously difficult (and in general Turing-undecidable), but which admits recently-developed technologies and theoretical results. Inspired by switched systems theory, we provide theoretical guarantees on the representative power of neural networks, leveraging recent results from the ML community. We additionally experimentally display how neural Lyapunov functions compete with state-of-the-art results and techniques, while admitting a wide range of improvement, both in theory and in practice. This study intends to improve our understanding of the opportunities and current limitations of neural-based data-driven analysis and control of complex dynamical systems.

Introduction

In control theory, a "switched system" is one that flips between different modes of behavior—common examples include walking robots changing gaits or power grids switching between energy sources. Determining the stability of such systems—ensuring all possible switching sequences eventually lead to equilibrium—is a notoriously difficult problem, classified as Turing-undecidable in the general case.

Engineers traditionally rely on Lyapunov functions to prove stability. However, these are often restricted to simple geometric shapes like ellipsoids or low-degree polynomials to remain computationally tractable via Semidefinite Programming (SDP). Recently, Neural Networks (NNs) have emerged as powerful candidates for learning these functions due to their universal approximation capabilities. Yet, NNs are frequently criticized as "black boxes" lacking formal safety guarantees. This research bridges that gap by providing the first formal theoretical guarantees for Neural Lyapunov Functions, specifically for switched linear systems.

Methodology: ReLU Networks as Lyapunov Functions

The authors focus on ReLU-activated Neural Networks. Because the ReLU function is piecewise linear, a neural network using this architecture naturally represents a Continuous Piecewise Linear (CPWL) function.

Theoretical Mapping

Leveraging results from convex geometry, the authors demonstrate that any stable switched system possesses a Lyapunov function whose level sets are polytopes (complex multi-sided shapes). By applying expressivity theory from the machine learning community, they calculate the exact depth and width a ReLU network requires to represent these polytopes to a desired precision.

Comparison of level sets for ellipsoidal and CPWL (neural) approximations in a 2D system.

Training and Constraints

To ensure the learned function serves as a valid Lyapunov norm, the authors enforce non-negativity on output weights and remove network biases. The networks are trained using a custom loss function designed to penalize the maximum growth rate of the system across all possible switching modes, using data sampled uniformly from a unit sphere.

Key Insights and Scaling

A central contribution of this work is identifying the "Efficiency Flip." In low-dimensional spaces, classical polynomial methods (like Sum-of-Squares, or SOS) are highly efficient. However, as the system dimension ($n$) increases, the number of variables required for polynomial methods grows combinatorially.

Scaling of variables required for SOS vs. CPWL approximations as state space dimension increases.

As shown in the scaling analysis, CPWL functions represented by neural networks can theoretically provide superior approximations with significantly fewer variables in high-dimensional spaces. This formalizes the connection between ReLU architectures and the geometric complexity (faces and vertices) of the Lyapunov polytopes.

Experimental Results

The approach was evaluated on two challenging benchmarks:

  1. 2D Proof of Concept: In a two-dimensional system with two matrices, the neural approach achieved a stability estimate (Joint Spectral Radius, or JSR) of 8.69, outperforming both the standard ellipsoidal approximation (9.58) and the degree-4 SOS approximation (8.72).
  2. 8D High-Dimensional Benchmark: In an eight-dimensional system with eight modes, the neural network matched the speed of basic SOS methods while providing significantly higher accuracy.

However, the authors noted a risk of "under-estimation." If the training data does not capture the system's worst-case trajectory, the network might report an over-optimistic stability margin. The paper suggests that L1-regularization is essential to mitigate this overfitting risk.

Limitations and Future Directions

While neural networks offer high expressivity, they introduce new challenges. Training involves non-convex optimization, which can be less predictable than the convex optimization used in classical methods. Furthermore, the results are currently sample-dependent; the quality of the stability estimate relies on the density and coverage of the training data.

Future research will focus on developing loss functions that further reduce overfitting and exploring post-processing steps—such as taking the convex hull of samples—to transform neural approximations into formal, mathematically guaranteed upper bounds for safety-critical applications.

Summary updated

Abstract

Neural-based, data-driven analysis and control of dynamical systems have been recently investigated and have shown great promise, e.g. for safety verification or stability analysis. Indeed, not only do neural networks allow for an entirely model-free, data-driven approach, but also for handling arbitrary complex functions via their power of representation (as opposed to, e.g. algebraic optimization techniques that are restricted to polynomial functions). Whilst classical Lyapunov techniques allow to provide a formal and robust guarantee of stability of a switched dynamical system, very little is yet known about correctness guarantees for Neural Lyapunov functions, nor about their performance (amount of data needed for a certain accuracy). We thus formally introduce neural Lyapunov functions for the stability analysis of switched linear systems: we benchmark them on this paradigmatic problem, which is notoriously difficult (and in general Turing-undecidable), but which admits recently-developed technologies and theoretical results. Inspired by switched systems theory, we provide theoretical guarantees on the representative power of neural networks, leveraging recent results from the ML community. We additionally experimentally display how neural Lyapunov functions compete with state-of-the-art results and techniques, while admitting a wide range of improvement, both in theory and in practice. This study intends to improve our understanding of the opportunities and current limitations of neural-based data-driven analysis and control of complex dynamical systems.
BibTeX
@inproceedings{debauche2024stability,
  author = {Virginie Debauche and Alec Edwards and Raphaël M. Jungers and Alessandro Abate},
  title = {{Stability Analysis of Switched Linear Systems with Neural Lyapunov Functions}},
  booktitle = {AAAI Conference on Artificial Intelligence},
  year = {2024},
  doi = {10.1609/aaai.v38i19.30092},
}
Figure