Solver-Admitted Metamorphic Testing of Learned Network Optimization Surrogates

Vineet Jagadeesan Nair, Stephen Peng, Arun RavindranarXiv 2026

TL;DR

Neural network surrogates for complex optimization problems often produce wildly different predictions for identical problems just by changing how the input is encoded (e.g., renumbering nodes). This paper introduces a "solver-admitted" metamorphic testing framework that uses traditional solvers to validate test cases, revealing that current state-of-the-art models for power grids and routing suffer from deep structural inconsistencies that standard accuracy metrics fail to detect.

What Problem Does This Paper Address?

In fields like power systems and logistics, we are increasingly replacing slow, traditional optimization solvers with fast "learned surrogates"—neural networks trained to predict optimal solutions. However, these models often lack equivariance: if you reorder the rows in a data table or rotate a map of cities, the model's prediction should change in a predictable, corresponding way. If it doesn't, the model is essentially "hallucinating" based on arbitrary encoding choices rather than the underlying physics or logic of the problem.

The challenge is that optimization problems often have multiple optima or numerical noise, making it hard to tell if a difference in prediction is a "bug" or just a valid alternative. This paper provides a rigorous way to audit these models for internal consistency while accounting for these nuances.

Methods

The authors propose a three-stage metamorphic testing pipeline:

  1. Transformation & Eligibility: Apply a problem-preserving transformation $T$ to an input $d$ (e.g., relabeling buses in a power grid).
  2. Admission by Re-Solving: To ensure the test is fair, a traditional "reference" solver (like IPOPT for power flow or Concorde for TSP) solves both the original and transformed problems. The test only proceeds if the solver confirms the problems are truly equivalent (e.g., they have the same optimal cost).
  3. Verdict with Numerical Floors: The model's predictions for both inputs are compared. To distinguish between harmless floating-point round-off and actual structural failures, the authors calibrate "numerical floors" by comparing results across different precisions (float32 vs. float64).
Fig. 1. From a relation to a test: admission re-solves both inputs to check the sampled transformation, and the verdict compares aligned predictions with the floor. Admission evidence depends on the solver’s guarantees.

The authors categorized relations into "Tiers," ranging from simple relabeling (Tier A) to structural changes like splitting a load into two smaller ones (Tier B).

Datasets

The study audits several high-profile neural solvers across four domains:

  • AC Optimal Power Flow (AC-OPF): Tested on standard IEEE grids (case14, case118) and larger benchmarks from the PGLib-OPF library (up to 4661 buses). Models included GridSFM-Open, LUMINA-2M, and GENCO.
  • Traveling Salesman Problem (TSP): Euclidean instances with 20 to 100 cities.
  • Capacitated Vehicle Routing (CVRP): 100-customer instances.
  • Maximum Independent Set (MIS): Graphs from the SATLIB library.

Key Insights and Ideas

  • Architecture is the Culprit: Surprisingly, randomly initialized models failed metamorphic tests almost as often as trained ones. This suggests that the inconsistencies are baked into the model architectures and input features (like using raw bus indices or fixed row orders) rather than being a byproduct of the training process.
  • Consistency $\neq$ Quality: The authors found that "fixing" a model to be consistent—for example, by sorting input rows into a canonical order—doesn't automatically make it better. In some cases, enforcing consistency actually degraded the model's accuracy or its ability to find feasible solutions.
  • The "Floor" Matters: Without calibrated numerical floors, researchers might over-report failures due to simple 32-bit arithmetic noise. The authors' precision calibration (shown in Figure 2) provides a principled way to separate "round-off" from "structural" discrepancies.
  • Scale Sensitivity: In routing models (like POMO), the rate of failures on rotation/reflection tests skyrocketed as the number of cities increased, reaching nearly 90% for 100-city problems.

Key Results

  • Widespread Failures: The GridSFM-Open model violated all 13 tested metamorphic relations on at least one grid. Many violations were massive—up to 30,000 times the numerical threshold.
  • Failure Heatmap: Figure 3 illustrates the prevalence of failures across different grid models and sizes. Even "foundation models" like LUMINA failed 9 out of 13 relations.
Fig. 3. Numbers give failing grids over evaluated grids. Color shows the largest max(δmean/10−6, δmax/10−5) on a logarithmic scale capped at 105, with white indicating all pass. Outlined GENCO cells fail only through float32 round-off. The float64 column counts relations that still fail after precision reruns. ≈ marks a deciding draw within twice the floor. The bottom row counts mechanism controls failing on case14 or case500.
  • Routing Inconsistency: For TSP, the POMO model showed a rotation/reflection violation rate that rose from 12.7% at 20 cities to 89.5% at 100 cities, despite having small mean optimality gaps.
  • MIS Normalization: The DIFUSCO model for MIS failed "disjoint-union" tests (where two separate graphs are solved together) in 35.6% of cases because its internal normalization logic leaked information across disconnected components.

Limitations and Future Work

  • Reference Solver Dependency: The "admission" step requires a traditional solver, which can be computationally expensive and may not always find the global optimum for non-convex problems.
  • Post-hoc Repairs: The interventions tested (like canonicalization and patching) were developed after the models were trained. The authors note that future work should investigate whether training from scratch with these "repaired" features can preserve both consistency and solution quality.
  • Non-Unique Optima: While the authors attempted to account for multiple optima using multi-start solvers and convex relaxations, certifying the full set of global optima for non-convex problems remains an open challenge.

Summary updated

Abstract

Equivalent encodings of an optimization problem can produce different learned predictions. Interpreting these differences requires accounting for numerical error and multiple optima. We construct metamorphic tests for optimization solver surrogates with explicit eligibility conditions, output alignment, and numerical thresholds. Reference-solver agreement and independent constraint checks determine which sampled pairs enter the audit. We study alternating-current optimal power flow (AC-OPF), the traveling salesman problem (TSP), the capacitated vehicle routing problem (CVRP), and maximum independent set (MIS). Across five grids, GridSFM-Open violates each of 13 relations on at least one grid, and 12 by more than twice the threshold. Randomly initialized copies of the grid models fail nearly the same relations, so the failures do not require training. Source patches and input canonicalization remove selected discrepancies, but no intervention establishes preserved accuracy and feasibility within the declared margin on every grid. In routing, Policy Optimization with Multiple Optima (POMO) has a single-pass rotation/reflection violation rate that rises from 12.7% to 89.5% between 20 and 100 cities. Graph-Based Diffusion Solvers for Combinatorial Optimization (DIFUSCO) violates the MIS disjoint-union relation on 35.6% of draws. Post hoc normalization within connected components removes these violations on the tested graphs. These findings support reporting metamorphic consistency alongside optimality, feasibility, and accuracy, and validating repair quality separately from consistency.
BibTeX
@misc{nair2026solver,
  author = {Vineet Jagadeesan Nair and Stephen Peng and Arun Ravindran},
  title = {{Solver-Admitted Metamorphic Testing of Learned Network Optimization Surrogates}},
  year = {2026},
  eprint = {2611.08837},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2611.08837},
}
Figure