Practical overview
When it fits
Use Betty when an experiment has linked optimization levels and benefits from a shared way to define problems, dependencies and execution. Its examples offer concrete starting points for research workflows such as hyperparameter optimization and implicit meta-learning.
Who it is for
- Machine-learning researchers implementing bilevel or multilevel optimization experiments
- PyTorch developers building meta-learning or hyperparameter-optimization workflows
- Researchers prototyping neural architecture search or data-reweighting methods
Documented uses
- Define optimization levels with model components, loss functions and configurations.
- Express hierarchical dependencies between optimization problems.
- Build reference-style experiments for hyperparameter optimization, architecture search, data reweighting or meta-learning.
- Run a multilevel program through Betty’s Engine and include a global validation stage.
Requirements & limits
The repository provides the library as the `betty-ml` Python package and identifies its license as Apache 2.0.
- The library is built around PyTorch and Python; the user supplies the task-specific models, data, losses and optimizers.
- The Problem and Engine abstractions are relevant when an experiment has hierarchical optimization dependencies.
- The README identifies Distributed Data Parallel and ZeRO support; Fully Sharded Data Parallel is labeled experimental.
- The repository includes application examples and tutorials for extending the basic structure.
Check current requirements in the official documentation. Source-based guidance does not mean OpenViST has run or independently tested this project.
Set up a Betty multilevel optimization program
Install Betty and define the problem and dependency structure needed to call its optimization engine.
Before you start
- Python environment for the betty-ml package
- PyTorch problem components, including modules, optimizers and data loaders
- Loss functions and problem configurations for each optimization level
Steps
Install the package with the command below.
pip install betty-mlDefine each optimization level as a
Problemsubclass, including its training-step loss and required components.Create an
Engineconfiguration and specify upper-to-lower and lower-to-upper dependencies between the problems.Instantiate the engine with the problems, dependencies and configuration, then call
engine.run().
Expected outcome
A Betty engine is configured to execute the defined multilevel optimization program.
Guide limitations
- The developer must supply the model, data, losses, problem configurations and dependency structure; installation alone does not create an experiment.
- The example documents the programming pattern, not a verified run or a guarantee that a particular project configuration will work.
Sources & review
Source record details
- Source availability
- Active
- Sources checked
- 14 October 2026
- Original website title
- leopard-ai/betty · Official homepage title · retained in its source language

