Probabilistic Transformer: Modelling Ambiguities and Distributions for RNA Folding and Molecule Design
Anonymous Author(s)
AfﬁliationAddress
Abstract
Our world is ambiguous and this is reﬂected in the data we use to train ouralgorithms.
This is especially true when we try to model natural processes wherecollected data is affected by noisy measurements and differences in measurementtechniques.
Sometimes, the process itself can be ambiguous, such as in the case of
RNA folding, where a single nucleotide sequence can fold into multiple structures.
This ambiguity suggests that a predictive model should have similar probabilisticcharacteristics to match the data it models.
Therefore, we propose a hierarchicallatent distribution to enhance one of the most successful deep learning models, the Transformer, to accommodate ambiguities and data distributions.
We show thebeneﬁts of our approach on a synthetic task, with state-of-the-art results in RNAfolding, and demonstrate its generative capabilities on property-based moleculedesign, outperforming existing work.
Introduction
Transformer models [1] are the architecture of choice for many applications.
Next to a wide rangeof NLP applications, such as language modelling [2, 3, 4] and machine translation [1, 5], they arealso very effective in other disciplines, such as computer vision [6, 7], biology [8, 9], and chemistry[10, 11].
An additional challenging application for which transformers are promising is RNAfolding, where the goal is to model a secondary structure (represented in dot-bracket notation [12])based on a given sequence of nucleotides.
RNA data is highly ambiguous since it is collected withdifferent techniques, resolutions, protocols and even contains natural ambiguities since there existmultiple structures for the same RNA sequence in the cell [13, 14] and vice-versa.
Similar to RNAstructures, molecules can be represented as sequences by using the simple molecular line entry system(SMILES) [15] and transformers arise as the architecture of choice in the ﬁeld [11, 16].
Although Transformers have outstanding performance, the deterministic core of the architecturecould harm performance in real-world applications like RNA folding.
If collected data containsnoisy labels or ambiguous samples, a vanilla Transformer model can only express uncertainties in thesoftmax output but not in the latent space.
When sampling, sequential interdependencies can only bemodelled in a decoder setting but not in an encoder-only setting.
We address these limitations byproposing a probabilistic Transformer (ProbTransformer) that models a hierarchical latent distributionand performs sampling in the latent space.
The ProbTransformer can represent ambiguities in thesedistributions and reﬁne the sampled latent vectors within the computational graph.
This is in linewith recent ﬁndings in cognitive science that suggest that the human brain both represents probabilitydistributions and performs probabilistic inference [17, 18].
Our approach is based on the idea ofcombining the transformer architecture with a conditional variational auto-encoder (cVAE)
[19], butin a hierarchical fashion similar to the hierarchical probabilistic U-Net [20].
Therefore, we introduce a new probabilistic layer and incorporate it after the attention and feed-forward layer (Section 3).
In thisway, we preserve the global receptive ﬁeld through the attention mechanism and remain independentof other enhancements in the transformer ecosystem [21].
To train the latent distributions, we makeuse of the generalized ELBO with constrained optimization [22] and introduce an annealing techniqueto adapt a hyperparameter online.
We see our contributions in three aspects:
• The introduction of the ProbTransformer, a novel hierarchical probabilistic architecture enhancement to the Transformer ecosystem.•
Our training procedure using GECO, the analysis of the sensitivity of its hyperparameter κ , andthe introduction of the online adaption technique kappa annealing which could be beneﬁcial forvariational training with ELBO in general. • A comprehensive empirical analysis that veriﬁes the ProbTransformer’s capability to learn and recover data distributions on a novel synthetic sequential distribution task, assesses its capabilityof handling data ambiguities in practice by achieving state-of-the-art performance in RNA folding,and demonstrates its generative character by outperforming existing work in Molecule Design.
We ﬁrst clarify notation and recap the cVAE [19] (Section 2), and then introduce the ProbTransformer(Section 3).
We then present our experiments on the sequential distribution task (Section 4.1), RNAfolding (Section 4.2), Molecule Design (Section 4.3), as well as our ablation study (Section 4.4),discuss related work (Section 5) and conclude (Section 6).
Background
Transformer Notation The Transformer [1] is a self-attention based sequence-to-sequence modelintroduced as an encoder-decoder architecture.
However, both encoder-only and decoder-onlyversions are very successful by themselves [2, 23], and in our work, we focus on either of these twoversions.
An encoder or decoder has N blocks and each block consists of a multi-head (masked)attention followed by a feed forward layer.
Around both of these layers there are residual connections[24] followed by layer normalization [25].
We use the parameterization with D model dimensions inthe residuals and attention, H heads per attention, D ff latent dimensions in the feed-forward layer,and n ∈ { 1 , . . .
, N } for the block in the Transformer.
In addition, we deﬁne X (cid:98) =( x 1 , . . .
, x S ) asthe input sequence of length S , and Y (cid:98) =( y 1 , . . .
, y S )
as the target sequence, ˆ Y (cid:98) =(
ˆ y 1 , . . .
, ˆ y S ) as thepredicted sequence.
Conditional Variational Auto-Encoder (cVAE)
The cVAE [19] is a deep conditional generativemodel and an extension of the Variational Auto-Encoder [26, 27].
During inference, the cVAE aimsto generate a distribution for an output y conditional on an input x .
More speciﬁcally, given an inputx , a latent variable z is drawn from a (conditional) prior model p θ ( z | x ) and used as an additionalinput to the generation model p ρ ( y | x , z ) in order to generate the prediction ˆ y .
The cVAE is trainedby minimizing the negative evidence lower bound (ELBO), L ELBO :
[Equation]
where q ψ ( z | x , y ) describes the posterior model (called “recognition network” in [19]).
All models areneural networks, and the prior and posterior models each output a mean and variance of a Gaussiandistribution which represents the distribution of the latent z .
During training, z post ∼ q ψ ( z | x , y )is sampled from this posterior model and used as input to the generation model p ρ ( y | x , ˆ z ) , whoseoutput ˆ y is compared to the true y with a cross-entropy loss.
This objective at training time can beviewed as a reconstruction task, which is an easier task than prediction.
The KL divergence term aimsto align the (conditional) prior model p θ ( z | x ) and the posterior model q ψ ( z | x , y ) .
The two lossesare added and then used to train the prior, posterior, and generation models jointly, employing thereparameterization trick [28].
Probabilistic Transformer
Building on concepts of the cVAE, we enhance the Transformer model to a probabilistic Transformer(ProbTransformer) by adding M ∈ { 1 , . . .
, M } probabilistic feed-forward layers (prob layer) to theexisting blocks.
We introduce our approach for an encoder-only model to simplify notation.
It also applies to the decoder-only model but not directly to an encoder-decoder model due to our trainingsetup.
Whether all or only a selection of blocks are enhanced with prob layers is a design decisionand examined empirically in Section 4.4.
In a block, we place the prob layer after the attention andfeed forward layer.
The prob layer parameterizes a univariate Gaussian N ( µ, σ 2 ) used to sample alatent vector z ∈ R D z for each position in the sequence.
We denote by X and Y the input and targetsequences of length S , by Z m (cid:98) =(
z m, 1 , . . .
, z m,S )
the position-wise sampled latent sequence of blockm , by Z (cid:98) =(
Z 1 , . .
, Z M ) all latent sequences of all blocks, and by Z <m (cid:98) =(
Z 1 , . .
, Z m − 1 ) all latentsequences of all blocks before m .
At inference time, we sample Z m and add it to the computationgraph of the current block, similar to sampling from the (conditional) prior in the cVAE.
However,in contrast to the cVAE, our sampling is conditioned hierarchically: the z vector also depends onpreviously sampled z vectors of all positions in all lower Transformer blocks:
[Equation]
A sequential relation is achieved by the attention mechanism: while the samples z m are drawn independently for each position, the following attention operations relate them and turn the position-wisesamples into a joint distribution over sequences reﬁned in higher blocks.
As a result of this hierarchical composition of the ProbTransformer, the cVAE’s (conditional) prior model p θ ( z m | Z <m , X )and generation model p
ρ ( Y | X, Z ) cannot be disentangled cleanly anymore in it and effectivelybecome a single model p Φ ( Y | X ) .
This model approximately marginalizes over latent variables
Z : P ( Y | X ) =
(cid:82) Z p ( Z | X ) × p
( Y | X, Z )
d Z , and we can easily sample from it by hierarchicallysampling p ( Z | X ) decomposed as
[Equation]
followed by sampling from p ( Y | X, Z ) .
We dub the combined model Φ the predictive model.
Atinference time, we can sample different predictions from this predictive model ˆ Y =
Φ( Y | X ) .
However, we can also use the mean of the respective (Gaussian) distributions instead of samplingfrom them.
We denote this as mean inference in contrast to sample inference .
In the following, weintroduce the prob layer architecture in detail before explaining our training setup and the learningobjective.
3.1 Position-wise Probabilistic Feed-Forward Network
[Figure]
The prob layer is applied to each position of the latent space separately and identically.
Figure 1 provides a visual description.
Itconsists of a linear layer that transforms from the model dimension
D model to the distribution dimension D z of the probabilistic latentspace, followed by an activation function.
Further, two linear layers with D z × D
z weight matrices generate the latent representation of a conditional Gaussian distribution with mean µ m ∈ R D zand log variance 1 log σ 2 m ∈ R D z for the prob layer in block m :
[Equation]
As mentioned before, during sample inference , we can sample from the distribution (Equation 6)and during mean inference we use z n (cid:98) = µ m .
An additional linear layer is used to compute the layer’soutput y m ∈ R D model (Equation 7).
Similar to the attention and feed forward layer, we employ aresidual connection [24] followed by a layer normalization [25].
3.2 Training Setup and Learning Objective
We optimize the ELBO as the standard practice for conditional training [19].
This requires avariational posterior Q ψ ( Z | X, Y ) that depends on both the input sequence X and target sequence
Y .
We model this posterior with a separate ProbTransformer Ψ with the same architecture as thepredictive model except of an additional input embedding for the target sequence Y and no outputgeneration layers, since we only make use of the latent sampling Z post and not of its actual modeloutput.
During training, we ﬁrst run the posterior model Ψ and sample in each prob layer the latent
Z post ∼ Q ψ .
In a second step, we run the predictive model Φ but use the latent realization Z postminstead of sampling an own Z m in each prob layer.
Figure 2 illustrates this training setup.
[Figure]
The negative ELBO loss L ELBO (Equation 1) is composed of a reconstruction loss L rec and a
Kullback-Leibler divergence D KL between the two distributions P and Q .
The reconstruction loss isthe cross-entropy between the predicted sequence ˆ Y and the true sequence Y while using the latent Z post from the posterior model:
[Equation]
(8) and D KL is the sum of KL divergences between the distributions P and Q from all prob layers:
[Equation]
With the default L ELBO loss, we discovered instability in the training and performance issues, evenwith a weighting factor β [29].
Therefore, we follow [20] to avoid convergence issues with the classic
ELBO objective and make use of the Generalized ELBO with Constrained Optimization (GECO)objective [22], optimizing the Lagrangian
[Equation]
The Lagrange multiplier λ balances the terms and is initialized to 1 , added to the learnable parameterspace and updated as a function of the exponential moving average of the reconstruction loss [20].
Inthe beginning of the training, there is high pressure on the reconstruction loss due to an increasing λ .
Once the desired reconstruction loss L rec ≈ κ is reached, the pressure moves to the KL-term.
Pleaseﬁnd more information about the training dynamics in Appendix A.κ was set to a constant in the original work of [22], but this is problematic since it is a sensitivehyperparameter due to the training dynamics.
Speciﬁcally, if κ is chosen too small , possible failuresmodes include that L rec never reaches it (with the pressure staying only on the reconstruction loss),that κ will be reached by over-ﬁtting, or that the posterior distribution collapses which leads to high
D KL ( Q ψ (cid:107) P θ ) and destabilizes the training.
On the other hand, if κ is chosen too large , the modelcan underﬁt or the reconstruction loss drops below κ , leading to a negative loss value and harmingthe training success signiﬁcantly.
To address this issue we introduce kappa annealing and adjustκ during training.
Let L c = 1 K (cid:80)
Kk =
L rec ( X k , Y k ) − κ be the mean constraint difference for Ktraining samples in one epoch of training or a deﬁned number of update steps.
In our experiments,we ﬁnd that initializing κ slightly too large and updating it every epoch with
[Equation]
leads to more stable training behaviour, improved ﬁnal performance, and reduces the need forexpensive tuning of κ .
Experiments
We demonstrate the beneﬁts of the ProbTransformer in three experiments: (1) using a novel syntheticsequential distribution task, we show the advantages of distributions in the latent space over thestandard softmax output distribution of a vanilla Transformer.
(2) We show the beneﬁts of the
ProbTransformer in dealing with ambiguous data in RNA folding.
(3) We use the ProbTransformer toimprove property-based Molecule Design by sampling from the latent space instead of a softmaxoutput.
In an additional ablation study, we provide insights on the impact of kappa annealing andhierarchical prob layers.
Our source code will be publicly available upon acceptance.
4.1 Synthetic Sequential Distribution Task
In real-world generation tasks, the true distribution is not available and is only implicitly accessible bya dataset.
To provide insights in the quality of distribution learning, we created a synthetic sequentialdistribution task and compare the ProbTransformer to two sampling methods of a vanilla Transformer.
Data We design the task to map a sequence of tokens from a source vocabulary x ∈ V ∗ i to a sequenceof target tokens from a target vocabulary y ∈ V ∗ o with the same length.
The tokens in the sourcesequence are used to build ‘phrases” P .
Each phase exists of l tokens sampled with replacement(similar to the combination of words to phrases in a sentence).
We generate randomly for each sourcetoken in each phrase is a unique distribution p ( y | x, P ) over the target tokens depending on the currentphrase.
Further, we design the distribution sparsely so that no more than k tokens from the targetvocabulary have a non-zero probability.
Training data are generated by sampling input sequences fromall phases (with replacement) and sampling the target sequence from its corresponding distribution.
Setup We used an encoder-only model.
For the ProbTransformer we enhanced each block with aprob layer.
We conﬁgured the task and the model to run on one GPU within a few hours.
Pleaseﬁnd more information about the task and the conﬁguration in Appendix B. For the inference of thevanilla Transformer we used MC dropout (using dropout during inference time, based on [30]) andsampling from the softmax distribution.
For the inference of the ProbTransformer we sample fromthe predictive model and use the token with the highest output value.
We generate 50 realizations persample to create a predictive distribution of the target vocabulary.
[Table]
Results We measure the generative performance of a model or sampling method with twometrics: The Validity describes the percentageof predicted tokens whose probability in the truedistribution is not zero.
Second, we measure the
KL-divergence between the sampled distributionand the true distribution since sampling shouldreproduce the true target token distribution.
Asshown in Table 1, the ProbTransformer outperforms the MC dropout and softmax sampling,demonstrating its strong performance in probabilistic sequence modelling.
Please note that this taskdoes not consider interdependence sampling, where the sampling of one token in a sequence dependson the realization of others, while the next task on RNA folding does.
4.2 RNA Folding
An RNA’s structure inﬂuences its function drastically [31] and the functional importance of RNAarguably is on par with that of proteins [32].
Since we can express RNA structures in dot-bracketnotation [12], the source and target have the same length, making RNA folding a suitable problem foran encoder-only Transformer model.
However, current learning-based work in the ﬁeld ignores thefacts that RNAs respond to cellular conditions by altering their structures dynamically which resultsin an ensemble of structures occurring with different probabilities [13, 14]. Real-world applicationsoften require structure analysis of very similar sequences, e.g. for the study of single or multiple pointmutations [33].
This can hardly be captured during training because this data is typically removedto avoid overﬁtting [34, 35, 36].
We address these issues with probabilistic modelling using our ProbTransformer and by keeping ambiguous training data, while implicitly measuring overﬁtting byexplicitly removing similarity to the test data.
Data We collect a large data pool of publicly available data from recent publications [37, 38, 36, 39,40] and split the predeﬁned validation and test sets, VL0 and TS0 [36], from the pool.
We deriveda testset, TSsameStruc , from 149 samples of TS0 that share the same structure with at least oneother sequence and uniformly sampled a disjoint set of 20 sequences with more than one annotatedsecondary structure from the remaining pool to produce an ambiguous testset, TSsameSeq .
Sampleswithout pairs and with a sequence similarity greater than 80% to the test and validation sets wereremoved from the pool.
However, in contrast to previous work [36, 38, 41], we kept all remainingsamples for training to capture the inﬂuence of point mutations on the structure.
The ﬁnal dataconsists of 52007 training and 1299 validation samples, and 1304 samples in the testset TS0 and 46samples in the testset TSsameSeq.
We observe 48092, 1304, and 20 unique sequences with up to7 different structures for a single sequence, and 27179, 1204, and 46 unique structures with up to582 different sequences for a single structure in the training, TS0, and TSsameSeq sets, respectively.
This indicates that many sequences map to the same structure and different structures for the samesequence.
We refer to Appendix C.1 for more information about the data.
Setup We use a 6-block encoder-only architecture with D model of 512 for the vanilla Transformerand ProbTransformer.
We train them for 200 epochs or 1M training steps.
We compare them againstthe state-of-the-art deep learning algorithms, SPOT-RNA {+[36], MXFold
 [38],+} and a commonlyused dynamic programming approach, RNAfold [42] on the testset TS0 and its subset TSsameStrucusing mean inference.
To analyse the capabilities of the ProbTransformer to reconstruct structuredistributions, we also infer the model 5, 10, 20, 50, and 100 times using sample inference on
TSsameSeq, and compare against three commonly-used algorithms specialized on the prediction ofstructure ensembles via sampling from the Boltzmann distribution based on experimentally derivedthermodynamic parameters: RNAsubopt [42], RNAshapes [43], and RNAstructure [44].
In contrastto previous work [36, 40, 38, 41], we do not use ensembling nor limitations on the accepted basepairs or secondary structures for post-processing, but independently train a CNN head on the outputof the ProbTransformer that maps the string representation to an adjacency matrix representing thestructure for evaluations on TS0 and TSsameStruc.
Although we are aware of the problems with exactevaluations via F1 Score due to the dynamic nature of RNA structures [45], we report F1 Score forreasons of comparability to previous work; however, we further report the number of solved structures(the ultimate goal of the task), and the average Hamming distance to achieve a better measure ofdistance.
For more details on the setup, CNN head, and metrics, we refer to Appendix C.2. [Figure]
We show catalytic
Results Table 2 summarizes the results of all approaches on TS0 and TSsameStruc.
Both attentionbased approaches generally achieve strong results, but we observe that the ProbTransformer outperforms the vanilla Transformer across all measures on both sets.
The ProbTransformer achieves thebest performance in terms of F1 Score, solves more than eight times the structures compared to thenext best approach (MXFold2) on both sets and achieves four times lower Hamming distance on [Table]
TSsameStruc compared to SPOT-RNA, indicating that it has learned to handle ambiguous sequences.
Our model is further capable of accurately reconstructing challenging structures, exemplarily shownfor two structures that contain long-range interactions in Figure 3.
When inferring the model multipletimes on TSsameSeq, the ProbTransformer is the only model in our evaluation that could reconstructmore than one structure for a given sequence (for two sequences this was already achieved wheninferring the model only ﬁve times).
The average Hamming distances of the best predictions on
TSsameSeq for every approach are summarized in Table 7 in Appendix C.3.3, showing the performance of the ProbTransformer can improve the Hamming distance by up to 44%, indicating thatthe ProbTransformer reconstructs the overall structure ensemble very well.
Additional results andexample predictions for RNA folding are reported in Appendix C.3.
4.3 Molecule Design
In the ﬁeld of generative chemistry [46], deep generative models are employed to explore the chemicalspace [47, 48, 49].
However, biological applications typically require that the designed molecules havecertain desired properties.
For example, to penetrate the blood-brain barrier in order to interact withreceptors of the nervous system, a molecule typically requires a certain permeability score [50, 51].
Conditional generation then refers to the problem of exploring the chemical space conditioned onmolecule properties; a well-suited task to evaluate the ProbTransformer in a decoder-only settingagainst the state-of-the-art transformer decoder model, MolGPT [11].
Data We use the GuacaMol [52] training data and the evaluation protocol provided by [11].
Formore information about the data we refer to Appendix D.1.
Setup We employ the same architecture as [11], enhanced with probabilistic layers, and trainour model for 20 epochs or 300k training steps.
During training, the model implicitly learns theproperties of the training data by conditioning generation on molecular properties together with theinput SMILES.
At inference, novel molecules with multiple desired property values are generated byproviding the model with a start token alongside with the desired property values while predictingthe next token until either a maximum length is reached or the model produces an end-token.
Wecondition the generation of molecules on three properties: the synthetic accessibility score (SAS) , thepartition coefﬁcient (logP) , and the topological polar surface area (TPSA) , using the same domainsof values described in [11].
For each combination of property values, the model generates a totalof 10000 molecules.
Results are reported in terms of the mean average deviation (MAD) and thestandard deviation (SD) relative to the range of the desired property values, as well as the validity ofthe generated compounds, their uniqueness in terms of the internal diversity of valid predictions, andtheir novelty compared to the training data.
For more information about the measures and the generalsetup, we refer to Appendix D.2.
Results
The results for the conditional generation of molecules are summarized in Table 3.
Weobserve a high validity score and a novelty of 1.0, indicating that our ProbTransformer has learnt theunderlying SMILES grammar very well and does not suffer from overﬁtting to the train data.
For themain task of conditional generation, the ProbTransformer clearly outperforms MolGPT across allmeasures, which highlights its ability to control multiple molecular properties during generation.
Thelargest improvement can be observed for the SD and MAD scores of TPSA, an important measurefor drug delivery in the body, improving the standard deviation (SD) by 57.5% and the mean averagedeviation (MAD) score by nearly 35%.
We do not observe improvements in uniqueness compared [Table] to MolGPT but note that nearly perfect uniqueness could, e.g., be achieved by adding carbons aposteriori [53].
Additional results and prediction examples are shown in Appendix D.3.
4.4 Ablation Studies
We perform two ablation studies to provide more evidence for the usefulness of hierarchical probabilistic construction and kappa annealing.
For this ablation, we use the RNA Folding task describedin Section 4.2 with the same architecture and the training steps.
We provide more details in E.
[Table] Hierarchical probabilistic design Due to thepossibility of having a prob layer in any block,we tested different setups from one prob layer(middle) up to all blocks enhanced with a problayer.
In Figure 4, we measure the performance improvement in Hamming distance compared to a vanilla Transformer on the TS0 and
TSsameStruct sets.
Performance saturates at 4prob layers for the TS0 set but keeps improvingon the TSsameStruct set.
This is in line with ourhypothesis that especially ambiguous samplesproﬁt more from the hierarchical architecture.
Kappa Annealing We assess the effect of kappa annealing when initializing κ with different initialvalues.
In this ablation, we compare a constant κ to kappa annealing on the Hamming distance,see Table 4.
In these results, kappa annealing always improves the performance and substantiallystabilizes ﬁnal performance across a range of initialization values.
Figure 4 shows the adaption of κover a training run, demonstrating that it smoothly converges to a smaller value.
Initializing withsuch a small value would yield much worse performance.
Related Work
Related Transformer Models A series of works enhanced the encoder-decoder Transformer architecture with a distribution in the latent space between encoder and decoder.
During inference, themodel samples from these distributions.
There is work in the ﬁeld of music representation [54] whichdoes not use a posterior model.
Work in neural machine translation [55, 56] has a separate posterior encoder and enhances the ELBO objective.
This is similar to the work of Lin et al.
[57] whichintroduces a variational decoder layer for dialogue modelling and has a separate posterior encoder.
Other work in text generation [58, 59, 60] uses the encoder for the predictive and posterior model.
In contrast to our work, neither of the methods mentioned above model hierarchical distributions oruse the GECO objective.
The work of Pei et al.
[61] introduces a hierarchical stochastic multi-headattention mechanism aiming at uncertainty estimation.
In contrast, we preserve the original attentionmechanism by adding a new layer.
The work of Liu et al.
[59] also introduces a β scheduling inβ -VAE ELBO objective [29] similar to our kappa annealing but focused on the KL loss instead of thereconstruction objective.
Related work in RNA folding Until recently, RNA folding was dominated by dynamic programming (DP) algorithms using either thermodynamic, statistical, or probabilistic scoring functions [62].
Learning-based approaches to the problem beneﬁt from making few assumptions on the foldingprocess and allowing previously unrecognized base pairing constraints [41], which recently led tostate-of-the-art performance using deep learning [36, 41].
We discuss these state-of-the-art deeplearning approaches in detail in Appendix C and refer to a recent review [63].
Related Work in Molecule design While a plethora of deep learning-based models have beenproposed for de novo generation of molecules in the past ﬁve years [64, 65, 66, 67, 68, 69, 70,71, 72, 73, 74], only some methods yet approached the challenging task of generating moleculeswith (multiple) predeﬁned property values (conditional generation).
These include conditional
RNNs [75], cVAEs [76], conditional adversarially regularized autoencoders [77], and more recentlyalso Transformers [11].
Since [76] considers inorganic molecules and conditional generation is onlyperformed in a case study in [77], and because of the usage of different evaluation protocols in [75]and [11], a correct evaluation and fair comparison of these approaches is out of the scope of thiswork.
We, therefore, compare the ProbTransformer to the most similar and recent work in the ﬁeld,
MolGPT , which, to our knowledge, is the current state-of-the-art in the ﬁeld.
For more details on thedifferent methods, we refer to multiple excellent reviews [78, 79, 46, 48].
Discussion and Conclusion
We propose a novel probabilistic layer to enhance the transformer architecture with hierarchical latentdistributions while keeping the global receptive ﬁeld via the attention mechanism.
We showed the beneﬁts of our approach in several experiments.
To our knowledge, the ProbTransformer is the ﬁrst learned RNA folding model that can provide multiple correct structure proposalsfor a given RNA sequence, which opens the doors to novel research paths in RNA structure predictionthat are in line with experimental evidence for RNA structural dynamics from, e.g., NMR studies,such as fraying [80], bulge migration [81], and ﬂuctuating base pairs [81].
On the challenging multiobjective optimization task [49] of designing molecules with desired properties, we demonstratesuperior control over molecule properties during the generation in a decoder-only setting comparedto a state-of-the-art vanilla Transformer architecture.
We want to point out that molecular researchinevitably bears the risk of misuse [82], but we strongly distance ourselves from any such attempts.
The ProbTransformer samples interdependent sequences in one forward path.
This sampling happensin the latent space, and the ProbTransformer can reﬁne or interpret a sampled latent representationin a further layer.
Compared to sampling from the softmax output distribution, this approach yieldsgreater ﬂexibility.
It also is compatible with other enhancements to the Transformer model since itonly adds a new layer but keeps everything else unchanged.
However, our approach also has limitations.
The additional layer and the posterior model increase thecomputational and memory needs up to a factor of two.
Our approach is also limited to encoder-onlyor decoder-only setups since it requires a target of the same length as the input sequence.
We have notapplied our model in natural language processing yet, e.g. as a language model, which could improvepredictive performance and save compute at inference time due to the probabilistic encoder.
Anotherfuture application could be in text-to-speech or automated speech recognition since natural speechcontains many ambiguities.
In general, our approach and especially the conditional variational trainingusing the GECO objective and kappa annealing, could be used in future probabilistic models.
Kappaannealing reduces the need for exhaustive hyperparameter optimization and increases performance.
Therefore, we expect that the positive impact of our work is not limited to RNA folding and moleculedesign but also to generative models in general.
Checklist
For all authors...
(a) Do the main claims made in the abstract and introduction accurately reﬂect the paper’s
contributions and scope?
[Yes] We describe our new approach in detail and provide a
experimental evaluation with state-of-the-art results.
(b) Did you describe the limitations of your work?
[Yes] We mention them in Section 6.(c)
Did you discuss any potential negative societal impacts of your work?
[Yes]
We arenot aware of negative impacts of RNA folding or foundation in probabilistic modelling
but in molecule design and mention this in Section 6.(d) Have you read the ethics review guidelines and ensured that your paper conforms to
them?
[Yes] We read it and our paper is conform.
If you are including theoretical results...
(a) Did you state the full set of assumptions of all theoretical results?
[N/A]
(b) Did you include complete proofs of all theoretical results?
[N/A]
If you ran experiments...
(a) Did you include the code, data, and instructions needed to reproduce the main experimental results (either in the supplemental material or as a URL)?
[Yes] We include thesource code and scripts to build the data in the supplemental material.
We also opensource our code upon acceptance as mentioned in Section 4(b) Did you specify all the training details (e.g., data splits, hyperparameters, how they werechosen)?
[Yes] Details about hyperparameter and data can be found in Appendices B,C,and D.
(c) Did you report error bars (e.g., with respect to the random seed after running experiments multiple times)?
[Yes] We report all experimental results including standarddeviation on multi-seed runs in the Appendix.(d)
Did you include the total amount of compute and the type of resources used (e.g., typeof GPUs, internal cluster, or cloud provider)?
[Yes] Details about compute resourcescan be found in Appendices B.2,C.2, and D.2.
[Table]
If you are using existing assets (e.g., code, data, models) or curating/releasing new assets...
[Table]
(a) If your work uses existing assets, did you cite the creators?
[Yes] We cite used opensource libraries in the Appendix B.2.
[Table]
(b) Did you mention the license of the assets?
[No] We use only open source software.
[Table]
(c) Did you include any new assets either in the supplemental material or as a URL?
[No]We do not include any new assets.
[Table]
(d) Did you discuss whether and how consent was obtained from people whose data you’re
[Table]
using/curating?
[No]
[Table]
(e) Did you discuss whether the data you are using/curating contains personally identiﬁable
[Table]
information or offensive content?
[No] Our data does not contain personally identiﬁable
[Table]
information or offensive content.
[Table]
If you used crowdsourcing or conducted research with human subjects...
[Table]
(a) Did you include the full text of instructions given to participants and screenshots, ifapplicable?
[N/A]
We do not use crowdsourcing nor conducted research with humansubjects.
[Table]
(b) Did you describe any potential participant risks, with links to Institutional Review Board
[Table]
(IRB) approvals, if applicable?
[N/A]
We do not use crowdsourcing nor conducted
[Table]
research with human subjects.
[Table]
(c) Did you include the estimated hourly wage paid to participants and the total amountspent on participant compensation?
[N/A] We do not use crowdsourcing nor conductedresearch with human subjects.
[-However, RNA dataoften considers an extended nucleotide alphabet using IUPAC nomenclature 
-]
[Table]