Profile

Settings

Loading…

← Papers

Help

FAQ

Which features require signing in?

You can read the commentary, paper info, Model Structure and related papers of public papers without signing in. Sign in to manage your account or contact us about your inquiries.

Can I upload a PDF file?

Upload papers with an arXiv or DOI link; the commentary is public to everyone. Papers whose source and terms of use can't be verified, so the commentary can't be made public, can't be uploaded. Uploading PDF files and keeping papers private are for subscribers only, and a paper uploaded as a file is saved as private only. Searching for official info by title runs only when you press the button.

Are the figures and AI commentary accurate?

Figures come only from the original paper, and only those whose terms of use are verified are shown. The commentary is written by AI and may be wrong. Check important claims, numbers and figure context against the evidence in the original paper.

I want to report a copyright issue.

Terms of use and the source of the original paper are on the Paper info tab. If there's a problem, choose "Paper content, figures and copyright" under Contact us and send the paper link, the part in question, and evidence that you hold the rights. Receiving your report doesn't confirm any rights or remove anything right away. You can see the result of the review under My inquiries.

I forgot my password.

If you signed up with email, use Forgot password in the sign-in window to reset it with your verified email. If you signed up with Google, Naver or Kakao, change your password with that service.

What should I include in an inquiry?

Tell us which screen you were on and what you were doing when the problem happened, along with the paper link. Don't include personal information such as passwords, API keys, verification codes or phone numbers. Inquiries and replies are stored in Refivu and you can see them under My inquiries.

How do I delete my account?

In Settings, under My account, press Delete account. Review what will be deleted and complete identity verification to delete your account. For other requests, choose "Account" under Contact us.

Paper commentary

Generating Sentences from a Continuous Space

Variational autoencoders can generate whole sentences from a continuous latent space

  • Problem Standard language models write one word at a time and have no global sentence vector. Adding a latent sentence variable makes maximum likelihood training intractable, because the posterior has no exact form.
  • Method The authors train a variational autoencoder with LSTM encoder and decoder, using a Gaussian prior on the sentence code. KL cost annealing and word dropout keep the model from ignoring the latent code.
  • Results On Penn Treebank the VAE scores slightly worse than the rnnlm baseline, with a KL divergence cost of 2. On Books Corpus imputations its unigram adversarial error is 22.39, versus 28.32 for the rnnlm.

Why a global sentence code is hard to learn

A recurrent language model predicts each word from a hidden state that is updated one step at a time, so it never builds a single vector that summarizes the whole sentence. That makes the model strong at density estimation but gives no interpretable handle on global properties such as topic or high-level syntax. Adding a latent variable for those properties makes maximum likelihood training intractable, since the posterior over the latent variable has no exact form.

Plain sequence autoencoders produce a sentence code, but the codes are not smooth: decoding points on a path between two codes gives ungrammatical intermediate sentences. Because such autoencoders have no prior over the code, they cannot assign probabilities to sentences or draw new ones. Skip-thought and paragraph vector models give useful sentence encodings, but neither can serve as a generative model.

A variational autoencoder for sentences

The encoder and decoder are both single-layer LSTM networks, so the model is a sequence autoencoder whose code is regularized by a Gaussian prior. The decoder is a language model conditioned on the sampled code, so if the code carries no useful information, the model behaves as an rnnlm. The encoder side is a learned posterior recognition model that outputs an approximate posterior over the code, usually a diagonal Gaussian, rather than a single deterministic vector.

The objective is the variational lower bound, which subtracts a KL divergence from the prior and adds an expected reconstruction log likelihood under the posterior. \[ \mathcal{L}(\theta;x) = -\mathrm{kl}\big(q_\theta(\vec z\,|\,x)\,\|\,p(\vec z)\big) + \mathbb{E}_{q_\theta(\vec z|x)}\big[\log p_\theta(x|\vec z)\big] \le \log p(x) \] Gradients are estimated with a single posterior sample per step, obtained with the Gaussian reparameterization trick, while the KL term is computed in closed form.

Several variants gave little difference in performance, including concatenating the sampled code to the decoder input at each step and using a softplus variance parametrization. Adding feedforward networks between the encoder and the latent variable, and between the latent variable and the decoder, required highway network layers for the model to learn.

More elaborate recognition models, a multistep sampling model styled after DRAW and a normalizing flow posterior, did not give meaningful gains over the plain VAE.

Why the KL term collapses to zero

The bound splits into a cross entropy term for the data under the posterior and a KL divergence from the prior, so a model that uses its latent variable must have a nonzero KL term with a relatively small cross entropy. In straightforward implementations, most runs with most hyperparameters set the posterior equal to the prior, which drives the KL term to zero.

In that state the model reduces to an rnnlm, which can still express arbitrary distributions over sentences, albeit with an awkward left-to-right factorization.

Earlier image VAEs avoided this because their pixel decoder was weak, which forced them to route information through the latent variable. The authors argue that the LSTM decoder is sensitive to small variation in its hidden states, including the noise from posterior sampling, so early in training it learns to ignore the latent code and fit the data with the easier decoder.

Once the decoder ignores the code, little gradient reaches the encoder, and the KL term settles at zero in a stable equilibrium.

KL cost annealing and word dropout

KL cost annealing adds a weight to the KL term that starts at zero and is raised until it reaches 1, at which point the cost equals the true variational lower bound. Early in training the model therefore encodes as much information in the code as it can, and later the weight pushes the codes to fill the prior; the rate of increase is a tuned hyperparameter.

On Penn Treebank the KL term spikes early, drops once the full penalty applies, and then rises slowly before converging.

Word dropout weakens the decoder by replacing a fraction of the conditioned-on previous words with the unknown token, so that predictions must lean on the latent code. A keep rate k sets the fraction of words retained, and it is tuned both for the VAE and for the rnnlm baseline. Standard dropout on the decoder's input embeddings was tried and did not help the model use the latent variable.

Penn Treebank language modeling

Hyperparameter search was restricted to VAE models that encode a nontrivial amount in the latent variable, measured by the KL term of the bound. The VAE's score is a variational bound on test likelihood, whereas the rnnlm's is its exact test likelihood, which places the VAE at a potential disadvantage.

In the standard setting the VAE is slightly worse than the rnnlm baseline, yet its reconstruction cost of 99 is better than the baseline's, and it uses the latent space with a KL divergence cost of 2. Training without both word dropout and cost annealing reliably gave performance equivalent to the baseline rnnlm with zero KL divergence.

With the keep rate set to 0, the inputless decoder conditions only on the position in the sentence and the latent code, and the VAE then carries a much larger KL term. Its improvement over the weakened rnnlm is substantial, but the weakened rnnlm in this setting is essentially limited to unigram statistics. The inputless decoder's generation process is fully differentiable, which the authors note could matter for adversarial training methods that need differentiable generators.

Why imputation suits a global latent variable

Given known words, an rnnlm must sum over unknown words in sequence, so exact inference over the missing variables is intractable for all but tiny vocabularies. The VAE faces the same intractability when sampling or computing maximum a posteriori imputations, but a global latent variable with a tractable recognition model lets information flow between all variables.

Models are trained on the Books Corpus, a collection from 12k e-books, mostly fiction, pruned to approximately 80m sentences. A fixed word keep rate of 75% is used in training unless otherwise stated, and both models decode right to left with 512 hidden units.

Inference for imputation

The rnnlm uses beam search with beam size 15, while the VAE uses approximate iterated conditional modes with 3 steps of a beam size 5 search, so both use a comparable amount of computation. Iterated conditional modes alternately maximizes conditional distributions to find a joint assignment, and this approximate version starts from the unknown token.

Each round sets the latent variable to its mode under the recognition model and then runs constrained beam search to fill the unknown words, and the final 20% of each sentence is imputed.

Qualitatively the VAE completions draw on topic and use a more varied vocabulary than the rnnlm's stereotypical completions.

Adversarial evaluation of imputations

Adversarial error is the gap between the ideal 50% discriminator accuracy and the accuracy a classifier attains on complete sentences versus imputed completions. Two classifiers are used, a bag-of-unigrams logistic regression and an LSTM logistic regression, trained with early stopping on an 80/10/10 split of 320k sentences.

The authors attribute the rnnlm's weakness to its beam being limited to the top 15 tokens of its initial unconditional distribution when producing the final token.

The rnnlm favors generic endings such as "he said", which gives it a slightly lower negative log likelihood, but its repetitive completions are easy for the classifiers to detect. Under this evaluation the VAE's imputations are harder to distinguish, which the authors relate to propagating information bidirectionally through the latent variable.

Word keep rate and the information in the latent code

Models are trained on the Books Corpus with varying keep rates and tested on a held out 10k sentence test set, with hyperparameters not re-tuned for each keep rate. Train and test performance are very similar in this setup.

As the keep rate falls from 100% to 0%, the KL divergence rises from 0.010358 to 20.906685, while the cross entropy goes from 45.01017 to 34.825763, with the 50% setting at 33.433636. A model with no dropout encodes very little in the latent variable, and lowering the keep rate stores more information there at some cost in overall likelihood.

The authors expect a model without a latent variable to degrade more under heavy word dropout, which their Penn Treebank results in the earlier section point toward.

Greedy decoding of prior samples

Codes are drawn from the Gaussian prior and each token is chosen by greedy argmax decoding conditioned on the code, so variation comes only from the code. At low keep rates, where little variance is explained by the code, greedy decoding does not produce diverse sentences. As the keep rate falls, samples become more varied, but at 0% they stop being plausible English, although the model still captures some higher order statistics.

The resulting sentences are less typical but are mostly grammatical and keep a clear topic, which the authors take as evidence that the code captures a variety of global features even for rare sentences.

Interpolating and encoding sentences

The sequence autoencoder path in Table 1 changes sharply and passes through ungrammatical sentences, which the authors read as evidence that the VAE's code space is smoother and fills the space.

In the VAE paths the intermediate sentences are almost always grammatical, and syntactic structure and part of the speech pattern change in a locally consistent way. Sentences with similar syntax and topic but flipped sentiment can receive similar codes, which the authors connect to similar distributional behavior of words such as bad and good.

Posterior samples for input sentences show that the codes capture the number of tokens, parts of speech and topic, while long sentences are reproduced less faithfully.

Limitations

Even with word dropout, KL cost annealing and the inputless decoder, the models could not be trained so that the KL term dominates the reconstruction term. The authors read this as evidence that local statistics remain easier to learn than information in the latent variable.

The inputless decoder is weaker than a standard decoder, and the language modeling comparison uses a variational bound for the VAE and exact likelihood for the rnnlm. The imputation comparison covers the final 20% of each sentence and a fixed beam budget, and the homotopy and prior sample analyses are qualitative, without a quantitative metric.

The authors list factorizing the latent variable into style and content, conditioning on extrinsic features and going beyond adversarial evaluation to a fully adversarial objective as future work.

Paper info

Authors
Samuel R. Bowman, Luke Vilnis, Oriol Vinyals, Andrew M. Dai, Rafal Jozefowicz, Samy Bengio
Venue
arXiv · Preprint
First published
2015-11-19
Added
2026-11-12
Updated
2016-5-12
Version
v4
arXiv
1511.06349
Category
cs.LG · cs.CL
Original paper terms
arXiv non-exclusive 1.0
What we show
Paper info and commentary

AI commentary is a separate explanation from the original paper and may contain errors. The original paper and figures follow each source's terms of use and any rights noted separately.

Quote from the paper

Samuel R. Bowman, Luke Vilnis, Oriol Vinyals, Andrew M. Dai, Rafal Jozefowicz, Samy Bengio (2015). Generating Sentences from a Continuous Space. arXiv:1511.06349v4. https://arxiv.org/abs/1511.06349v4

BibTeX
@misc{bowman2015generating,
  title = {{Generating Sentences from a Continuous Space}},
  author = {Samuel R. Bowman and Luke Vilnis and Oriol Vinyals and Andrew M. Dai and Rafal Jozefowicz and Samy Bengio},
  year = {2015},
  eprint = {1511.06349},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1511.06349v4}
}

See related papersBrowse other papers

Paper preview
Account security

Connect Google account

If you connect a Google account, you can sign in with it too.

Refivu

Delete account

Refivu
Refivu

Sign up