arXiv:2608.25095eess.SYAug 2026

Manuscript Offprint

arXiv:2608.25095

Scalable Self-Supervised Learning for Multiphase AC-OPF in Distribution Systems with Topology Reconfiguration

Hoang T. Nguyen, Shaohui Liu, Reetam Sen Biswas, Varsha Pendyala, Nurali Virani, Deepjyoti Deka, Priya L. Donti

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Hoang T. Nguyen 1^{1}, Shaohui Liu 1^{1}, Reetam Sen Biswas 2^{2}, Varsha Pendyala 2^{2}, Nurali Virani 2^{2}, Deepjyoti Deka 1^{1}, and Priya L. Donti 1^{1}

Abstract—The proliferation of distributed energy resources (DERs) in distribution grids enables the active coordination of these assets to reduce costs and enable cleaner operations. Realizing this potential requires solving multiphase AC optimal power flow (AC-OPF) quickly across varying loads, DER availabilities, and topology reconfigurations, at much greater speed and scale than conventional nonlinear solvers. Learning-based surrogates can offer millisecond inference, yet existing methods target largely balanced transmission systems and do not scale to the multiphase, unbalanced, and reconfigurable nature of distribution feeders at utility scale. We present the Penalty + Sequential Linearized Feasibility Seeking (SLFS) algorithm, a self-supervised learning framework for multiphase distribution AC-OPF under switch-induced topology changes. Penalty+SLFS requires no labeled optimal solutions and trains directly from the AC-OPF objective and constraints through a differentiable fixed-point power flow solver, avoiding expensive label generation and admitting robust training procedures. Topology changes are handled efficiently using Sherman–Morrison–Woodbury updates of the admittance-matrix inverse, while an M-step Jacobian approximation accelerates differentiation through the power flow solver. At inference, SLFS repairs any infeasible predictions, providing feasibility guarantees with low computational overhead. On IEEE feeders ranging from 13 to 8,500 nodes, Penalty+SLFS achieves negligible optimality gaps and near-zero constraint violations, delivers up to three orders of magnitude speedups over IPOPT, and remains robust under large distributional shifts, demonstrating a viable path toward real-time, topology-aware AC-OPF for large-scale distribution grids.

I. INTRODUCTION

Distribution grids are evolving into actively controlled cyber–physical systems. The growing penetration of inverter-interfaced distributed energy resources (DERs) and electrified loads intensifies variability and tightens operational limits such as voltage and current constraints [1]. These challenges are exacerbated in distribution feeders, which are often multiphase and unbalanced, include switches inducing topology changes, and require operators to evaluate many load/DER/switch scenarios in near real time [2], [3]. AC optimal power flow (AC-OPF) provides a structured approach to coordinate distribution assets and minimize constraint violations. Unfortunately, AC-OPF is inherently nonlinear and nonconvex, making it difficult to solve reliably and quickly in large-scale systems. These long solve times pose a bottleneck for real-time operations, look-ahead analysis, and interconnection studies.

Learning-based approaches can accelerate OPF by, e.g., learning warm starts [4], predicting active constraints [5], learning iterative steps of a solver [6], or learning direct solution mappings [7]–[10]. Among these, the latter approach offers the potential for orders-of-magnitude speedups by directly mapping from operating conditions to OPF solutions, often in milliseconds at inference time. For instance, learning-based approaches for transmission AC-OPF are able to produce high-quality solutions two to three orders of magnitude faster than traditional solvers [7], [9]; however, these gains have not yet been translated to distribution feeders, motivating our work.

The literature has explored two main approaches for learning direct solution mappings: supervised learning and self-supervised learning. Supervised learning approaches learn mappings by using offline-generated optimal solutions as labels within a regression error loss function [11]–[13]. While supervised training is typically straightforward, it requires labeled OPF solutions generated via successful AC-OPF solves; such labels can be expensive to obtain at scale and generally represent only feasible points (i.e., infeasible samples are generally eliminated from training). While dataset pipelines such as OPF-Learn [14] tighten sampling around the feasible region and increase the yield of usable labels, data generation can still take hours to days and scale poorly with grid size [14]–[16]. Recent grid foundation models follow this supervised, labeled-data route at transmission scale: IBM GridFM/GENCO unifies power flow, AC-OPF, and state estimation in one architecture [17], [18], Microsoft GridSFM predicts AC-OPF solutions across multiple transmission topologies [19], and LUMINA evaluates multi-topology pretraining and transfer for AC-OPF surrogates [20]. Self-supervised approaches avoid this labeled-data bottleneck by training directly against the optimization structure, i.e., the objective and constraint violations [7], [9], [10], [21]. While this sometimes comes at the cost of training stability [22], nonetheless, self-supervised methods for transmission AC-OPF and SCOPF have been shown to match or exceed supervised surrogates while avoiding large labeled datasets [16], [23], [24].

A key challenge for both self-supervised and supervised methods is feasibility enforcement, i.e., raw neural-network predictions frequently violate physical constraints. To address this, many works penalize constraint violations in the loss via Lagrange multipliers [20], [25]–[28], which can improve reliability relative to pure supervised objectives, especially under distributional shift [20]. However, while these methods

1^{1} Massachusetts Institute of Technology, Cambridge, MA, USA.

2^{2} GE Vernova Advanced Research Center, Niskayuna, NY, USA.

TABLE I NOMENCLATURE

encourage constraint satisfaction, they do not strictly enforce it, so trained models may still return infeasible solutions [9]. An alternative is to include hard feasibility enforcement components within training and inference, correcting raw predictions into feasible solutions [9], [10], [21]. Although such methods can enforce feasibility, they are often substantially more expensive than pure penalty-based methods due to the cost of the enforcement process and the need to differentiate through it during training.

Distribution AC-OPF imposes three additional requirements that existing surrogates rarely satisfy simultaneously: handling multiphase unbalanced physics, validity across discrete switch configurations, and feeders with thousands of nodes. Switch reconfiguration is routine in distribution operations for loss minimization and service restoration, and a separate literature optimizes the switch positions themselves [3], [29], [30]. Because each configuration alters the nodal admittance matrix and the power flows, a surrogate must condition on the switch status. Multiphase distribution learning has targeted power flow rather than OPF [31], while supervised distribution OPF surrogates generally either assume a fixed topology and/or inherit the labeled-data cost discussed above [32].

Motivated by these gaps, we contribute the following:

  1. Penalty+SLFS approach: We introduce a self-supervised surrogate for multiphase distribution AC-OPF that includes an efficient differentiable power-flow solver in its architecture, trains with a penalty-based loss, and employs a novel feasibility-seeking procedure at inference. Penalty+SLFS scales to large unbalanced feeders with switch-induced topology reconfiguration and remains accurate and robust under shifts in loads and DERs.

  2. Scalable feasibility enforcement: We propose a sequential linearized feasibility-seeking (SLFS) algorithm that iteratively refines setpoints via successive linearizations and exploits distribution network structure to enforce operational limits at inference time. The algorithm uses only matrix-vector operations and is GPU-friendly. Under standard assumptions, we prove that constraint violations decrease monotonically using SLFS.

  3. Efficient training: We improve training efficiency via two innovations. (i) We use an M-step Jacobian approximation for unrolled differentiation through the fixed-point power flow solver, which improves speed and memory-efficiency compared to implicit differentiation. We provide approximation error bounds under standard assumptions. (ii) To efficiently handle topology reconfiguration, we use the Sherman–Morrison–Woodbury (SMW) identity, with iterative refinement for ill-conditioned cases, to efficiently update the inverse admittance matrix across switch configurations in training and inference.

  4. Robust training: Unlike supervised pipelines that rely on specialized feasible-region sampling, our method trains on both feasible and infeasible instances, improving generalization and robustness under distributional shift. This is possible because training requires only input samples—not labeled OPF solutions—and thus data are inexpensive to create and need not be limited to feasible points.

  5. Large-scale validation: We validate Penalty+SLFS on

SymbolDescription
P={1,…,Np}\mathcal{P} = \{1, \dots, N_p\}Non-slack phase nodes
E,Esw\mathcal{E}, \mathcal{E}_{\text{sw}}Static phase-level branches and switch branches
D\mathcal{D}Set of DER units
NcN_cNumber of DER unit-phase controls
nk∈Pn_k \in \mathcal{P}Injection node of the k-th DER setpoint
z=(zmn)(m,n)∈Esw\mathbf{z} = (z_{mn})_{(m,n) \in \mathcal{E}_{\text{sw}}}Switch status (1=closed, 0=open)
v,∣v∣min⁡/max⁡\mathbf{v}, |\mathbf{v}|^{\min/\max}Complex voltages (vn)n∈P(v_n)_{n \in \mathcal{P}} and magnitude bounds
αmnmax\alpha_{mn}^{\text{max}}Max. angle difference on (m,n)(m, n)
sload,sder\mathbf{s}^{\text{load}}, \mathbf{s}^{\text{der}}Load/DER apparent-power injections
pj,ϕder,qj,ϕder,sj,ϕder,maxp_{j,\phi}^{\text{der}}, q_{j,\phi}^{\text{der}}, s_{j,\phi}^{\text{der,max}}Active/reactive/max. apparent power of DER unit jj, phase ϕ\phi
pjder,pjder,availp_{j}^{\text{der}}, p_{j}^{\text{der,avail}}Aggregate and available active power of unit jj
pder,qder\mathbf{p}^{\text{der}}, \mathbf{q}^{\text{der}}Stacked DER P/QP/Q setpoints (length NcN_c)
pder,min/max,qder,min/max\mathbf{p}^{\text{der,min/max}}, \mathbf{q}^{\text{der,min/max}}Bounds on pder,qder\mathbf{p}^{\text{der}}, \mathbf{q}^{\text{der}}
sj,ϕder,maxs_{j,\phi}^{\text{der,max}}Max. apparent power of unit jj, phase ϕ\phi
Y(z)\mathbf{Y}(\mathbf{z})Topology-dependent admittance matrix
ymny_{mn}Series admittance of branch (m,n)(m, n)
imnmax,imnmaxi_{mn}^{\text{max}}, i_{mn}^{\text{max}}Branch current and thermal rating on (m,n)(m, n)
s0,s0max\mathbf{s}_0, \mathbf{s}_0^{\text{max}}Substation apparent power and its limit
Φ0,Φj\Phi_0, \Phi_jPhases at the slack bus and of DER unit jj

multiphase distribution systems with topology reconfiguration across grids ranging in size from 13 to 8,500 nodes. Penalty+SLFS provides scalable, high-quality solutions with inference speedups of up to two to three orders of magnitude over IPOPT on medium-to-large feeders.

Notation: Bold lower-case (upper-case) letters denote vectors (matrices); (⋅)⊤(\cdot)^{\top} and diag(⋅)\text{diag}(\cdot) denote transpose and diagonalization. For a complex quantity, ℜ{⋅}\Re\{\cdot\}, ℑ{⋅}\Im\{\cdot\}, jj, and (⋅)‾\overline{(\cdot)} denote the real part, imaginary part, imaginary unit, and complex conjugate. For A∈Cn×m\mathbf{A} \in \mathbb{C}^{n \times m}, ∥A∥p\|\mathbf{A}\|_p is the induced pp-norm. The map clip(x,l,u\mathbf{x}, \mathbf{l}, \mathbf{u}) = min⁡(max⁡(x,l),u)\min(\max(\mathbf{x}, \mathbf{l}), \mathbf{u}) denotes elementwise clipping. For f:Cn→Cm\mathbf{f} : \mathbb{C}^n \to \mathbb{C}^m, Jsf(s)J_{\mathbf{s}}\mathbf{f}(\mathbf{s}) denotes the real representation of its Jacobian.

References (42)