# Towards Generalization of Graph Neural Networks for AC Optimal Power Flow

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

## Key facts

- Cited by 6 papers in the map (data through 14 Oct 2026).
- Builds on 27 of its 52 references that are in the map.
- First posted on arXiv 8 Oct 2025.

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

- [Rethinking Attention with Performers](https://mlsanity.com/paper/2009.14794/) (2020)
- [Recipe for a General, Powerful, Scalable Graph Transformer](https://mlsanity.com/paper/2205.12454/) (2022)
- [Interaction Networks for Learning about Objects, Relations and Physics](https://mlsanity.com/paper/1612.00222/) (2016)
- [From Local Structures to Size Generalization in Graph Neural Networks](https://mlsanity.com/paper/2010.08853/) (2020)
- [Topology Adaptive Graph Convolutional Networks](https://mlsanity.com/paper/1710.10370/) (2017)
- [Predicting AC Optimal Power Flows: Combining Deep Learning and Lagrangian Dual Methods](https://mlsanity.com/paper/1909.10461/) (2019)
- [Learning Optimal Solutions for Extremely Fast AC Optimal Power Flow](https://mlsanity.com/paper/1910.01213/) (2019)
- [The Power Grid Library for Benchmarking AC Optimal Power Flow Algorithms](https://mlsanity.com/paper/1908.02788/) (2019)
- [Optimal Power Flow Using Graph Neural Networks](https://mlsanity.com/paper/1910.09658/) (2019)
- [DeepOPF: A Feasibility-Optimized Deep Neural Network Approach for AC Optimal Power Flow Problems](https://mlsanity.com/paper/2007.01002/) (2020)
- [Learning Warm-Start Points for AC Optimal Power Flow](https://mlsanity.com/paper/1905.08860/) (2019)
- [Topology-aware Graph Neural Networks for Learning Feasible and Adaptive ac-OPF Solutions](https://mlsanity.com/paper/2205.10129/) (2022)
- [Foundation Models for the Electric Power Grid](https://mlsanity.com/paper/2407.09434/) (2024)
- [CANOS: A Fast and Scalable Neural AC-OPF Solver Robust To N-1 Perturbations](https://mlsanity.com/paper/2403.17660/) (2024)
- [OPFData: Large-scale datasets for AC optimal power flow with topological perturbations](https://mlsanity.com/paper/2406.07234/) (2024)
- [Leveraging power grid topology in machine learning assisted optimal power flow](https://mlsanity.com/paper/2110.00306/) (2021)
- [FSNet: Feasibility-Seeking Neural Network for Constrained Optimization with Guarantees](https://mlsanity.com/paper/2506.00362/) (2025)
- [Solutions of DC OPF are Never AC Feasible](https://mlsanity.com/paper/1912.00319/) (2019)
- [Spatial Network Decomposition for Fast and Scalable AC-OPF Learning](https://mlsanity.com/paper/2101.06768/) (2021)
- [Unsupervised Optimal Power Flow Using Graph Neural Networks](https://mlsanity.com/paper/2210.09277/) (2022)
- [High-Fidelity Machine Learning Approximations of Large-Scale Optimal Power Flow](https://mlsanity.com/paper/2006.16356/) (2020)
- [Compact Optimization Learning for AC Optimal Power Flow](https://mlsanity.com/paper/2301.08840/) (2023)
- [Accelerating Optimal Power Flow with GPUs: SIMD Abstraction of Nonlinear Programs and Condensed-Space Interior-Point Methods](https://mlsanity.com/paper/2307.16830/) (2023)
- [PGLearn -- An Open-Source Learning Toolkit for Optimal Power Flow](https://mlsanity.com/paper/2505.22825/) (2025)
- [A Principled Framework to Evaluate Quality of AC-OPF Datasets for Machine Learning: Benchmarking a Novel, Scalable Generation Method](https://mlsanity.com/paper/2508.19083/) (2025)
- [The Impact of the Topology on Cascading Failures in Electric Power Grids](https://mlsanity.com/paper/1401.4473/) (2013)
- [Physics-Informed Graph Neural Networks for Robust AC-Optimal Power Flow](https://mlsanity.com/paper/2410.04818/) (2024)

## Built on by (most cited first, 6 of 6)

- [GENCO - A Unified Neural Solver Embedded in a Development Framework for Steady-State Grid Analysis](https://mlsanity.com/paper/2608.09921/) (2026)
- [gridfm-datakit-v1: A Python Library for Scalable and Realistic Power Flow and Optimal Power Flow Data Generation](https://mlsanity.com/paper/2512.14658/) (2025)
- [PowerModelsGAT-AI: Physics-Informed Graph Attention for Multi-System Power Flow with Continual Learning](https://mlsanity.com/paper/2603.16879/) (2026)
- [Learning to Route Electric Trucks Under Operational Uncertainty](https://mlsanity.com/paper/2604.26566/) (2026)
- [Unified Heterogeneous Graph Neural Network solver for Power Flow, Optimal Power Flow and State Estimation](https://mlsanity.com/paper/2609.16738/) (2026)
- [Learning by Examples: Power Grid Steady State Analysis with a Tabular Foundation Model](https://mlsanity.com/paper/2610.20462/) (2026)

## Abstract (arXiv)

AC Optimal Power Flow (ACOPF) is computationally intensive for large-scale grids, often requiring prohibitive solution times with conventional solvers. Machine learning offers significant speedups, but existing models struggle with scalability and topology flexibility. To address these challenges, we propose a Hybrid Heterogeneous Message Passing Neural Network (HH-MPNN) that integrates a heterogeneous graph neural network (GNN) with a scalable transformer and physics-informed positional encodings. Our architecture explicitly models distinct power system components to capture local features while using global attention for long-range dependencies. Evaluated on diverse benchmarks, including PGLearn and GridFM-DataKit datasets, HH-MPNN achieves less than 1% optimality gap on default topologies across grid sizes from 14 to 2,000 buses. For N-1 contingencies, our approach demonstrates zero-shot N-1 generalization with less than 3% optimality gap on several test cases despite training only on default topologies. We further develop an approach that ensures robust N-1 generalization to high-impact contingencies through targeted augmentation of the training data, showing that exhaustive simulation is unnecessary for topologically flexible models. Finally, size generalization experiments demonstrate that pre-training on small grids significantly improves performance on large-scale systems. Achieving computational speedups of up to 5,000 times compared to interior point solvers, these results advance practical, generalizable machine learning for real-time power system operations.
