Bilevel optimization is an optimization problem in which the objective of an outer (upper-level) problem depends on the solution of an inner (lower-level) optimization problem. The upper level sets parameters, the lower level optimizes its own objective under those parameters, and the upper level adjusts the parameters based on the result. It has been studied in mathematical programming since the 1970s and shares its structure with the Stackelberg game in economics.
In machine learning the framework is used for hyperparameter optimization, meta-learning, and neural architecture search, among other tasks. Model training corresponds to the inner problem and the choice of training configuration to the outer problem; methods for passing or approximating gradients through the inner solution are an active research topic.