Betty: An Automatic Differentiation Library for Multilevel Optimization
Sang Keun Choe, Willie Neiswanger, Pengtao Xie, Eric P. Xing
Abstract
Gradient-based multilevel optimization (MLO) has gained attention as a framework for studying numerous problems, ranging from hyperparameter optimization and meta-learning to neural architecture search and reinforcement learning. However, gradients in MLO, which are obtained by composing best-response Jacobians via the chain rule, are notoriously difficult to implement and memory/compute intensive. We take an initial step towards closing this gap by introducing BETTY, a software library for large-scale MLO. At its core, we devise a novel dataflow graph for MLO, which allows us to (1) develop efficient automatic differentiation for MLO that reduces the computational complexity from O(d 3 ) to O(d 2 ), (2) incorporate systems support such as mixed-precision and data-parallel training for scalability, and (3) facilitate implementation of MLO programs of arbitrary complexity while allowing a modular interface for diverse algorithmic and systems design choices. We empirically demonstrate that BETTY can be used to implement an array of MLO programs, while also observing up to 11% increase in test accuracy, 14% decrease in GPU memory usage, and 20% decrease in training wall time over existing implementations on multiple benchmarks. We also showcase that BETTY enables scaling MLO to models with hundreds of millions of parameters. We open-source the code at https://github.com/leopard-ai/betty .
Ask Lune
Know this paper in minutes, not an afternoon.
Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.
5 top-tier papers have cited it since. Know what they found before your reviewers do.
Lune can draw on
the full paper · the top-tier papers that cite it · related work
Free to start. No credit card required.
Lineage
- Efficient and Modular Implicit Differentiation cites On the Iteration Complexity of Hypergradient Computation
- Efficient and Modular Implicit Differentiation cites Bilevel Optimization: Convergence Analysis and Enhanced Design
- Making Scalable Meta Learning Practical cites Efficient and Modular Implicit Differentiation
- Making Scalable Meta Learning Practical cites On the Iteration Complexity of Hypergradient Computation
- Provably Convergent Federated Trilevel Learning cites Bilevel Optimization: Convergence Analysis and Enhanced Design
- Bilevel Optimization: Convergence Analysis and Enhanced Design cites On the Iteration Complexity of Hypergradient Computation
Cited by top-tier papers5
- Making Scalable Meta Learning PracticalSang Keun Choe, Sanket Vaibhav Mehta, Hwijeen Ahn, Willie Neiswanger et al.NeurIPS 2023 · 28 citations
- DreamPRM: Domain-reweighted Process Reward Model for Multimodal ReasoningQi Cao, Ruiyi Wang, Ruiyi Zhang, Sai Ashish Somayajula et al.NeurIPS 2025 · 17 citations
- Modality-Agnostic Self-Supervised Learning with Meta-Learned Masked Auto-EncoderHuiwon Jang, Jihoon Tack, Daewon Choi, Jongheon Jeong et al.NeurIPS 2023 · 9 citations
- Provably Convergent Federated Trilevel LearningYang Jiao, Kai Yang, Tiancheng Wu, Chengtao Jian et al.AAAI 2024 · 6 citations
- Consistency of Compositional Generalization Across Multiple LevelsChuanhao Li, Zhen Li, Chenchen Jing, Xiaomeng Fan et al.AAAI 2025 · 1 citation
Builds on16
- ZeRO: memory optimizations toward training trillion parameter modelsSamyam Rajbhandari, Jeff Rasley, Olatunji Ruwase, Yuxiong HeSC 2020 · 852 citations
- Long-Tailed Classification by Keeping the Good and Removing the Bad Momentum Causal EffectKaihua Tang, Jianqiang Huang, Hanwang ZhangNeurIPS 2020 · 533 citations
- Efficient and Modular Implicit DifferentiationMathieu Blondel, Quentin Berthet, Marco Cuturi, Roy Frostig et al.NeurIPS 2022 · 386 citations
- Bilevel Optimization: Convergence Analysis and Enhanced DesignKaiyi Ji, Junjie Yang, Yingbin LiangICML 2021 · 343 citations
- On the Iteration Complexity of Hypergradient ComputationRiccardo Grazzi, Luca Franceschi, Massimiliano Pontil, Saverio SalzoICML 2020 · 241 citations
Related papers
- Scalable Meta-Learning via Mixed-Mode DifferentiationIurii Kemaev, Dan A. Calian, Luisa M. Zintgraf, Gregory Farquhar et al.ICML 2025
- Multi-Objective Meta LearningFeiyang Ye, Baijiong Lin, Zhixiong Yue, Pengxin Guo et al.NeurIPS 2021 · 71 citations
- A Stochastic Approach to Bi-Level Optimization for Hyperparameter Optimization and Meta LearningMinyoung Kim, Timothy M. HospedalesAAAI 2025 · 3 citations
- Moreau Envelope for Nonconvex Bi-Level Optimization: A Single-Loop and Hessian-Free Solution StrategyRisheng Liu, Zhu Liu, Wei Yao, Shangzhi Zeng et al.ICML 2024 · 24 citations
- Mixture-of-World Models: Scaling Multi-Task Reinforcement Learning with Modular Latent DynamicsBoxuan Zhang, Weipu Zhang, Zhaohan Feng, Wei Xiao et al.ICLR 2026 · 1 citation
