Search arXivSearch

arXiv · 2607.12241

Gradient-Free Topology Adaptation for Power Flow Surrogates via In-Context Whitening

Abstract

Machine-learned surrogates for the AC power flow (ACPF) problem amortize the cost of repeated solves on a fixed network, but lose one to two orders of magnitude of accuracy when a line outage changes the topology. This degradation is an operator shift. The altered admittance matrix changes the input-to-output map, so identical inputs yield a different output distribution. Existing methods correct this with target-topology data and per-topology gradient steps. We ask whether the correction can instead be made statistical and gradient-free. We propose In-Context Whitening (ICW), which trains an ACPF surrogate in an output space whitened by the base topology's first two moments, and adapts it to an unseen N-1 or N-2 topology by re-estimating that whitening from a few hundred solved cases on the new topology. This adaptation is gradient-free, weight-free, and architecture-agnostic. We prove that among affine whiteners the unique choice that preserves the coordinate-wise semantics of the physical output vector is ZCA whitening, so within efficient invertible corrections, two moments are sufficient. Across the IEEE 30-, 118-, and 300-bus systems under N-1 and N-2 contingencies, ICW reduces overall error by 6$\times$ to 28$\times$ over frozen surrogates (up to 54$\times$ per-quantity under N-2) and cuts worst-bus power-balance mismatch by up to 30$\times$, with consistent gains across three backbones. At deployment scale it matches or beats gradient-based adaptation in accuracy while adapting 21$\times$ to 34$\times$ faster, with a cost that parallelizes on commodity CPU cores rather than requiring one GPU per contingency.

Explore related subjects

Keep this discovery

Explore connections, maps & timelines

BibTeXRIS

Ayushi Jolotia, Parikshit Pareek. 2026-07-14. Gradient-Free Topology Adaptation for Power Flow Surrogates via In-Context Whitening. https://arxiv.org/abs/2607.12241

Cite the original work for its findings. Save a collection to share your selection of sources.

KEEP EXPLORING

Related papers

Failure-Aware Iterative Learning of State-Control Invariant Sets

In this paper, we address the problem of computing maximal state-control invariant sets for deterministic linear systems using failing trajectories. We introduce the concept of state-control invariance, which extends control invariance from the state space to the joint state-control space. The maximal state-control invariant (MSCI) set simultaneously encodes the maximal control invariant set (MCI) and, for each state in the MCI, the set of control inputs that preserve invariance. We prove that the state projection of the MSCI is the MCI and the state-dependent sections of the MSCI are the admissible invariance-preserving inputs. Building on this framework, we develop a Failure-Aware Iterative Learning (FAIL) algorithm for deterministic linear time-invariant systems with polytopic constraints. The algorithm iteratively updates a constraint set in the state-control space by learning predecessor halfspaces from one-step failing state-input pairs, without knowing the dynamics. For each failure, FAIL learns the violated halfspaces of the predecessor of the constraint set by a regression on failing trajectories. We prove that the learned constraint set converges monotonically to the MSCI. Numerical experiments on a double integrator system validate the proposed approach.

eess.SY

Consensus and Synchronization of Multi-agent Systems over Finite Fields - Graph Topologies

This paper presents cooperative protocols for multi-agent systems with agents having a finite state-space. Both scalar single-integrator consensus and general LTI system synchronization are considered. Systems having a finite state-space describe agents with minimal memory capacity processing only a finite alphabet. Such systems are remarkably resilient to communication noise. The crucial problem, however, is to construct the admissible communication topology, which is NP-hard. We address this by efficiently exploring the subsets of admissible graph matrices and propose two new algorithms to generate them. Simulations validate the proposed approach.

eess.SY

Extracting Exact Lie Derivatives Without Backpropagation: A Dual Compiler for Neural Control Barrier Functions

A safety filter based on a neural control barrier function (CBF) deployed in an embedded control loop evaluates, at each control cycle, the trained network and its Lie derivatives along the system vector fields, under the memory and worst-case execution time (WCET) constraints that safety-oriented coding standards impose. Reverse-mode automatic differentiation, by which training frameworks obtain these derivatives, retains an activation cache whose size grows with the sum of the layer widths, and general-purpose differentiation runtimes allocate the computational graph from the heap at each call. This paper presents a compiler that evaluates a neural CBF and its exact Lie derivatives by forward-mode dual-number arithmetic. The compiler emits self-contained C++ code in which a single forward pass, without backpropagation, returns the barrier value and its exact Lie derivative along a given vector field; the drift and input Lie derivatives of the safety constraint are obtained from one such pass per vector field, and a second-order extension based on hyper-dual numbers returns the exact second-order Lie derivatives required by CBFs of relative degree two. The dual forward pass requires a workspace bounded by four times the widest layer, independent of network depth, and the emitted code contains no allocation call sites, so the absence of dynamic allocation is verifiable by inspection of the code. On an ESP32-S3 microcontroller, the compiled filter assembles the complete safety constraint in under one millisecond from statically allocated buffers of at most 768 bytes, and the maximum execution time over 1000 evaluations lies within 5% of the median in all three examples, whereas a heap-allocating reverse-mode baseline shows maxima 33% and 70% above its median in the two first-order examples. The compiler and the embedded experiments are released as open-source software.

eess.SY