Masked Sobolev Training for Feasibility-Reliable Optimization Proxies

Andrew W. Rosemberg, Joaquim Dias Garcia, Russell Bent, Pascal Van HentenryckNeurIPS 2026

TL;DR

Training neural networks to mimic heavy-duty optimization solvers allows us to make complex, real-time decisions in milliseconds—until those networks hallucinate physically impossible answers that violate hard constraints. This paper shows how to teach neural networks not just what the optimal answer is, but how that answer shifts locally when inputs nudge, using a clever random-masking trick. By feeding the network just a tiny, sparse fraction of these solver derivatives during training, we get dramatically safer, constraint-respecting predictions without slowing down inference at deployment.

What Problem Does This Paper Address?

Imagine managing an electric power grid. Every few minutes, demand fluctuates, and you have to solve a massive, nonlinear math problem to route electricity cheaply without melting power lines. Classical optimization solvers find exact answers, but they can be painfully slow. Enter optimization proxies: neural networks trained to map problem inputs (like power demand) directly to optimal decisions in a single, millisecond-scale forward pass.

The catch? Standard supervised learning only teaches the network to match optimal output values. Constrained optimization landscapes are tricky: they are smooth in local pockets, but whenever a new physical limit (an "active constraint") hits its ceiling, the solution's behavior kinks sharply. Across a complex system, the input space fractures into combinatorially many of these pockets. A standard neural network interpolating blindly between training points can easily drift across boundaries, yielding low average error while quietly violating critical physical laws—like power-flow limits—in the worst-case scenarios.

Methods

To give the network a better feel for the local terrain, the authors turn to Sobolev training—a technique where a model learns to match both function values and their first derivatives (Jacobians). Here, the derivatives aren't ordinary gradients; they are solver sensitivities, extracted offline by differentiating through the optimization solver's optimality (KKT) conditions. They tell the network: "If demand at node A ticks up slightly, here is how generator B responds."

Architecture of Masked Sobolev Training, splitting offline solver sensitivity extraction from online masked neural network training.

However, matching the entire Jacobian matrix in large constrained problems backfires: it is computationally heavy, and sensitivities from neighboring, conflicting constraint regimes end up pulling the network's weights in opposite directions.

What's new here is sparse stochastic masked Sobolev training:

  • Offline: A classical solver generates optimal solutions and local sensitivity matrices for sampled inputs.
  • Online: During each training step, a uniform random binary mask selects only a tiny fraction (say, 5–10%) of Jacobian entries to supervise via automatic differentiation, normalized so the overall derivative loss weight stays unbiased.
  • Deployment: All derivative machinery and solvers are stripped away, leaving a fast, standard neural network forward pass.

Datasets

Rather than introducing new benchmarks, the authors evaluate their method across three distinct, existing problem families designed to test different geometric regimes:

  • Acrobot Swing-Up (Optimal Control): Trajectory data distilled from a Proximal Policy Optimization (PPO) reference controller on an underactuated two-link pendulum.
  • PGLib AC Optimal Power Flow (AC-OPF): Three realistic electric grid benchmarks—ieee300 (300 buses), pegase1k, and rte6k (up to 6,468 buses)—testing large-scale nonlinear equality and inequality constraints.
  • Markowitz Portfolio Selection: Synthetic financial instances featuring a second-order-cone risk constraint, budget constraint, and nonnegativity bounds.

Key Insights and Ideas

  • Less derivative supervision is actually more: Usually, masking is just a hack to save GPU memory. Here, the authors discover it acts as a crucial algorithmic control. In power-grid experiments, supervising 100% of the Jacobian caused constraint violations to spike by over $5\times$ compared to supervising just 5%. Sparse random masking prevents gradient tug-of-war across shifting active constraints while still nudging the network onto the right manifold.
  • Theory backs the local geometry: Under idealized smoothness assumptions, matching values alone bounds worst-case interpolation error proportionally to the distance between training samples ($\mathcal{O}(\delta)$), whereas matching both values and derivatives tightens that bound quadratically ($\mathcal{O}(\delta^2)$).
  • Sensitivities aren't magic bullets: When optimal solutions are heavily sparse (like a financial portfolio investing in only a few assets), most derivatives are flat-out zero, and tiny input shifts abruptly change which assets are chosen. Knowing when not to trust local derivatives is just as important as using them.

Key Results

  • Faster learning in smooth regimes (Acrobot): Sobolev-trained proxies reached 95% of the teacher policy's performance in 1,349 iterations versus 3,446 for value-only training—a $2.5\times$ speedup (16 minutes vs. 40 minutes wall-clock time, with only a 2% per-iteration overhead). Across hyperparameter sweeps, 95.4% of Sobolev runs hit the target threshold compared to just 4.2% of baseline runs.
Figure 2: Acrobot policy distillation. Shaded curves show variability across the hyperparameter sweep, while solid curves highlight the runs used for the convergence comparison.
  • Safer tail behavior in complex grids (AC-OPF): Across all three power networks, masked Sobolev training kept optimality gaps under 0.22% while slashing median worst-case constraint violations by roughly 18% (ieee300), 400% / $4\times$ (pegase1k), and 180% (rte6k), outperforming the baseline on worst-case feasibility in over 85% of test instances. On the 6,468-bus grid, training epoch time rose modestly ($1.6\times$), while inference speed remained identical.
  • Clear failure mode (Portfolio): Under tight risk budgets ($\le 10\%$), sparse allocations made derivative supervision counter-productive, yielding worse optimality gaps (29.5% vs. 14.7% for value-only). Under looser risk budgets ($> 10\%$), Sobolev regained a clear lead (8.7% vs. 18.9%).

Limitations and Future Work

The method relies on local solver sensitivities being informative across neighboring data points; it struggles when solutions are sparse, sensitivities vanish, or problems involve discrete decisions and sharp active-set jumps. Furthermore, the proxy still outputs raw predictions without hard feasibility guarantees (minor power-flow mismatches remain), and uniform random masking does not actively filter out noisy or ill-conditioned derivative entries.

For future work, the authors suggest building adaptive masks or mixture-of-experts models that switch off derivative losses in jagged regimes, pairing Sobolev training with differentiable projection/repair layers to guarantee 100% hard feasibility, and developing fully self-supervised GPU pipelines that compute implicit derivatives on the fly without pre-solving offline datasets.

Summary updated

Abstract

Optimization proxies amortize parametric constrained optimization by learning fast approximations of solution maps. Because constrained solution maps can be smooth within locally stable active-set regimes but change behavior across their boundaries, the parameter space may split into combinatorially many critical regions, making finite-sample generalization and reliable constraint behavior central challenges. To address this challenge, this paper develops sparse stochastic masked Sobolev training for optimization proxies, augmenting value supervision with randomly selected solver-sensitivity targets rather than dense Jacobian matching. The mask acts as an algorithmic control: it exposes the proxy to local derivative information while avoiding overconstraint from conflicting active constraint set signals. We provide approximation bounds showing that, under coverage and regularity, joint value-and-Jacobian matching improves finite-sample generalization. Experiments characterize when and how this benefit appears. In smooth optimal-control distillation, where feasibility is guaranteed by construction, and only a few active-set regimes arise, Sobolev supervision reaches 95\% of reference-policy performance about $2.5\times$ faster than value-only training. In AC optimal power flow, masked Sobolev training keeps optimality gaps below 0.22\% across three PGLib networks while reducing the median worst-case constraint violation by up to $4\times$. A mean--variance portfolio study identifies the complementary limitation: when sensitivities are highly local or vanish across active-set regimes, derivative supervision can be less useful than value-only training.
BibTeX
@inproceedings{rosemberg2026masked,
  author = {Andrew W. Rosemberg and Joaquim Dias Garcia and Russell Bent and Pascal Van Hentenryck},
  title = {{Masked Sobolev Training for Feasibility-Reliable Optimization Proxies}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2026},
  url = {https://openreview.net/forum?id=XuxAvk8BQy},
}
Figure