NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Fully First-Order Algorithms for Online Non-Convex Bilevel Optimization

Tingkai Jia, Ting Wang, Cheng ChenNeurIPS 2026

TL;DR

Updating hyperparameters on the fly as live data streams shift usually requires expensive second-order derivatives—computing slopes of slopes—which becomes a memory and speed nightmare for modern machine learning models. This paper introduces a suite of algorithms for online bilevel optimization that rely exclusively on standard first-order gradients. By sidestepping second-order math via a clever Lagrangian reformulation, the authors match the theoretical performance of much heavier algorithms at a fraction of the computational headache.

What Problem Does This Paper Address?

Many machine learning tasks have a Russian nesting doll structure: an outer problem depends on the solution to an inner problem. Think of hyperparameter tuning, where you adjust L2 regularization (outer) based on how well a model trains on data (inner). This is bilevel optimization. When data arrives in a continuous, shifting stream rather than a static batch, it becomes Online Bilevel Optimization (OBO). Here, the goal is to minimize "regret"—how poorly your streaming decisions perform compared to knowing the shifting optimal solutions in hindsight.

To update the outer variable, standard OBO algorithms calculate a hypergradient (the total derivative of the outer objective). Because the inner model's optimal weights depend on the outer hyperparameters, the chain rule forces you to differentiate through the inner optimization process. Traditionally, this requires Hessian-vector products (HVPs)—second-order derivatives that track curvature. For large neural networks or strict real-time budgets, HVPs devour memory and runtime, and in noisy settings, they suffer from high variance. The authors ask: Can we solve non-convex OBO with strong theoretical guarantees using only basic, first-order gradients?

Methods

Instead of differentiating through the inner argmin directly, the authors borrow a penalty-method trick from offline optimization and adapt it to streaming data. They rewrite the bilevel problem as a single-level problem with an inequality constraint (requiring the inner loss to be no worse than its minimum), and then fold that constraint into the objective using a time-varying Lagrange multiplier, $\lambda_t$.

At the optimal inner parameters, the partial derivative of this Lagrangian with respect to the inner variables vanishes to zero. Consequently, the nasty implicit second-order term completely drops out of the hypergradient!

Building on this HVP-free foundation, the authors propose three algorithms:

  • $\text{F}^2\text{OBO}$ (Fully First-Order OBO): At each time step $t$, it runs two parallel inner gradient descent loops—one minimizing the inner loss, one minimizing the Lagrangian—before updating the outer variable and gently increasing the penalty $\lambda_t$. It also works in a fast "single-loop" mode (just one inner step per round).
  • $\text{AF}^2\text{OBO}$ (Adaptive-Iteration $\text{F}^2\text{OBO}$): Instead of running a fixed number of inner steps, it loops until the inner gradient norms drop below a strict threshold, dynamically adapting to sudden environment shifts.
  • $\text{SF}^2\text{OBO}$ (Stochastic $\text{F}^2\text{OBO}$): Designed for noisy, mini-batch gradients, using carefully scheduled growing batch sizes to tame gradient variance without needing to average over past time windows.
Table 1: Comparison of algorithms on bilevel local regret without window averaging as defined in Eq.(2) in terms of gradient queries, required Hessian-vector product (HVP) queries, fully single-loop structure, local regret bounds, and corresponding theorems. VT and H2,T are defined in Eq.(4). E2,T and PT are defined in Eq.(9) and Theorem 3.2, respectively.

Datasets

No new benchmarks are introduced; instead, the authors simulate dynamic, shifting data streams by modifying two classic datasets:

  • MNIST: Used for dynamic parametric loss tuning on imbalanced data. Over 400 timesteps divided into four phases, class distributions are artificially skewed to drift from $0.6^i$ to $0.9^i$ across digits $i = 0, \dots, 9$.
  • 20 Newsgroups: Used for online hyperparameter optimization (tuning L2 regularization) over 10,000 iterations. Distribution drift is simulated by injecting 5%, 10%, and 15% label noise at iterations 2,500, 5,000, and 7,500.

Key Insights and Ideas

  • Walking the $\lambda_t$ tightrope: The penalty multiplier $\lambda_t$ faces a delicate trade-off. Too small, and your constrained approximation drifts away from the true bilevel problem; too large, and gradients explode, destabilizing training. Scheduling $\lambda_t$ to grow polynomially over time ($\lambda_{t+1} = (1 + 1/t)^\tau \lambda_t$) hits the mathematical sweet spot.
  • Beating severe inner drift via adaptivity: Standard static-loop algorithms suffer linear regret (meaning they fail to learn effectively) if the inner optimal solution oscillates wildly—even if the outer objective barely changes! By running inner updates until gradients are provably tiny, $\text{AF}^2\text{OBO}$ completely removes the inner-solution drift term ($H_{2,T}$) from its regret bound.
  • Simpler single-loop assumptions: Previous second-order single-loop methods only worked if you assumed the Hessians changed slowly over time—a tough condition to verify in the wild. Single-loop $\text{F}^2\text{OBO}$ only requires first-order gradients to drift sublinearly.

Key Results

Across theoretical bounds and empirical tests, the first-order methods go toe-to-toe with—and frequently beat—second-order baselines:

  • Deterministic Regret: Multi-loop $\text{F}^2\text{OBO}$ achieves $O(1 + V_T + H_{2,T})$ local regret in $O(T \log T)$ gradient queries and zero HVPs, matching the second-order OBBO algorithm and beating SOBOW's $O(T^2)$ HVP complexity ($V_T$ measures function value drift; $H_{2,T}$ measures inner-solution drift). $\text{AF}^2\text{OBO}$ achieves $O(\log T + V_T)$ regret, dropping $H_{2,T}$ entirely.
  • Imbalanced MNIST: $\text{AF}^2\text{OBO}$ achieved the highest balanced testing accuracy among all tested deterministic methods, while single-loop $\text{F}^2\text{OBO}$ empirically outperformed its second-order single-loop counterpart (FSOBO) in accuracy (though exhibiting higher local regret, matching theory).
  • Noisy 20 Newsgroups: In the stochastic setting, $\text{SF}^2\text{OBO}$ achieved the best test accuracy (80.03%) and lowest training loss (1.2914), beating both SOBBO (79.79% accuracy) and SOGD (76.07%). It ran in 103.02s—nearly a third faster than SOBBO (150.80s), though slower than the momentum-based SOGD (41.28s), which traded accuracy for speed.
Comparison of stochastic OBO algorithms highlighting regret bounds and zero HVP queries.

Limitations and Future Work

The entire theoretical house of cards rests on the inner-level objective being strongly convex—meaning it has a single, clean, bowl-shaped global minimum. That works great for linear classifiers with L2 regularization, but breaks down when the inner problem involves training deep, non-convex neural networks from scratch. In future work, the authors aim to relax this restriction by extending their first-order framework to non-convex inner objectives that satisfy the Polyak-Łojasiewicz (PL) condition—a much more realistic landscape for modern deep learning.

Summary updated

BibTeX
@inproceedings{jia2026fully,
  author = {Tingkai Jia and Ting Wang and Cheng Chen},
  title = {{Fully First-Order Algorithms for Online Non-Convex Bilevel Optimization}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2026},
  url = {https://openreview.net/forum?id=pACG95YX0v},
}
Figure