AI backkground giving a sense of power grids and foundtaional models

GridFM

Small foundation models for the electric grid

Architecture

GridSFM is a block-structured discrete neural operator that processes power grids as heterogeneous graphs. Following discrete exterior calculus (DEC) principles, bus quantities (voltage magnitude, angle, nodal injections) are treated as discrete 0-forms on graph vertices, while branch flows are 1-forms on oriented edges. The bus–branch incidence acts as the discrete exterior derivative coupling the two; Kirchhoff’s current law appears naturally as its codifferential. This formulation gives the architecture a coordinate-free, topology-agnostic view of power flow that transfers across grids of different size and connectivity.

A type-aware projection embeds heterogeneous node and edge features into a shared latent space, augmented with a topology-conditioned learned positional encoding. The latent representation is refined by a stack of N blocks, each applying three sub-operations in sequence with residual skips:

  1. A per-type global mixer — every node attends to every other node of its type.
  2. A topology-aware mixer along the grid’s edges — where node types interact and the grid’s topology enters.
  3. A per-type MLP.

Five prediction heads output bus voltage magnitude V, angle θ, generator active dispatch Pg, generator reactive dispatch Qg, and a feasibility verdict with a continuous margin. Branch flows (Pij, Qij) are computed analytically from the predicted bus state via the π-equivalent branch model with off-nominal tap ratio, following the PowerModels.jl polar-AC formulation. This keeps the model on the AC manifold by construction rather than as a soft constraint.

Training Data

GridSFM is trained on ~200 base transmission topologies drawn from three open sources:

  • PGLib-OPF — the IEEE PES benchmark library covering networks from hundreds to tens of thousands of buses.
  • OPFData — a large-scale AC-OPF dataset derived from PGLib-OPF.
  • The msr_* corpus — a 48-state continental-US transmission topology set plus six multi-state regions, built by our open-data pipeline (described below).

Each base topology is expanded via a multi-axis perturbation pipeline that varies, independently and in combination:

Generator merit order — cost coefficients shuffled on 40% of generators, so dispatch learns from physics and cost structure rather than per-grid orderings.

Load profiles — 0.8×–1.5× nominal global scaling with ±10% per-load jitter; a separate high-load variant from 1.1×–1.3× covers the upper-stress tail.

Generator availability — 30% of scenarios contain outages (70% single, 20% double, 10% triple element), weighted by Pmax.

Line ratings — 20% of scenarios derate 10% of branches to 70%–95% of nominal.

Voltage limits — 15% of scenarios tighten Vmin/Vmax on 10% of buses.

A synthetic-infeasibility pipeline generates targeted failure modes — voltage squeeze, thermal bottleneck, angle tightening, DC-thermal congestion — driving a balanced ~50/50 feasible/infeasible training mix. Across all topologies and scenarios, training spans more than half a million labeled samples.

GridSFM neural architecture: heterogeneous graph embedding feeds N blocks of attention and topological diffusion, with five prediction heads
GridSFM architecture diagram — heterogeneous-graph embedding, N transformer blocks with topological diffusion and skips, five prediction heads (V, θ, Pg, Qg, feasibility)

“On a brand-new grid, as few as ~10 fine-tuning scenarios already produce reasonable cost and dispatch estimates.”


A pipeline for building realistic open-data grid models

Companion to GridSFM, we built a five-stage pipeline that constructs complete, OPF-solvable transmission models entirely from public data:

  1. Extract power infrastructure from OpenStreetMap via a local Overpass API instance.
  2. Reconstruct bus-branch topology — voltage inference (neighbor consensus), line merging, and transformer detection.
  3. Estimate electrical parameters using voltage-class lookup tables calibrated with US Energy Information Administration plant-level data.
  4. Allocate hourly demand from EIA-930 to individual buses, using US Census population as a spatial proxy.
  5. Solve both DC and AC optimal power flow using PowerModels.jl with a progressive-relaxation strategy that automatically loosens constraints on imprecise models.
Reconstructed Virginia transmission grid: 661 buses, 744 lines, 519 transformers, and 65 generators built entirely from open data sources.
Final bus-branch model for Virginia — 661 buses colored by voltage class, 744 AC lines, 519 transformers, 65 generators sized by capacity

The pipeline was validated on all 48 contiguous US states and six multi-state regions, including the full Western (5,076 buses) and Eastern (21,697 buses) Interconnections. Of the 48 single-state models:

  • 42 of 48 (88%) converge at the strictest relaxation level for AC-OPF at peak hour.
  • 44 of 48 (92%) converge at off-peak.
  • Median dispatch cost: $22/MWh (range $2.6/MWh for hydro-dominated Vermont to $104.1/MWh for import-dependent Rhode Island).
  • Median system loss: 1.0% (range 0.2%–7.1%) — physically plausible against real US transmission losses of 2–3%.
  • AC–DC cost premium: median 1.8% (0.0–13.8%) — consistent with literature values.

All 54 models — 48 single-state and 6 multi-state — are publicly released at github.com/microsoft/GridSFM (opens in new tab).

Comparison to prior approaches

GridSFM is, to our knowledge, the first openly released learned AC-OPF surrogate trained jointly across ~200 base topologies. Most published learned AC-OPF surrogates are per-grid specialists — trained and evaluated on a single fixed topology. The closest comparable architecture, gridfm-graphkit (Linux Foundation Energy / IBM Research), is in the same accuracy class on per-grid metrics; GridSFM’s distinguishing properties are (a) a single backbone shared across grids, (b) feasibility as a first-class output, and (c) data efficiency: as few as ~10 fine-tune scenarios yield a useful model on a new grid.

Validated 48-state model results: dispatch costs and fuel mix across the contiguous United States, built from publicly available data only.
States ranked by DC-OPF dispatch cost with installed-capacity fuel mix alongside