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 Sequences With Recurrent Neural Networks

LSTM networks learn to generate long, realistic sequences one step at a time

  • Problem A next-step RNN used as a generator drifts once its own samples feed back in, and standard RNNs keep too little history to correct that drift.
  • Method The authors stack LSTM layers to predict one data point at a time, using a softmax for text and a mixture density layer for pen traces.
  • Results On Hutter Prize Wikipedia validation data, the character-level network reaches 1.33 bits-per-character with dynamic evaluation, against 1.67 with static evaluation.

Why generated sequences drift

A recurrent network can be trained to predict each next input from the real sequence, and then it can generate new sequences by sampling from its output distribution and feeding each sample back as the next input. Because the network treats its own samples as real data, a generated sequence is a distribution over outputs whose conditioning comes from everything the network has already emitted.

Unlike n-gram models or compression algorithms that count exact matches, a trained RNN interpolates between training examples, so it rarely reproduces the same thing twice.

The weakness appears when the predictions depend only on the last few inputs. If those inputs were themselves sampled and went wrong, the network has little chance to recover, and the error keeps carrying forward. Standard RNNs struggle to keep information about past inputs for long spans, so the same instability shows up for long-range structure as well as for stability.

Injecting noise into the predictions has been proposed as a remedy, but the authors argue that a longer memory is a more basic fix, because a network that can look further back can still make sense of its history after a bad step. The problem is sharper with real-valued data, where predictions can easily move off the manifold the training data lies on.

The study asks whether an LSTM can use its memory to generate sequences with long-range structure, first for discrete text and then for real-valued online handwriting. The handwriting part is then extended to a network that conditions on a text string, so that the generator writes a given sentence rather than free-form pen traces.

The stacked LSTM prediction network and its loss

The first input of each sequence is a null vector of zeros, so the network makes its first real prediction with no prior information. Skip connections run from the inputs to every hidden layer and from every hidden layer to the outputs. They shorten the path between the bottom and top of the network, which eases training of deep stacks and reduces the vanishing gradient problem.

When N equals 1 the architecture is an ordinary single-layer next-step prediction RNN.

Each output vector y_t parameterises the predictive distribution Pr(x_{t+1}|y_t) over the next input, and the choice of that distribution has to match the data. Finding a good distribution for high-dimensional real-valued data is the hard part. The probability of a whole sequence is the product of the next-step probabilities, and the training loss is its negative logarithm, so minimising the loss maximises the likelihood of the training sequences.

The loss is computed as \(L(x) = -\sum_{t=1}^{T} \log \Pr(x_{t+1} \mid y_t)\), and its gradients with respect to the weights are obtained by backpropagation through time applied to the same graph, then used in gradient descent.

In the LSTM version used here, each cell has an input gate, a forget gate, an output gate and a cell state, and the gates read the current input, the previous hidden state and the cell state through weight matrices. The gates use a logistic sigmoid and the cell update uses a tanh, and the weight matrices from the cell to the gates are diagonal, so each gate element sees only the matching cell element.

The original LSTM used an approximate gradient that updated weights every timestep, whereas this study uses the full gradient from backpropagation through time.

Word and character prediction on Penn Treebank

Both predictors use a single hidden layer of 1000 LSTM units. The character-level network has input and output layers of size 49 and about 4.3M weights, while the word-level network has 10,000 inputs and outputs and about 54M weights.

Dynamic evaluation lets the weights keep adapting while each test sequence is predicted once, which the study considers a fairer match to compression algorithms. Regularisation is applied with weight noise at a standard deviation of 0.075, and with adaptive weight noise where the noise variance is learned with the weights; adaptive weight noise removes the need for early stopping.

Without regularisation and with static evaluation, the character-level network reaches 1.32 bits-per-character and a perplexity of 167, while the word-level network reaches a perplexity of 138 at 1.27 bits-per-character. With weight noise and dynamic evaluation the gap narrows to 124 for characters against 117 for words, so the word-level advantage shrinks as regularisation is added.

The study compares these numbers with values reported in Mikolov's thesis, where a 5-gram with smoothing reached 141, a word-level feedforward network 141.8, PAQ8 131.1 and a dynamically evaluated word-level RNN 123.2. Combining several RNNs with a 5-gram and a cache model reached 89.4 in that thesis, a figure that is not an experiment of this study.

The gain from dynamic evaluation is larger here than in Mikolov's thesis, which the authors read as evidence that LSTM adapts more quickly to new data than ordinary RNNs.

Character prediction on Hutter Prize Wikipedia

The first 96M bytes of the Hutter Prize data are split into sequences of 100 bytes for training, and the remaining 4M bytes are used for validation. The data contain 205 one-byte unicode symbols, and the network uses 700 LSTM cells with about 21.3M weights.

Table 2 reports 1.42 bits-per-character on the training data, 1.67 on validation with static evaluation and 1.33 on validation with dynamic evaluation. The benefit of dynamic evaluation is attributed to the long-range coherence of Wikipedia, where some words are much more frequent in certain articles and adapting to them during evaluation helps.

Validation scores come out better than training scores, which the authors explain by underfitting on the training data and by some portions of the data, such as plain text, being harder than others, such as XML tags. The current best Hutter Prize entry, a variant of PAQ-8, reaches 1.28 bits-per-character on the same data including its code, mainstream compressors such as zip get more than 2, and a text-only character RNN reached 1.54 on held-out data, improving to 1.47 when combined with a maximum entropy model.

These comparison values come from other systems and are not controlled runs of this network.

A generated sample of four pages shows a large vocabulary of dictionary words and invented but plausible words such as 'Lochroom River' and 'swalloped', together with punctuation placed at roughly the right rhythm. The sample also closes quotation marks and parentheses, balances equals signs used for headings, and nests XML tags, which the authors read as a sign of memory because the closure cannot be predicted from nearby text.

Handwriting prediction with depth and regularisation

Each point in the pen trace is three numbers: the x and y offsets from the previous point and a binary end-of-stroke feature, so the input layer has size 3. The offsets are normalised to mean 0 and standard deviation 1 over the training set.

The one-layer network uses a single hidden layer of 900 LSTM cells, and the deeper network uses three hidden layers of 400 LSTM cells each, with both networks having around 3.4M weights. The networks are trained with rmsprop, which divides the gradients by a running average of their recent magnitude, and the output derivatives are clipped to [-100, 100] while the LSTM derivatives are clipped to [-10, 10].

The three-layer network is retrained with adaptive weight noise with all standard deviations initialised to 0.075, since fixed-variance weight noise was judged ineffective because it stops the mixture density layer from using precisely specified weights.

On the validation set, the single-layer network reaches a Log-Loss of -1025.7 nats with SSE 0.40, the unregularised three-layer network -1041.0 nats with SSE 0.41, and the three-layer network with adaptive weight noise -1057.7 nats with SSE 0.41. The three-layer network's loss is 15.3 nats lower than the single-layer network's, although the sum-squared-error is slightly lower for the single layer.

Adaptive weight noise lowers the loss by a further 16.7 nats relative to the unregularised three-layer network without significantly changing the sum-squared error.

The generated handwriting samples show that the network has learned strokes, letters and short common words such as 'of' and 'the'. Invented words such as 'eald', 'bryoes' and 'lenrest' look plausible in English, and the average character spans more than 25 timesteps, which the authors take as evidence of coherent long-range structure.

Conditioning the network on text with a soft window

An RNN transducer could handle two sequences of different length, but preliminary experiments on handwriting synthesis were not encouraging, and the study suggests that using two separate RNNs and merging their outputs is a likely reason.

The study instead convolves a soft window with the text string and feeds it into the prediction network as an extra input, so that the network decides which character to write next while it makes its predictions. The window parameters are output by the network at each timestep, so the alignment is learned during prediction rather than fixed beforehand.

For a character sequence c of length U and a data sequence x of length T, the window at timestep t is a weighted sum of the one-hot character vectors, with weights given by a mixture of K Gaussian functions: \(\phi(t,u) = \sum_{k=1}^{K} \alpha_{kt}\exp(-\beta_{kt}(\kappa_{kt}-u)^2)\) and \(w_t = \sum_{u=1}^{U}\phi(t,u)c_u\). Here phi(t,u) is the window weight on character c_u at timestep t, so the window vector w_t is a single vector that summarises the text at that step.

The synthesis network uses the IAM-OnDB character transcriptions, which contain 80 distinct characters, but only a subset of 57 is kept, with the remaining digits and most punctuation replaced by a generic non-letter label. The character sequence is one-hot encoded, so each window vector has size 57, and a mixture of 10 Gaussian functions gives a 30-parameter window vector.

The architecture mirrors the best prediction network, with three hidden layers of 400 LSTM cells, 20 bivariate Gaussian mixture components and a size 3 input layer, for about 3.7M weights in total.

Handwriting synthesis against the prediction network

The synthesis network reaches a Log-Loss of -1096.9 nats with no regularisation and -1128.2 nats with adaptive weight noise, both with SSE 0.23 on the validation set. Adaptive weight noise improves the log-loss by about 31.3 nats while leaving the sum-squared-error unchanged. The regularised network is said to produce slightly more realistic sequences, although that difference is hard to see by eye.

Both synthesis networks perform considerably better than the best prediction network on the same validation data, with a sum-squared-error reduced by 44%.

Unbiased and biased sampling of handwriting

Unbiased samples are drawn by iteratively drawing each next input from the predictive distribution, as for the prediction network, while sampling also decides when the text has been fully written. The stopping rule ends sampling when the window weight on the position just past the last character becomes larger than the weights on all the characters themselves.

Stylistic traits such as character size, slant and cursiveness vary between samples but stay consistent within each one, which suggests the network fixes these traits early and keeps them until the end.

Unbiased samples are often hard to read, and the mistakes include missing, confused or garbled letters, with more mistakes when rare words or phrases appear in the character sequence. Biased sampling is motivated by the expectation that good handwriting is smoother and more predictable, and so is more probable under the network, so favouring probable outputs should make samples easier to read.

The heuristic works one step at a time and does not search for high-probability sequences as a whole, which would be a harder inference problem.

As the bias increases, the samples lose diversity and move toward a kind of average handwriting that is very regular and easy to read, though letters are still not written the same way at different points in a sequence. A bias of 0.15 is described as giving a good balance between diversity and legibility.

Priming uses real training sequences as the start of a sample, and the sampled lines that follow do not appear in the training set; the samples are selected for legibility. Priming with a probability bias of 1 is shown for further samples, and those lines likewise do not exist in the training set. Priming on a real writer's sequences is presented as a way to model the style of that writer.

The author ran informal blind taste tests during presentations, and at least some unbiased samples could not be told apart from real handwriting by eye. These tests were carried out by the author during presentations rather than as a controlled study, so they are not a measured rate of indistinguishability.

Limits of the evidence

The word-level network has many more parameters than the character-level network, so the Penn Treebank comparison between them is somewhat unfair, and the study does not establish whether the character-level model would benefit from more weights. Adaptive weight noise was judged prohibitively slow for the word-level network, so that network was regularised only with fixed-variance weight noise.

The handwriting synthesis experiments use a 57-character subset, with other characters replaced by a generic non-letter label, so the trained model does not cover the full 80-character transcription set. The human check is an informal taste test, and the study reports the mistakes that remain, which include garbled letters and degraded samples for rare words.

Applying the approach to speech synthesis is left as future work and is not tested here.

Paper info

Authors
Alex Graves
Venue
arXiv · Preprint
First published
2013-8-4
Added
2026-11-12
Updated
2014-6-5
Version
v5
arXiv
1308.0850
Category
cs.NE · 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

Alex Graves (2013). Generating Sequences With Recurrent Neural Networks. arXiv:1308.0850v5. https://arxiv.org/abs/1308.0850v5

BibTeX
@misc{graves2013generating,
  title = {{Generating Sequences With Recurrent Neural Networks}},
  author = {Alex Graves},
  year = {2013},
  eprint = {1308.0850},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1308.0850v5}
}

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