# Multi-task / transfer learning Bayesian optimization for heterogenous search spaces

**URL:** <https://accelerated-discovery.org/t/multi-task-transfer-learning-bayesian-optimization-for-heterogenous-search-spaces/203>\
**Category:** Tools\
**Tags:** bayes-opt\
**Created:** [June 3, 2024, 1:49pm UTC](https://accelerated-discovery.org/t/multi-task-transfer-learning-bayesian-optimization-for-heterogenous-search-spaces/203 "2024-06-03T13:49:06Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![sgbaird](https://yyz1.discourse-cdn.com/flex003/user_avatar/accelerated-discovery.org/sgbaird/32/341_2.png) [@sgbaird](https://accelerated-discovery.org/u/sgbaird)\
**Post date:** [June 3, 2024, 1:49pm UTC](https://accelerated-discovery.org/t/multi-task-transfer-learning-bayesian-optimization-for-heterogenous-search-spaces/203/1 "2024-06-03T13:49:06Z")

</div>

There’s an interest from the community (e.g., [BayBE](https://emdgroup.github.io/baybe/userguide/transfer_learning.html)) in being able to perform transfer learning within a Bayesian optimization framework to avoid the “cold-start” characteristic of many Bayesian optimization campaigns despite related data being available. Some examples:

1. Maximizing chemical reaction yields based on a related chemical reaction yield that shares a subset of parameters
2. Maximizing measured superhardness while incorporating physics-based simulations of bulk and shear moduli simulations (related parameters, search space between simulation and experiment is not one-to-one)
3. Maximizing experimentally observed yield strength and elongation at fracture while incorporating physics-based simulations (e.g., Thermo-Calc)

Some questions come up, such as:

1. What are effective ways to approach benchmarking with this topic?
2. What are the state-of-the-art (already implemented) methods for doing so?

Related resources:

> <https://github.com/facebook/Ax/issues/1038>
>
> Both seem to follow a similar setup.
> 
> \[Multi-task\](https://ax.dev/tutorials/mu…lti\_task.html) (Ax):
> 
> \> A typical use case is optimizing an expensive-to-evaluate (online) system with supporting (offline) simulations of that system.
> 
> \[Multi-fidelity\](https://botorch.org/tutorials/discrete\_multi\_fidelity\_bo) (BoTorch):
> 
> \> In this tutorial, we show how to do multi-fidelity BO with discrete fidelities based on \[1\], where each fidelity is a different "information source." This tutorial uses the same setup as the \[continuous multi-fidelity BO tutorial\](https://botorch.org/tutorials/multi\_fidelity\_bo), except with discrete fidelity parameters that are interpreted as multiple information sources.
> \> 
> \> We use a GP model with a single task that models the design and fidelity parameters jointly. In some cases, where there is not a natural ordering in the fidelity space, it may be more appropriate to use a multi-task model (with, say, an ICM kernel). We will provide a tutorial once this functionality is in place.
> 
> Going to close this outright as I did find an answer to the question in the BoTorch docs, namely that multi-fidelity is probably better than multi-task when there is a natural ordering in the fidelity space. Maybe worth mentioning that I'm guessing constraints are supported for multi-task. In contrast, constraints are not yet implemented for multi-fidelity #961 and discrete fidelities are not fully exposed in Ax (but are present in BoTorch) #979. Not sure if anyone has tried comparing the performance of multi-fidelity vs. multi-task for a fidelity problem with "a natural ordering".

> **[Basic transfer learning example · emdgroup/baybe · Discussion #257](https://github.com/emdgroup/baybe/discussions/257)**
>
> I took the basic transfer learning example and brought it into a Colab notebook: https://colab.research.google.com/drive/1YOVW7hxdBlRrmnrYirubU5Yj2Z7GEqup?usp=sharing. It seemed to run OK (thanks f...

> **[General feedback - documentation, functionality, and software dev ·...](https://github.com/emdgroup/baybe/discussions/101)**
>
> I had a nice time reviewing this repository! Overall I think it's a really comprehensive, clean, and well-documented project. Thank you for open-sourcing it! Find below some questions and suggestio...

---

<div class="post-metadata">

**Author:** ![sgbaird](https://yyz1.discourse-cdn.com/flex003/user_avatar/accelerated-discovery.org/sgbaird/32/341_2.png) [@sgbaird](https://accelerated-discovery.org/u/sgbaird)\
**Post date:** [June 26, 2024, 9:01pm UTC](https://accelerated-discovery.org/t/multi-task-transfer-learning-bayesian-optimization-for-heterogenous-search-spaces/203/2 "2024-06-26T21:01:06Z")

</div>

Some related literature based on Meta AE workshop 2024:

- Fan, Z.; Han, X.; Wang, Z. HyperBO+: Pre-Training a Universal Hierarchical Gaussian Process Prior for Bayesian Optimization.
- Fan, Z.; Han, X.; Wang, Z. Transfer Learning for Bayesian Optimization on Heterogeneous Search Spaces. arXiv February 13, 2024. [[2309.16597] Transfer Learning for Bayesian Optimization on Heterogeneous Search Spaces](https://doi.org/10.48550/arXiv.2309.16597).
- Astudillo, R.; Frazier, P. I. Bayesian Optimization of Function Networks. arXiv December 31, 2021. [[2112.15311] Bayesian Optimization of Function Networks](https://doi.org/10.48550/arXiv.2112.15311).
- Astudillo, R.; Frazier, P. Bayesian Optimization of Composite Functions. In Proceedings of the 36th International Conference on Machine Learning; PMLR, 2019; pp 354–363.

Additionally:

- [Ax: Multi-task BO](https://ax.dev/tutorials/multi_task.html)
- [BoTorch: Composite BO](https://botorch.org/tutorials/composite_mtbo)
- [Composite Bayesian Optimization with the High Order Gaussian Process](https://github.com/pytorch/botorch/blob/main/tutorials/composite_bo_with_hogp.ipynb)
- [Composite Multi-Task BO](https://botorch.org/tutorials/composite_mtbo)
- [Meta-Learning with the Rank-Weighted GP Ensemble (RGPE)](https://botorch.org/tutorials/meta_learning_with_rgpe)

Key terms:

- composite functions
- function networks
- multi-task
- meta-learning

---

<div class="post-metadata">

**Author:** ![jakobzeitler](https://yyz1.discourse-cdn.com/flex003/user_avatar/accelerated-discovery.org/jakobzeitler/32/190_2.png) [@jakobzeitler](https://accelerated-discovery.org/u/jakobzeitler)\
**Post date:** [September 20, 2024, 2:16pm UTC](https://accelerated-discovery.org/t/multi-task-transfer-learning-bayesian-optimization-for-heterogenous-search-spaces/203/3 "2024-09-20T14:16:48Z")

</div>

We have done a lot of work in this area, see: [MATTERHORN STUDIO - robust-TLBO IP](https://www.matterhorn.studio/products/robust-tlbo-ip)

Keen to share more later this year as we embark on some case studies.

Happy to chat and discuss!
