betaFeedback

WorksComputer Science

Few-Shot Bioactivity Prediction with Meta-Learning under Assay Heterogeneity

Abstract

Accurate bioactivity prediction is a central challenge in early-stage drug discovery, as individual assays often contain too few measurements to train reliable models independently. Meta-learning offers a principled approach to this few-shot setting, but assay heterogeneity may limit its effectiveness. Here, we test this hypothesis and show that meta-learning performance degrades as meta-training tasks become more heterogeneous. To address this, we introduce MetaHeta, a meta-learning framework that accounts for assay heterogeneity by conditioning predictions on auxiliary data from related assays, with relatedness defined flexibly from available assay information. The architecture of MetaHeta combines linear attention over large auxiliary datasets with exact attention over scarce task-specific context, enabling efficient scaling to the former without compromising exact attention over the latter. We demonstrate the benefits of our approach on assays from ChEMBL and BindingDB, improving few-shot bioactivity prediction and downstream compound prioritization in retrospective Bayesian optimization.

Introduction

Accurately predicting compound activity in biological assays is a central challenge in early-stage drug discovery. Reliable in silico predictors can guide candidate selection and therefore reduce the time and resources required for experimental evaluation ((Jiménez-Luna et al., 2021; Scalia et al., 2026)). Machine learning models have been widely employed for this task, but their performance typically relies on the availability of large amounts of high-quality data ((Tian et al., 2024; Mayr et al., 2018)). However, since bioactivity measurements are expensive to acquire, individual assays often contain too little data to train accurate models in isolation, placing assay-specific bioactivity prediction in a few-shot learning regime ((Vella & Ebner, 2022; Altaleb-Tran et al., 2017)). A natural way to alleviate this data scarcity is to share information across assays, but naïvely pooling their measurements risks conflating distinct assay-specific relationships.

A particularly promising approach to this problem is meta-learning ((Schmidhuber, 1987; Hochreiter et al., 2001)), which aims to learn shared structure across a collection of related tasks to facilitate adaptation to new ones, but without directly pooling their measurements. This collection of tasks is commonly referred to as the meta-dataset. In bioactivity prediction, each such task can naturally correspond to an individual assay, with a small number of observed compound–activity pairs forming a context set from which activities are predicted for new compounds (target inputs).

A variety of meta-learning approaches have been developed to enable information sharing across tasks. Finn et al. (2017) introduced MAML, a gradient-based algorithm that learns a shared parameter initialization from which the model can adapt to new tasks in a few gradient steps. With a similar bi-level optimization objective, Chen et al. (2023) learn a shared feature representation on top of which task-specific Gaussian Processes (GPs) are fit.

Neural Processes (NPs) (Garnelo et al. 2018b;a) instead amortize task adaptation by learning a mapping from a set of context points to predictive distributions at target locations, offering a scalable alternative to GPs. Transformer Neural Processes (TNPs) (Nguyen & Grover, 2022) parameterize this mapping using attention mechanisms, making them well suited to modeling sets while capturing rich interactions between context and target points. This architecture also underpins Prior-Data Fitted Networks (PFNs), which pre-train TNPs on massive synthetic datasets for off-the-shelf prediction on new tasks (Müller et al., 2022).

A key assumption underlying meta-learning is that tasks in the meta-dataset are sufficiently related to induce a shared prior that supports efficient adaptation to new tasks from limited data (Baxter, [5]). However, the heterogeneity of assays in large-scale bioactivity datasets, arising from differences in experimental conditions, endpoints, and measurement protocols (Landrum & Riniker, 2024), can render this assumption questionable, potentially limiting the effectiveness of meta-learning. We illustrate the intuition behind this potential failure mode in Figure 1. Indeed, prior work suggests that meta-learning methods struggle to adapt to task-specific bioactivity data (Stanley et al., 2021), with Schimunek et al. (2023) reporting that even a naive baseline that ignores the context set can outperform several established meta-learning approaches. Here, we hypothesize that assay heterogeneity is a key factor limiting the effectiveness of meta-learning for bioactivity prediction, and explicitly account for it in a dedicated modeling framework.

Figure 1. Failure mode of meta-learning under assay heterogeneity. A heterogeneous meta-dataset can induce a broad prior, such that limited task-specific data are insufficient to concentrate the posterior around functions relevant to a new assay.

Our contributions are as follows:

(i) we systematically study the effect of meta-training task heterogeneity on few-shot bioactivity prediction, demonstrating in a controlled setting that increasing heterogeneity can degrade meta-learning performance across a range of methods and context sizes;

(ii) motivated by these findings, we introduce MetaHeta, a meta-learning framework in which predictions are additionally conditioned on data from related assays. This allows the model to approximate the posterior predictive under a more informative prior relevant to the target task, rather than under that induced by the entire heterogeneous meta-training distribution. Assay relatedness can be defined flexibly based on target homology or known experimental conditions;

(iii) to make conditioning on such auxiliary data computationally practical, we develop a TNP-based architecture that combines exact attention over scarce task-specific context with linear attention over potentially large auxiliary datasets, enabling efficient conditioning at scale.

We further demonstrate that findings from our controlled heterogeneity study translate into practical gains on assays from real-world bioactivity databases, improving few-shot bioactivity prediction and retrospective Bayesian optimization.

Related work

Early meta-learning approaches include metric-based methods (Vinyals et al., 2016; Snell et al., 2017), developed primarily for few-shot classification, and adaptation-based methods that learn shared structure across tasks to enable rapid task-specific adaptation from limited data (Finn et al., 2017; Nichol et al., 2018). These ideas have also been applied to few-shot molecular property prediction (Nguyen et al., 2020; Alle-Tian et al., 2017; Schimunek et al., 2023; Wang et al., 2021; 2024), with much of this work focusing on classification. More directly relevant to our probabilistic regression setting, deep kernel-based methods meta-learn shared feature representations while retaining task-specific Gaussian process inference (Chen et al., 2023; Patschkowski et al., 2020). A complementary line of work instead amortizes task adaptation by directly learning a mapping from task-specific context and target inputs to predictive distributions, with Neural Processes (NPs) forming a canonical family of such methods (Garnelo et al. 2018b;a; Kim et al., 2019; Rochussen & Fortuin, 2026). In recent years, NPs equipped with transformer architectures (Vaswani et al., 2017) (TNPs have emerged as a prominent variant (Nguyen & Grover, 2022; Feng et al., 2023; Ashman, 2024), with Prior-Data Fitted Networks (PFNs) further extending this paradigm by pre-training TNPs on broad synthetic task distributions (Müller et al., 2022). This line of work has been particularly influential in tabular learning (Hollmann et al., 2025; Grinsztajn et al., 2026; Qu et al., 2026), with recent studies showing that tabular foundation models can exhibit capabilities beyond conventional tabular settings (Nakerst et al., 2026), including molecular property prediction (Hicham et al., 2026). We also discuss methods that explicitly account for task heterogeneity in Appendix § 11.

Setup

Let X⊆Rd\mathcal{X} \subseteq\mathbb{R}^{d} denote the space of dd-dimensional molecular representations and Y⊆R\mathcal{Y} \subseteq\mathbb{R} the space of assay outcomes. We model each assay τ\tau as a task, corresponding to an unknown function fτ:X→Yf_{\tau}: \mathcal{X} \to\mathcal{Y}, where fτ∼P(f)f_{\tau} \sim P(f), and P(f)P(f) denotes an underlying stochastic process on X\mathcal{X}. For each τ\tau, we observe a finite dataset D={(xn,yn)}n=1N∈D\mathcal{D} = \{(x_n, y_n)\}_{n=1}^{N} \in\mathbb{D} generated according to yn=fτ(xn)+ϵny_n = f_{\tau}(x_n) + \epsilon_n, with ϵn∼N(0,στ2)\epsilon_n \sim\mathcal{N}(0, \sigma_{\tau}^{2}). Here, D:=⋃N∈N(X×Y)N\mathbb{D} := \bigcup_{N \in\mathbb{N}}(\mathcal{X} \times\mathcal{Y})^{N} denotes the collection of all such datasets. Each dataset can be partitioned into a context set DC\mathcal{D}^{C} and a target set DT\mathcal{D}^{T} of sizes Nc:=∣DC∣N_c := |\mathcal{D}^{C}| and Nt:=∣DT∣N_t := |\mathcal{D}^{T}|, respectively. We denote the corresponding inputs and outputs by (XC,YC)∈RNc×d×RNc(X^{C}, Y^{C}) \in\mathbb{R}^{N_c \times d} \times\mathbb{R}^{N_c} and (XT,YT)∈RNt×d×RNt(X^{T}, Y^{T}) \in\mathbb{R}^{N_t \times d} \times\mathbb{R}^{N_t}. We assume access to a meta-dataset Dmeta:={Dτ}τ=1M\mathcal{D}_{\mathrm{meta}} := \{\mathcal{D}_{\tau}\}_{\tau=1}^{M} consisting of MM assay-specific datasets, each containing a potentially small number of observations. Our goal is to meta-learn a predictor that maps an assay-specific context set and target inputs to a predictive distribution over target outcomes. Formally, we seek to learn the posterior predictive map π:D×XNt→P(YNt)\pi: \mathbb{D} \times\mathcal{X}^{N_t} \to\mathcal{P}(\mathcal{Y}^{N_t}), which we parameterize by pθ(YT∣XT,DC)p_{\theta}(Y^{T} \mid X^{T}, \mathcal{D}^{C}).

MetaHeta

Beyond a single shared prior

Failure mode of meta-learning under assay heterogeneity Consider a probabilistic meta-learner pθp_{\theta} trained by maximizing the expected log-likelihood:

L(θ)=EXT,YT,DC[log⁡pθ(YT∣XT,DC)](1)\mathcal{L}(\theta) = \mathbb{E}_{X^{T},Y^{T},\mathcal{D}^{C}}\left[\log p_{\theta}\left(Y^{T} \mid X^{T},\mathcal{D}^{C}\right)\right] \tag*{(1)}
=−EXT,DC[KL⁡[p(YT∣XT,DC) ∥ pθ(YT∣XT,DC)]]+const,(2)= -\mathbb{E}_{X^{T},\mathcal{D}^{C}}\left[\operatorname{KL}\left[p\left(Y^{T} \mid X^{T},\mathcal{D}^{C}\right) \,\middle\|\, p_{\theta}\left(Y^{T} \mid X^{T},\mathcal{D}^{C}\right)\right]\right] + \mathrm{const}, \tag*{(2)}

where the expectations over meta-training tasks and their context-target splits are estimated using Dmeta\mathcal{D}_{\mathrm{meta}}, and p(YT∣XT,DC)p(Y^{T} \mid X^{T},\mathcal{D}^{C}) denotes the posterior predictive distribution (PPD) that pθ(YT∣XT,DC)p_{\theta}(Y^{T} \mid X^{T},\mathcal{D}^{C}) is trained to approximate (Nagler, 2023). The PPD can be written as:

p(YT∣XT,DC)=∫p(YT∣XT,f)P(df∣DC),(3)p(Y^{T} \mid X^{T},\mathcal{D}^{C}) = \int p(Y^{T} \mid X^{T},f)P(df \mid\mathcal{D}^{C}), \tag*{(3)}

where the prior P(f)P(f) underlying the posterior P(⋅∣DC)P(\cdot\mid\mathcal{D}^{C}) reflects the distribution of assay functions represented in Dmeta\mathcal{D}_{\mathrm{meta}}. Consequently, the composition of tasks in Dmeta\mathcal{D}_{\mathrm{meta}} shapes the shared prior P(f)P(f) and, in turn, influences the ability of the meta-learner to adapt to new tasks given limited task-specific context DC\mathcal{D}^{C}. Since bioactivity assays are often highly heterogeneous (Landrum & Riniker, 2024), the prior induced by Dmeta\mathcal{D}_{\mathrm{meta}} may be too broad for the task-specific context to sufficiently concentrate the posterior on the relevant assay regime, limiting the effectiveness of meta-learning.

Accounting for heterogeneity through assay relatedness Motivated by this, we propose to model tasks as arising from a mixture of latent assay regimes ξk∼p(ξ)\xi_k \sim p(\xi), reflecting their shared characteristics such as the biological target or assay conditions. Each such component ξk\xi_k induces its own prior Pξk(f)P_{\xi_k}(f), giving rise to a corresponding component-specific PPD pξk(YT∣XT,DC)p_{\xi_k}(Y^{T} \mid X^{T},\mathcal{D}^{C}). The prior induced by the heterogeneous Dmeta\mathcal{D}_{\mathrm{meta}} can then be viewed as a mixture of these component priors, with the corresponding PPD being a mixture of the component-specific PPDs. Since learning a separate posterior predictive map for each of the potentially many latent components is impractical, we follow Ashman et al. [4] and instead use a single meta-learner pθ(YT∣XT,DC,Daux)p_{\theta}(Y^{T} \mid X^{T},\mathcal{D}^{C},\mathcal{D}^{\mathrm{aux}}) to amortize prediction across different latent components. Here, Daux={Dτ′}\mathcal{D}^{\mathrm{aux}} = \{\mathcal{D}_{\tau'}\} denotes a set of auxiliary datasets generated from the same latent component ξk\xi_k as the target task τ\tau:

ξk∼p(ξ),fτ,{fτ′}∼Pξk(f),(XT,YT),DC∼fτ,Dτ′∼fτ′.(4)\xi_k \sim p(\xi), \quad f_{\tau},\{f_{\tau'}\} \sim P_{\xi_k}(f), \quad(X^{T},Y^{T}),\mathcal{D}^{C} \sim f_{\tau}, \quad\mathcal{D}_{\tau'} \sim f_{\tau'}. \tag*{(4)}

For a single target input-output pair (x,y)(x, y), Ashman et al. [4] show that:

Eξk,DC,Daux[KL⁡(pξk(y∣x,DC)∥p(y∣x,DC,Daux))]≤Eξk,DC[KL⁡(pξk(y∣x,DC)∥p(y∣x,DC))].(5)\mathbb{E}_{\xi_k, D^C, D^{\mathrm{aux}}}\left[\operatorname{KL}\left(p_{\xi_k}(y \mid x, D^C) \mathbin{\|} p(y \mid x, D^C, D^{\mathrm{aux}})\right)\right] \leq\mathbb{E}_{\xi_k, D^C}\left[\operatorname{KL}\left(p_{\xi_k}(y \mid x, D^C) \mathbin{\|} p(y \mid x, D^C)\right)\right]. \tag*{(5)}

Intuitively, conditioning on auxiliary data provides additional evidence about the underlying assay regime ξk\xi_k and can yield a closer approximation to the corresponding PPD pξkp_{\xi_k} than conditioning on task-specific context alone. Such additional evidence can be particularly valuable when DCD^C is small and may not be sufficiently informative on its own. This raises two practical challenges: identifying related assays to construct DauxD^{\mathrm{aux}}, and efficiently conditioning a meta-learner on both DCD^C and DauxD^{\mathrm{aux}}.

Defining assay relatedness

Depending on the modeling problem and available information, it might be useful to define assay relatedness at different levels. We consider two classes of settings.

Target-based relatedness Consider a setting where ξk\xi_k is determined by target identity, such that assays sharing the same target are drawn from Pξk(f)P_{\xi_k}(f). Then, Eq. (5) directly suggests constructing DauxD^{\mathrm{aux}} by collecting tasks with the same biological target as τ\tau. However, this construction can be overly restrictive with, for example, understudied protein targets, which are particularly relevant from a few-shot modeling perspective precisely because their assay data are often scarce ((Sharma et al., 2023)). In such settings, known biological relationships between targets can be leveraged to construct DauxD^{\mathrm{aux}} instead, as formalised in Proposition 1:

Proposition 1. Consider an extension of the data-generating process in Eq. (4) in which the latent components are structured hierarchically as ξfamily∼p(ξ)\xi_{\mathrm{family}} \sim p(\xi) and ξprot,{ξprot′}∼p(⋅∣ξfamily)\xi_{\mathrm{prot}}, \{\xi_{\mathrm{prot}}'\} \sim p(\cdot\mid\xi_{\mathrm{family}}), with fτ∼Pξprot(f)f_\tau\sim P_{\xi_{\mathrm{prot}}}(f) and {fτ′}∼Pξprot′(f)\{f_{\tau}'\} \sim P_{\xi_{\mathrm{prot}}'}(f). Under this generative structure, assume that auxiliary data from target homologs provide no additional information for predicting yy once the target’s protein-specific component is known. Then:

Eξfamily,ξprot,DC,Daux[KL⁡(pξprot(y∣x,DC)∥p(y∣x,DC,Daux))]≤Eξfamily,ξprot,DC[KL⁡(pξprot(y∣x,DC)∥p(y∣x,DC))].\mathbb{E}_{\xi_{\mathrm{family}}, \xi_{\mathrm{prot}}, D^C, D^{\mathrm{aux}}}\left[\operatorname{KL}\left(p_{\xi_{\mathrm{prot}}}(y \mid x, D^C) \mathbin{\|} p(y \mid x, D^C, D^{\mathrm{aux}})\right)\right] \leq\mathbb{E}_{\xi_{\mathrm{family}}, \xi_{\mathrm{prot}}, D^C}\left[\operatorname{KL}\left(p_{\xi_{\mathrm{prot}}}(y \mid x, D^C) \mathbin{\|} p(y \mid x, D^C)\right)\right].

Intuitively, assays of distinct but homologous proteins can still inform predictions for the target through their shared family-level component. The proof is in Appendix § 14.

Description-based relatedness Target identities or known biological relationships may not always be available to practitioners. In such cases, we instead define relatedness based on broadly available information about assay protocols or experimental conditions. Specifically, for each τ\tau, we assume access to its natural-language description aτa_\tau, which may be noisy or incomplete. Prior to training, we map each aτa_\tau to a dd-dimensional dense representation hτ=ϕ(aτ)∈Rdh_\tau= \phi(a_\tau) \in\mathbb{R}^d, where ϕ\phi denotes an embedding model; in our experiments ϕ\phi is instantiated as PubMedBERT ((Gu et al., 2021)). We then quantify relatedness between assays τ\tau and τ′\tau' by cosine similarity between their description embeddings, sτ,τ′=⟨hτ,hτ′⟩/(∥hτ∥∥hτ′∥)s_{\tau,\tau'} = \langle h_\tau, h_{\tau'}\rangle/(\|h_\tau\|\|h_{\tau'}\|). Since sτ,τ′s_{\tau,\tau'} provides only a heuristic for identifying useful auxiliary assays, we control retrieval selectivity using a threshold γ\gamma and include Dτ′D_{\tau'} in DauxD^{\mathrm{aux}} if sτ,τ′≥γs_{\tau,\tau'} \geq\gamma. Meta-training with description-based relatedness is shown in Algorithm 1.

Model

The architecture is shaped by two competing design constraints arising from the variable availability of auxiliary data. First, because DauxD^{\mathrm{aux}} may frequently be empty, parameters dedicated exclusively to auxiliary data would often receive no learning signal, motivating parameter sharing between the processing of DCD^C and DauxD^{\mathrm{aux}}. Second, DauxD^{\mathrm{aux}} may instead contain many observations across multiple related datasets, making quadratic attention prohibitively expensive, while DCD^C is typically small. Parameter sharing between DCD^C and DauxD^{\mathrm{aux}} is therefore necessary, but their different scales call for different computational treatment. Our architecture, shown in Figure 2, addresses this using two coupled TNP-like branches that share attention parameters while employing different self-attention mechanisms. For both branches, each observation [xi,yi,ei][x_i, y_i, e_i] is first embedded with an MLP, with target observations having their activities masked to 0. Here, eje_j is a one-hot indicator of the task of origin, allowing observations from all auxiliary datasets to be concatenated into a single sequence without ambiguity. To preserve invariance to permutations of auxiliary datasets, the indicators are assigned using a canonical ordering of Daux\mathcal{D}^{\mathrm{aux}}, for example by task relatedness (Proposition 2 in Appendix § 14). Within each encoder layer, context representations attend to the auxiliary representations, before target representations attend to the augmented context. For the context branch, we employ standard softmax self-attention, whereas the auxiliary branch uses FAVOR+ (Choromanski et al., 2021), a linear-time approximation based on positive orthogonal random features. Since FAVOR+ provides an unbiased estimator of the softmax kernel, the same parameters can be used under both attention schemes while still targeting the same underlying operation. This allows us to scale efficiently to large Daux\mathcal{D}^{\mathrm{aux}} without sacrificing exact attention over the task-specific context. The use of coupled TNP-like branches builds on ICICL-TNP (Ashman et al., [4]); we provide a detailed comparison of the two architectures in Appendix § 11.

Figure 2. Architecture overview of MetaHeta. A shared input MLP embeds context, target, and concatenated auxiliary observations, augmented with task-of-origin indicators, with target activities masked to 0. Encoder layers use exact self-attention for the context and FAVOR+ for auxiliary data, followed by context-to-auxiliary and target-to-context cross-attention. When Daux=∅\mathcal{D}^{\mathrm{aux}} = \varnothing, the auxiliary branch is skipped. Finally, an output MLP parameterizes a mean-field Gaussian predictive distribution. Formal definitions of the attention operators are given in Appendix § 13.

Experiments

We structure the experiments as follows. In Section 5.1, we investigate the effect of meta-training task heterogeneity on meta-learning performance in a controlled environment. In § 5.2, we show the few-shot bioactivity prediction capabilities of MetaHeta on real-world bioactivity assays from ChEMBL (Gaulton et al., 2012). In § 5.3, we demonstrate its effectiveness for downstream compound prioritization through retrospective Bayesian optimization. Finally, in § 5.4, we ablate the auxiliary-conditioning mechanism and examine its computational cost. All results are averaged over five random seeds and reported with standard errors.

Meta-learning under controlled assay heterogeneity

To study the effect of task heterogeneity in isolation, we construct a semi-synthetic benchmark based on kinase activity screening data from Drewry et al. (2017). Kinases provide a well-suited testbed: their common ATP-binding function is reflected in a highly conserved catalytic domain, while inhibitor response depends largely on variation at a small subset of active-site residues (Sheridan et al., 2009; Born et al., [7]). Coupled with the well-defined phylogenetic organization of the kinome, these properties provide a natural, biologically meaningful hierarchy of task relatedness.

Benchmark construction We first fit a separate GP to each kinase’s activity measurements and sample synthetic tasks from the resulting posteriors. We consider four meta-training regimes sharing a common meta-dataset DmetacoreD_{\mathrm{meta}}^{\mathrm{core}} of 5000 tasks sampled from GPs corresponding to EPHA kinases, with the unaugmented DmetacoreD_{\mathrm{meta}}^{\mathrm{core}} serving as a baseline. The three additional regimes extend this common core, each with another 5000 tasks sampled from GPs corresponding to: (i) EPHA kinases, (ii) non-EPHA tyrosine kinases (TK), and (iii) non-tyrosine kinases (non-TK), yielding progressively more heterogeneous task distributions, as reflected by relatedness measures reported in Table 3 in Appendix § 8.§ 1. Crucially, the 5000 tasks added per regime differ only in the kinase-specific GP from which activities are sampled, so heterogeneity is induced solely through differences in the task-generating functions. Evaluation is likewise fixed across regimes and performed on held-out validation and test sets, each comprising 250 tasks sampled from GPs corresponding to EPHA kinases. A full description of the synthetic task-generation procedure is provided in Appendix § 8.§ 1.

Regimeρact\rho_{\mathrm{act}}dsited_{\mathrm{site}}
EPHA0.4660.149
TK0.3160.367
EPHA + non-TK0.1810.512

Table 3. Quantitative characterization of kinase relatedness across heterogeneity regimes. ρact\rho_{\mathrm{act}}: average pairwise Pearson correlation between kinase activity profiles over the PKIS2 compound panel; dsited_{\mathrm{site}}: average pairwise normalized Hamming distance across the 29 active-site residues identified by Sheridan et al. (2009).

Experimental setup We evaluate all methods in the few-shot regime at context sizes ∣DC∣∈{4,8,16,32}\lvert D^{C}\rvert\in\{4, 8, 16, 32\}. We compare our approach against a set of strong probabilistic meta-learning methods, including members of the NP family, CNP, ANP, and TNP (Garnelo et al., 2018a; Kim et al., 2019; Nguyen & Grover, 2022), as well as deep kernel-based methods, ADKF-IFT and DKT (Chen et al., 2023; Patacchiola et al., 2020). We additionally include MAML (Finn et al., 2017) as a widely used gradient-based baseline. Since the benchmark tasks are sampled from fitted GP posteriors, we can evaluate predictions relative to the corresponding true data-generating functions. We therefore report the fraction of oracle performance in terms of Ros2R_{\mathrm{os}}^{2} and NLL, denoted by FRos2F_{R_{\mathrm{os}}^{2}} and FNLLF_{\mathrm{NLL}}, respectively. For our method, DauxD^{\mathrm{aux}} contains at most five same-target datasets, ordered by decreasing average 5-nearest-neighbor Tanimoto similarity to the current task. Auxiliary datasets exceeding 512 observations are randomly subsampled to that size. Full details are provided in Appendix § 8.§ 4.

Assay heterogeneity can hurt meta-learning performance The effect of increasing task heterogeneity is remarkably consistent across the considered methods and context sizes, as shown for FRos2F_{R_{\mathrm{os}}^{2}} in Figure 3. Across all 28 method–context combinations, augmenting DmetacoreD_{\mathrm{meta}}^{\mathrm{core}} with additional tasks from the same kinase subfamily improves FRos2F_{R_{\mathrm{os}}^{2}} in 25 cases, whereas augmentation with tasks from other tyrosine and non-tyrosine kinases decreases it in 24 and 26 cases, respectively. Moreover, the latter leads to a larger performance deterioration than the former in 23 comparisons. The effects on FNLLF_{\mathrm{NLL}} are smaller in magnitude but follow the same overall pattern, as shown in Figure 6 of Appendix § 9. Same-subfamily augmentation improves performance in 20 of 24 method–context combinations; within-group and outside-group augmentations decrease it in 15 and 18 cases, re-

Figure 3. Effect of meta-training task heterogeneity on few-shot bioactivity prediction. Performance of all the considered methods generally deteriorates as DmetacoreD_{\mathrm{meta}}^{\mathrm{core}} is augmented with progressively less related tasks. MetaHeta remains the best-performing approach regardless of the training regime.

Figure 6. Effect of meta-training task heterogeneity on few-shot bioactivity prediction. Performance of all the considered methods generally deteriorates as Dmeta\mathcal{D}_{\mathrm{meta}} is augmented with progressively less related tasks. MetaHeta remains the best-performing approach regardless of the training regime.

respectively, and outside-group augmentation performs worse than within-group augmentation in 18 comparisons. For both metrics, differences between regimes become more pronounced with increasing context size, as generally weaker performance at small context sizes can partially mask the effect of task heterogeneity. Overall, these results demonstrate that increasing meta-training task heterogeneity can impair meta-learning performance, despite the increase in available training data.

Accounting for assay relatedness benefits few-shot meta-learning Across all heterogeneity regimes, MetaHeta, which explicitly accounts for task relatedness, achieves the best performance on both metrics at every context size. Notably, it retains this advantage even in a deliberately unfavorable cross-regime comparison: when trained under the most heterogeneous regime (Dmetacore\mathcal{D}_{\mathrm{meta}}^{\mathrm{core}} augmented with non-TK tasks), it still outperforms baselines trained under the most favorable regime (Dmetacore\mathcal{D}_{\mathrm{meta}}^{\mathrm{core}} augmented with additional EPHA tasks). Even at the smallest context size ∣DC∣=4|\mathcal{D}^{C}| = 4, MetaHeta already approaches oracle performance in terms of FNLLF_{\mathrm{NLL}}. This suggests that conditioning data from related assays provides a valuable signal beyond the task-specific context, yielding informative predictive distributions even with very few observations from the target assay.

Auxiliary information transfers across homologous targets To examine cross-target transfer of auxiliary information, we retain the preceding setup with meta-training on Dmetacore\mathcal{D}_{\mathrm{meta}}^{\mathrm{core}}, but perform validation and testing on tasks from the EPHB kinase subfamily. Since these targets are not represented in Dmetacore\mathcal{D}_{\mathrm{meta}}^{\mathrm{core}}, no same-target assays are available. However, because the EPHA and EPHB subfamilies both belong to the EPH kinase family, we can use Proposition 1 to construct Dmetaaux\mathcal{D}_{\mathrm{meta}}^{\mathrm{aux}} from the homologous EPHA tasks present in Dmetacore\mathcal{D}_{\mathrm{meta}}^{\mathrm{core}} (see Appendix § 8.§ 4.1 for full details). The results in Table 1 demonstrate that MetaHeta matches or exceeds all baselines across both metrics and all context sizes, with particularly large gains in the lowest-context regime. This suggests that information from homologous targets can support prediction, particularly when task-specific data are limited.

MethodContext size = 4Context size = 8Context size = 16Context size = 32
FNLL↑F_{\mathrm{NLL}} \uparrowFRos2↑F_{R_{\mathrm{os}}^{2}} \uparrowFNLL↑F_{\mathrm{NLL}} \uparrowFRos2↑F_{R_{\mathrm{os}}^{2}} \uparrowFNLL↑F_{\mathrm{NLL}} \uparrowFRos2↑F_{R_{\mathrm{os}}^{2}} \uparrowFNLL↑F_{\mathrm{NLL}} \uparrowFRos2↑F_{R_{\mathrm{os}}^{2}} \uparrow
TNP0.611±0.0190.611 \pm0.019−0.077±0.029-0.077 \pm0.0290.827±0.0040.827 \pm0.0040.110±0.0250.110 \pm0.0250.900±0.0020.900 \pm0.0020.226±0.0200.226 \pm0.0200.931±0.0010.931 \pm0.0010.309±0.0150.309 \pm0.015
ANP0.601±0.0140.601 \pm0.014−0.001±0.002-0.001 \pm0.0020.812±0.0040.812 \pm0.0040.025±0.0350.025 \pm0.0350.899±0.0010.899 \pm0.0010.228±0.0110.228 \pm0.0110.931±0.0010.931 \pm0.0010.321±0.0070.321 \pm0.007
CNP0.609±0.0140.609 \pm0.0140.124±0.0100.124 \pm0.0100.827±0.0040.827 \pm0.0040.156±0.0040.156 \pm0.0040.901±0.0020.901 \pm0.0020.252±0.0160.252 \pm0.0160.930±0.0010.930 \pm0.0010.313±0.0060.313 \pm0.006
ADKF-IFT0.262±0.0270.262 \pm0.0270.028±0.0030.028 \pm0.0030.760±0.0070.760 \pm0.0070.079±0.0130.079 \pm0.0130.882±0.0020.882 \pm0.0020.174±0.0130.174 \pm0.0130.925±0.0020.925 \pm0.0020.282±0.0190.282 \pm0.019
DKT0.121±0.0180.121 \pm0.0180.021±0.0020.021 \pm0.0020.646±0.0110.646 \pm0.0110.071±0.0020.071 \pm0.0020.806±0.0060.806 \pm0.0060.158±0.0120.158 \pm0.0120.874±0.0030.874 \pm0.0030.285±0.0100.285 \pm0.010
MAML−0.101±0.119-0.101 \pm0.1190.108±0.0450.108 \pm0.0450.257±0.0130.257 \pm0.0130.314±0.0230.314 \pm0.023
MetaHeta0.829±0.015\mathbf{0.829 \pm0.015}0.501±0.018\mathbf{0.501 \pm0.018}0.882±0.004\mathbf{0.882 \pm0.004}0.346±0.053\mathbf{0.346 \pm0.053}0.901±0.004\mathbf{0.901 \pm0.004}0.327±0.084\mathbf{0.327 \pm0.084}0.934±0.003\mathbf{0.934 \pm0.003}0.333±0.041\mathbf{0.333 \pm0.041}
MethodContext size = 4Context size = 8Context size = 16Context size = 32
NLL ↓\downarrowRos2↑R^2_{\mathrm{os}} \uparrowNLL ↓\downarrowRos2↑R^2_{\mathrm{os}} \uparrowNLL ↓\downarrowRos2↑R^2_{\mathrm{os}} \uparrowNLL ↓\downarrowRos2↑R^2_{\mathrm{os}} \uparrow
TNP7.406 ± 2.519−0.070 ± 0.0702.381 ± 0.216−0.048 ± 0.0371.537 ± 0.0260.153 ± 0.0101.303 ± 0.0280.199 ± 0.017
ICICL-TNP2.291 ± 0.1120.069 ± 0.0381.786 ± 0.0220.117 ± 0.0201.485 ± 0.0070.155 ± 0.0201.362 ± 0.0440.131 ± 0.026
ANP8.020 ± 4.795−0.048 ± 0.0472.718 ± 0.265−0.071 ± 0.0451.697 ± 0.0750.056 ± 0.0441.418 ± 0.0980.131 ± 0.057
CNP5.945 ± 2.766−0.176 ± 0.0432.399 ± 0.229−0.013 ± 0.0101.715 ± 0.0280.063 ± 0.0031.472 ± 0.0290.120 ± 0.008
ADKF-IFT22.605 ± 9.4000.060 ± 0.0014.509 ± 0.3740.110 ± 0.0052.235 ± 0.0290.173 ± 0.0031.582 ± 0.0520.265 ± 0.009
DKT37.880 ± 18.2360.022 ± 0.0076.682 ± 0.5640.068 ± 0.0243.075 ± 0.0660.148 ± 0.0162.059 ± 0.0700.224 ± 0.025
TabICLv2−−0.011 ± 0.006−−0.008 ± 0.003−−0.018 ± 0.003−0.010 ± 0.005
TabPFNv3−0.026 ± 0.003−0.037 ± 0.003−0.073 ± 0.003−0.111 ± 0.001
MAML−−0.214 ± 0.054−−0.022 ± 0.025−0.050 ± 0.013−0.065 ± 0.007
ST-MAML−−0.048 ± 0.005−0.043 ± 0.005−0.061 ± 0.003−0.062 ± 0.006
Frequent Hitters−0.086 ± 0.007−0.095 ± 0.014−0.123 ± 0.010−0.131 ± 0.008
Similarity Search−0.012 ± 0.001−0.029 ± 0.001−0.041 ± 0.000−0.050 ± 0.000
RF-Daux−−0.228 ± 0.009−−0.196 ± 0.006−−0.194 ± 0.009−−0.213 ± 0.023
MetaHeta2.216 ± 0.0500.129 ± 0.0281.765 ± 0.0370.140 ± 0.0291.466 ± 0.0200.187 ± 0.0181.277 ± 0.0100.228 ± 0.011
MetaHeta (γ=0.7\gamma= 0.7)2.325 ± 0.0910.127 ± 0.0261.778 ± 0.0390.129 ± 0.0261.476 ± 0.0240.179 ± 0.0161.277 ± 0.0120.223 ± 0.010
MetaHeta (γ=0.8\gamma= 0.8)2.469 ± 0.1240.119 ± 0.0241.808 ± 0.0360.112 ± 0.0251.497 ± 0.0290.170 ± 0.0161.295 ± 0.0250.218 ± 0.009
MetaHeta (γ=0.9\gamma= 0.9)4.423 ± 1.9380.098 ± 0.0322.090 ± 0.1630.074 ± 0.0251.585 ± 0.0510.151 ± 0.0191.422 ± 0.0760.204 ± 0.013
MetaHeta-R2.438 ± 0.112−0.256 ± 0.1641.959 ± 0.030−0.089 ± 0.0761.606 ± 0.0840.099 ± 0.0451.363 ± 0.0480.185 ± 0.013

Table 1. Few-shot prediction on EPHB test tasks after meta-training on DmetacoreD_{\mathrm{meta}}^{\mathrm{core}}. MetaHeta matches or exceeds all baselines across both metrics and all context sizes.

Meta-learning evaluation on real-world bioactivity assays

To assess whether the findings from the controlled assay-heterogeneity setting extend beyond the semi-synthetic benchmark, we evaluate MetaHeta on FS-Mol (Stanley et al., 2021), a few-shot learning benchmark built from ChEMBL (Gaulton et al., 2012) bioactivity assays.

Experimental setup As in Section 5.1, we consider a highly data-scarce regime with ∣DC∣∈{4,8,16,32}|\mathcal{D}^{C}| \in\{4, 8, 16, 32\}. We construct Daux\mathcal{D}^{\mathrm{aux}} based on assay-description similarity with threshold γ=0.5\gamma= 0.5, selecting at most 5 auxiliary datasets per task and subsampling each to at most 512 observations. We compare MetaHeta against previously introduced meta-learning baselines, together with ST-MAML (Wang et al., 2022), a MAML variant designed to account for task heterogeneity, and ICICL-TNP (Ashman et al., [4]), evaluated with the same Daux\mathcal{D}^{\mathrm{aux}} as our method. We additionally include two state-of-the-art tabular foundation models, TabICLv2 (Qu et al., 2026) and TabPFNv3 (Grinsztajn et al., 2026), as well as three non-meta-learning sanity checks: Frequent Hitters and Similarity Search (Schimunek et al., 2023), and RF-Daux\mathcal{D}^{\mathrm{aux}}, a random forest fitted per target assay after combining its context with the observations in Daux\mathcal{D}^{\mathrm{aux}}. Since the underlying data-generating functions are unavailable, we report the standard Ros2R^{2}_{\mathrm{os}} and NLL where applicable. Details are in Appendix § 8.§ 4.

Results Across the four context sizes and both metrics, our method achieves the best performance in 7 out of 8 comparisons. The gains are the largest in the most data-scarce regime and diminish as more task-specific context becomes available. Consistent with the observations of Schimunek et al. (2023), Frequent Hitters, which ignores the task context and instead learns from observations naively pooled across all assays in Dmeta\mathcal{D}_{\mathrm{meta}}, outperforms several meta-learning approaches. This suggests that standard meta-learners may struggle to exploit highly heterogeneous assay collections, particularly when only limited context data are available. In contrast, our approach is the only method that outperforms Frequent Hitters across all context sizes. Both tabular foundation models perform poorly, particularly at the smallest context sizes, providing further evidence that broad generic priors can be insufficient when limited context is available to identify the relevant task regime. MetaHeta consistently outperforms ICICL-TNP, whose Ros2R^{2}_{\mathrm{os}} declines as the context size increases from 16 to 32 while ours improves, potentially reflecting the benefit of retaining exact self-attention over the context rather than processing it through pseudo-tokens. Additionally, the poor performance of RF-Daux\mathcal{D}^{\mathrm{aux}} suggests that access to related auxiliary data alone is insufficient for effective prediction.

Retrospective Bayesian optimization

To assess the practical utility of MetaHeta, we investigate whether its improved predictive performance in low-data settings translates into more effective compound prioritization when used as a surrogate model in retrospective Bayesian optimization on BindingDB assays (Liu et al., 2025).

Experimental setup We conduct the evaluation with initial conditions designed to resemble an early-stage compound-optimization scenario, in which activity measurements are available only for compounds belonging to a single, weakly active chemical series. Specifically, for each of the eight considered assays and each random seed, we initialize optimization with four randomly selected compounds sharing a Bemis–Murcko scaffold (Bemis & Murcko, [6]) with median activity below the assay-specific 25th percentile. We then perform 10 optimization rounds using the LogEI acquisition function (Ament et al., [2]). We compare MetaHeta against most of the probabilistic baselines introduced in § 5.2, a task-specific GP with a Tanimoto kernel, and random selection. Further details on assay selection and candidate-pool construction are provided in Appendix § 8.§ 2.

Results As shown in Figure 4, MetaHeta finds the most active compounds among the compared methods in three of the eight assays and ranks second in three others. It is also the only approach to retrieve compounds that rank among the 5% most active in each of the eight assays. Table 4 in Appendix § 9.§ 2 further demonstrates the strong and consistent performance of MetaHeta across all the considered assays: our approach achieves an average rank of 1.875, leaving a substantial gap to the second-ranked method, TabPFN, with an average rank of 4.0. Notably, the task-specific GP ranks last in four of the eight assays, suggesting that fitting a surrogate independently from assay-specific observations alone can be unreliable in such a low-data regime.

Figure 4. Retrospective Bayesian optimization trajectories on eight BindingDB assays. Dashed horizontal lines (—\text{---}) mark the activity threshold for the top 5% of compounds in each assay; MetaHeta is the only method to identify such compounds in every assay.

MethodAverage rank
TNP4.375
ANP5.375
CNP5.375
ADKF-IFT7.250
DKT6.625
TabPFN4.000
ICICL-TNP5.000
Random6.375
GP7.750
MetaHeta1.875

Table 4. Average rank across retrospective Bayesian optimization tasks. For each assay, methods are ranked according to their final best-observed activity averaged over five random seeds; ranks are then averaged across the eight assays.

Ablation

In this section, we examine: (i) how the trade-off between predictive performance and inference time of MetaHeta depends on the number of auxiliary datasets and the choice of architecture; (ii) its sensitivity to the similarity threshold γ\gamma; and (iii) whether assay-description similarity provides a useful proxy for task relatedness.

Experimental setup We use the models trained on FS-Mol (§ 5.2). To answer (i), we compare predictive performance and inference time of MetaHeta and ICICL-TNP as we vary ∣Daux∣|\mathcal{D}^{\mathrm{aux}}| at inference time, keeping γ=0\gamma= 0 and using the same auxiliary datasets for both methods. For (ii), we evaluate stricter similarity thresholds by increasing γ\gamma while retaining a maximum of five auxiliary datasets. Lastly, to address (iii), we evaluate MetaHeta with the default γ=0.5\gamma= 0.5 and a maximum of five auxiliary datasets, but shuffle the assignment of retrieved auxiliary assays to target assays. We denote this variant as MetaHeta-R.

Results Figure 5 shows that conditioning on a single auxiliary dataset suffices to substantially improve Ros2R^2_{\mathrm{os}}, with little further change as more datasets are added. Figure 7 in Appendix § 9.§ 3 shows continued reductions in NLL, suggesting that additional datasets mainly refine uncertainty estimates rather than improve point predictions. Although conditioning on a single auxiliary dataset increases inference time by approximately 2.3 – 2.5 times, each additional dataset adds only around three seconds, resulting in 20% overhead when expanding Daux\mathcal{D}^{\mathrm{aux}} from 1 to 5. We attribute this modest incremental cost to FAVOR+ attention, which allows our architecture to condition on five auxiliary datasets faster than ICICL-TNP does on a single one. It also makes more effective use of the auxiliary signal, achieving higher mean Ros2R^2_{\mathrm{os}} across all context sizes and nonzero auxiliary-dataset counts. Table 2 shows that increasing γ\gamma degrades performance, with the largest deterioration at γ=0.9\gamma= 0.9, where many target assays lack even a single auxiliary assay satisfying the similarity criterion. Notably, shuffling auxiliary-assay assignments in MetaHeta-R leads to comparatively modest increases in NLL but substantially degrades Ros2R^2_{\mathrm{os}}, with the sharpest drops at small context sizes. This provides strong evidence that assay-description similarity offers a useful basis for constructing Daux\mathcal{D}^{\mathrm{aux}} by capturing relatedness relevant to prediction, particularly when task-specific data are scarce.

Figure 5. Ros2R^2_{\mathrm{os}} and inference time of MetaHeta and ICICL-TNP with varying cardinality of Daux\mathcal{D}^{\mathrm{aux}}. Auxiliary conditioning improves predictive performance with modest incremental cost. Our architecture processes five auxiliary datasets faster than ICICL-TNP processes a single one.

Figure 7. NLL of MetaHeta and ICICL-TNP with varying cardinality of Daux\mathcal{D}^{\mathrm{aux}}.

Conclusion

In this work, we first investigate the effect of meta-training task heterogeneity on few-shot bioactivity prediction in a controlled setting, and show that increasing heterogeneity can systematically degrade meta-learning performance across methods and context sizes. To address this, we introduce MetaHeta, a meta-learning framework which explicitly accounts for assay heterogeneity by conditioning predictions on auxiliary data from related assays. Its architecture enables this auxiliary conditioning to scale efficiently to large datasets while preserving exact attention over scarce task-specific context. We further demonstrate the effectiveness of our method under three notions of assay relatedness: shared target identity, phylogenetic relationships between targets, and assay-description similarity. Finally, we demonstrate the effectiveness of MetaHeta on bioactivity assays from ChEMBL and BindingDB, improving both few-shot prediction and downstream compound prioritization through retrospective Bayesian optimization. We discuss the limitations of our approach and directions for future work in Appendix § 12. Taken together, our results identify assay heterogeneity as an important challenge for few-shot bioactivity meta-learning and show that conditioning on related assays provides an effective and scalable way to address it.

Acknowledgments

MK thanks Max from HPC for his invaluable contributions to maintaining the author’s caloric intake and, consequently, productivity. VF was supported by the Branco Weiss Fellowship. This project has received funding from the European Research Council (ERC) under the European Funding Union’s Horizon 2020 research and innovation programme (grant agreement No 101125506–DOG-AMP).

Experimental details

Controlled-heterogeneity benchmark construction

Data preparation We construct the semi-synthetic kinase benchmark from the PKIS2 profiling data of Drewry et al. (2017), comprising 645 compounds from 86 chemotypes screened against 392 wild-type human kinases. We first restrict the panel to the kinases considered in our benchmark and preprocess the molecular structures with RDKit (Landrum et al. (2026)) by selecting the parent fragment, neutralizing charges, and canonicalizing tautomers. Activity values are transformed from the unit interval to logit space after clipping extreme values. Molecules are represented using 1024-bit Morgan fingerprints with radius 2.

Kinase-specific GP fitting For each kinase, we standardize the transformed activity values and fit an exact Gaussian process with a constant mean and a scaled Tanimoto kernel over Morgan fingerprints. This yields a separate posterior distribution over activity functions for each kinase. We assess each kinase-specific GP using leave-one-chemotype-out cross-validation. In each fold, one chemotype is held out, the GP is refitted on the remaining compounds, and predictive performance is compared against a baseline that predicts the mean activity of the training fold. We retain only kinases with positive balanced leave-one-chemotype-out.

Molecule generation To obtain a sufficiently large molecular domain for synthetic task generation, we expand the original kinase-panel chemistry using CReM (Polishchuk (2020)) mutation and growth operations. Generated molecules are filtered to satisfy basic drug-like property constraints, requiring molecular weight between 150 and 650, log⁡P\log P between −1-1 and 7, topological polar surface area below 180, at most 6 hydrogen-bond donors, 12 hydrogen-bond acceptors, and 15 rotatable bonds. We further retain only molecules whose maximum Tanimoto similarity to any molecule in the original panel lies between 0.40 and 0.60, yielding approximately 10610^{6} candidate molecules. These molecules are then partitioned into training, validation, and test molecular domains using an 80/10/10 Bemis–Murcko scaffold split, with scaffolds kept disjoint across the three partitions.

Task construction Each synthetic assay is generated by first sampling its size from a PERT distribution with minimum 40, mode 100, maximum 1024, and concentration 20. We then sample the corresponding number of molecules from the relevant molecular split and select a kinase-specific GP. Activities are generated by drawing jointly from the GP posterior over the selected molecules and adding Gaussian observation noise, with the fitted observation-noise standard deviation scaled by 0.5. Using this procedure, we first generate a core meta-dataset of 5000 tasks from GPs corresponding to EPHA kinases. We then generate an additional 5000 tasks for each heterogeneity regime while keeping the sampled task sizes and molecular inputs fixed across regimes. Only the kinase-specific GP used to generate the activity values is varied, with source GPs corresponding to (i) EPHA kinases, (ii) non-EPHA tyrosine kinases, or (iii) non-tyrosine kinases. We additionally generate 250 validation and 250 test assays from EPHA kinase GPs. For the homologous-target transfer experiment, we generate 250 validation and 250 test assays from EPHB kinase GPs, while keeping training restricted to EPHA tasks.

Kinase relatedness across regimes To quantify the increasing relatedness gap across the three kinase regimes, we consider two measures: similarity of kinase activity profiles across the PKIS2 compound panel and sequence divergence at the 29 active-site residues identified by Sheridan et al. (2009), with the resulting values reported in Table 3.

Retrospective Bayesian optimization

Data preparation We curate assays from BindingDB (Liu et al., 2025) for retrospective Bayesian optimization experiments. Molecular structures are first processed with RDKit (Landrum et al., 2026) using the same procedure as described in Appendix § 8.§ 1. We restrict the data to measurements against human, single-chain protein targets and remove target names associated with more than one UniProt (Consortium, 2025) identifier or more than one target-chain sequence, ensuring an unambiguous mapping between target name and protein identity. We further retain only BindingDB entries for which all measurements associated with a given DOI correspond to a single target. We consider affinity measurements reported as KiK_i, IC50IC_{50}, or KdK_d, and retain only observations for which exactly one of these three endpoints is available, discarding observations with either no usable measurement or multiple reported endpoints. The remaining measurements are converted to a common pp-activity scale as Y=9−log⁡10(x)Y = 9 - \log_{10}(x), where xx is the reported affinity in nM. Finally, compounds with molecular weight above 900 Da are removed.

Assay selection We select assays that are sufficiently large and chemically diverse to support retrospective compound optimization while retaining a non-degenerate activity landscape. Specifically, we require each assay to contain between 500 and 2000 compounds and at least 30 Bemis–Murcko scaffolds (Bemis & Murcko, [6]) represented by at least five compounds each. We further exclude assays for which any single activity value accounts for more than 25% of the measurements. Finally, since the optimization experiments are commonly initialized from a single weakly active chemical series, we require each assay to contain at least five eligible starting scaffolds, defined as Bemis–Murcko scaffolds represented by at least five compounds whose median activity lies at or below the assay-specific 25th percentile. This ensures that each retained assay admits multiple chemically distinct low-activity starting series from which to simulate early-stage compound optimization. Since BindingDB contains records originating from both ChEMBL and the patent literature, we restrict assay selection to those derived from the latter to avoid potential overlap with the ChEMBL-based FS-Mol training data. We conduct the experiments on eight assays satisfying all the above criteria with the following identifiers: 10.7270/Q2348QXR, 10.7270/Q2N018M8, 10.7270/Q2S46W6V, 10.7270/Q2FN152J, 10.7270/Q2BZ68G7, 10.7270/Q2B27XNR, 10.7270/Q2TB1B01, and 10.7270/Q2P26PFT.

Assay descriptions Assay descriptions were generated using GPT-5.6 Sol (OpenAI, 2026) by parsing the patent document corresponding to each of the eight BindingDB entries with the following prompt:

Given the provided patent, write a single concise paragraph describing the experimental assay used to measure compound bioactivity. Include, when stated, the biological target and relevant construct or species, assay type and biological context (e.g., biochemical, cellular, binding, functional), key reagents or substrates, experimental conditions such as concentrations, incubation times, temperature, buffer or medium, the measurement technology or equipment, and the measured endpoint or readout. Describe only information explicitly supported by the source and do not infer missing experimental details. Do not report or summarize compound-specific activity values, potency measurements, active/inactive classifications, hit rates, structure–activity relationships, rankings, or conclusions about which compounds performed well or poorly. The description should characterize how the assay was performed and what it measured, independently of the observed compound outcomes. Keep the output to one short paragraph.

The resulting descriptions used in the experiment were:

  • 10.7270/Q2348QXR: A biochemical ATPase assay measured ATP hydrolysis by recombinant human DHX9 in the presence of an annealed double-stranded RNA substrate. The 10-μ\muL reactions used DHX9 delivered at 1.25 nM in 40 mM HEPES, pH 7.5, 0.01% Tween-20, 0.01% BSA, 1 mM DTT, 5 mM MgCl2_2, and RNase inhibitor and were initiated with 30 nM double-stranded RNA and 10 μ\muM ATP. After one hour at room temperature, ADP-Glo reagent was added for 40 minutes, followed by kinase-detection reagent for another 40 minutes. Luminescence was recorded on an EnVision plate reader, providing an ADP-production readout of DHX9 ATPase activity.

  • 10.7270/Q2N018M8: Endothelial and hepatic lipase activity was measured biochemically using the fluorescent FRET substrate A10070 incorporated into DMPG vesicles. Endothelial lipase was supplied in conditioned medium from HT-1080 cells engineered to overexpress endogenous EL, while hepatic lipase was partially purified from conditioned medium of HL-expressing COS cells. Enzyme was preincubated with compound for 30 minutes at 37°C in 50 mM HEPES, pH 8.0, 50 mM NaCl, and 1 mM CaCl2_2, after which diluted substrate vesicles initiated the reaction. Fluorescence was recorded for 60 minutes on a Gemini plate reader at 490-nm excitation and 530-nm emission, and the slope between 300 and 900 seconds represented the reaction rate.

  • 10.7270/Q2S46W6V: A fluorescence-polarization competition assay measured binding of recombinant eIF4E to the fluorescent cap analogue EDA-m7^{7}GDP-ATTO-550. Final reactions contained 75 nM eIF4E, 20 nM fluorescent ligand, and 1% DMSO in 20 mM Tris, pH 7.5, 100 mM NaCl, 1 mM DTT, and 0.02% Tween-20. Protein and ligand were preincubated for five minutes before compound addition, and 100-μ\muL reactions in black half-area 96-well plates were equilibrated for 30 minutes at room temperature while protected from light. A PerkinElmer Victor 2 multi-label counter measured fluorescence polarization as the competitive-binding readout.

  • 10.7270/Q2FN152J: An isolated-enzyme HTRF kinase assay measured phosphorylation by the recombinant His-tagged cytoplasmic domain of TrkA/NTRK1, residues 441–796, using the Cisbio KinEASE-TK kit. The assay used 4 nM TrkA, 40 μ\muM ATP, and kit buffer supplemented with 10 mM MgCl2_2 and 2 mM DTT; enzyme and ATP were preactivated for 20 minutes at room temperature, exposed to compound for 20 minutes, and then incubated with 1 μ\muM biotinylated tyrosine-kinase substrate for 35 minutes. Detection buffer containing streptavidin-XL665 and a cryptate-labelled phosphotyrosine antibody stopped the reaction, followed by 60 minutes at room temperature and EnVision measurement of the 665/620-nm emission ratio.

  • 10.7270/Q2BZ68G7: A biochemical radiometric methyltransferase assay measured incorporation of tritium from 3^3H-SAM into GST-tagged MEKK2 by purified full-length human SMYD3. Compounds and 0.4 nM SMYD3 were preincubated for 30 minutes at room temperature in 25 mM Tris-Cl, pH 8.0, 1 mM TCEP, 0.005% bovine skin gelatin, and 0.005% Tween-20; 8 nM 3^3H-SAM and 12 nM MEKK2 then initiated the reaction in 2% DMSO. Non-radioabelled SAM stopped incorporation, and radiolabelled MEKK2 was precipitated onto scintillation-proximity beads in 0.5 M citric acid. A PerkinElmer Top-Count reader measured incorporated radioactivity as disintegrations or counts per minute.

  • 10.7270/Q2B27XNR: A biochemical time-resolved fluorescence assay measured ERK2-catalysed phosphorylation of a truncated ATF2 substrate fused to GFP. Reactions contained 0.25 nM ERK2, 0.4 mM ATF2-GFP, 20 μ\muM ATP, 50 mM Tris at pH 7.5, 10 mM MgCl2_2, 1 mM EGTA, 0.01% Triton X-100, 1 mM DTT, and 2.5% DMSO and proceeded for 30 minutes at room temperature. Reactions were stopped with TR-FRET dilution buffer containing 25 mM EDTA and 2 nM terbium-labelled anti-phospho-ATF2 (Thr71), incubated for at least another 30 minutes, and read on a Phераstar at 340-nm excitation and 520/495-nm emission; the emission ratio was the phosphorylation readout.

  • 10.7270/Q2TB1B01: A biochemical time-resolved fluorescence assay measured ERK2 phosphorylation of truncated ATF2-GFP. Reactions contained 0.25 nM ERK2, 0.4 μ\muM

ATF2-GFP, 20 μ\muM ATP, 50 mM Tris at pH 7.5, 10 mM “MgC2_2” as printed in the patent, 1 mM EGTA, 0.01% Triton X-100, 1 mM DTT, and 2.5% DMSO and were incubated for 30 minutes at room temperature. TR-FRET dilution buffer, 25 mM EDTA, and 2 nM terbium-labelled anti-phospho-ATF2 (Thr71) stopped the reaction; after at least 30 additional minutes, a Pherastar measured fluorescence at 520 and 495 nm following 340-nm excitation, and the emission ratio represented phosphorylation.

  • 10.7270/Q2PV6PFT: A low-ATP biochemical kinase assay used recombinant full-length N-terminally His-tagged human TBK1 expressed in insect cells and a biotinylated peptide substrate, biotin-Ahx-GDEDFSSFAEPG-amide. TBK1 and compound were preincubated for 15 minutes at 22°C in HEPES buffer containing MgCl2_2, DTT, BSA, Nonidet-P40, and protease inhibitors; phosphorylation then proceeded for 30 minutes at 22°C with 10 μ\muM ATP and 1 μ\muM peptide. EDTA stopped the reaction, and streptavidin-XL665, an anti-phosphoserine antibody, and europium-labelled anti-mouse IgG were added for one hour. A Pherastar or Viewlux TR-FRET reader measured 620- and 665-nm emissions after 350-nm excitation, with their ratio representing phosphorylated substrate.

Metrics

We evaluate all methods using negative log-likelihood (NLL), where applicable, and the out-of-sample coefficient of determination Ros2R_{\mathrm{os}}^2, following Chen et al. (2023). For a task with context set DC=(XC,YC)\mathcal{D}^{C}=(X^{C},Y^{C}) and target set DT=(XT,YT)\mathcal{D}^{T}=(X^{T},Y^{T}), we compute

Ros2=1−∑n=1Nt(ynT−y^nT)2∑n=1Nt(ynT−yˉC)2,yˉC=1Nc∑n=1NcynCR_{\mathrm{os}}^2=1-\frac{\sum_{n=1}^{N_t}(y_n^T-\hat{y}_n^T)^2}{\sum_{n=1}^{N_t}(y_n^T-\bar{y}^{C})^2}, \qquad\bar{y}^{C}=\frac{1}{N_c}\sum_{n=1}^{N_c}y_n^C

where y^nT\hat{y}_n^T denotes the predictive mean at target input xnTx_n^T.

Since the synthetic assays in Section 5.1 are sampled from known kinase-specific GP posteriors, we have access to their corresponding data-generating functions. This allows us to compute an exact GP oracle by conditioning the generating GP on the same context set DC\mathcal{D}^{C} available to each method. The oracle uses the same observation-noise model as the synthetic data-generation process. We report performance relative to this oracle. We further define:

FRos2=Ros2Ros2,oracle.(6)F_{R_{\mathrm{os}}^2}=\frac{R_{\mathrm{os}}^2}{R_{\mathrm{os}}^{2,\mathrm{oracle}}}. \tag*{(6)}

For NLL, we instead compare the corresponding average predictive densities:

FNLL=exp⁡(−NLL)exp⁡(−NLLoracle)=exp⁡(NLLoracle−NLL).(7)F_{\mathrm{NLL}}=\frac{\exp(-\mathrm{NLL})}{\exp(-\mathrm{NLL}_{\mathrm{oracle}})}=\exp(\mathrm{NLL}_{\mathrm{oracle}}-\mathrm{NLL}). \tag*{(7)}

Since exp⁡(−NLL)\exp(-\mathrm{NLL}) is the geometric mean predictive density, FNLLF_{\mathrm{NLL}} has a direct interpretation as the ratio between the geometric mean predictive density of a method and that of the oracle. In both cases, a value of 1 corresponds to oracle-level performance.

Implementation details

We evaluate all methods at context sizes ∣DC∣∈{4,8,16,32}|\mathcal{D}^{C}|\in\{4,8,16,32\}. We largely follow Stanley et al. (2021), but deviate in how context size is handled during training and validation. Specifically, for each context size, we train and validate a separate model using that same fixed context size, and evaluate it only at the corresponding context size. Given the highly data-scarce regime considered here, this ensures that every method is optimized for the same task-specific data budget on which it is evaluated, and avoids conflating few-shot performance with generalization across context sizes. This also places amortized methods, which can naturally accommodate varying context sizes, on the same footing as prior FS-Mol evaluations in which methods are trained using a fixed support-set size (Stanley et al. (2021); Chen et al. (2023)). For each evaluation assay, we sample 10 context–target splits and average evaluation metrics across splits before averaging across assays. For the controlled-heterogeneity experiments, all methods are given the same molecular representation used by the task-generating GPs, namely 1024-bit radius-2 Morgan fingerprints. This ensures that differences in performance relative to the GP oracle cannot be attributed to a mismatch in molecular representation. For the experiments on FS-Mol, we do not enforce a single representation across methods: we align representations where appropriate, while retaining method-specific feature extractors when they are part of the original approach or using alternative representations when these perform better. This is because imposing a single shared representation may disadvantage particular baselines whose performance is strongly tied to the choice of molecular representation. For the retrospective Bayesian optimization experiments, we train models with the context size sampled uniformly from {4,…,32}\{4,\ldots,32\}. During validation, we evaluate each model on three independently sampled context–target splits at each context size ∣DC∣∈{4,8,16,32}|\mathcal{D}^{C}| \in\{4,8,16,32\}, and average performance across all splits and context sizes.

MetaHeta

Controlled-heterogeneity experiment Our model is trained with meta-batch size 32 for 10 epochs using AdamW (Loschilov & Hutter, 2019) with learning rate 10−410^{-4}, weight decay 0.01 and a cosine learning-rate schedule with 10% warm-up. We evaluate on the validation set after each epoch and retain the checkpoint with the lowest validation NLL. We use at most 5 auxiliary datasets per task and subsample each auxiliary dataset to 512 observations. The input embedder consists of 2 layers with hidden dimension 128, and the output decoder consists of a single layer with dimension 64. The main network contains 6 attention layers with embedding dimension 128, using 8 attention heads with head dimension 16, and a dropout rate of 0.25.

FS-Mol experiment For FS-Mol, we use a meta-batch size of 16 and train for 100 epochs with learning rate 3×10−43 \times10^{-4}. We evaluate on the validation set after each epoch and retain the checkpoint with the lowest validation NLL. The architecture is increased to an embedding and feed-forward dimension of 256, decoder dimension 128, 8 attention layers, and head dimension 32, while retaining 8 attention heads, a 2-layer input embedder, and a 1-layer decoder. We use at most 5 auxiliary datasets per task and subsample each to at most 512 observations, with cosine-similarity threshold γ=0.5\gamma= 0.5. For molecular representations, we use Hyformer embeddings (Izdebski et al., 2026).

Auxiliary dataset construction The construction of Daux\mathcal{D}^{\mathrm{aux}} in MetaHeta is adapted to the notion of assay relatedness available in each experimental setting:

  • Controlled-heterogeneity experiment. We construct Daux\mathcal{D}^{\mathrm{aux}} according to Eq. (5), selecting at most five same-target datasets, ordered by decreasing average 5-nearest-neighbor Tanimoto similarity to the current task. The similarity is computed exclusively from molecular inputs; target outputs are never used in auxiliary-dataset selection. Auxiliary datasets containing more than 512 observations are randomly subsampled to that size.

  • Homologous-target transfer experiment. For the EPHB evaluation, where same-target auxiliary assays are unavailable, we instead construct Daux\mathcal{D}^{\mathrm{aux}} according to Proposition 1. For each such EPHB assay, we sample five auxiliary tasks from the pool of assays targeting any member of the EPHA subfamily and order them by decreasing activity variance. Each auxiliary dataset is again subsampled to at most 512 observations.

  • FS-Mol & retrospective Bayesian optimization. We construct Daux\mathcal{D}^{\mathrm{aux}} using assay-description similarity, as described in Algorithm 1, retaining at most five auxiliary datasets per task and subsampling each to at most 512 observations.

Baselines

Implementations of the baseline methods were based primarily on the code released by Chen et al. (2023), Stanley et al. (2021), and implementations of several Neural Process variants available at https://github.com/cambridge-mlg/tnp, released under the MIT License.

  • Transformer Neural Process (TNP) (Nguyen & Grover, 2022). We use the same architecture and training setup as for our model. In particular, setting the number of auxiliary datasets to zero reduces our model to the standard TNP-D (using the efficient implementation described by Feng et al. (2023)).

  • Conditional Neural Process (CNP) (Garnelo et al., 2018a). For FS-Mol, we use mean aggregation and a 256-dimensional context representation, with a decoder hidden dimension

of 256 and with Hyformer embeddings as molecular representations. For the controlled-heterogeneity experiment we reduce both the context representation and decoder hidden dimensions to 128.

  • Attentive Neural Process (ANP) (Kim et al., 2019). We match the TNP baseline in architectural parameters, including the embedding, feed-forward, decoder, and attention dimensions, as well as the number of attention heads and layers, while omitting the latent path.

  • Adaptive Deep Kernel Fitting with Implicit Function Theorem (ADKF-IFT) (Chen et al., 2023). For FS-Mol, we retain the feature extractor used in the original implementation, combining ECFP fingerprints with a GNN-MT from Stanley et al. (2021). For the controlled-heterogeneity experiment, we replace the GNN with a two-layer MLP with hidden and output dimensions of 1024, operating on the same 1024-bit fingerprints used by the GP oracle.

  • Deep Kernel Transfer (DKT) (Patacchiola et al., 2020). We use the implementation provided by Chen et al. (2023) and follow the same experimental setup and feature-extractor choices as for ADKF-IFT.

  • Model-Agnostic Meta-Learning (MAML) (Finn et al., 2017). We use the implementation from Stanley et al. (2021) based on GNN-ST. For the controlled-heterogeneity experiment, we replace the GNN with the same two-layer MLP used for ADKF-IFT and DKT. The regression head for the kinase experiments is an MLP with hidden dimensions 256 and 64.

  • ST-MAML (Wang et al., 2022). We preserve the MAML setup, adding a stochastic task encoder with hidden dimension 128, a 32-dimensional latent representation, and a 32-dimensional task feature. We weight the KL regularization term by 0.1 and average predictions over five context-conditioned latent samples at evaluation.

  • Frequent Hitters (Schimunek et al., 2023). Frequent Hitters is simply an MLP trained on data pooled across all training assays, without using the support set of the target assay. Following a hyperparameter sweep, we use four hidden layers of width 16, batch size 256, learning rate 10−310^{-3}, no dropout or weight decay, and train for up to 100 epochs with an early-stopping patience of 10 epochs. Molecular inputs are represented using ECFP fingerprints.

  • Similarity Search. As an additional sanity-check baseline proposed by Schimunek et al. (2023), we use Morgan fingerprints with radius 2 and 1024 bits, and predict each target as the Tanimoto-similarity-weighted average of the context labels.

  • TabPFNv3 (Grinsztajn et al., 2026). We use Morgan fingerprints with radius 2 and 1024 bits as molecular representations, which we found to perform better than Hyformer embeddings.

  • TabICLv2 (Qu et al., 2026}). We use the same molecular representation as for TabPFNv3.

  • ICICL-TNP (Ashman et al., [4]). Across all settings, we always construct Daux\mathcal{D}^{\mathrm{aux}} in the same way as for MetaHeta, such that both models condition on exactly the same auxiliary data. As in MetaHeta, we share the projection parameters between the corresponding MHSA and MHCA blocks of the context and auxiliary branches. We do not include dataset-of-origin one-hot indicators, as auxiliary datasets are represented separately through their pseudo-token sets. We use 64 pseudo-tokens for each auxiliary dataset and set the number of context pseudo-tokens equal to the context size, ∣DC∣|\mathcal{D}^{C}|.

  • RF-Daux\mathcal{D}^{\mathrm{aux}}. We construct Daux\mathcal{D}^{\mathrm{aux}} in the same way as for MetaHeta and then concatenate its datasets with the task-specific context set. A random forest with 250 trees is then fit to that combined dataset.

Computational resources

A single training run of MetaHeta was performed on an NVIDIA H100 GPU and required approximately 24 hours. The runtime ablation in § 5.4 was performed on an NVIDIA Tesla V100S 32 GB GPU with an Intel Xeon Gold 6226R CPU @ 2.90 GHz.

Extended results

Controlled-heterogeneity experiment

Retrospective bayesian optimization

Ablation

Algorithms

Algorithm 1 outlines the core meta-training procedure, with Daux\mathcal{D}_{\mathrm{aux}} constructed based on assay-description similarity. For clarity, auxiliary-dataset limits, ordering, and subsampling are omitted; full experimental details are provided in Appendix § 8.

Algorithm 1: Description-based auxiliary dataset selection and meta-training

Input: Meta-dataset Dmeta={Dτ}τ=1M\mathcal{D}_{\mathrm{meta}} = \{\mathcal{D}_{\tau}\}_{\tau=1}^{M}, assay descriptions {aτ}τ=1M\{a_{\tau}\}_{\tau=1}^{M}, meta-learner pθp_{\theta}, embedding model ϕ\phi, similarity threshold γ\gamma

  1. Compute assay-description embeddings: hτ←ϕ(aτ)∀τ∈{1,…,M}h_{\tau} \leftarrow\phi(a_{\tau}) \quad\forall\tau\in\{1,\ldots,M\}

  2. Compute pairwise assay similarities: sτ,τ′←⟨hτ,hτ′⟩∥hτ∥∥hτ′∥∀τ,τ′∈{1,…,M}s_{\tau,\tau'} \leftarrow\frac{\langle h_{\tau},h_{\tau'}\rangle}{\|h_{\tau}\|\|h_{\tau'}\|} \quad\forall\tau,\tau' \in\{1,\ldots,M\}

  3. repeat

  4. Sample a task τ\tau from Dmeta\mathcal{D}_{\mathrm{meta}}: ((XT,YT),DC)∼Dmeta((X^{T},Y^{T}),\mathcal{D}^{C}) \sim\mathcal{D}_{\mathrm{meta}}

  5. Initialize auxiliary data: Daux←∅\mathcal{D}_{\mathrm{aux}} \leftarrow\varnothing

  6. foreach τ′∈{1,…,M}∖{τ}\tau' \in\{1,\ldots,M\}\setminus\{\tau\} do

  7. if sτ,τ′≥γs_{\tau,\tau'} \ge\gamma then

  8. Daux←Daux∪{Dτ′}\mathcal{D}_{\mathrm{aux}} \leftarrow\mathcal{D}_{\mathrm{aux}} \cup\{\mathcal{D}_{\tau'}\}

  9. Compute the negative log-likelihood: LNLL←−log⁡pθ(YT∣XT,DC,Daux)\mathcal{L}_{\mathrm{NLL}} \leftarrow-\log p_{\theta}(Y^{T}\mid X^{T},\mathcal{D}^{C},\mathcal{D}_{\mathrm{aux}})

  10. Update θ\theta: θ←θ−α∇θLNLL\theta\leftarrow\theta-\alpha\nabla_{\theta}\mathcal{L}_{\mathrm{NLL}}

  11. until convergence

Extended related work

Task heterogeneity in meta-learning Task heterogeneity in meta-learning has been addressed by prior work through two broad strategies. One line of work explicitly models multiple task regimes using mixtures of meta-learners or hierarchical task structures, with individual components specializing to subsets of related tasks [8] (Wang & van Hoof 2022; Yao et al. 2019; Jerfel et al. 2019; Zhou et al. 2021). These approaches typically rely on a prespecified number of task clusters or mixture components, thereby imposing some prior structure on the task distribution. This is difficult to justify for bioactivity prediction, where assay heterogeneity arises from multiple interacting factors and may not admit a small, disjoint set of task regimes. In large assay collections the relevant regimes may be numerous and overlapping, making a global mixture cardinality difficult to specify. Among these approaches, Jerfel et al. (2019) is an exception, using a Dirichlet process mixture that can introduce additional components as it encounters new task regimes, but still assumes a discrete mixture structure over tasks. A complementary line of work, more directly comparable to our setting, instead infers task-specific representations from the available context set and uses them to condition or modulate the meta-learner, thereby adapting to heterogeneous task distributions without explicitly enumerating the underlying task regimes (Wang et al., 2022; Vettoruzzo et al., 2024; Vuorio et al., 2019). Notably, Wang et al. (2022) explicitly address the difficulty of inferring task identity from scarce context by representing it as a stochastic latent variable, which captures uncertainty over the underlying task regime.

Comparison with ICICL-TNP [4] The architecture of MetaHeta is related to ICICL-TNP, but differs primarily in how information from multiple auxiliary datasets is represented and exchanged. Both architectures use coupled TNP-style processing paths for the task-specific context and auxiliary data, while avoiding quadratic attention over the potentially large auxiliary datasets. ICICL-TNP achieves this using a Perceiver-style (Jaegle et al., 2021) pseudo-token architecture: (i) the task-specific context set and each auxiliary dataset are separately encoded into their own sets of pseudo-tokens; (ii) the auxiliary pseudo-tokens attend to the context pseudo-tokens; (iii) self-attention is applied separately within each set of pseudo-tokens; and (iv) the context pseudo-tokens attend back to the auxiliary pseudo-tokens before conditioning the target representations. Consequently, observations from different auxiliary datasets exchange information only indirectly. MetaHeta concatenates auxiliary observations into a single sequence and applies linear self-attention across them, enabling direct information exchange between observations from different auxiliary datasets. This is made possible by augmenting each observation with a one-hot indicator of its task of origin, which preserves task identity after concatenation, while the use of FAVOR+ (Choromanski et al., 2021) in the auxiliary branch keeps self-attention computationally efficient even for large auxiliary sets. This removes the pseudo-token bottleneck and, in our setting, enables substantially more efficient conditioning on large auxiliary collections. However, as a result of representing task identity explicitly through one-hot indicators, the input embedding dimension fixes the maximum number of auxiliary datasets that can be accommodated without modifying the architecture. ICICL-TNP does not have this restriction, since task identity is represented structurally through separate pseudo-token sets.

Discussion

Limitations

Scope of the theoretical guarantees Both the result of Ashman et al. [4] in Eq. (5) and Proposition 1, which motivate our selection of auxiliary datasets, are derived for exact Bayesian posterior predictive distributions under their respective generative assumptions. They therefore do not directly guarantee improvements for finite-capacity models trained on a finite meta-dataset. Likewise, description-based relatedness is only a heuristic for identifying useful auxiliary assays. However, we demonstrate that auxiliary conditioning remains effective across all three settings considered in this work: when relatedness is defined by shared target identity, by homology between distinct targets, and heuristically from assay descriptions. In the latter setting, randomly shuffling the retrieved auxiliary assays (§ 5.4) substantially degrades predictive performance, indicating that the observed gains depend on meaningful assay relatedness.

Fixed auxiliary-dataset capacity Because MetaHeta encodes dataset identity using one-hot indicators, the maximum number of auxiliary datasets is fixed by the input dimensionality and cannot be increased after training without modifying the model, as elaborated in Appendix § 11. In practice, however, we found this limitation to be mild: the model can simply be trained with a conservative upper bound and evaluated with fewer auxiliary datasets. Our ablation in § 5.4 demonstrates that performance remains strong across varying inference-time auxiliary-set cardinalities.

Future work

Proposition 1 considers a two-level hierarchy in which protein-specific components share a common family-level component. In practice, biological relatedness can exhibit richer structure. A natural extension would therefore be to incorporate multiple levels of relatedness, allowing auxiliary information to be shared across increasingly broad groups of related targets. Beyond hierarchical structure, future work could also incorporate additional data modalities, such as protein sequence or structure and richer assay metadata, to define relatedness more comprehensively.

Attention operators

MHSA and MHCA ((Vaswani et al., 2017)) Let Z∈RN×dzZ \in\mathbb{R}^{N \times d_z} and Z′∈RM×dzZ' \in\mathbb{R}^{M \times d_z} denote query and conditioning representations, respectively, where dzd_z is the embedding dimension. Let HH denote the number of attention heads, and let dkd_k and dvd_v denote the query/key and value dimensions within each head. Layer indices are omitted for clarity.

For each head h=1,…,Hh = 1, \ldots, H, the query, key, and value matrices are defined as

Qh=ZWQ,h,Kh=Z′WK,h,Vh=Z′WV,h,(8)Q_h = ZW_{Q,h}, \qquad K_h = Z'W_{K,h}, \qquad V_h = Z'W_{V,h}, \tag*{(8)}

where WQ,h,WK,h∈Rdz×dkW_{Q,h}, W_{K,h} \in\mathbb{R}^{d_z \times d_k} and WV,h∈Rdz×dvW_{V,h} \in\mathbb{R}^{d_z \times d_v}. Multi-head cross-attention is defined as

Ah(Z,Z′)=softmax⁡(QhKh⊤dk)Vh,(9)A_h(Z,Z') = \operatorname{softmax}\left(\frac{Q_hK_h^{\top}}{\sqrt{d_k}}\right)V_h, \tag*{(9)}
MHCA⁡(Z,Z′)=Concat⁡(A1(Z,Z′),…,AH(Z,Z′))WO,(10)\operatorname{MHCA}(Z,Z') = \operatorname{Concat}\left(A_1(Z,Z'),\ldots,A_H(Z,Z')\right)W_O, \tag*{(10)}

where softmax is applied rowwise, concatenation is along the feature dimension, and WO∈RHdv×dzW_O \in\mathbb{R}^{Hd_v \times d_z}. Multi-head self-attention is defined as

MHSA⁡(Z)=MHCA⁡(Z,Z).(11)\operatorname{MHSA}(Z) = \operatorname{MHCA}(Z,Z). \tag*{(11)}

FAVOR+ (Choromanski et al., 2021) The positive random feature map ϕ:Rdk→R>0r\phi:\mathbb{R}^{d_k}\to\mathbb{R}_{>0}^{r}, where rr is the number of random features, is defined as

ϕ(u)=exp⁡(−∥u∥2/2)r[exp⁡(ω1⊤u)⋮exp⁡(ωr⊤u)],(12)\phi(u) = \frac{\exp\left(-\lVert u\rVert^2/2\right)}{\sqrt{r}} \begin{bmatrix} \exp(\omega_1^{\top}u)\\ \vdots\\ \exp(\omega_r^{\top}u) \end{bmatrix}, \tag*{(12)}

where the projection vectors have marginal distribution ωi∼N(0,Idk)\omega_i \sim\mathcal{N}(0,I_{d_k}) and are sampled using orthogonal random features, in independent blocks when r>dkr>d_k. This yields

E[ϕ(u)⊤ϕ(v)]=exp⁡(u⊤v).(13)\mathbb{E}\left[\phi(u)^{\top}\phi(v)\right] = \exp(u^{\top}v). \tag*{(13)}

Writing Φ\Phi for the rowwise application of ϕ\phi, the feature matrices are defined as

Qh′=Φ(dk−1/4Qh)∈RN×r,Kh′=Φ(dk−1/4Kh)∈RM×r.(14)Q'_h = \Phi(d_k^{-1/4}Q_h) \in\mathbb{R}^{N\times r}, \qquad K'_h = \Phi(d_k^{-1/4}K_h) \in\mathbb{R}^{M\times r}. \tag*{(14)}

Bidirectional FAVOR+ approximates each attention head by

A^h(Z,Z′)=Dh−1Qh′((Kh′)⊤Vh),Dh=diag⁡(Qh′((Kh′)⊤1M)),(15)\widehat{A}_h(Z,Z') = D_h^{-1}Q'_h\left((K'_h)^{\top}V_h\right), \qquad D_h = \operatorname{diag}\left(Q'_h\left((K'_h)^{\top}\mathbf{1}_M\right)\right), \tag*{(15)}

where 1M\mathbf{1}_M is the length-MM vector of ones. By FAVOR+(Z)(Z), we denote the corresponding multi-head self-attention operation:

FAVOR+⁡(Z)=Concat⁡(A^1(Z,Z),…,A^H(Z,Z))WO.(16)\operatorname{FAVOR+}(Z) = \operatorname{Concat}\left(\widehat{A}_1(Z,Z),\ldots,\widehat{A}_H(Z,Z)\right)W_O. \tag*{(16)}

Proofs

Permutation invariance

Proposition 2 (Permutation invariance). Let Daux={Dj}j=1K\mathcal{D}^{\mathrm{aux}} = \{D_j\}_{j=1}^{K}, and let S:DK→DKS:\mathcal{D}^{K}\to\mathcal{D}^{K} be a map satisfying

S(Dρ(1),…,Dρ(K))=S(D1,…,DK)for every permutation ρ.(17)S(D_{\rho(1)},\ldots,D_{\rho(K)}) = S(D_1,\ldots,D_K) \qquad\text{for every permutation }\rho. \tag*{(17)}

With the dataset indicator eje_j attached to each observation in the jj-th dataset after sorting, predictions are invariant to permutations of datapoints within each Dj∈DauxD_j \in\mathcal{D}^{\mathrm{aux}} and to permutations of datasets in Daux\mathcal{D}^{\mathrm{aux}}, at inference with fixed FAVOR+ features.

Proof. For fixed random features, Φ(PQ)=PΦ(Q)\Phi(PQ)=P\Phi(Q) for any permutation matrix PP, and

(PK′)⊤(PV)=(K′)⊤V,(PK′)⊤1=(K′)⊤1.(18)(PK')^{\top}(PV) = (K')^{\top}V, \qquad(PK')^{\top}\mathbf{1} = (K')^{\top}\mathbf{1}. \tag*{(18)}

Thus bidirectional FAVOR+ is permutation equivariant. Permutation-equivariant self-attention and cross-attention invariant to key/value ordering yield predictions invariant to observation order for fixed dataset indicators (Lee et al., 2019). It therefore remains to consider dataset order in Daux\mathcal{D}^{\mathrm{aux}}. By assumption, SS produces the same canonical ordering under any dataset permutation, preserving each dataset’s indicator and hence the predictive distribution. □

Proposition 1

For convenience, we restate the proposition here.

Proposition 1. Consider an extension of the data-generating process in Eq. (4) in which:

ξfamily∼p(ξ),ξprot,{ξprot′}∼p(⋅∣ξfamily),\xi_{\mathrm{family}} \sim p(\xi), \qquad\xi_{\mathrm{prot}}, \{\xi_{\mathrm{prot}}'\} \sim p(\cdot\mid\xi_{\mathrm{family}}),

with fτ∼Pξprot(f)f_\tau\sim P_{\xi_{\mathrm{prot}}}(f) and fτ′∼Pξprot′(f)f_{\tau}' \sim P_{\xi_{\mathrm{prot}}'}(f). Assume that auxiliary data from target homologs provide no additional information for predicting yy once the target’s protein-specific component is known:

pξprot(y∣x,DC,Daux)=pξprot(y∣x,DC).p_{\xi_{\mathrm{prot}}}(y \mid x, \mathcal{D}^{C}, \mathcal{D}^{\mathrm{aux}}) = p_{\xi_{\mathrm{prot}}}(y \mid x, \mathcal{D}^{C}).

Then:

Eξfamily,ξprot,DC,Daux[KL⁡(pξprot(y∣x,DC)∥p(y∣x,DC,Daux))]≤Eξfamily,ξprot,DC[KL⁡(pξprot(y∣x,DC)∥p(y∣x,DC))].\mathbb{E}_{\xi_{\mathrm{family}},\xi_{\mathrm{prot}},\mathcal{D}^{C},\mathcal{D}^{\mathrm{aux}}}\left[\operatorname{KL}\left(p_{\xi_{\mathrm{prot}}}(y \mid x,\mathcal{D}^{C}) \mathbin{\|} p(y \mid x,\mathcal{D}^{C},\mathcal{D}^{\mathrm{aux}})\right)\right] \leq \mathbb{E}_{\xi_{\mathrm{family}},\xi_{\mathrm{prot}},\mathcal{D}^{C}}\left[\operatorname{KL}\left(p_{\xi_{\mathrm{prot}}}(y \mid x,\mathcal{D}^{C}) \mathbin{\|} p(y \mid x,\mathcal{D}^{C})\right)\right].

Proof. The integrands on both sides do not depend explicitly on ξfamily\xi_{\mathrm{family}}, so this variable can be integrated out:

Eξprot,DC,Daux[KL⁡(pξprot(y∣x,DC)∥p(y∣x,DC,Daux))]≤Eξprot,DC[KL⁡(pξprot(y∣x,DC)∥p(y∣x,DC))].(19)\mathbb{E}_{\xi_{\mathrm{prot}},\mathcal{D}^{C},\mathcal{D}^{\mathrm{aux}}}\left[\operatorname{KL}\left(p_{\xi_{\mathrm{prot}}}(y \mid x,\mathcal{D}^{C}) \mathbin{\|} p(y \mid x,\mathcal{D}^{C},\mathcal{D}^{\mathrm{aux}})\right)\right] \leq \mathbb{E}_{\xi_{\mathrm{prot}},\mathcal{D}^{C}}\left[\operatorname{KL}\left(p_{\xi_{\mathrm{prot}}}(y \mid x,\mathcal{D}^{C}) \mathbin{\|} p(y \mid x,\mathcal{D}^{C})\right)\right]. \tag*{(19)}

The rest of the argument follows the proof of Ashman et al. [4], with all expectations taken under the marginal distributions induced by the hierarchical generative process.

LHS. Expanding the KL divergence gives

LHS=−Eξprot,DC,DauxH[pξprot(y∣x,DC)]−Eξprot,DC,Daux∫pξprot(y∣x,DC)log⁡p(y∣x,DC,Daux) dy.(20)\begin{aligned} \mathrm{LHS}={}&-\mathbb{E}_{\xi_{\mathrm{prot}},\mathcal{D}^{C},\mathcal{D}^{\mathrm{aux}}}H[p_{\xi_{\mathrm{prot}}}(y \mid x,\mathcal{D}^{C})]\\ &-\mathbb{E}_{\xi_{\mathrm{prot}},\mathcal{D}^{C},\mathcal{D}^{\mathrm{aux}}}\int p_{\xi_{\mathrm{prot}}}(y \mid x,\mathcal{D}^{C})\log p(y \mid x,\mathcal{D}^{C},\mathcal{D}^{\mathrm{aux}})\,\mathrm{d}y. \tag*{(20)} \end{aligned}

The first integrand does not depend on Daux\mathcal{D}^{\mathrm{aux}}, so this variable also can be integrated out. For the second term, conditional independence and marginalization yield

−Eξprot,DC,Daux∫pξprot(y∣x,DC)log⁡p(y∣x,DC,Daux) dy=−EDC,Daux∫Eξprot∣DC,Daux[pξprot(y∣x,DC,Daux)]log⁡p(y∣x,DC,Daux) dy=−EDC,Daux∫p(y∣x,DC,Daux)log⁡p(y∣x,DC,Daux) dy=EDC,DauxH[p(y∣x,DC,Daux)].(21)\begin{aligned} &-\mathbb{E}_{\xi_{\mathrm{prot}},\mathcal{D}^{C},\mathcal{D}^{\mathrm{aux}}}\int p_{\xi_{\mathrm{prot}}}(y \mid x,\mathcal{D}^{C})\log p(y \mid x,\mathcal{D}^{C},\mathcal{D}^{\mathrm{aux}})\,\mathrm{d}y\\ ={}&-\mathbb{E}_{\mathcal{D}^{C},\mathcal{D}^{\mathrm{aux}}}\int\mathbb{E}_{\xi_{\mathrm{prot}}\mid\mathcal{D}^{C},\mathcal{D}^{\mathrm{aux}}}\left[p_{\xi_{\mathrm{prot}}}(y \mid x,\mathcal{D}^{C},\mathcal{D}^{\mathrm{aux}})\right]\log p(y \mid x,\mathcal{D}^{C},\mathcal{D}^{\mathrm{aux}})\,\mathrm{d}y\\ ={}&-\mathbb{E}_{\mathcal{D}^{C},\mathcal{D}^{\mathrm{aux}}}\int p(y \mid x,\mathcal{D}^{C},\mathcal{D}^{\mathrm{aux}})\log p(y \mid x,\mathcal{D}^{C},\mathcal{D}^{\mathrm{aux}})\,\mathrm{d}y\\ ={}&\mathbb{E}_{\mathcal{D}^{C},\mathcal{D}^{\mathrm{aux}}}H[p(y \mid x,\mathcal{D}^{C},\mathcal{D}^{\mathrm{aux}})]. \tag*{(21)} \end{aligned}

Hence

LHS=−Eξprot,DCH[pξprot(y∣x,DC)]+EDC,DauxH[p(y∣x,DC,Daux)].(22)\mathrm{LHS}=-\mathbb{E}_{\xi_{\mathrm{prot}},\mathcal{D}^{C}}H[p_{\xi_{\mathrm{prot}}}(y \mid x,\mathcal{D}^{C})] +\mathbb{E}_{\mathcal{D}^{C},\mathcal{D}^{\mathrm{aux}}}H[p(y \mid x,\mathcal{D}^{C},\mathcal{D}^{\mathrm{aux}})]. \tag*{(22)}

RHS. Similarly,

RHS=−Eξprot,DCH[pξprot(y∣x,DC)]−Eξprot,DC∫pξprot(y∣x,DC)log⁡p(y∣x,DC) dy.(23)\begin{aligned} \mathrm{RHS}={}&-\mathbb{E}_{\xi_{\mathrm{prot}},\mathcal{D}^{C}}H[p_{\xi_{\mathrm{prot}}}(y \mid x,\mathcal{D}^{C})]\\ &-\mathbb{E}_{\xi_{\mathrm{prot}},\mathcal{D}^{C}}\int p_{\xi_{\mathrm{prot}}}(y \mid x,\mathcal{D}^{C})\log p(y \mid x,\mathcal{D}^{C})\,\mathrm{d}y. \tag*{(23)} \end{aligned}

Marginalizing ξprot\xi_{\mathrm{prot}} in the second term gives

−Eξprot,DC∫pξprot(y∣x,DC)log⁡p(y∣x,DC) dy=−EDC∫Eξprot∣DC[pξprot(y∣x,DC)]log⁡p(y∣x,DC) dy=−EDC∫p(y∣x,DC)log⁡p(y∣x,DC) dy=EDCH[p(y∣x,DC)].(24)\begin{aligned} &-\mathbb{E}_{\xi_{\mathrm{prot}},\mathcal{D}^{C}}\int p_{\xi_{\mathrm{prot}}}(y \mid x,\mathcal{D}^{C})\log p(y \mid x,\mathcal{D}^{C})\,\mathrm{d}y\\ ={}&-\mathbb{E}_{\mathcal{D}^{C}}\int\mathbb{E}_{\xi_{\mathrm{prot}}\mid\mathcal{D}^{C}}\left[p_{\xi_{\mathrm{prot}}}(y \mid x,\mathcal{D}^{C})\right]\log p(y \mid x,\mathcal{D}^{C})\,\mathrm{d}y\\ ={}&-\mathbb{E}_{\mathcal{D}^{C}}\int p(y \mid x,\mathcal{D}^{C})\log p(y \mid x,\mathcal{D}^{C})\,\mathrm{d}y\\ ={}&\mathbb{E}_{\mathcal{D}^{C}}H[p(y \mid x,\mathcal{D}^{C})]. \tag*{(24)} \end{aligned}

Thus

RHS⁡=−Eξprot,DCH[pξprot(y∣x,DC)]+EDCH[p(y∣x,DC)].(25)\operatorname{RHS} = -\mathbb{E}_{\xi_{\mathrm{prot}},D^{C}} H\left[p_{\xi_{\mathrm{prot}}}\left(y \mid x,D^{C}\right)\right] +\mathbb{E}_{D^{C}} H\left[p\left(y \mid x,D^{C}\right)\right]. \tag*{(25)}

Finally, conditioning does not increase entropy in expectation:

EDC,DauxH[p(y∣x,DC,Daux)]≤EDCH[p(y∣x,DC)].(26)\mathbb{E}_{D^{C},D^{\mathrm{aux}}} H\left[p\left(y \mid x,D^{C},D^{\mathrm{aux}}\right)\right] \le\mathbb{E}_{D^{C}} H\left[p\left(y \mid x,D^{C}\right)\right]. \tag*{(26)}

The remaining terms are identical, so LHS⁡≤RHS⁡\operatorname{LHS} \le\operatorname{RHS}. □\square

References

  1. [2]Sebastian Ament, Sam Daulton, David Eriksson, Maximilian Balandat, and Eytan Bakshy. Unexpected improvements to expected improvement for bayesian optimization. In Thirty-seventh Conference on Neural Information Processing Systems, 2023. URL https://openreview.net/forum?id=1vYAGGj9PE.arxiv.org/abs/2310.20708
  2. [4]Matthew Ashman, Cristiana Diaconu, Adrian Weller, and Richard E. Turner. In-context in-context learning with transformer neural processes. In Javier Antorán and Christian A. Naesseth (eds.), Proceedings of the 6th Symposium on Advances in Approximate Bayesian Inference, volume 253 of Proceedings of Machine Learning Research, pp. 1–29. PMLR, 21 Jul 2024. URL https://proceedings.mlr.press/v253/ashman24a.html.arxiv.org/abs/2406.13493
  3. [5]J. Baxter. A model of inductive bias learning. Journal of Artificial Intelligence Research, 12:149–198, March 2000. ISSN 1076-9757. doi: 10.1613/jair.731. URL http://dx.doi.org/10.1613/jair.731.
  4. [6]Guy W. Bemis and Mark A. Murcko. The properties of known drugs. 1. molecular frameworks. Journal of Medicinal Chemistry, 39(15):2887–2893, 07 1996. ISSN 0022-2623. doi: 10.1021/jm9602928. URL https://doi.org/10.1021/jm9602928.
  5. [7]Jannis Born, Tien Huynh, Astrid Stroobants, Wendy D Cornell, and Matteo Manica. Active site sequence representations of human kinases outperform full sequence representations for affinity prediction and inhibitor generation: 3D effects in a 1D model. J. Chem. Inf. Model., 62(2):240–257, January 2022.DOI
  6. [8]Lucian Chan, Marcel Verdonk, and Carl Poelking. Embracing assay heterogeneity with neural processes for markedly improved bioactivity predictions, 2023. URL https://arxiv.org/abs/2308.09086.

Paper details

vlnc:W_y43a5a6u
Version
v1 · latest
Published
Fresh — added to the Hub within the last 30 days
Added
License
CC BY 4.0
Usage

views · 0

downloads · 0

A view counts once per browser per day, a download each time the PDF is requested.

  • Computer Science

Not recorded for this paper

View statement
Looking for related papers…
Contents