arXiv:2609.00644math.OCSep 2026

Manuscript Offprint

arXiv:2609.00644

Disciplined Bilevel Programming

Hao Zhu, Joschka Boedecker

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

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.

Contents

1 Introduction 3
1.1 Previous and related work 3
1.2 Contributions 5
1.3 Outline 6

2 Disciplined optimization 6
2.1 Disciplined convex programming 6
2.2 Problems involving parameters 7
2.3 Nonlinear optimization problems 8

3 Disciplined bilevel programming 8
3.1 Lower problem canonicalization 9
3.2 Standing assumptions 9
3.3 Conic optimality 10
3.4 Single-level reformulation 11
3.5 A simple example 11

4 Approximate optimality and continuation 13
4.1 Relaxed complementarity 14
4.2 Gap continuation 14

5 Implementation 15
5.1 The BLVPY pipeline 15
5.2 A simple code snippet 18

6 Examples 18
6.1 Ridge regression auto-tuning 19
6.2 Stackelberg security game 20
6.3 Renewable capacity planning 21
6.4 Traffic tolling 23
6.5 Planar truss design 27
6.6 Differentiable model predictive control 28

7 Discussion 31

A Proofs 33
A.1 Proof of proposition 4.1 33
A.2 Proof of corollary 4.2 33

B Consistency of globally solved relaxations 34

References (58)