Toward Out-of-Distribution Generalization in Neural AC Power Flow

Ojas Sanghi, Anvita Bhagavathula, Alvaro Carbonero, Priya L. DontiarXiv 2026

TL;DR

This paper investigates how to make Graph Neural Networks (GNNs) for AC power flow generalize to larger, unseen grids without retraining. The authors demonstrate that using physics-informed losses and physically motivated data augmentation—specifically perturbing branch values—can significantly improve "zero-shot" transfer from small benchmark systems to a 500-bus grid.

What Problem Does This Paper Address?

AC Power Flow (PF) is the fundamental calculation used to determine bus voltages and power flows in an electrical grid. As we integrate more volatile renewables and face extreme weather, grid operators need to run these simulations millions of times in near real-time. Traditional iterative solvers (like Newton-Raphson) are accurate but often too slow for this scale.

While GNNs have emerged as lightning-fast "proxies" for these solvers, they suffer from a major "generalization gap." A model trained on a small 30-bus grid typically fails when applied to a 500-bus grid. Generating high-quality training data for massive grids is computationally expensive, so we need models that can learn the "physics of power flow" on small systems and transfer that knowledge to large ones—a capability known as out-of-distribution (OOD) generalization.

Methods

The authors systematically evaluate three "levers" to improve zero-shot transfer across three different GNN architectures (CANOS-PF, PowerFlowNet, and GraphConv):

  1. Physics-Based Loss (PBL): Instead of just training the model to mimic a solver's output (Supervised/MSE), they use a loss function that penalizes violations of the actual AC power balance equations. This encourages the model to act as a solver itself.
  2. Multi-Grid Training: Training the model on a mix of different small grid sizes (IEEE-30, 57, and 118) to see if topological diversity helps scale extrapolation.
  3. Data Augmentation:
    • Branch Value Perturbation: Adding Gaussian noise to edge attributes (like line impedance).
  4. Line/Generator Dropout: Randomly removing components to simulate contingencies.
Figure 1: Overview of our evaluation framework. We train GNN-based power flow approximators on small benchmark grids (IEEE-30/57/118) with a physics-based loss (Power Balance Loss, or PBL) and mixed-scale training, apply branch value perturbation and line/generator dropout, then evaluate zero-shot transfer to the larger, out-of-distribution GOC-500 grid.

Datasets

The study utilizes the PF$\Delta$ benchmark, a massive dataset containing over 850,000 solved AC power flow instances.

  • Training/Validation: IEEE-30, IEEE-57, and IEEE-118 bus systems.
  • OOD Evaluation: The GOC-500 (500-bus) system, which is significantly larger and topologically different from the training sets.

Key Insights and Ideas

  • Physics is the Best Regularizer: Physics-informed objectives (PBL) consistently outperformed standard supervised learning for OOD transfer. By penalizing physical mismatches, the model learns the underlying constraints of the system rather than just memorizing the mapping of a specific grid.
  • Breaking Numerical Overfitting: The authors found that models often overfit to the narrow numerical ranges of branch parameters in small grids. Branch value perturbation forces the model to learn how flows change relative to impedance, leading to a massive 54.6% improvement in transfer performance for edge-aware models.
  • Diversity $\neq$ Scale: Interestingly, training on multiple small grids (multi-grid) matched the performance of the best single small grid but failed to close the gap to a model trained on the target 500-bus grid. This suggests that seeing more small grids isn't enough; models need better inductive biases to handle the change in scale.
  • Structural Dropout is Risky: Unlike in standard computer vision, randomly dropping lines or generators (dropout) didn't consistently help. This is likely because random outages can create physically infeasible or disconnected grid states that confuse the model.

Key Results

  • PBL vs. MSE: For models like PowerFlowNet and GraphConv, switching to a physics-based loss drastically reduced the mean power balance error on the unseen GOC-500 grid compared to standard MSE training.
  • Augmentation Impact: Branch perturbation was the most effective augmentation, particularly for the CANOS-PF architecture, which is designed to exploit heterogeneous edge interactions.
Figure 2: Effect of loss function and multi-grid training on GOC-500 performance across all three GNNs. Horizontal lines show the same architecture trained directly on GOC-500 with MSE or PBL, respectively, as an in-distribution reference. Error bars = standard deviation over 3 training runs.

Limitations and Future Work

Despite these improvements, a significant performance gap remains between zero-shot models and those trained directly on the target grid. The authors note that:

  • Aggregate metrics can be misleading: While mean errors improved, "worst-case" bus mismatches can still be 45x higher than the mean, which is unacceptable for critical infrastructure.
  • Future Directions: The field needs to move toward scale-invariant representations (architectures that don't care how many buses are in the system) and explore few-shot fine-tuning, where a model trained on small grids is quickly adapted using only a tiny amount of data from a large grid.

Summary updated

Abstract

Growing uncertainty in power system operations from renewables integration, extreme weather, and data center loads challenges the reliability of traditional power flow solvers at scale. Machine learning-based proxies are a potentially promising alternative, but the prohibitive cost of generating training data for large grids makes out-of-distribution generalization a key capability for deployment; currently, models trained on small grids lack that capability. In this work, we systematically evaluate how physics-informed losses, multi-grid training, and perturbation-based data augmentation improve the zero-shot transfer of three graph neural network-based power flow models from smaller systems to a larger, unseen 500-bus system. We find that (1) physics-informed losses improve transfer relative to purely supervised objectives; (2) multi-grid training on smaller systems matches the best single grid but does not close the gap to target-grid training; (3) perturbation-based augmentation on edge attributes improves transfer by up to 54.6%; and (4) random line/generator dropout does not consistently improve performance.
BibTeX
@misc{sanghi2026toward,
  author = {Ojas Sanghi and Anvita Bhagavathula and Alvaro Carbonero and Priya L. Donti},
  title = {{Toward Out-of-Distribution Generalization in Neural AC Power Flow}},
  year = {2026},
  eprint = {2611.23729},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2611.23729},
}
Figure