Source-linked AI summary

Learning by Examples: Power Grid Steady State Analysis with a Tabular Foundation Model

Olayiwola Arowolo, Oluwadara Adedeji, Peter Palensky, Jochen L. Cremer

arXiv:2610.20462v1cs.LG

TL;DR

Power-grid steady-state analysis spans tasks for which machine-learning generalization remains challenging. This paper evaluates pretrained TabPFN as a shared approach to power flow, contingency screening, and voltage-stability-margin prediction; it is competitive with task-specific baselines across the tasks, especially on 2000-bus power flow and margin prediction. The approach remains brittle in extrapolation, including in zero-shot settings.

  • Problem

    Power-system machine learning faces limited generalization to unseen operating points, while repeated AC power-flow solves are costly and voltage-stability margin is expensive to determine.

    Source: §I · p. 1, E. Voltage Stability Margin Prediction · p. 3
  • Method

    The paper uses pretrained TabPFN as a general-purpose solver, applying in-context learning to context samples without task-specific retraining or fine-tuning across three steady-state tasks.

    Source: §I · p. 2, §V · p. 10
  • Results

    The TFM is competitive with task-specific baselines across the three tasks and is especially accurate for 2000-bus power flow and voltage-stability-margin prediction.

    Source: §V · p. 11, §VI · p. 12
  • Takeaways & Limitations

    The results indicate potential for pretrained tabular foundation models in power-system workflows across the tested steady-state tasks.

    Source: §VI · p. 12

    TabPFN remains brittle in extrapolation, and its zero-shot power-flow and voltage-stability-margin performance is significantly degraded.

    Source: §V · p. 11

Abstract

from arXiv · show

Foundation models have shown strong generalization across scientific domains, but their use in power systems remains largely task-specific. We investigate whether a pretrained tabular foundation model (TFM), TabPFN, can serve as a general-purpose neural solver for power grid steady-state analysis. We evaluate the TFM on three tasks: power flow (PF) prediction, N-k contingency screening (NCS), and voltage stability margin (VSM) prediction. We performed experiments on 118- and 2000-bus systems, comparing the TFM against task-specific neural baselines. Without retraining or fine-tuning, the TFM matches or outperforms the best task-specific model in several settings across the three tasks. For 118-bus PF prediction, a variant of the TFM achieves errors of $1\times 10^{-3}$ pu for voltage magnitudes and $0.30^\circ$ for voltage angles, outperforming all baselines. On unseen N-1 contingency and close-to-infeasible PF cases, the TFM is competitive with the DCPF approximation. For millions of unseen N-2 contingencies, the TFM achieves AUCs of 0.92 and 0.95 for branch and voltage violation screening, respectively. The TFM also attains accurate VSM prediction performance for the 2000-bus system with limited labelled data. The TFM attains strong results across the tested tasks despite pretraining without any power-system-specific dataset and requiring no fine-tuning step. These results offer a glimpse into the potential of pretrained TFMs as a neural solver for a range of power grid analysis tasks.

I. INTRODUCTION

Power-grid operations need rapid steady-state security analyses, but repeated AC power-flow solves are costly and existing machine-learning approaches face generalization and scalability challenges. This paper applies a tabular foundation model to power flow, voltage-stability-margin prediction, and contingency screening.

I. INTRODUCTION

  • Repeated AC power-flow solves become costly at scale; exhaustive N-3 screening on IEEE-118 requires over 1 million solver calls per operating point.DC power flow is commonly used instead, but can have large errors at high loading.Source: §I · p. 1
  • Machine-learning models face limited generalization to unseen operating points, topology and parameter configurations, alongside dataset scarcity and trust barriers.Existing approaches may require retraining for unseen configurations, while separate component-specific models are not scalable.Source: §I · p. 1
  • Existing graph neural network approaches remain task- and grid-specific, and their architectural limitations can hurt performance on tasks with little locality dependence.Developing a model with both topology flexibility and sufficient accuracy across tasks remains challenging.Source: §I · pp. 1–2
  • Prior power-system foundation models target specific applications, while proposed GridFM approaches cover only limited task sets in pretraining.The paper investigates a tabular foundation model as a potential general-purpose GridFM.Source: §I · p. 2
  • The paper formulates power flow and voltage-stability-margin prediction as tabular regression and contingency screening as tabular classification, evaluating the approach on 118- and 2000-bus grids.Its contributions include methods to extract topological features for accuracy and scalability, and case studies of accuracy and robustness.Source: §I · p. 2

II. PROBLEM FORMULATION

The section frames steady-state analysis through AC power flow, its DC approximation, and the N-k contingency and voltage-stability tasks. AC power flow is nonlinear, whereas the stated DC approximation is linear under simplifying assumptions.

II. PROBLEM FORMULATION

  • The section introduces AC power flow, its DC approximation, N-k contingency screening, and voltage-stability or loadability-margin prediction as steady-state analysis tasks.Source: §II · p. 2

A. AC power flow

  • AC power flow determines steady-state electrical flows and is formulated as nonlinear equations over grid buses and branches.The formulation defines voltage magnitude and angle, and active and reactive power injections at each bus.Source: A. AC power flow · p. 2

II. PROBLEM FORMULATION

A. AC power flow

  • Each bus has two known and two unknown variables depending on bus type, yielding 2N equations with 2N unknowns.Newton–Raphson calculates unknown voltage variables at PQ and PV buses; the other variables are derived analytically.Source: A. AC power flow · p. 2

B. DC Power Flow Approximation

  • The AC power-flow equations have no analytical solution and are evaluated through Newton–Raphson iterations.For transmission systems, the DC approximation assumes zero conductances, small phase-angle differences, and voltage magnitudes fixed at 1.0 pu.Source: B. DC Power Flow Approximation · p. 2
  • Under the stated assumptions, DC power flow is linear and can be solved for the unknown voltage angles at each bus.Source: B. DC Power Flow Approximation · p. 2

C. AC Power Flow Prediction

Power-flow prediction is framed as estimating unknown AC power-flow variables from known variables. Contingency screening can either classify feasibility directly or predict power-flow variables and apply feasibility thresholds.

C. AC Power Flow Prediction

  • The power-flow learning task predicts the unknown variables of the AC power-flow solution from problem instances in the training data.The unknown variables and active-branch status define the solution map being approximated.Source: C. AC Power Flow Prediction · pp. 2–3

D. N −k Contingency Screening

E. Voltage Stability Margin Prediction

Voltage stability margin quantifies additional loading before instability, with the nose point marking maximum loading. The paper formulates predicting this margin as a regression task.

E. Voltage Stability Margin Prediction

  • Voltage stability margin quantifies how much additional load a grid can admit before voltage collapse, and numerical solvers can diverge near the PV-curve nose.The nose is conventionally derived with continuation power flow, which scales specified injections while holding voltage setpoints fixed.Source: E. Voltage Stability Margin Prediction · p. 3
  • The loadability factor decreases from the base injection to the nose point, where it equals 1; its value minus 1 is the loadability margin.This margin is the fraction by which every grid injection can be scaled before voltage instability is reached.Source: E. Voltage Stability Margin Prediction · p. 3
  • Voltage-stability-margin prediction is formulated as regression because continuation power flow requires repeated AC solves and DC power flow is inaccurate under stressed, high-loading conditions.Source: E. Voltage Stability Margin Prediction · p. 3

III. METHODOLOGY

The paper uses TabPFN as a pretrained tabular model that predicts from labelled context examples without fitting weights to each new dataset. At inference, labelled context and unlabelled queries are processed together to produce query predictions.

A. Tabular Foundation Model

  • TabPFN processes labelled context examples and unlabelled query rows together, returning predictions in one forward pass without a weight update.The model is pretrained once on synthetic datasets sampled from a prior; no real data is used during pretraining.Source: A. Tabular Foundation Model · pp. 3–4, Figure 1 · p. 4
  • Unlike standard supervised learning, adapting the TFM to a new task, grid topology, or operating-point range requires changing the context, not retraining.The passage contrasts dataset-specific gradient updates with inference-time in-context learning.Source: A. Tabular Foundation Model · p. 3
  • TabPFN uses row and column attention, making predictions independent of row or column order, and returns a predictive distribution for each label.Source: A. Tabular Foundation Model · p. 4

B. Predicting power flow residuals

The method predicts power-flow states through residual learning relative to a linear DC approximation. For larger grids, it uses power decoupling to reduce input features, under an assumption of weak cross-couplings.

B. Predicting power flow residuals

  • TabPFN represents each power-flow example with 2N known variables as feature columns and predicts unknown variables column by column, optionally learning deviations from the DC solution.The DC approximation sets voltage magnitudes to 1 pu and approximates angles from active-power injections; the residual captures nonlinear effects.Source: B. Predicting power flow residuals · p. 4
  • The unknown injections are reconstructed from the predicted voltage states.Source: B. Predicting power flow residuals · p. 4

C. Scaling TFM to larger grids with power decoupling

  • For the 2000-bus system, the context table has 4000 feature columns, above TabPFN's 2000-column pretraining limit; processing larger tables may degrade accuracy.The authors note that larger tables may still be processed if they fit in GPU memory.Source: C. Scaling TFM to larger grids with… · p. 4
  • Under weak P–V and Q–θ cross-couplings, TabPFN approximates voltage angles from active-power inputs and voltage magnitudes from reactive-power inputs.This decouples the power-flow equations into two half-systems for feature selection.Source: C. Scaling TFM to larger grids with… · p. 4

D. Encoding grid topology in tabular data

Because a TFM does not encode grid topology automatically, the method supplies topology through features combining outage-distribution factors with pre-outage power flows. It uses low-rank updates to obtain factors for N-k contingencies.

D. Encoding grid topology in tabular data

IV. CASE STUDIES

The case studies use PFΔ data for power-flow and voltage-stability tasks, plus generated contingency data for screening. They evaluate on 118- and 2000-bus systems, with contingency screening limited to the 118-bus grid.

A. Dataset

  • PFΔ includes solved AC power-flow instances and separate N-1, N-2, and close-to-infeasible subsets; the 118-bus data has 3600 training and 200 test samples, versus 600 and 92 for 2000 buses.For VSM, the study uses the close-to-infeasible full-topology subset and labels augmented operating points with proportional loadability margin.Source: A. Dataset · p. 5
  • The PFΔ dataset alone is unsuitable for steady-state violation prediction because all its samples violate voltage or branch-power limits; generated data provides a more realistic secure/unsafe balance.The generated dataset contains 1,558,730 N-1 scenarios, about 64% secure, and 3,133,892 N-2 scenarios, about 41% secure; islanding cases are discarded.Source: A. Dataset · p. 5

B. Experimental setting

  • Power-flow and VSM studies use both grids, but contingency screening uses only the 118-bus grid because the 2000-bus problem is intractably large.Source: B. Experimental setting · p. 5
  • Baselines include self-supervised GNS and TGN, supervised PowerFlowNet and LeapNet, and semi-supervised PI-EVGNN.GNS and TGN minimize power imbalance; PowerFlowNet and LeapNet use supervised learning, while PI-EVGNN combines prediction and power-balance losses.Source: B. Experimental setting · p. 5
  • TabPFN uses each experiment's training split as context and test split as query; neural baselines train for 200 epochs, and results average three random seeds.The seeds are 3, 7, and 11; the seed changes the sampled training and test data.Source: B. Experimental setting · p. 5

C. Power flow analysis

TabPFN performs strongly on full-topology power-flow prediction, and its residual and fast-decoupled variants retain strong results across larger grids and shifted operating conditions. Power-balance residuals provide a complementary measure of physical consistency, not agreement with ground truth.

C. Power flow analysis

  • On the 118-bus grid, TabPFN achieves V RMSE of 0.0011 and Q RMSE of 0.047, the lowest errors among models for those variables.It also has lower errors than all four GNN-based baselines across all four predicted variables.Source: C. Power flow analysis · p. 6, Figure 2 · p. 6
  • On the 118-bus grid, TabPFN-R has the lowest error for 3 of 4 predicted variables; on the 2000-bus grid, it has the lowest V and θ errors.TabPFN-FD has slightly lower θ and P errors on the 2000-bus system and similar V and Q errors to the original model.Source: C. Power flow analysis · p. 6
  • Across N-1 zero-shot, N-1 mixed, and N-2 zero-shot tests, TabPFN has comparable errors to trained GNN baselines and performs especially strongly on the 2000-bus grid.In zero-shot tests its θ and P errors are comparable to DCPF; with N-1 samples in context, its errors are lower than DCPF.Source: Figure 3 · p. 6, C. Power flow analysis · p. 7
  • On close-to-infeasible zero-shot tests, TabPFN has lower V and θ errors than DCPF on both grids, but a larger P error; on the 2000-bus grid it has the lowest V, θ, and Q errors in both settings.TabPFN errors fall significantly in the mixed experiment compared with zero-shot.Source: C. Power flow analysis · p. 7, Figure 4 · p. 7
  • GNS and TGN have consistently lower power-balance residuals than TabPFN, yet often have larger RMSE errors; residuals and prediction errors should be assessed together.Power-balance residual measures deviation from zero power imbalance, and lower residual indicates physical consistency, not a match to the true operating point.Source: C. Power flow analysis · pp. 7–8, Figure 5 · p. 8

D. N-k contingency screening

For unseen N-2 contingencies, TabPFN separates violation from non-violation scenarios through in-context learning, with AUCs comparable to trained classifiers. Direct classification outperforms screening through PF neural surrogates, while the fixed classification threshold limits average recall.

D. N-k contingency screening

  • TabPFN+ has strong screening performance and outperforms base TabPFN; it also screens branch violations better than voltage violations.The authors hypothesize that linear changes in bus voltage angles as topology features may help by adding knowledge of flow redistribution after a branch outage.Source: D. N-k contingency screening · p. 8
  • For branch violations, base TabPFN average recall is 0.85 on held-out N-1 and 0.79 on N-2, versus DCPF’s 0.60 and 0.62, respectively.DCPF cannot screen voltage violations because it assumes 1 p.u. voltage at every bus; TabPFN voltage-screening AUC is 0.95 on both held-out N-1 and unseen N-2 contingencies.Source: D. N-k contingency screening · p. 8, Figure 6 · p. 9
  • Direct contingency classification performs much better than screening through PF neural surrogates; only TGN outperforms DCPF on combined screening across both datasets.The authors attribute poor predict-then-threshold accuracy to MSE-induced smoothing of extreme errors in branch angles or voltage magnitudes.Source: D. N-k contingency screening · p. 9

E. Voltage stability margin prediction

The VSM experiments compare in-distribution prediction with extrapolation to unseen loading levels. TabPFN performs well in several in-distribution settings, but all models struggle to predict low margins out of distribution.

E. Voltage stability margin prediction

  • The in-distribution and out-of-distribution experiments use family-separated VSM data, with the latter trained only on base operating points.The in-distribution experiment draws one operating point per family from base, augmented, and nose operating points; training sets contain 3600 independent points for 118 buses and 600 for 2000 buses.Source: E. Voltage stability margin prediction · p. 9
  • For in-distribution low margins, GNS leads on the 118-bus grid with 57.7% within ±0.01, while TabPFN leads on the 2000-bus grid.On 118 buses, TabPFN is second to GNS at low margins and second to GNS at higher margins; on 2000 buses, it is similar to LeapNet at higher margins.Source: Table II · p. 9, E. Voltage stability margin prediction · p. 10
  • 4.7% of GNS predictions fall within the ±0.01 tolerance for low-margin 118-bus out-of-distribution cases, and all models have poor low-margin accuracy.The authors identify this as evidence of difficulty extrapolating to unseen loading levels and note the importance of including low-margin or near-infeasible operating points in training.Source: E. Voltage stability margin prediction · p. 10, Table III · p. 10
  • 88% and 96% of samples fall within TabPFN’s predicted 90% interval on the 118-bus and 2000-bus grids, respectively.The authors report that the interval’s lower bound is a conservative estimate near the nose point, where point predictions overestimate the margin.Source: E. Voltage stability margin prediction · p. 10

V. DISCUSSIONS

Across three steady-state analysis tasks, TabPFN is competitive with task-specific baselines without retraining, though results vary by task and system size. The discussion highlights extrapolation and inference costs, while the conclusion frames pretrained TFMs as a potential alternative to task-specific neural surrogates.

V. DISCUSSIONS

  • TabPFN is competitive with task-specific baselines across tasks without fine-tuning, but no model consistently ranks best.On 118 buses, TabPFN has the lowest in-distribution PF errors for V and Q, LeapNet for P and θ, and GNS for VSM; on 2000 buses, TabPFN ranks near the top.Source: §V · pp. 10–11
  • On the 2000-bus system, GNN-based models have larger errors, while TabPFN ranks near the top for PF and VSM.The authors describe this as highlighting TabPFN’s potential to scale better than GNN-based models.Source: §V · p. 11
  • All ML models, including TabPFN, remain brittle in extrapolation; changing context data improves 2000-bus VSM accuracy by about 80%.Baselines do not match that improvement even when retrained with in-distribution operating points.Source: §V · p. 11
  • Predicting DCPF residuals improves TabPFN accuracy, while decoupling Pθ and VQ enables 2000-bus scaling without sacrificing accuracy.The proposed linear topology feature also improves average recall in contingency classification.Source: §V · p. 11
  • TabPFN assesses 3.1 million contingencies in about 2752 seconds, versus 637 seconds for DCPF, and its PF inference is considerably slower than baseline inference.TabPFN requires no training; its computational benefit lies in avoiding training rather than faster inference, and parallel target prediction may increase memory use.Source: Table IV · p. 11, §V · p. 11

VI. CONCLUSION

  • The paper concludes that pretrained TFMs can be a practical and simple alternative to task-specific neural surrogates for steady-state analysis.Future work includes larger systems, context selection, task-relevant features, and more efficient inference for multi-output tasks such as PF.Source: §VI · p. 12
Loading 2610.20462v1…