π€ AI Summary
This work addresses the challenge of embedding power flow (PF) solvers within neural networks for solving AC optimal power flow (AC-OPF), which typically complicates gradient computation and hinders compatibility with automatic differentiation frameworks. To overcome this, the paper proposes the FPL-OPF framework, which integrates a fast physics-aware layer into the neural network and constructs a truncated automatic differentiation graph only over the final few iterations of the power flow solver. This approach efficiently approximates implicit gradients without explicitly deriving Jacobian matrices or solving linear systems. By combining unsupervised learning with theoretical gradient analysis, FPL-OPF achieves significantly accelerated training, near-zero constraint violations, and solution quality on par with state-of-the-art methods across multiple test systems, thereby unifying physical feasibility, computational efficiency, and seamless integration with automatic differentiation.
π Abstract
Learning to solve the Alternating Current Optimal Power Flow (AC-OPF) problem by neural networks (NNs) is a promising approach in real-time applications. Existing methods to ensure the physical feasibility of NN outputs embed a power flow (PF) solver within networks. However, the gradient through the PF solver, namely, implicit differentiation, needs manual Jacobian derivation and the solution of linear systems, which is computationally prohibitive and hinders integration with modern automatic differentiation (AD) frameworks. To address these challenges, we propose FPL-OPF, a novel unsupervised learning framework that incorporates a Fast Physics-aware Layer for AC-OPF problems. FPL-OPF embeds a fast PF iterative solver within the NN and takes solely the last few or even the final iterations into the AD graph. This design ensures high computational efficiency for both the forward and backward passes, circumventing complex custom backward implementations. Theoretically, we rigorously prove that the gradient from this design serves as a high-fidelity surrogate of the true implicit gradient under mild conditions. Extensive experiments demonstrate that FPL-OPF achieves significant speedups over state-of-the-art unsupervised learning approaches, while maintaining near-zero constraint violations and competitive optimality. Our code is available at https://github.com/wowotou1998/fpl-opf