Penalty-Based First-Order Methods for Bilevel Optimization with Minimax and Constrained Lower-Level Problems

Yiyang Shen, Yutian He, Weiran Wang, Qihang Lin

TL;DR

Imagine trying to tune the hyperparameters of an AI model, except the model itself is locked in a tug-of-war game—like training to survive worst-case adversarial scenarios. Standard optimization math breaks down when you nest a "minimax" game inside another optimization loop without strict, idealized assumptions. This paper introduces a clever mathematical shortcut using penalty functions to flatten these nested games, giving us the first provably fast, gradient-based algorithms to solve them—and substantially speeding up constrained optimization along the way.

What Problem Does This Paper Address?

In machine learning, bilevel optimization is everywhere. Think of hyperparameter tuning: an "upper-level" loop tweaks hyperparameters to minimize validation error, while a "lower-level" loop trains model weights to minimize training loss.

Meanwhile, minimax optimization (minimizing the maximum possible loss) is the engine behind robust AI, like adversarial training and Distributionally Robust Optimization (DRO), where models prepare for worst-case data shifts.

What happens if you want to tune hyperparameters for a robust minimax model? You get a bilevel problem where both levels are minimax games.

Existing bilevel methods usually rely on a comfortable crutch: they assume the lower-level problem is a simple minimization with a single, unique, bowl-shaped solution ("strong convexity"). This lets them smoothly trace how upper-level tweaks affect lower-level outcomes using calculus (implicit gradients). When the lower level is a minimax game—or merely convex with multiple valid solutions—that unique mapping vanishes, and standard algorithms hit a wall. The authors ask: How can we solve bilevel minimax problems using only basic first-order gradients, without assuming strong convexity?

Methods

Instead of trying to differentiate through the lower-level game, the authors flatten the two-story problem into a single-level one using a duality-gap penalty.

In any convex-concave minimax game, there is a primal objective and a dual objective. At the optimal equilibrium (a saddle point), the gap between them shrinks to zero; everywhere else, it is positive. The authors take this primal-dual gap, multiply it by a penalty parameter $\rho$, and add it directly to the upper-level objective. If the algorithm strays from the lower-level equilibrium, it pays a steep price.

This transforms the nested nightmare into a single-level non-convex-concave minimax problem. To solve it, they adapt existing inexact proximal point methods—algorithms that break a hard problem into a sequence of well-behaved, strongly-convex-strongly-concave subproblems:

  • Deterministic setting: Uses an optimal first-order method (OptFOM) to solve the subproblems using exact gradients.
  • Stochastic setting: Swaps in a Stochastic Accelerated Primal-Dual (SAPD) subroutine when only noisy mini-batch gradients are available.

What’s new: While the core algorithmic engines are adapted from recent optimization literature, applying this duality-gap penalty framework to general bilevel minimax problems—and proving its exact convergence rates—is entirely new. Furthermore, the authors show that standard constrained lower-level problems can be rewritten as minimax problems via Lagrangian duality (under Slater’s condition, a standard feasibility check), allowing their method to solve constrained bilevel problems with a single penalty parameter instead of two.

Datasets

No new benchmarks were introduced, as the focus is theoretical and algorithmic, though the authors evaluate their methods on two setups:

  • Synthetic Constrained Linear Optimization: Randomly generated linear programs with box and linear inequality constraints across dimensions up to $(300, 300, 15)$, following prior benchmarks.
  • Real-World Fairness/Robustness Datasets (CelebA & Waterbirds): Image classification datasets notorious for spurious correlations (e.g., waterbirds appearing mostly over water backgrounds), where the rarest minority group makes up just 3% of the training data.

Key Insights and Ideas

  • Duality gaps are natural constraint enforcers: Because weak duality guarantees the primal-dual gap is never negative—and equals zero if and only if you're at a saddle point—it acts as a built-in, math-friendly thermometer for lower-level optimality without needing unique solutions.
  • Fewer penalties mean faster convergence: Previous methods for constrained lower-level problems required two separate penalty parameters (one for the upper level, one for the lower-level constraints). Multiplying them created jagged landscapes with smoothness constants scaling at $\Theta(\epsilon^{-3})$. By converting constraints into a minimax game via Lagrangian duality, the authors eliminate the second penalty, calming the smoothness down to $\Theta(\epsilon^{-1})$ and slashing complexity from $\tilde{O}(\epsilon^{-7})$ to $\tilde{O}(\epsilon^{-4})$.
  • Decoupling deep networks makes bilevel DRO tractable: Deep neural networks aren't convex, which violates the lower-level math assumptions. In their experiments, the authors cleverly place the non-convex feature extractor in the upper level and keep only the linear classifier in the lower minimax level—satisfying the theory while boosting real-world performance.

Key Results

  • Theoretical Speedups: Establishes the first oracle complexity bounds for bilevel minimax optimization: $\tilde{O}(\epsilon^{-4})$ gradient evaluations to find an approximate stationary ($\epsilon$-KKT) point deterministically, and $\tilde{O}(\epsilon^{-9})$ in the stochastic setting. For convex constrained lower-level problems, $\tilde{O}(\epsilon^{-4})$ beats prior bests of $\tilde{O}(\epsilon^{-7})$ (merely convex) and $\tilde{O}(\epsilon^{-6})$ (strongly convex).
  • Synthetic Optimization: Converged faster on constraint violations and duality gaps than baseline penalty methods (FOP and SMO), achieving lower final upper-level objectives (e.g., $-462.92$ vs. $-461.45$ for SMO on the largest instances with tuned step sizes).
  • Group DRO Accuracy: Tuning hyperparameters and representations via their stochastic bilevel method dramatically improved worst-group test accuracy over standard Group DRO:
  • CelebA ($\lambda = 10^{-4}$): Jumped from 42.04% to 86.06% worst-group accuracy (while keeping average accuracy high at 91.11%).
  • Waterbirds ($\lambda = 10^{-4}$): Improved from 76.53% to 83.61% worst-group accuracy.

Limitations and Future Work

  • Compact domains & Slater's condition: The proofs require all variable domains to be bounded (compact). For constrained lower-level problems, the speedup relies on Slater’s condition (strict feasibility) holding; if strong duality fails, older, slower primal-penalty methods still work where this one cannot.
  • "Lifted" stationarity: Convergence is proven for a lifted $\epsilon$-KKT point, meaning stationarity is defined in an expanded variable space with auxiliary variables rather than purely on the original variables. Designing algorithms for stricter stationarity notions remains open.
  • High stochastic cost: An $\tilde{O}(\epsilon^{-9})$ complexity for stochastic gradients is steep. The authors suggest integrating variance-reduction techniques in future work to bring this cost down.

Summary updated

Abstract

We study a class of bilevel optimization problems in which both the upper- and lower-level problems have minimax structures. This setting captures a broad range of emerging applications. Despite the extensive literature on bilevel optimization and minimax optimization separately, existing methods mainly focus on bilevel optimization with lower-level minimization problems, often under strong convexity assumptions, and are not directly applicable to the minimax lower-level setting considered here. To address this gap, we develop penalty-based first-order methods for bilevel minimax optimization without requiring strong convexity of the lower-level problem. In the deterministic setting, we establish that the proposed method finds a lifted $\epsilon$-KKT point with $\tilde{O}(\epsilon^{-4})$ oracle complexity. We further show that bilevel problems with convex constrained lower-level minimization can be reformulated as special cases of our framework via Lagrangian duality, leading to an $\tilde{O}(\epsilon^{-4})$ complexity bound that improves upon the existing $\tilde{O}(\epsilon^{-7})$ result when the lower-level Slater's condition holds. Finally, we extend our approach to the stochastic setting, where only stochastic gradient oracles are available, and prove that the proposed stochastic method finds a nearly lifted $\epsilon$-KKT point with $\tilde{O}(\epsilon^{-9})$ oracle complexity.
BibTeX
@inproceedings{shen2026penalty,
  author = {Yiyang Shen and Yutian He and Weiran Wang and Qihang Lin},
  title = {{Penalty-Based First-Order Methods for Bilevel Optimization with Minimax and Constrained Lower-Level Problems}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2026},
  url = {https://openreview.net/forum?id=K4vQ9YKOxc},
}
Figure