Spaces:
Running
Alternating Current Robust Secure Sets (AC-RSS) with GENCO in the Loop: Benders Decomposition and Conformal Screening with a No-Miss Guarantee
Muhammad Abdillah — Electrical Engineering Study Program, Universitas Pertamina, Jakarta, Indonesia
· m.abdillah@universitaspertamina.ac.id
GitHub repository: https://github.com/abdillah8384/genco-certified-ac-rss
· Paper with full proofs: https://github.com/abdillah8384/genco-certified-ac-rss/blob/main/Document_Proof_Mathematical_Model/paper_ieee.pdf
· Not affiliated with IBM.
Abstract
In the alternating current robust security (AC-RS) framework, the robust secure set (RSS) gives, for every hour, the range of dispatch that remains secure for every PV and load realization in a forecast box, in the base case and in N-1 contingencies. In the author's dissertation (https://hiroshima.repo.nii.ac.jp/records/2003847), it was computed with DC power flow and a big-M KKT MILP. This work makes the DC solution certified and then makes it AC-aware with GENCO in the loop. A two-phase combinatorial Benders decomposition solves all 48 hourly bilevel problems of an IEEE 118-bus study with 20 PV buses to certified optimality and shows that the big-M MILP misreports 20 of them by up to 6.3 MW. Exact AC power flow (gridfm-datakit) shows that 45 of 48 certified DC limits are AC-insecure; a GENCO-in-the-loop correction removes the violations and shows that DC overstates the secure range by 43% on average. Finally, the AC mismatch that GENCO measures inside its own corrective layers explains 56 % of its error. This physics-trajectory recalibration (PTR), wrapped in split-conformal screening, skips exact AC for 54% of the secure scenarios (plain conformal: 4.7%) with a proven bound of 5% on missed insecure scenarios (observed 0.09%), also in a topology GENCO never saw.
Introduction
Grid foundation models such as GENCO can predict AC power flow quickly and differently, but a security decision needs a guarantee. This work asks how a foundation model can be used inside a certified security workflow without giving up the certificate: certification where it can be had (Benders bounds, exact AC verification), and GENCO where it is strong (batched, differentiable prediction with an internal physics check). The main contributions are (i) a two-phase Benders decomposition of the RSS bilevel problem without primal big-M and with a certified bound; (ii) a GENCO-in-the-loop AC correction of the DC robust secure set; (iii) physics-trajectory recalibration, which turns GENCO's own per-layer AC mismatch into an error model, and a split-conformal screen built on it with a finite-sample no-miss guarantee; and (iv) complete proofs of all statements and numerical checks of each of them.Methodology
2.1. Study setup
The study uses the PGLib-OPF IEEE 118-bus case (19 dispatchable units, 186 branches), 20 PV buses, the hourly load and PV profile of the dissertation, and three topologies: the base case and the loss of one circuit of the double corridors 69–70 and 100–103. A fourth topology (one circuit of 49–66 lost) is never used for training and serves as an unseen-topology test. All exact AC power flows are computed with gridfm-datakit 1.1.0 (lightsim2grid Newton–Raphson). GENCO (GNS_heterogeneous, PowerFlow task) was trained with gridfm-graphkit 0.9.0.3 on 24,000 datakit scenarios of the RSS operating region (1,077,891 parameters, CPU).
2.2. Robust secure set model
Nature chooses the PV and load vector p in the hourly box; the operator answers with the dispatch u. The DC line limits in the three topologies, the power balance, and the ramp-limited unit bounds define the feasible dispatch set U(p), and the RSS limits of the index α = dᵀu (total output of the non-balancing units) are the two bilevel problems in (4):
2.3. Two-phase Benders decomposition
The master problem keeps p, u, and binary variables z that encode which units are active and which constraints are binding. Instead of a big-M constant, it uses exact bounds S computed from the data (5), plus a robust value-function cut (6). The subproblem checks whether a dual certificate (7) exists for the master's pattern; if not, a Farkas certificate gives the combinatorial cut (8). If phase 1 stalls, the duals are lifted into the master with a bound on the dual side only (phase 2).
2.4. GENCO in the loop and AC correction
For every hour and limit, a pool of PV/load vertices (the Benders worst case, 60 random vertices, and GENCO-gradient vertices) and their DC dispatch responses is evaluated in all three topologies. GENCO predicts the security quantities (9) for the whole pool in one batch; the conformal rule of Section 2.5 decides which scenarios are sent to exact AC; every verified overload tightens the DC limit of that branch and topology (10); Benders is solved again until no verified violation remains.
2.5. Physics-trajectory recalibration and conformal screening
Inside each of its K corrective layers GENCO evaluates the AC mismatch of its intermediate estimate; a forward hook records the trajectory (11) at no extra cost. A gradient-boosted regressor fitted on a tune split learns GENCO's error from this trajectory (12). On an independent calibration split, the conformal threshold (13) decides which scenarios can be cleared without exact AC (14). The GENCO-gradient adversary maximizes a smooth maximum of predicted loading over the box (15).
2.6. Theoretical guarantees
- Results and Discussion
3.1. Certified DC robust secure set
Table 1 compares the two-phase Benders decomposition with the big-M KKT MILP of the dissertation code (same HiGHS solver, same computer). For the MILP, the reported objective is compared with the value that its own decision really attains (follower re-solved exactly).

Table 1. Certified DC-RSS: two-phase Benders vs. big-M KKT MILP
The big-M errors are of the order of the solver's integrality tolerance times L (10⁻⁶ × 5·10⁴ = 0.05 p.u.); the Benders incumbent is always re-solved exactly, so its reported value is always attained. The mean DC secure range is 644 MW.

Figure 1. (a) Certified DC limits per hour and AC-corrected limits (Section 3.4). (b) Big-M MILP: reported minus attained value. (c) Measured solve time per hour.
3.2. GENCO accuracy and its corrective-layer trajectory
GENCO predicts the maximum branch loading with a mean absolute error of 2.75% of the rating on the training distribution, 3.14% on the screening distribution, and 2.95% in the unseen topology. The AC mismatch inside GENCO contracts by more than two orders of magnitude over the 10 layers, almost identically in the unseen topology. Single numbers of that trajectory are weak error indicators (Spearman 0.23), but the whole trajectory is informative: alone it removes 37% of the error, and PTR (trajectory plus
GENCO outputs remove 56% (3.11% → 1.36%; unseen topology 2.95% → 1.84%).

Figure 2. (a) GENCO vs. exact AC maximum branch loading by topology. (b) AC mismatch inside GENCO, layer by layer. (c) Ablation: what the recalibrator sees vs. remaining error.
3.3. Screening with a guarantee
Table 2 reports the share of secure scenarios that can be cleared without exact AC and the observed miss rate (insecure and cleared), averaged over 20 random tune/calibration/test splits (266 of 1000 test scenarios are insecure, because the screening scenarios sit on the RSS boundary by construction).

Table 2. Conformal screening: secure scenarios cleared without exact AC and observed miss rate (mean of 20 splits).

Figure 3. Conformal upper bound on the maximum branch loading vs. exact AC at α = 0.05. Green: cleared without exact AC. Plain conformal has to keep almost every scenario; PTR clears most secure ones, also in the unseen topology.

Figure 4. Secure scenarios cleared and miss rate as functions of α over 20 random splits (band = min–max). The miss rate always stays far below the guarantee α.
3.4. AC-corrected robust secure set
In 45 of 48 hour-limit problems the certified DC limit is not AC-secure (worst branch at 114.3% of its rating). The GENCO-in-the-loop correction removes all verified violations in at most 3 iterations (29 s per limit). It moves 28 of 48 limits by up to 279 MW (hour 21, lower limit), and the mean secure range falls from 644 MW to 414 MW. In hour 18 the corrected set is empty, although DC reports 271 MW. PTR cleared 35 % of the 19,500 pool scenarios; a full audit with exact AC found 1 missed insecure scenario (first iteration of one; none in any final iteration). The GENCO-gradient adversary found a worse vertex than all Benders and random vertices in 41 of 100 searches, by at most 1.2% of the rating.

Figure 5. (a) Secure range removed by the AC correction per hour and limit. (b) Worst exact-AC loading at GENCO-adversarial vs. Benders/random vertices.
3.5. Extension: second-life EV batteries
Second-life EV batteries at the 20 PV sites (power = state of health × 0.35 × PV capacity) were added as dispatch resources. They widen the certified DC range by 562 MW on average (361–763 MW). The worstcase points remain AC-insecure in 35 of 48 cases, so the AC correction is needed with batteries too.

Figure 6. RSS width with and without second-life batteries.
Conclusions
A certified Benders bound, exact AC where it matters, and GENCO with physics-trajectory recalibration where a guarantee allows exact AC to be skipped together turn the DC robust secure set of the dissertation into an AC-aware one. The study showed that (i) the big-M MILP can report values it does not attain, while the Benders certificate cannot; (ii) the certified DC limits are mostly AC-insecure and overstate the secure range by 43 % on average; and (iii) GENCO's own corrective-layer trajectory is a strong, free signal of its error, which makes guaranteed screening practical.Limitations and Next Steps
a. The official GENCO checkpoints could not be downloaded from the author's environment, so a small GENCO was trained from scratch on CPU; the code loads official weights unchanged, and a stronger model will change all GENCO numbers.
b. No speed claim: on this 118-bus case on CPU, exact AC takes 0.29 ms and GENCO 10.3 ms per scenario. The value shown is the share of exact checks that can be skipped with a guarantee, which matters where exact checks are expensive (large grids, AC-OPF re-dispatch, many contingencies, GPU batches).
c. The AC correction tightens active-power limits; the corrected limits are conservative and verified on the screened pool, not over the continuous box. Generator reactive limits are reported, not enforced.
d. The conformal guarantee assumes exchangeability; the unseen-topology results are an empirical robustness check.
e. Next steps: official GENCO checkpoints on GPU, larger grids, an exact AC robust counterpart, and reactive-power-aware correction cuts.Code, Model and Data
a. GitHub repository: https://github.com/abdillah8384/genco-certified-ac-rss — code, datageneration recipe, trained GENCO weights, all results and figures, Gradio app (python app.py ).
b. Paper (IEEE format, with the complete model and all proofs in the appendix):
https://github.com/abdillah8384/genco-certified-ac-rss/blob/main/Document_Proof_Mathematical_Model/paper_ieee.pdf
c. Supplement (complete formulation and proofs):
https://github.com/abdillah8384/genco-certified-ac-rss/blob/main/Document_Proof_Mathematical_Model/supplement_proofs.pdf
d. Reproduce:
bash setup.sh then python genco_ac_rssr_challenge.py (everything, about 6 h on 2 CPU cores) or python genco_ac_rssr_challenge.py --steps e1, e3, e4, e5, fig, numbers, with the shipped weights (about 45 min). pytest -q tests. checks every proved statement numerically.
Use of AI: The authors utilized Anthropic's Claude Code to assist in developing the code and writing the text, comprehensively reviewing all AI-generated content before finalization.
Thank you to the GridFM team for GENCO, gridfm-graphkit and gridfm-datakit.




