math.OCSep 1, 2026

Disciplined Bilevel Programming

Authors: Hao ZhuJoschka Boedecker

Organizations: IMBIT//BrainLinks-BrainTools · Department of Computer Science, University of Freiburg

Abstract

Bilevel optimization provides a natural modeling language for hierarchical decision problems. However, applying existing numerical solvers usually requires substantial manual analysis and reformulation. In this paper, we introduce disciplined bilevel programming (DBLP), a symbolic framework that allows users to specify and solve optimistic bilevel problems in a high-level, human-readable way that is close to the mathematical formulation. For problems with a disciplined nonlinear upper problem and a convex lower problem satisfying the disciplined parameterized programming rules, DBLP automatically canonicalizes the lower problem into conic form and constructs an equivalent single-level reformulation using the conic Karush-Kuhn-Tucker conditions. We relax the resulting complementarity constraint and use a gap continuation procedure to approximately solve a sequence of smooth nonlinear problems. We implement DBLP in the open-source Python package BLVPY, an extension of CVXPY for bilevel programming. We demonstrate the modeling and solution capabilities of BLVPY on a range of bilevel optimization problems from several application domains. The proposed framework and implementation allow users to specify and solve bilevel optimization problems within a few lines of code, without prior expertise in bilevel modeling and numerical optimization.

Explore similar work

May 8, 2026math.OC

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

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 an εε-KKT point with O~(ε4)\tilde{O}(ε^{-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 O~(ε4)\tilde{O}(ε^{-4}) complexity bound that improves upon the existing O~(ε7)\tilde{O}(ε^{-7}) result. 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 εε-KKT point with O~(ε9)\tilde{O}(ε^{-9}) oracle complexity.
Yiyang Shen, Yutian He, Weiran Wang +1
Nov 27, 2025math.OC

On the Condition Number Dependency in Bilevel Optimization

Bilevel optimization minimizes an objective function, defined by an upper-level problem whose feasible region is the solution of a lower-level problem. We study the oracle complexity of finding an εε-stationary point with first-order methods when the upper-level problem is nonconvex, and the lower-level problem is strongly convex. Recent works (Ji et al., ICML 2021; Arbel and Mairal, ICLR 2022; Chen et al., JMLR 2025) achieve a O~(κˉy4ε2)\tilde{\mathcal{O}}(\bar κ_y^4 ε^{-2}) upper bound that is near-optimal in εε, which can be reduced to O~(κˉy7/2ε2)\tilde{\mathcal{O}}(\bar κ_y^{7/2} ε^{-2}) by a naive application of Nesterov acceleration in the inner loop, where κˉy\bar κ_y is the global condition number. However, the optimal dependency on the condition number is unknown. In this work, we establish a new Ω(κy5/2ε2)Ω(κ_y^{5/2} ε^{-2}) lower bound, where κy<κˉyκ_y < \bar κ_y is the lower-level condition number that is of the same order as κˉy\bar κ_y when the smoothness constants are O(1)\mathcal{O}(1). Our lower bound establishes the first provable gap in terms of condition number dependency between bilevel problems and minimax problems in this setup. Our lower bounds can be extended to various settings, including high-order smooth functions, stochastic oracles, and convex hyper-objectives: (1) For second-order and arbitrarily smooth problems, we show lower bounds of Ω(κy31/14ε12/7)Ω({κ_y^{31/14}} ε^{-12/7}) and Ω(κy21/10ε8/5)Ω(κ_y^{21/10} ε^{-8/5}), respectively. (2) For convex-strongly-convex problems, we improve the previously best lower bound (Ji and Liang, JMLR 2022) from Ω(κy/ε)Ω(κ_y /\sqrtε) to Ω(κy3/2/ε)Ω(κ_y^{3/2} / \sqrtε). (3) For smooth stochastic problems, we also show a lower bound of Ω(κy4ε4)Ω(κ_y^4 ε^{-4}).
Lesi Chen, Jingzhao Zhang
May 9, 2026math.OC

Select-then-differentiate: Solving Bilevel Optimization with Manifold Lower-level Solution Sets

We study optimistic bilevel optimization when the lower-level problem has a non-isolated manifold of minimizers. In this setting, the hyper-objective may be non-differentiable because the upper-level criterion must choose among multiple lower-level solutions. Under a local Polyak--Łojasiewicz (PŁ) condition, we show that differentiability does not require the lower-level solution set to be a singleton: uniqueness of the optimistic selection is sufficient. This yields an explicit pseudoinverse-based hyper-gradient formula extending the classical singleton-minimizer result. We further characterize the regularity of the hyper-objective: non-degeneracy of the selected minimizer along the solution manifold yields local smoothness, while failure of uniqueness can create many non-differentiable points and failure of non-degeneracy can destroy all positive Hölder regularity of the hyper-gradient. Motivated by this theory, we propose HG-MS, a select-then-differentiate method combining explicit optimistic selection with efficient pseudoinverse-based hyper-gradient computation. Despite the nonconvex nature of optimistic selection over the lower-level solution manifold, we show that HG-MS converges to a stationary point of the optimistic objective with complexity governed by the intrinsic dimension of the solution manifold rather than its ambient dimension. Empirically, we test a practical variant of HG-MS for matched-budget LLM source reweighting. This variant preserves the select-then-differentiate principle and obtains the best GSM8K/MATH scores across the tested backbones, along with competitive or best MT-Bench instruction-following results.
Saeed Masiha, Zebang Shen, Negar Kiyavash +1