A Pareto-optimal compositional energy-based model for sampling and optimization of protein sequences
Abstract
Deep generative models have emerged as a popular machine learning-based approach for inverse design problems in the life sciences.
However, these problems often require sampling new designs that satisfy multiple properties of interest in addition to learning the data distribution.
This multi-objective optimization becomes more challenging when properties are independent or orthogonal to each other.
In this work, we propose a Pareto-compositional energy-based model (pcEBM) , a framework that uses multiple gradient descent for sampling new designs that adhere to various constraints in optimizing distinct properties. We demonstrate its ability to learn non-convex Pareto fronts and generate sequences that simultaneously satisfy multiple desired properties across a series of real-world antibody design tasks.
Introduction
Generative models have shown promise across various applications in the life sciences for generating chemically- and physically-plausible designs and in accelerating the process of scientific discovery.
Part of this trend of adoption can be owed to the convincing examples created by generative adversarial networks (GANs) [13], variational autoencoders (VAEs) [23], energy-based models (EBMs) [8] and, more recently, diffusion models [35; 32; 5].
However, there are far fewer success stories in real-world industry applications [6; 15].
Some reasons include an overrepresenation of image datasets; a lack of evaluation protocols and metrics for synthetic data [37; 33]; challenges around controllable generation and training — for exmaple GANs; and challenges in generating samples that are different from have been seen during training [22; 2; 38].
Taken together, these serve to limit the applicability of generative modeling for real-world use cases.
Our work is motivated by this and, in particular, the need to accelerate the development and discovery of new molecules, namely therapeutic antibodies.
Though several generative models have already been proposed for these purposes [10; 12; 31], generating new samples without guidance or control does not guarantee downstream success of the proposed molecules.
In practice, each molecule has to satisfy multiple properties. For therapeutic antibodies, this could include properties such as binding affinity, polyreactivity, and viscosity [1; 20; 39].
Failure to account for these and other properties can lead to serious complications later on during scale-up, manufacturing, and clinical trials and the optimization of straightforward objectives does not necessarily translate into progress in the laboratory [28].
Motivated by this challenge, we propose a new EBM for antibody design that simultaneously takes into account multiple properties that an antibody has to satisfy.
The adherence to multiple properties is a challenge in itself, as it often involves optimizing multiple conflicting objectives.
In antibodies, for instance, optimization of binding affinity alone may come at the expense of developability properties, parameters that govern the likelihood of success of a molecule during manufacturing and quality control .
In general, in optimizing multiple conflicting properties, it is often impossible to find a single sample that satisfies all of the objectives simultaneously [21].
We argue that, instead, one should aim to propose a set of diverse data points from the Pareto front [3] that correspond to different choices for various objective functions.
Doing so enables a global perspective the optimal trade-off between objectives and can select a molecule according to their preference.
To achieve Pareto optimality, we rely on recent advances in multi-objective optimization (MOO)[34; 27] as well as on compositional sampling with EBMs [8] to build a Pareto-optimal compositional EBM ( pcEBM ).
Figure 1 exemplifies both why we need pcEBM and what we achieve with it when optimizing a design of an initial antibody sequence.
We first present the the necessary background on multi-objective optimization in subsection 2.1 and related work on compositional sampling with EBM in subsection 2.2 leading to pcEBM described in subsection 2.3.
In section 3 we include empirical evaluation and discussion, before concluding in section 4.
Background and method
Problem setup.
Antibodies are composed of two chains of amino acids (AA), which can be represented as sequences of characters. Each AA comes from an alphabet of 20 characters corresponding , typically of combined length L ∼ 250 .
We will denote the sequences as x = ( x 1 , . . .
, x L ) , where x l ∈ { 1 , . .
, 20 } corresponds to the AA type at position l .
For each of those sequences, we measure m properties, such that f i : R L → R for all i ∈ 1 , . . .
, m .
Our goal is to generate new sequences x ∗ with preferred values for each of the m properties.
Since we cannot fully satisfy all of the properties/objectives simultaneously (they may be conflicting with each other), we are interested in finding samples which can not be further improved simultaneously for all the objectives, yielding the notion of Pareto optimality [4]. Definition 2.1 (Pareto Optimality [4; 27])
For x 1 , x 2 ∈ R d , we say that x 1 is dominated by x 2 iff f i ( x 2 ) ≤
f i ( x 1 ) , ∀ i ∈ [ m ] . A point x ∗ is called globally Pareto optimal on R d iff it is not dominated by any other x ′ ∈ R d . A point x ∗ is called locally Pareto optimal iff there exists an open neighborhood N ( x ∗ ) of x ∗ , such that x ∗ is not dominated by any x ∈ N ( x ∗ ) .
The collection of globally (resp.
locally)
Pareto optimal points are called the global (resp.
local)
Pareto set.
The collection of function values F ( x ∗ ) =
( f 1 ( x ∗ ) , f 2 ( x ∗ ) , . . .
, f m ( x ∗ )) of all the Pareto points x ∗ is called the Pareto front .
2.1 Multi-objective optimization
A simple approach to solving MOO is linear scalarization [21] based on a preference vector λ =
[ λ 1 , . . .
, λ m ] from the probability simplex on [ m ] , i.e., S = { λ : (cid:80) mi
=
λ i = 1 , λ i ≥ 0 , i ∈ [ m ] } .
Each λ ∈ S leads to a weighted objective function f λ ( x ) = (cid:80) mi
=
λ
i f i ( x ) and its minimizer x ∗ λ = argmin
x f λ ( x ) .
As we evaluate on λ from a grid of S , we hope that the corresponding x ∗ λ approximates the Pareto front.
The solutions obtained by linear scalarization lie in the convex envelope of the Pareto front, which renders the approach plausible for situations where the Pareto front is convex [27].
An alternative approach for non-convex Pareto fronts is multiple gradient descent (MGD) [7], which iteratively updates variable x along a direction that ensures that all objectives are decreased simultaneously and guides the optimization towards a Pareto improvement.
Denote the gradient of the i -th objective as ∇ x f i ( x ) .
With gradient descent, we update the variable x k ← x k − 1 − ηg ( x ) , where g ( x ) is a vector to be determined and η is a small step size.
From a 1st-order Taylor expansion, we can deduce that ⟨∇ x f i ( x ) , g ⟩ ≈ − ( f i ( x k ) − f i ( x k − 1 )) /η which represents the decreasing rate of f i when we update x along direction g ( x ) .
In MGD, g is chosen to maximize the slowest decreasing rate among all the objectives, that is:
[Equation]
By doing so, g ( x ) is pushed to have positive inner products with all ∇ x f i ( x ) .
If the latter is impossible, {∇ x f i ( x ) } mi =1 will contain conflicting directions and we will get g ( x ) = 0 which terminates the procedure.
By using Lagrangian duality, Désidéri [7] has shown that the above objective has the optimal value g ( x ) ≈ (cid:80) mi =1 λ ∗ i ∇ x f i ( x ) where { λ i ∇ x f i ( x ) } i =1 m is the solution of min λ i
∥ m (cid:88) i =
λ i ∇ x f i ( x ) ∥ 2 subject to m (cid:88) i
= λ
i =
and λ
i ≥ 0 for all i ∈ [ m ] .
The above convex optimisation problem has a closed form solution when m = 2 and a fast algorithm for m > 2 [34; 19].
By construction, when the step size is small, MGD decreases monotonically all objectives simultaneously and will terminate at a local Pareto point.
2.2 Compositional energy-based models
Although EBMs have been around for many years [25; 24], recent interest in generative modeling has led to a resurgence of interest [8; 9].
EBMs learn to represent data by approximating an unnormalized probability distribution across data.
They do so by learning an energy function E θ ( x ) parameterized by a neural network that maps each input x to a scalar real value interpreted as the energy and approximating the data distribution by the Boltzmann distribution under unit temperature:
[Equation]
Training an EBM on a given data distribution is usually done by contrastive divergence [16].
Besides predicting the un-normalized data likelihood, EBMs can be used to sample new data points x from p θ (during both training and generation).
Sampling is typically performed by some Markov-Chain
Monte-Carlo (MCMC) procedure.
We consider the common case of Langevin Diffusion (LD) where the samples are initialized from refinement/uniform random noise followed by iterative refinement:
[Equation]
with k being the sampling step and η the step size.
The above sampling procedure can be easily extended to produce samples from the composition of p θ with other distributions of interest.
Along this direction, Du et al.
[9] considered the problem of sampling from m composed distributions, each modeling a different propertiey f i , an approach referred to as compositional EBM (cEBM).
Du et al.
proposed multiple variations for executing different logical operations over properties of interest, such as conjunction, negation, and disjunction.
In the following, we focus on conjunction, which corresponds to combining individual EBMs as a product of experts:
[Equation]
We also note that cEBM utilized the following sampling procedure:
[Equation]
which amounts to applying LD w.r.
[Equation]
2.3 Pareto compositional sampling
Inspired by previous work on multi-objective optimization [7; 27] discussed in subsection 2.1, we here propose pcEBM, a method that samples from the Pareto front of m Boltzmann distributions of interest.
Our approach entails utilizing multiple gradient descent to select a locally optimal direction that optimizes the slowest decreasing rate among all the objectives of the compositional EBMs: [Equation] to
[Equation]
where α is a positive constant and the internal optimization problem is the same utilized in MGD and the external sampler is performing Langevin diffusion.
that were separately trained on data with good affinity and BV scores, respectively, with smaller energies being more desirable.
Suppose that we are generating a new sequence x , either by starting from random noise or by improving an existing one.
At each step k , if x k − 1 is far from the Pareto front and the gradients ∇ x f i ( x k − 1 ) have non-negligible norm, Equation 4 will drive x k −closer to the Pareto front.
On the other hand, when x ∗ is close to the Pareto front and the gradients have nearly vanished, the noise dominates and x k − 1 performs Brownian motion.
As will be demonstrated experimentally, the addition of noise ω helps pcEBM to explore more efficiently the Pareto as compared to MGD, whereas the locally optimal determination of the optimization direction renders the optimization more effective than cEBM.
Empirical evaluation
In the following, we compare the Pareto compositional EBM pcEBM with three baselines: multiple gradient descent ( MGD ) [7], a compositional EBM ( cEBM ) [9], and a linearly scaled cEBM ( lscEBM ) [21].
Experimental setup.
We wish to generate plausible antibody sequences according to three key properties: (i) similarity to known human antibodies from the public database of observed antibodies [29] ( Ab-like ), (ii) binding affinity to antigens of interest ( Aff ), and (iii) an experimental measure of nonspecificity — phenomena which can affect the dosing regimen, safety, and overall therapeutic profile of an antibody — which we refer to as the BV score [17] 1 .
We use datasets from both public and proprietary sources to train three separate EBMs, each pertaining to a property of interest.
Though alternative choices are also possible, we instantiate all models as sequence-based convolution networks [11].
More details on the architecture can be found in the Appendix.
We use the same models for sampling new sequences with each of the baselines.
The differences in implementation are as follows: MGD does not add any noise, cEBM uses Lanvegin dynamics but has uniform weights for all properties; ls-cEBM differs from cEBM in that it includes domain-informed weights; and finally pcEBM learns the optimal weights for each property per sequence.
Each baseline relies on two main hyper-parameters, namely the step size η and the number of steps k .
To compare different approaches in terms of their ability to satisfy multiple properties, we adopt the
Hyper-Volume ( HV ) metric from the multi-objective optimization literature [14] computed over the energy scores of each property model.
In all experiments, we aim for minimizing the energy scores per property.
Additionally, as a proxy for how well the sampled sequences capture the properties of interest we compute the minimal edit distance of each sampled sequence to the ones seen during the training of each property EBM ( e dist ) [30].
More details about the computation of these metrics can be found in the Appendix.
Results and discussion.
Our experiments are designed to provide answers to the following research questions:
• Q.1 Can we use EBMs to generate valid/reasonable, multi-property compliant antibody sequences?
• Q.2 Does sampling with Langevin Dynamics propose more Pareto optimal sequences?
• Q.3 Does pcEBM have an advantage over cEBM?
• Q.
Starting from a seed sequence, can we improve a property of interest using (p)cEBM? HV
[Table]
Ab-Like, Aff, BV)
[Table]
[Table]
[Table] η = [Table] Table 1 and Table 2 address Q.1 .
We find that EBMs trained on data possessing a single property of interest propose sequences that are similar to those sharing the same property, but are dissimilar to the sequences preferred by other objectives.
In contrast, sequences generated by a multi-property EBMs have smaller distances to all properties compared to the single-property EBMs.
Amongst the four considered multi-objective baselines, pcEBM generates sequences with greater hyper-volume and similarity to the training datasets, whereas MGD is a close second.
We surmise the difference between cEBM and pcEBM is owed to their speed of convergence.
We confirm this in Figure 3 by plotting the energy score at each sampling step for both cEBM and pcEBM with a step size of η = 0 .
As observed, for the same starting sequence pcEBM converges faster.
This result partially answers Q.3 .
[Table]
proxy for similarity to real data with the specific property.
To further test our approach, we calculate HV across the three properties we aim to account for.
Here, we consider the energy of each property EBM as proxy for the objective of interest [-
-]2 .
The advantage of pcEBM is noticeable at smaller step sizes (see Table 1), while the variance in both edit distance and hyper-volume for different η is significantly smaller for pcEBM than others.
Figure 2 depicts the Pareto front for two properties obtained from candidate sequences from each baseline. We find that the pcEBM front is broader than MGD-based approaches, which agres our supposition that employing LD leads to an improved coverage of the Pareto front as compared to pure gradient descent.
Further, pcEBM and MGD fronts are closer to the origin that that obtained by direct LD, which demonstrates the advantage of the multi-properly optimization aspect of pcEBM, addressing Q.2 and Q.3 .
Finally, for Q.4 we wish to explore the possibility for improving properties of already existing antibodies by using the variants of compositional EBMs.
We focus our analysis on nonspecificity ( BV ) as we have an external SeqCNN classifier that can act as a surrogate pseudo-oracle.
We start by screening the existing sequences to select only those with low BV scores, which we refer to as “seeds”.
We use sequences with poor experimental and predicted BV scores as seed sequences for generation and then reuse the nonspecificity pseudo-oracle to evaluate the newly proposed designs.
Figureshows the BV score improvement achieved by each baseline.
We notice that the multi-objective methods manage to improve the worst BV scores from 0.27 to above 0.9, with MGD and pcEBM giving a slightly lower average score than cEBM (though all scores are comparably high).
The plots in Figure 4 provide further insight into the nonspecificity optimization process by examining a low-dimensional embedding of seed and optimized sequences.
The embedding is obtained by using tSNE to project the last layer feature representations of the sequences obtained from the nonspecificity oracle, onto a 2D space.
We color each point (sequence) by their BV score with blue indicating a good score and red a poor one.
On the same plot, we overlay a seed sequence and its corresponding proposed designs.
We see that both cEBM and pcEBM improve the probability for a good nonspecificity score, and move the seed towards the section of the manifold covered by datapoints with good scores.
Conclusion
We propose a new approach to sampling data points that simultaneously satisfy multiple desired properties.
We do so by integrating multiple gradients within compositional energy based models.
In a series of experiments for generating and improving existing sequences, we validate the performance of the compositional EBMs as well as their Pareto optimality.
The generality and modularity of pcEBM allow for multiple expansions we are excited to explore: ( i ) other data types, in particular graph structures suitable for molecules, ( ii ) incorporating other sampling frameworks such as Stein variational gradient descent [26], ( iii ) incorporating uncertainty estimates, and ( iv ) Pareto-optimal training for EBMs name a few.
Appendix 4.1 Additional details on experiments
SeqCNNs For all properties and baselines we use an identical NN architecture, that is one model per protein chain, consisted of three Conv1D layers with kernel size 9 and padding 1, ReLU nonlinearities and penultimate layer of size 256.
All EBMs were trained with contrastive training, Adam optimizer and early stopping criterion.
Hyperparameters For each multipropery sampling baseline, the following hyper parameter grid was explored with random search:
• step size - η ∈ { 1 e − 4 , 1 e − 2 , 1 , 10 , 40 } • number of steps - k ∈ { 100 , 200 , 300 , 400 } • noise type - ω ∈ {N , U} .
4.2 Metrics
Hypervolume HV is an indicator for evaluating the quality of sets of solutions in multi objective optimization.
For a given reference point of r =
[ r 1 , ..., r m ] we have an upper bound of the objectives, such that supxf i ( x ) ≤ r i , ∀ i ∈ [ m ] .
For a given set of solutions X = { x l } nl =1 , a hypervolume indicator HV ( X ) is a measure of the region between all f i objectives and r :
[Equation]
where Λ( · ) denotes the Lebesgue measure.
In the context of our experiments, we are interested in minimizing the energy scores per each property, and we choose a reference point r
=
We compte HV from each Pareto front to the reference point with the implementation provided in PyMoo [18].
Edit distance Edit distance is the typical score for quantifying how dissimilar two strings (in our case, sequences) are to one another, measured by counting the minimum number of operations required to transform one string into the other.
Although different variants exist, here we rely on the
Levenshtein distance which accounts for insertions, deletions and substitutions.
In all experiments we use the python library edist as implemented in [36].