AI Powered Lyapunov Function Discovery
Project Overview
Context
Existing research proved that Reinforcement Learning can discover Lyapunov functions for small, basic academic systems using a commercial PC.
The Question
How can we scale this Reinforcement Learning framework onto a high-performance supercomputer to automatically discover valid Lyapunov functions for complex power grids?
The Solution
- Scale the existing codebase to run on Barkla2, University of Liverpool’s HPC that uses datacentre grade GPUs.
- Implement and run real world complex power systems (6-dimensional DC microgrid).
What were the key results of your research project?
- HPC & MLOps Infrastructure Stabilisation: Re-architected and stabilised the symbolic reinforcement learning codebase to scale on the Barkla2 supercomputer. Solved major performance bottlenecks by creating a dynamic SymPy compilation cache (yielding (O(1) expression lookups), fixing multi-GPU SLURM cluster device bindings, expanding the tokeniser to handle physical scientific notation, and building a 1,200+ line Streamlit analytics dashboard for real-time training and counterexample monitoring.
- 6D DC Microgrid Formal Stability Certification (`success: True`): Formulated energy-normalised deviation coordinates to normalise the microgrid's physical energy storage into an unweighted sum-of-squares. Combined with relaxing search grammar rules (removing the child constraint on the `n2` operator to allow nested sums) and targeting the function set to ('add', 'n2'), the pipeline achieved 100% formal mathematical certification (`success: True`) on Barkla2.
- Discovered Analytical Lyapunov Function: The framework discovered the exact analytical stability certificate with zero counterexamples across 50,000 domain evaluation points, achieving a test error of (NMSE = 0.0000) and a reward of (R = 0.996075).
- High-Dimensional Power Network Scaling (12D, 20D, 49D):** Extended the framework to high-dimensional power networks, including 12D multi-machine systems, 20D Kron-reduced models, and 49D full-order IEEE 39-bus networks. Authoring a "Dimension-Changing Guide" streamlined onboarding for future researchers, while high-dimensional tests revealed that unconstrained symbolic searches hit a sparse reward bottleneck—highlighting the need to embed physics-informed dissipative constraints directly into the search grammar.
How do you feel you have benefitted from completing this internship and has it made you consider future career paths?
N8 research internship provided me with many valuable opportunities. Through this project I:
- Got experience running jobs on a HPC using SLURM.
- Learnt how to read, research, and learn from existing papers with support from an academic.
- Learnt how to present academic findings.
- Had a valuable experience with the whole technical research process.
Yes, it has definitely made me reconsider my future career path. Previously, I considered pursuing a postgraduate degree mainly because I felt an undergraduate degree wouldn't give me the depth I wanted. However, this internship helped me realise what I truly care about: deeply knowing and working with the cutting edge of frontier technology. Experiencing real-world technical research first-hand has significantly grown my passion for research.
Download presentation slides