Abstract
Trieste is a modular, open-source Python library designed to bring scalable Bayesian Optimization (BO) and active learning to the TensorFlow 2 ecosystem. By addressing the technical challenges of running sequential decision-making loops within a graph-based framework, Trieste enables researchers to leverage GPU acceleration and deep learning models to efficiently explore expensive black-box functions.
Introduction
Bayesian Optimization is the gold standard for optimizing "black-box" functions that are expensive to evaluate, such as tuning hyperparameters for massive neural networks or conducting physical laboratory experiments. While libraries like BoTorch exist for PyTorch, TensorFlow 2 previously lacked a dedicated, modern BO library.
The primary challenge is technical: TensorFlow is optimized for massive parallel tasks via computational graphs. Conversely, BO is inherently sequential—evaluating a point, updating a model, and deciding the next step. In TensorFlow, this evolving nature often triggers "retracing," where the framework constantly rebuilds the graph, leading to significant performance overhead. Trieste was developed to bridge this gap, providing a production-ready toolkit that manages these internal dynamics efficiently.
Methods and Architecture
Trieste is built on a modular "plug-and-play" philosophy consisting of four key building blocks:
- Interfaces: It offers two primary execution modes. The
BayesianOptimizerprovides a standard automated loop, while theAskTellOptimizeris tailored for real-world settings where the objective function is not a simple Python snippet (e.g., physical lab experiments where results are returned asynchronously). - Probabilistic Models: Trieste interfaces directly with established libraries like GPflow (Gaussian Processes), GPflux (Deep GPs), and Keras (Neural Networks).
- Acquisition Rules: These define the strategy for selecting the next point, balancing exploration of uncertain regions with exploitation of known optima.
- Acquisition Functions: The library includes standard functions like Expected Improvement (EI) and advanced variants for multi-objective or constrained optimization.
Crucially, Trieste leverages TensorFlow’s automatic differentiation to calculate gradients for these acquisition functions, allowing for efficient optimization via a parallelized multi-start L-BFGS-B optimizer. Special care is taken to avoid expensive graph retracing, maintaining high performance throughout the sequential loop.
Applications and Utility
As a software framework, Trieste is evaluated through its utility across various research and industrial domains rather than a single benchmark dataset. It has been successfully deployed for:
- Engineering Design: Optimizing the design of heat exchangers.
- Manufacturing: Improving adhesive bonding processes.
- Synthetic Benchmarks: Serving as the foundation for various BO research papers.
Key Results and Insights
Trieste stands out for its production-ready reliability and feature richness. Key highlights include:
- Model Agnosticism: Users can swap a simple Gaussian Process for a Deep Ensemble or a Sparse Variational GP without altering the optimization pipeline, unlocking BO for datasets far larger than traditional methods can handle.
- Robustness: The library features a comprehensive test suite with 97% code coverage, ensuring reliability for both academic and industrial use.
- Advanced Optimization Support: Out-of-the-box support for multi-objective optimization (finding trade-offs), multi-fidelity optimization (leveraging cheap, low-quality data), and constrained optimization.
- Monitoring: Seamless integration with TensorBoard allows real-time monitoring of model convergence and optimization statistics.
Limitations and Future Directions
While highly flexible, the authors identify several areas for future development. Standard BO continues to struggle with high-dimensional input variables; the team plans to integrate more robust methods for high-dimensional objective functions. Additionally, future versions aim to support non-Euclidean search spaces, such as categorical data or graph-structured inputs. As an open-source project, Trieste's roadmap remains community-driven, evolving with the needs of the broader TensorFlow ecosystem.
Summary updated