# GridSFM: A Foundation Model for Solving AC Optimal Power Flow

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

## Key facts

- No citing papers in the map yet (data through 14 Oct 2026).
- Builds on 21 of its 41 references that are in the map.
- First posted on arXiv 24 Sep 2026.

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

- [Inductive Representation Learning on Large Graphs](https://mlsanity.com/paper/1706.02216/) (2017)
- [Transformers are RNNs: Fast Autoregressive Transformers with Linear Attention](https://mlsanity.com/paper/2006.16236/) (2020)
- [Strategies for Pre-training Graph Neural Networks](https://mlsanity.com/paper/1905.12265/) (2019)
- [Graph Neural Networks with Learnable Structural and Positional Representations](https://mlsanity.com/paper/2110.07875/) (2021)
- [DC3: A learning method for optimization with hard constraints](https://mlsanity.com/paper/2104.12225/) (2021)
- [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)
- [DeepOPF: A Feasibility-Optimized Deep Neural Network Approach for AC Optimal Power Flow Problems](https://mlsanity.com/paper/2007.01002/) (2020)
- [Topology-aware Graph Neural Networks for Learning Feasible and Adaptive ac-OPF Solutions](https://mlsanity.com/paper/2205.10129/) (2022)
- [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)
- [Convex Relaxation of Optimal Power Flow, Part I: Formulations and Equivalence](https://mlsanity.com/paper/1405.0766/) (2014)
- [DeepOPF+: A Deep Neural Network Approach for DC Optimal Power Flow for Ensuring Feasibility](https://mlsanity.com/paper/2009.03147/) (2020)
- [Accelerating Optimal Power Flow with GPUs: SIMD Abstraction of Nonlinear Programs and Condensed-Space Interior-Point Methods](https://mlsanity.com/paper/2307.16830/) (2023)
- [LUMINA: Foundation Models for Topology Transferable ACOPF](https://mlsanity.com/paper/2603.04300/) (2026)
- [GENCO - A Unified Neural Solver Embedded in a Development Framework for Steady-State Grid Analysis](https://mlsanity.com/paper/2608.09921/) (2026)
- [Generic Existence of Unique Lagrange Multipliers in AC Optimal Power Flow](https://mlsanity.com/paper/1806.06615/) (2018)
- [Building Power Grid Models from Open Data: A Complete Pipeline from OpenStreetMap to Optimal Power Flow](https://mlsanity.com/paper/2605.04289/) (2026)
- [UNION: A Unified AC-OPF Framework for Topology-Varying Real-Time Grid Operation](https://mlsanity.com/paper/2608.25784/) (2026)

## Abstract (arXiv)

We introduce GridSFM, a framework that combines a pretrained foundation model across grid topologies with physics-informed fine-tuning for solving AC Optimal Power Flow (AC-OPF) at scale. It is a 15 million parameter physics-inspired graph neural network pretrained across 54 topologies of 500 to 4,000 buses. Our model attains a 2.45% zero-shot generation-cost error on a 10,000 bus case held-out operating conditions with no degradation as system size grows. Building on this, we pair the pretrained backbone with a physics-informed fine-tuning design based on Newton's method for power flow. With only 100 solved instances, GridSFM adapts to unseen grids up to 10,000 buses. We show it out performs single topology, dedicated neural network models that are trained more data, both in terms of cost and solver iterations when deployed as warm starting points. In designing this foundation model, we overcome the fact that the feasible set for AC-OPF can be disconnected. This is an obstruction that prevents any continuous neural network from approximating the solution map. To do so, we lift the problem and relax its constraints with logarithmically penalized slacks. We prove that the resulting elastic feasible set is contractible, that the AC-OPF minimizers remain minimizers of the elastic problem above an explicit penalty threshold, and that projecting an approximate solution back onto the AC-OPF feasible set is well posed. We release all models, data, and code so that the community can build on a shared starting point for AC-OPF.
