TL;DR
Optimizing complex AI systems that mix differentiable models with "black-box" components (like human evaluators or proprietary APIs) is notoriously difficult due to high dimensionality and a lack of end-to-end gradients. This paper introduces A-BAD-BO, a novel algorithm that reparameterizes the problem into a low-dimensional "local loss" space, allowing Bayesian Optimization to efficiently tune millions of parameters across a hybrid system.
The Challenge of AutoAI
In the real world, machine learning models rarely act alone. They are usually cogs in a larger machine. Consider a healthcare system where multiple models predict organ health (liver, kidney, heart), and their outputs are reviewed by human doctors (acting as "black-box" components) before a final diagnosis is made.
Optimizing such a system presents a significant challenge:
- Local Optimization Fails: Training each model independently on its own dataset doesn't guarantee the whole system works well. Sometimes, a model needs to be "suboptimal" locally to compensate for biases or errors in other parts of the system.
- Global Gradient Descent Fails: If even one component is a black box (like a human or a closed-source LLM like ChatGPT), you cannot backpropagate gradients through the entire chain.
- Standard Bayesian Optimization (BO) Fails: While BO handles black boxes well, it suffers from the "curse of dimensionality." You cannot use standard BO to tune a system with millions of neural network parameters.
The authors call this challenge AutoAI: the quest to jointly optimize all components of a complex, hybrid system.
Methods: The A-BAD-BO Algorithm
The core innovation of A-BAD-BO (Black-box And Differentiable Bayesian Optimization) is a clever reparameterization. Instead of trying to optimize the massive vector of all system parameters ($\theta$), the algorithm optimizes the local loss configuration ($\ell$).
The Bilevel Approach:
- Outer Level (Global): The algorithm uses Bayesian Optimization to search for the ideal "local loss" for each ML component. If there are 10 models in the system, BO is only searching in a 10-dimensional space, regardless of how many millions of parameters each model has.
- Inner Level (Local): For a given target local loss suggested by the BO, a subroutine uses standard gradient descent to find model parameters that hit that specific loss value. Because the ML components themselves are differentiable, this part is fast and efficient.
By treating the system's total performance as a noisy function of these local losses, A-BAD-BO can navigate the trade-offs between components without needing a global gradient.
Key Insights: The "Suboptimality" Paradox
One of the most striking insights from this research is that local optimality does not imply system optimality. In systems with biased black boxes, achieving the best overall system performance often requires the differentiable ML models to perform worse on their local tasks to "cancel out" the errors of the black box.
The algorithm naturally discovers how models can adapt to one another. For example, if a motion-planner in a robot is too conservative, the upstream object detector might learn to slightly "shrink" bounding boxes to compensate. By moving the optimization target from the parameter space to the loss space, the authors successfully bypass the high-dimensional bottlenecks that usually hinder Bayesian Optimization.
Experimental Results
The authors evaluated A-BAD-BO across four increasingly complex scenarios, ranging from synthetic Directed Acyclic Graphs (DAGs) to a realistic healthcare system and an LLM prompt engineering pipeline.
- Superior Optimality: Across all tests, A-BAD-BO achieved lower system loss than "Local GD" (training parts in isolation).
- Sample Efficiency: It significantly outperformed global BO baselines like TuRBO, reaching better solutions with far fewer system queries.
- Scalability: In the LLM pipeline, A-BAD-BO successfully optimized a system where the differentiable parts contained 132 million parameters (using DistilBERT models alongside ChatGPT), a feat impossible for standard BO.
- Theoretical Grounding: The authors proved that A-BAD-BO is "asymptotically no-regret," meaning it is mathematically guaranteed to eventually converge to the optimal system parameters.
Limitations and Future Work
- Scaling with Component Count: While the algorithm scales well with the number of parameters, the BO complexity still grows with the number of components. A system with hundreds of separate models would still pose a challenge.
- DAG Assumption: The current framework assumes the system is a Directed Acyclic Graph. Extending this to systems with feedback loops or more complex topologies remains an open question.
- Black-box Parameters: The paper assumes black-box components are fixed. Future work could explore how to optimize parameters inside the black boxes (e.g., tuning the temperature of an LLM) alongside the differentiable parts.
Summary updated