Introduction

PyPI version GitHub Actions Workflow Status GitHub commit activity GitHub top language GitHub language count Python version license Code style: black

JBOAT is a compositional OperAtion-level Toolbox for gradient-based BLO. Unlike existing libraries that typically encapsulate fixed solver routines, JBOAT factorizes the BLO workflow into atomic, reusable primitives. Through a unified constraint reconstruction perspective, it empowers researchers to automatically compose over 85+ solver variants from a compact set of 17 gradient operations.

JBOAT is designed to offer robust computational support for a broad spectrum of BLO research and applications, enabling innovation and efficiency in machine learning and computer vision.

πŸ”‘ Key Features

  • 🧩 Compositional Operation-Level Abstraction: Deconstructs BLO solvers into three modular stages: Gradient Mapping (GM), Numerical Approximation (NA), and First-Order (FO).

  • ⚑ Accelerated JIT Execution: Built on Jittor, enabling meta-operator fusion and high-performance execution on NVIDIA GPUs.

  • 🏭 Generative Solver Construction: Supports dynamic serialization of operations. Users can recover classical algorithms or discover novel hybrid solvers simply by changing configurations.

  • πŸ›  Configuration-Driven: Define complex optimization strategies via simple JSON configurations, decoupling algorithmic logic from model definitions.

  • βœ… Comprehensive Testing: Achieves 99% code coverage through rigorous testing with pytest, ensuring software robustness.

πŸš€ Why JBOAT?

Existing automatic differentiation (AD) tools primarily focus on specific optimization strategies, such as explicit or implicit methods, and are often targeted at meta-learning or specific application scenarios, lacking support for algorithm customization.

In contrast, JBOAT expands the landscape of Bi-Level Optimization (BLO) applications by supporting a broader range of problem-adaptive operations. It bridges the gap between theoretical research and practical deployment, offering unparalleled flexibility to design, customize, and accelerate BLO techniques.

🌍 Applications

JBOAT covers a wide spectrum of BLO applications, categorized by the optimization target:

  • Data-Centric: Data Hyper-Cleaning, Synthetic Data Reweighting, Diffusion Model Guidance.

  • Model-Centric: Neural Architecture Search (NAS), LLM Prompt Optimization, Parameter Efficient Fine-Tuning (PEFT).

  • Strategy-Centric: Meta-Learning, Hyperparameter Optimization (HO), Reinforcement Learning from Human Feedback (RLHF).

πŸ“œ License

MIT License

Copyright (c) 2025 Yaohua Liu

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the β€œSoftware”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED β€œAS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.