neural variational document model
Recent advances in neural variational inference have spawned a renaissance in deep latent variable models. In this paper we introduce a generic variational inference framework for generative and conditional models of text. While traditional variational methods derive an analytic approximation for the intractable distributions over latent variables, here we construct an inference network conditioned on the discrete text input to provide the variational distribution. We validate this framework on two very different text modelling applications, generative document modelling and supervised question answering. Our neural variational document model combines a continuous stochastic document representation with a bag-of-words generative model and achieves the lowest reported perplexities on two standard test corpora. The neural answer selection model employs a stochastic representation layer within an attention mechanism to extract the semantics between a question and answer pair. On two question answering benchmarks this model exceeds all previous published benchmarks.READ FULL TEXT VIEW PDF
Recent advances in Neural Variational Inference allowed for a renaissanc...
Many modern unsupervised or semi-supervised machine learning algorithms ...
Document editing has become a pervasive component of production of
We present a new, fully generative model of optical telescope image sets...
Neural attention has become central to many state-of-the-art models in
Majority of the text modelling techniques yield only point estimates of
Statistical morphological inflectors are typically trained on fully
neural variational document model
Neural variational inference document model in the paper "Neural variational inference for text processing"
Neural variational inference document model in the paper "Neural variational inference for text processing"
Probabilistic generative models underpin many successful applications within the field of natural language processing (NLP). Their popularity stems from their ability to use unlabelled data effectively, to incorporate abundant linguistic features, and to learn interpretable dependencies among data. However these successes are tempered by the fact that as the structure of such generative models becomes deeper and more complex, true Bayesian inference becomes intractable due to the high dimensional integrals required. Markov chain Monte Carlo (MCMC)(Neal, 1993; Andrieu et al., 2003) and variational inference (Jordan et al., 1999; Attias, 2000; Beal, 2003)
are the standard approaches for approximating these integrals. However the computational cost of the former results in impractical training for the large and deep neural networks which are now fashionable, and the latter is conventionally confined due to the underestimation of posterior variance. The lack of effective and efficient inference methods hinders our ability to create highly expressive models of text, especially in the situation where the model is non-conjugate.
. The principle idea is to build an inference network, implemented by a deep neural network conditioned on text, to approximate the intractable distributions over the latent variables. Instead of providing an analytic approximation, as in traditional variational Bayes, neural variational inference learns to model the posterior probability, thus endowing the model with strong generalisation abilities. Due to the flexibility of deep neural networks, the inference network is capable of learning complicated non-linear distributions and processing structured inputs such as word sequences. Inference networks can be designed as, but not restricted to, multilayer perceptrons (MLP), convolutional neural networks (CNN), and recurrent neural networks (RNN), approaches which are rarely used in conventional generative models. By using the reparameterisation method(Rezende et al., 2014; Kingma & Welling, 2014), the inference network is trained through back-propagating unbiased and low variance gradients w.r.t. the latent variables. Within this framework, we propose a Neural Variational Document Model (NVDM) for document modelling and a Neural Answer Selection Model (NASM) for question answering, a task that selects the sentences that correctly answer a factoid question from a set of candidate sentences.
The NVDM (Figure 2
) is an unsupervised generative model of text which aims to extract a continuous semantic latent variable for each document. This model can be interpreted as a variational auto-encoder: an MLP encoder (inference network) compresses the bag-of-words document representation into a continuous latent distribution, and a softmax decoder (generative model) reconstructs the document by generating the words independently. A primary feature of NVDM is that each word is generated directly from a dense continuous document representation instead of the more common binary semantic vector(Hinton & Salakhutdinov, 2009; Larochelle & Lauly, 2012; Srivastava et al., 2013; Mnih & Gregor, 2014). Our experiments demonstrate that our neural document model achieves the state-of-the-art perplexities on the 20NewsGroups and RCV1-v2.
with a latent stochastic attention mechanism to model the semantics of question-answer pairs and predict their relatedness. The attention model is designed to focus on the phrases of an answer that are strongly connected to the question semantics and is modelled by a latent distribution. This mechanism allows the model to deal with the ambiguity inherent in the task and learns pair-specific representations that are more effective at predicting answer matches, rather than independent embeddings of question and answer sentences. Bayesian inference provides a natural safeguard against overfitting, especially as the training sets available for this task are small. The experiments show that the LSTM with a latent stochastic attention mechanism learns an effective attention model and outperforms both previously published results, and our own strong non-stochastic attention baselines.
In summary, we demonstrate the effectiveness of neural variational inference for text processing on two diverse tasks. These models are simple, expressive and can be trained efficiently with the highly scalable stochastic gradient back-propagation. Our neural variational framework is suitable for both unsupervised and supervised learning tasks, and can be generalised to incorporate any type of neural networks.
Latent variable modelling is popular in many NLP problems, but it is non-trivial to carry out effective and efficient inference for models with complex and deep structure. In this section we introduce a generic neural variational inference framework that we apply to both the unsupervised NVDM and supervised NASM in the follow sections.
We define a generative model with a latent variable , which can be considered as the stochastic units in deep neural networks. We designate the observed parent and child nodes of as and
respectively. Hence, the joint distribution of the generative model is, and the variational lower bound is derived as:
where parameterises the generative distributions and . In order to have a tight lower bound, the variational distribution should approach the true posterior . Here, we employ a parameterised diagonal Gaussian as . The three steps to construct the inference network are:
Construct vector representations of the observed variables: , .
Assemble a joint representation: .
Parameterise the variational distribution over the latent variable: .
and can be any type of deep neural networks that are suitable for the observed data; is an MLP that concatenates the vector representations of the conditioning variables;, we are able to carry out stochastic back-propagation to optimise the lower bound (Eq. 1).
During training, the model parameters together with the inference network parameters are updated by stochastic back-propagation based on the samples drawn from . For the gradients w.r.t. , we have the form:
For the gradients w.r.t. we reparameterise and sample
to reduce the variance in stochastic estimation(Rezende et al., 2014; Kingma & Welling, 2014). The update of can be carried out by back-propagating the gradients w.r.t. and :
It is worth mentioning that unsupervised learning is a special case of the neural variational framework wherehas no parent node . In that case is directly drawn from the prior instead of the conditional distribution , and .
Here we only discuss the scenario where the latent variables are continuous and the parameterised diagonal Gaussian is employed as the variational distribution. However the framework is also suitable for discrete units, and the only modification needed is to replace the Gaussian with a multinomial parameterised by the outputs of a softmax function. Though the reparameterisation trick for continuous variables is not applicable for this case, a policy gradient approach (Mnih & Gregor, 2014) can help to alleviate the high variance problem during stochastic estimation. (Kingma et al., 2014)
proposed a variational inference framework for semi-supervised learning, but the prior distribution over the hidden variableremains as the standard Gaussian prior, while we apply a conditional parameterised Gaussian distribution, which is jointly learned with the variational distribution.
The Neural Variational Document Model (Figure 2) is a simple instance of unsupervised learning where a continuous hidden variable , which generates all the words in a document independently, is introduced to represent its semantic content. Let be the bag-of-words representation of a document and be the one-hot representation of the word at position .
As an unsupervised generative model, we could interpret NVDM as a variational autoencoder: an MLP encodercompresses document representations into continuous hidden vectors (); a softmax decoder reconstructs the documents by independently generating the words (). To maximise the log-likelihood of documents, we derive the lower bound:
where is the number of words in the document and is a Gaussian prior for . Here, we consider is observed for all the documents. The conditional probability over words
(decoder) is modelled by multinomial logistic regression and shared across documents:
where learns the semantic word embeddings and represents the bias term.
As there is no supervision information for the latent semantics, , the posterior approximation is only conditioned on the current document . The inference network is modelled as:
For each document , the neural network generates its own parameters and that parameterise the latent distribution over document semantics . Based on the samples , the lower bound (Eq. 5) can be optimised by back-propagating the stochastic gradients w.r.t. and .
Since is a standard Gaussian prior, the Gaussian KL-Divergence can be computed analytically to further lower the variance of the gradients. Moreover, it also acts as a regulariser for updating the parameters of the inference network .
Answer sentence selection is a question answering paradigm where a model must identify the correct sentences answering a factual question from a set of candidate sentences. Assume a question is associated with a set of answer sentences , together with their judgements , where if the answer is correct and otherwise. This is a classification task where we treat each training data point as a triple while predicting for the unlabelled question-answer pair .
The Neural Answer Selection Model (Figure 2) is a supervised model that learns the question and answer representations and predicts their relatedness. It employs two different LSTMs to embed raw question inputs and answer inputs . Let and be the state outputs of the two LSTMs, and , be the positions of the states. Conventionally, the last state outputs and , as the independent question and answer representations, can be used for relatedness prediction. In NASM, however, we aim to learn pair-specific representations through a latent attention mechanism, which is more effective for pair relatedness prediction.
NASM applies an attention model to focus on the words in the answer sentence that are prominent for predicting the answer matched to the current question. Instead of using a deterministic question vector, such as , NASM employs a latent distribution to model the question semantics, which is a parameterised diagonal Gaussian . Therefore, the attention model extracts a context vector by iteratively attending to the answer tokens based on the stochastic vector . In doing so the model is able to adapt to the ambiguity inherent in questions and obtain salient information through attention. Compared to its deterministic counterpart (applying as the question semantics), the stochastic units incorporated into NASM allow multi-modal attention distributions. Further, by marginalising over the latent variables, NASM is more robust against overfitting, which is important for small question answering training sets.
In this model, the conditional distribution is:
For each question , the neural network generates the corresponding parameters and that parameterise the latent distribution over question semantics . Following Bahdanau et al. (2015), the attention model is defined as:
where is the normalised attention score at answer token , and the context vector is the weighted sum of all the state outputs . We adopt as the question and answer representations for predicting their relatedness . is a deterministic vector that is equal to , while is a combination of the sequence output and the context vector (Eq. 14). For the prediction of pair relatedness
, we model the conditional probability distribution
by sigmoid function:
To maximise the log-likelihood we use the variational lower bound:
Following the neural variational inference framework, we construct a deep neural network as the inference network :
where and are also modelled by LSTMs111In this case, the LSTMs for and are shared by the inference network and the generative model, but there is no restriction on using different LSTMs in the inference network., and the relatedness label is modelled by a simple linear transformation into the vector . According to the joint representation , we then generate the parameters and , which parameterise the variational distribution over the question semantics . To emphasise, though both and are modelled as parameterised Gaussian distributions, as an approximation only functions during inference by producing samples to compute the stochastic gradients, while is the generative distribution that generates the samples for predicting the question-answer relatedness .
Based on the samples , we use SGVB to optimise the lower bound (Eq.16). The model parameters and the inference network parameters are updated jointly using their stochastic gradients. In this case, similar to the NVDM, the Gaussian KL divergence can be analytically computed during training process.
is an undirected topic model implemented by restricted Boltzmann machines, and docNADE(Larochelle & Lauly, 2012) is a neural topic model based on autoregressive assumption. The models based on Sigmoid Belief Networks (SBN) and Deep AutoRegressive Neural Network (DARN) structures are implemented by Mnih & Gregor (2014), which employs an MLP to build a Monte Carlo control variate estimator for stochastic estimation.
We experiment with NVDM on two standard news corpora: the 20NewsGroups222http://qwone.com/ jason/20Newsgroups and the Reuters RCV1-v2333http://trec.nist.gov/data/reuters/reuters.html. The former is a collection of newsgroup documents, consisting of 11,314 training and 7,531 test articles. The latter is a large collection from Reuters newswire stories with 794,414 training and 10,000 test cases. The vocabulary size of these two datasets are set as 2,000 and 10,000.
To make a direct comparison with the prior work we follow the same preprocessing procedure and setup as Hinton & Salakhutdinov (2009), Larochelle & Lauly (2012), Srivastava et al. (2013), and Mnih & Gregor (2014). We train NVDM models with 50 and 200 dimensional document representations respectively. For the inference network, we use an MLP (Eq. 8
) with 2 layers and 500 dimension rectifier linear units, which converts document representations into embeddings. During training we carry out stochastic estimation by taking one sample for estimating the stochastic gradients, while in prediction we use 20 samples for predicting document perplexity. The model is trained by Adam(Kingma & Ba, 2015) and tuned by hold-out validation perplexity. We alternately optimise the generative model and the inference network by fixing the parameters of one while updating the parameters of the other.
Table (a)a presents the test document perplexity. The first column lists the models, and the second column shows the dimension of latent variables used in the experiments. The final two columns present the perplexity achieved by each topic model on the 20NewsGroups and RCV1-v2 datasets. In document modelling, perplexity is computed by , where is the number of documents, represents the length of the th document and is the log probability of the words in the document. Since is intractable in the NVDM, we use the variational lower bound (which is an upper bound on perplexity) to compute the perplexity following Mnih & Gregor (2014).
While all the baseline models listed in Table (a)a apply discrete latent variables, here NVDM employs a continuous stochastic document representation. The experimental results indicate that NVDM achieves the best performance on both datasets. For the experiments on RCV1-v2 dataset, the NVDM with latent variable of 50 dimension performs even better than the fDARN with 200 dimension. It demonstrates that our document model with continuous latent variables has higher expressiveness and better generalisation ability. Table (b)b compares the 5 nearest words selected according to the semantic vector learned from NVDM and docNADE.
In addition to the perplexities, we also qualitatively evaluate the semantic information learned by NVDM on the 20NewsGroups dataset with latent variables of 50 dimension. We assume each dimension in the latent space represents a topic that corresponds to a specific semantic meaning. Table 4 presents 5 randomly selected topics with 10 words that have the strongest positive connection with the topic. Based on the words in each column, we can deduce their corresponding topics as: Space, Religion, Encryption, Sport and Policy. Although the model does not impose independent interpretability on the latent representation dimensions, we still see that the NVDM learns locally interpretable structure.
We experiment on two answer selection datasets, the QASent and the WikiQA datasets. QASent (Wang et al., 2007) is created from the TREC QA track, and the WikiQA (Yang et al., 2015) is constructed from Wikipedia, which is less noisy and less biased towards lexical overlap444Yang et al. (2015) provide detailed explanation of the differences between the two datasets.. Table 6 summarises the statistics of the two datasets.
In order to investigate the effectiveness of our NASM model we also implemented two strong baseline models — a vanilla LSTM model (LSTM) and an LSTM model with a deterministic attention mechanism (LSTM+Att). The former directly applies the QA matching function (Eq. 15) on the independent question and answer representations which are the last state outputs and from the question and answer LSTM models. The latter adds an attention model to learn pair-specific representation for prediction on the basis of the vanilla LSTM. Moreover, LSTM+Att is the deterministic counterpart of NASM, which has the same neural network architecture as NASM. The only difference is that it replaces the stochastic units
with deterministic ones, and no inference network is required to carry out stochastic estimation. Following previous work, for each of our models we also add a lexical overlap feature by combining a co-occurrence word count feature with the probability generated from the neural model. MAP and MRR are adopted as the evaluation metrics for this task.
To facilitate direct comparison with previous work we follow the same experimental setup as Yu et al. (2014) and Severyn (2015). The word embeddings are obtained by running the word2vec tool (Mikolov et al., 2013) on the English Wikipedia dump and the AQUAINT555https://catalog.ldc.upenn.edu/LDC2002T31 corpus. We use LSTMs with layers and hidden units, and apply dropout after the embedding layer. For the construction of the inference network, we use an MLP (Eq. 10) with 2 layers and tanh units of 50 dimension, and an MLP (Eq. 17) with 2 layers and tanh units of 150 dimension for modelling the joint representation. During training we carry out stochastic estimation by taking one sample for computing the gradients, while in prediction we use 20 samples to calculate the expectation of the lower bound. Figure 6 presents the standard deviation of NASM’s MAP scores while using different numbers of samples. Considering the trade-off between computational cost and variance, we chose 20 samples for prediction in all the experiments. The models are trained using Adam (Kingma & Ba, 2015)
, with hyperparameters selected by optimising the MAP score on the development set.
Table 6 compares the results of our models with current state-of-the-art models on both answer selection datasets. On the QASent dataset, our vanilla LSTM model outperforms the deep CNN 666As stated in (Yih et al., 2013) that the evaluation scripts used by previous work are noisy — 4 out of 72 questions in the test set are treated answered incorrectly. This makes the MAP and MRR scores lower than the true scores. Since Severyn (2015) and Wang & Ittycheriah (2015) use a cleaned-up evaluation scripts, we apply the original noisy scripts to re-evaluate their outputs in order to make the results directly comparable with previous work. model by approximately on MAP and on MRR. The LSTM+Att performs slightly better than the vanilla LSTM model, and our NASM improves the results further. Since the QASent dataset is biased towards lexical overlapping features, after combining with a co-occurrence word count feature, our best model NASM outperforms all the previous models, including both neural network based models and classifiers with a set of hand-crafted features (e.g. LCLR). Similarly, on the WikiQA dataset, all of our models outperform the previous distributional models by a large margin. By including a word count feature, our models improve further and achieve the state-of-the-art. Notably, on both datasets, our two LSTM-based models have set strong baselines and NASM works even better, which demonstrates the effectiveness of introducing stochastic units to model question semantics in this answer sentence selection task.
In Figure 4, we compare the effectiveness of the latent attention mechanism (NASM) and its deterministic counterpart (LSTM+Att) by visualising the attention scores on the answer sentences. For most of the negative answer sentences, neither of the two attention models can attend to reasonable words that are beneficial for predicting relatedness. But for the correct answer sentences, such as the ones in Figure 4, both attention models are able to capture crucial information by attending to different parts of the sentence based on the question semantics. Interestingly, compared to the deterministic counterpart LSTM+Att, our NASM assigns higher attention scores on the prominent words that are relevant to the question, which forms a more peaked distribution and in turn helps the model achieve better performance.
In order to have an intuitive observation on the latent distributions, we present Hinton diagrams of their log standard deviation parameters (Figure 4). In a Hinton diagram, the size of a square is proportional to a value’s magnitude, and the colour (black/white) indicates its sign (positive/negative). In this case, we visualise the parameters of 50 conditional distributions with the questions selected from 5 different groups, which start with ‘how’, ‘what’, ‘who’, ‘when’ and ‘where’. All the log standard deviations are initialised as zero before training. According to Figure 4, we can see that the questions starting with ‘how’ have more white areas, which indicates higher variances or more uncertainties are in these dimensions. By contrast, the questions starting with ‘what’ have black squares in almost every dimension. Intuitively, it is more difficult to understand and answer the questions starting with ‘how’ than the others, while the ‘what’ questions commonly have explicit words indicating the possible answers. To validate this, we compute the stratified MAP scores based on different question type. The MAP of ’how’ questions is 0.524 which is the lowest among the five groups. Hence empirically, ’how’ questions are harder to ’understand and answer’.
As shown in the experiments, neural variational inference brings consistent improvements on the performance of both NLP tasks. The basic intuition is that the latent distributions grant the ability to sum over all the possibilities in terms of semantics. From the perspective of optimisation, one of the most important reasons is that Bayesian learning guards against overfitting.
According to Eq. 5 in NVDM, since we adopt as a standard Gaussian prior, the KL divergence term can be analytically computed as . It is not difficult to find that it actually acts as L2 regulariser when we update the . Similarly, in NASM (Eq. 16), we also have the KL divergence term . Different from NVDM, it attempts to minimise the distance between and that are both conditional distributions. Because as well as are learned during training, the two distributions are mutually restrained while being updated. Therefore, NVDM simply penalises the large and encourages to approach the prior for every document , but in NASM, acts like a moving baseline distribution which regularises the update of for every different conditions. In practice, we carry out early stopping by observing the prediction performance on development dataset for the question answer selection task. Using the same learning rate and neural network structure, LSTM+Att reaches optimal performance and starts to overfit on training dataset generally at the th iteration, while NASM starts to overfit around the th iteration.
More interestingly, in the question answer selection experiments, NASM learns more peaked attention scores than its deterministic counterpart LSTM+Att. For the update process of LSTM+Att, we find there exists a relatively big variance in the gradients w.r.t. question semantics (LSTM+Att applies deterministic while NASM applies stochastic ). This is because the training dataset is small and contains many negative answer sentences that brings no benefit but noise to the learning of the attention model. In contrast, for the update process of NASM, we observe more stable gradients w.r.t. the parameters of latent distributions. The optimisation of the lower bound on one hand maximises the conditional log-likelihood (that the deterministic counterpart cares about) and on the other hand minimises the KL-divergence (that regularises the gradients). Hence, each update of the lower bound actually keeps the gradients w.r.t. from swinging heavily. Besides, since the values of are not very significant in this case, the distribution of attention scores mainly depends on . Therefore, the learning of the attention model benefits from the regularisation as well, and it explains the fact that NASM learns more peaked attention scores which in turn helps achieve a better prediction performance.
Since the computations of NVDM and NASM can be parallelised on GPU and only one sample is required during training process, it is very efficient to carry out the neural variational inference. Moreover, for both NVDM and NASM, all the parameters are updated by back-propagation. Thus, the increased computation time for the stochastic units only comes from the added parameters of the inference network.
, but applications of these directed generative models come up against the problem of establishing low variance gradient estimators. Recent advances in neural variational inference mitigate this problem by reparameterising the continuous random variables(Rezende et al., 2014; Kingma & Welling, 2014), using control variates (Mnih & Gregor, 2014) or approximating the posterior with importance sampling (Bornschein & Bengio, 2015). The instantiations of these ideas (Gregor et al., 2015; Kingma et al., 2014; Ba et al., 2015) have demonstrated strong performance on the tasks of image processing. The recent variants of generative auto-encoder (Louizos et al., 2015; Makhzani et al., 2015) are also very competitive. Tang & Salakhutdinov (2013) applies the similar idea of introducing stochastic units for expression classification, but its inference is carried out by Monte Carlo EM algorithm with the reliance on importance sampling, which is less efficient and lack of scalability.
Another class of neural generative models make use of the autoregressive assumption (Larochelle & Murray, 2011; Uria et al., 2014; Germain et al., 2015; Gregor et al., 2014). Applications of these models on document modelling achieve significant improvements on generating documents, compared to conventional probabilistic topic models (Hofmann, 1999; Blei et al., 2003) and also the RBMs (Hinton & Salakhutdinov, 2009; Srivastava et al., 2013). While these models that use binary semantic vectors, our NVDM employs dense continuous document representations which are both expressive and easy to train. The semantic word vector model (Maas et al., 2011) also employs a continuous semantic vector to generate words, but the model is trained by MAP inference which does not permit the calculation of the posterior distribution. A very similar idea to NVDM is Bowman et al. (2015), which employs VAE to generate sentences from a continuous space.
Apart from the work mentioned above, there is other interesting work on question answering with deep neural networks. One of the popular streams is mapping factoid questions with answer triples in the knowledge base (Bordes et al., 2014a, b; Yih et al., 2014). Moreover, Weston et al. (2015); Sukhbaatar et al. (2015); Kumar et al. (2015) further exploit memory networks, where long-term memories act as dynamic knowledge bases. Another attention-based model (Hermann et al., 2015) applies the attentive network to help read and comprehend for long articles.
This paper introduced a deep neural variational inference framework for generative models of text. We experimented on two diverse tasks, document modelling and question answer selection tasks to demonstrate the effectiveness of this framework, where in both cases our models achieve state of the art performance. Apart from the promising results, our model also has the advantages of (1) simple, expressive, and efficient when training with the SGVB algorithm; (2) suitable for both unsupervised and supervised learning tasks; and (3) capable of generalising to incorporate any type of neural network.
Learning word vectors for sentiment analysis.In Proceedings of ACL, 2011.
Stochastic backpropagation and approximate inference in deep generative models.In Proceedings of ICML, 2014.
Modelling input texts: from Tree Kernels to Deep Learning. PhD thesis, University of Trento, 2015.
(1) Inference Network :
(2) Generative Model :
(3) KL Divergence :
The variational lower bound to be optimised:
(1) Inference Network :
(2) Generative Model
(3) KL Divergence :
The variational lower bound to be optimised:
The computational complexity of NVDM for a training document is . Here, represents the cost for the inference network to generate a sample, where is the number of the layers in the inference network and is the average dimension of these layers. Besides, is the cost of reconstructing the document from a sample, where is the average length of the documents and represents the volume of words applied in this document model, which is conventionally much lager than .
The computational complexity of NASM for a training question-answer pair is . The inference network needs . It takes to produce the joint representation for a question-answer pair and its label, where is the total number of parameters of an LSTM and is the average length of the sentences. Based on the joint representation, an MLP spends to generate a sample, where is the number of layers and represents the average dimension. The generative model requires . Similarly, it costs to construct the generative latent distribution , where can be saved if the LSTMs are shared by the inference network and the generative model. Besides, the attention model takes and the relatedness prediction takes the last .
Since the computations of NVDM and NASM can be parallelised in GPU and only one sample is required during training process, it is very efficient to carry out the neural variational inference. As NVDM is an instantiation of variational auto-encoder, its computational complexity is the same as the deterministic auto-encoder. In addition, the computational complexity of LSTM+Att, the deterministic counterpart of NASM, is also . There is only time increase by introducing an inference network for NASM when compared to LSTM+Att.