Elamur Research

Generating Sequences With Recurrent Neural Networks

Paper · 2013 · Alex Graves

Summary

A pen can lift from a half-written word and return to dot a letter several strokes later. A closing quotation mark can be separated from its opening by a stretch of otherwise ordinary text. In both cases the next action depends on something that happened well before the immediately preceding step. This paper asks how much of that structure a recurrent neural network can reproduce by learning to predict one observation at a time. It uses Long Short-Term Memory, or LSTM, a way of giving the network an internal state whose contents can persist. During training, the network sees recorded sequences. To generate a new sequence, it draws from its prediction and treats the result as the next observation. Each draw can change the course of everything that follows.

The paper uses the same recurrent design with different kinds of predictions. For text generation, the network assigns probabilities to discrete choices. Word prediction gives better Penn Treebank results than character prediction, with a smaller reported gap after regularisation, which is used to reduce overfitting. The character predictor has far fewer weights and can assemble strings outside a fixed word inventory. A larger network generates Wikipedia-like material a byte at a time. Among its outputs are plausible spellings, paired punctuation, nested markup and extended stretches that resemble distinct parts of an article. The paper finds sensible language chiefly in short phrases. The longer stretches show persistence in format and vocabulary.

For handwriting, the network predicts a pen displacement together with a flag indicating the end of a stroke. With pen records alone, it learns to produce recognisable letters and some short words. To make it write supplied text, the paper adds a moving window over the requested characters. The network controls the location and spread of this window as it writes. Training gives it the transcription of each line, while the correspondence between individual characters and pen movements emerges from the task of predicting the trace. The generated lines vary in size, slant and connectedness, and often preserve those traits throughout a sample.

Two changes to sampling give the writer some control after training. Concentrating the distribution of pen movements makes the writing more regular and usually easier to read, while reducing variety. The paper shows a bias of 0.15 as a useful balance in its examples. Feeding the network a fragment of real writing before asking for a continuation can carry aspects of the fragment’s style into the new text. The handwriting evidence comes from validation measurements and visual demonstrations. The experiments use the original test partition for training, and the judgements of realism are mostly informal. Unusual strings cause more writing errors, so realistic pen movements and reliable reproduction of the requested letters remain distinct outcomes.

Deep dive: Generating Sequences With Recurrent Neural Networks

See how recurrent networks with LSTM memory generate text and pen movements, and learn to follow a requested line of handwriting. · about 80 minutes to read

The problem and its context

When predictions become part of the history

A recurrent predictor processes a stream in order. It receives an observation, updates its state and uses that state to anticipate what comes next. In a stream of recorded data, the next observation arrives from outside the network. A poor prediction can be followed by an entirely ordinary input that helps the network recover. Generation changes who supplies that input. Once the predictor starts producing its own stream, a sampled observation changes the state from which the next prediction will be made. A short interval of implausible output can therefore affect a much longer continuation.

There is a difference between uncertainty and loss of control here. In handwriting, several next movements may be reasonable after the same prefix. Drawing from an appropriate distribution is a way to turn that uncertainty into variation. Trouble begins when the resulting sequence leaves the kinds of histories the network learned to handle. In a continuous trajectory a small succession of plausible-looking displacements can lead the pen to a position from which the local pattern is hard to interpret. If the predictor still retains some information about the earlier stroke or the broader line, it has something else to use when deciding how to continue.

The paper makes memory central to this argument. It describes ordinary recurrent networks as flexible in principle but difficult to train to retain and use faraway evidence. Every observation can affect the recurrent computation, yet the practical question is whether the information survives intervening steps in a form that later predictions can use. The paper presents better memory as a means to sustain a sequence as well as a means to improve individual forecasts. It mentions adding noise to feedback as another response explored in earlier work. Noise can expose a predictor to surprising inputs. LSTM addresses the separate problem of keeping useful information accessible as those inputs arrive.

The history is also the source of each prediction’s specificity. The same current character can signal different things in a heading and in an ordinary sentence. The same small pen movement can belong to a rising lead-in stroke or to a mark that is almost finished. A recurrent state lets those two situations produce different distributions even when the latest observation is identical. The paper asks whether the network can learn such distinctions at a scale that reaches beyond adjacent observations. This gives the work a testable consequence in its samples. A generator that retains the larger situation should sometimes bring a structure to an appropriate close or continue a recognisable style after the evidence that established it has passed.

What previous generators supplied

The paper places the sampling loop in a line of recurrent generation work on music, text and captured movement. The underlying idea was already available. Learn a conditional prediction from recorded examples, then use sampled predictions as the observations of a new sequence. The task here is to make that loop work with structures whose relevant history can be long. LSTM already had a record in recognition tasks, including speech recognition with deep recurrent neural networks. In recognition, a recorded signal remains available throughout the processing. Generation places the memory in a loop where the network’s decisions also shape the signal it sees.

The author compares recurrent prediction with an n-gram and with Prediction by Partial Matching, a coding approach based on matching recent strings against earlier material. Counts from exact contexts can be informative when those contexts recur. With multiple real coordinates, exact recurrence becomes a much less practical basis for sharing evidence. Slightly different movements can still serve the same function in a letter. A network uses a learned internal representation to share predictive behaviour across histories that need never occur in identical form.

That property matters for producing something new. A word assembled from characters need never have appeared as a complete string. A handwritten stroke can take an intermediate path among similar paths in the training data. Both are possible because the generated observation is chosen from a distribution derived from the state. The paper presents this flexibility as an advantage for synthesis. The same flexibility leaves room for sequences that merely resemble real examples in pieces. Judging the output then requires asking which regularities survive the process of assembling those pieces.

Earlier neural text work had already examined prediction at character granularity and reported somewhat weaker results than comparable word prediction. Word-based prediction has a practical attraction because an entire lexical item becomes available at each step. It comes with a dictionary and an output calculation over that dictionary, which the paper describes as costly for large vocabularies. Earlier work considered tree structures, low-rank approximations and the stochastic training approach in A Fast and Simple Algorithm for Training Neural Probabilistic Language Models. This paper is interested in a further question raised by the choice of units. A generator that emits smaller units can produce spelling variants, unfamiliar names and other strings whose complete forms could not be listed in advance.

Why these two kinds of data make different demands

A language model assigns probabilities to continuations of text. A word is one possible unit of continuation. Characters and bytes push the unit of observation below the level at which many recognisable patterns occur. Spelling now requires a succession of decisions. A pair of delimiters can span far more decisions, and markup can create dependencies between openings and closings that have several other structures between them. Raw encyclopedia data puts prose beside addresses, headings and machine-readable document material. Generating it therefore tests the persistence of several different kinds of pattern in the same stream.

Online handwriting also unfolds at a granularity smaller than its familiar units. Here online refers to recording the path of the pen as it is written. An image of the finished line, called offline handwriting in the paper, supplies a different kind of observation. A trace gives successive positions and indicates where the pen left the surface. It can be drawn for inspection, and the path also reveals temporal decisions hidden by the final image. A dot may have been added well after the rest of the letter. A mark that looks close to another mark on the page may have been made much later.

The pen coordinates make this a continuous prediction problem. For a text symbol, the alternatives can be enumerated, and the network can assign a probability to each one. For movement, two coordinates can vary together, and a single history can support several plausible destinations. Between strokes the recording gives no intermediate positions, so the next recorded point can be far from the current one. The paper uses a distribution broad enough to express several alternatives and flexible enough for both coordinates to matter jointly. This choice puts uncertainty in the prediction itself, where it can be used when drawing a new movement.

The handwriting design also reflects what the paper wants the generator to preserve. A preprocessing pipeline that standardises slant or size can simplify tasks in which the important output is a letter identity. Here slant and size are part of what makes one sample differ from another. The aim is to learn these variations from traces while still letting a line have a consistent appearance. Pointwise generation gives the system room to vary how a letter is formed, how far a stroke travels and how letters connect. It also lengthens the interval over which the predictor must coordinate those choices.

A transcription leaves the timing open

A network that generates a convincing handwriting trace from pen history alone has no user input specifying an intended sentence. Adding a transcription changes the task. A string of characters gives the required contents, but its positions do not come with timestamps. A character can take a different number of pen observations depending on how it is written. The network has to coordinate progress along the string with progress along a trajectory whose timing emerges as it generates.

The paper discusses Sequence Transduction with Recurrent Neural Networks, an earlier approach that deals with sequences of different lengths and unknown alignment. Preliminary attempts to use that approach for synthesis were unpromising. The author suggests that keeping the two streams in separate recurrent networks before combining their outputs might be less suitable here than giving the pen predictor access to both. That explanation is offered as a possibility. It motivates a design in which the current pen history can affect which part of the transcription supplies information at that step.

Providing the entire requested string with equal emphasis at every movement would leave the network to work out which part matters and how far it has progressed. Assigning fixed durations to characters would supply an alignment before the variation in writing has a chance to determine one. The proposed window gives progress a state of its own. It can stay close to a character for the movements needed to draw it, move forward as the trace develops and give some weight to neighbours during a transition. Because the weights vary smoothly with the window’s parameters, the error signal from predicting the pen can also train the mechanism that selects text.

The method, step by step

Read the latest observation and update the recurrent stack

The basic predictor has a repeated computation at each timestep. The current observation travels directly to each hidden layer. A hidden layer also uses its own previous output, and layers above the bottom receive the current output from their immediate neighbour below. The network combines the current hidden outputs into a prediction for the next observation. The calculations for a given history are deterministic. Variation enters when the sampling procedure chooses one outcome from the distribution and supplies it on the next step.

The recurrent prediction and generation loop

The steps in order.

The recurrent prediction and generation loopStep 1: Receive the current symbol or pen observation1. Receive the current symbol or pen observationStep 2: Update the first recurrent memory layer2. Update the first recurrent memory layerStep 3: Read any supplied text through a soft window3. Read any supplied text through a soft windowStep 4: Update higher layers with the available inputs4. Update higher layers with the available inputsStep 5: Build a distribution for the next observation5. Build a distribution for the next observationStep 6: Score the recorded target during training6. Score the recorded target during trainingStep 7: Feed back a sampled observation during generation7. Feed back a sampled observation during generation

At the bottom of the stack, the update has the following form.

h[1,t] = H(W[x→1] x[t] + W[1→1] h[1,t−1] + b[1])

Here t is the current time index and t−1 is its predecessor. The vector x[t] is the current input and h[1,t] is the output of the first hidden layer. W[x→1] multiplies the input vector and W[1→1] multiplies that layer’s preceding output h[1,t−1]. Each W is a learned weight matrix, with its arrow showing the source and destination of the connection. The bias b[1] adds a learned vector. H denotes the hidden-layer operation. In this paper it is a recurrent LSTM operation with an additional cell state, which the compact stack notation leaves implicit.

h[n,t] = H(W[x→n] x[t] + W[n−1→n] h[n−1,t] + W[n→n] h[n,t−1] + b[n])

The index n identifies a layer above the first. The same-time output h[n−1,t] comes from the layer below and reaches layer n through W[n−1→n]. The recurrent matrix W[n→n] carries the previous output h[n,t−1] of layer n back to that layer. W[x→n] and b[n] are its direct input matrix and bias. H, x[t] and t retain their earlier meanings. The recurrence thus runs along time inside each layer and up the stack inside each timestep.

r[t] = bᵧ + ∑_{n=1…N} W[n→y] h[n,t]

The vector r[t] contains the raw outputs before the transformations that make them distribution parameters. The index n ranges over the N hidden layers, h[n,t] is layer n’s current output, and W[n→y] maps that output to the prediction layer, denoted by y in the connection label. The sum adds the weighted vectors and the output bias bᵧ adds a baseline. This gives each recurrent layer a direct route to the prediction. The paper motivates the corresponding direct input and output connections as a way to shorten paths along which the training signal can weaken.

y[t] = F(r[t])

Here F is the output transformation, r[t] is the vector of raw outputs at time t, and y[t] contains the parameters used for prediction at that step. The recurrent stack can be specified independently of the observation type because F and the choice of distribution supply the adaptation to text or pen movement.

Build a sequence probability out of next-step predictions

The prediction convention starts a sequence with an all-zero input. The first distribution can therefore be formed before an actual observation is supplied. For each later prediction, the recurrent state already reflects the observations processed so far. When the clock advances, the next real observation becomes an input during training and a sampled observation takes that place during generation.

P(X) = ∏_{t=1…T} P(x[t+1] ∣ y[t])

X denotes the scored sequence, P(X) is the overall probability assignment, and ∏ multiplies the successive conditional factors. The index t runs over the T prediction steps in the notation. x[t+1] is the observed or proposed next input and y[t] specifies its distribution given the available history. The input at the start is the null vector. In the continuous case the factors refer to a density for movement and a probability for the binary observation.

L = −∑_{t=1…T} log P(x[t+1] ∣ y[t])

Here L is the sequence loss, log is the natural logarithm in this objective, and ∑ adds the terms across time. T, t, x[t+1], y[t] and the conditional factor have the same meanings as in the product. Taking logs makes the training objective additive across steps. An observed symbol given a small probability makes a large contribution to the loss, even if the predictor gave high probability to a neighbouring symbol or correct guesses elsewhere in the sequence.

Back-propagation through time computes how this loss depends on the network’s weights. The computation is traced backward through the copies of the recurrent layer used at successive timesteps. A single matrix participates many times, so the loss can reach that matrix through several different paths. This is how a prediction made well into a sequence can train a weight that also shaped the state earlier in it. The resulting derivatives drive gradient-based updates, with different training settings for text and handwriting.

The Wikipedia training procedure illustrates why a gradient path and a forward history must be kept conceptually distinct. Hidden outputs and cell contents can be passed onward as numerical values when a new segment begins. The subsequent predictions use those values even if the computation used to produce them is outside the backward pass for the new segment. The loss then trains through a shorter section of the recurrent history. The paper uses this truncated gradient to keep updates manageable while preserving a longer span of context for predictions. Its choice depends on keeping adjacent segments in their original order.

Give the hidden computation a cell state

The version of LSTM used in the paper maintains a cell state alongside the hidden output. The cell state can keep part of its previous value and add fresh content. Three gates control the amount of proposed content to add, the amount of existing content to keep, and the amount of updated content to expose. This supplies a route through time whose behaviour depends on what the gates have learned to do with a particular input. For the following equations, the layer index is suppressed, and a[t] denotes the time-dependent input provided to the layer apart from its recurrent feedback.

i[t] = σ(W[a→i] a[t] + W[h→i] h[t−1] + W[c→i] c[t−1] + bᵢ)

The input gate i[t] is a vector of coefficients that scale newly proposed cell content. σ is the logistic sigmoid, which places each coefficient between zero and one. a[t] is the current layer input, h[t−1] is its preceding hidden output and c[t−1] is its previous memory state. The matrices W[a→i], W[h→i] and W[c→i] map those vectors into the input gate. The vector bᵢ is its bias. The connection from c is diagonal, so a cell coordinate influences the corresponding gate coordinate directly.

f[t] = σ(W[a→f] a[t] + W[h→f] h[t−1] + W[c→f] c[t−1] + b𝒇)

Here f[t] is the forget gate. The same types of inputs reach it at time t through its own three matrices, W[a→f], W[h→f] and W[c→f], and b𝒇 is its bias. The sigmoid σ makes the gate a set of scaling factors. A coordinate near one leaves much of the corresponding preceding cell value available. A coordinate near zero strongly attenuates it. That lets different coordinates preserve information over different spans, depending on what the gate computes along the way.

c[t] = f[t] ⊙ c[t−1] + i[t] ⊙ tanh(W[a→c] a[t] + W[h→c] h[t−1] + b𝒄)

The vector c[t] is the updated cell state and ⊙ means multiplication coordinate by coordinate. The forget gate f[t] scales the old state c[t−1]. The input gate i[t] scales the candidate update formed from a[t] and h[t−1] by W[a→c] and W[h→c], with bias b𝒄. tanh, the hyperbolic tangent, bounds each candidate coordinate in magnitude. The addition is important. Information can survive along the retained part of the state while a separate term introduces information from the new observation.

o[t] = σ(W[a→o] a[t] + W[h→o] h[t−1] + W[c→o] c[t] + bₒ)

The output gate o[t] uses the current input a[t], the prior hidden output h[t−1] and the updated state c[t]. Its three matrices connect these quantities to the gate and bₒ supplies its bias. The sigmoid σ again makes a vector of scaling coefficients. Because W[c→o] is diagonal, the gate can use the newly updated value of the corresponding cell coordinate in deciding how much to expose.

h[t] = o[t] ⊙ tanh(c[t])

Here h[t] is the layer’s visible output, o[t] is the output gate, c[t] is the current cell state, and ⊙ and tanh act coordinate by coordinate. The hidden output can be small even while the corresponding memory value is retained for a later step. This matters when evidence has to be carried through a stretch in which it contributes little to immediate predictions. The equations permit that behaviour. Whether it emerges depends on the learned gates and the sequences used to train them.

The paper uses the full recurrent gradient within each backward segment in place of the approximate, per-step update procedure used in the original LSTM algorithm. Large derivatives can still cause numerical trouble. In these experiments the author clips derivatives with respect to the inputs to the LSTM nonlinearities, meaning that values beyond the chosen range are replaced by the appropriate boundary. Handwriting training also applies clipping at the raw outputs. The paper mentions that LSTM input-derivative clipping was already present in the author’s publicly available LSTM code.

Give text a discrete output distribution

Each text unit is encoded with a one-hot vector. The entry for the observed unit is one and all the other entries are zero. Switching from words to characters or bytes changes the inventory used for this representation and the number of alternatives at the output. The output transformation is softmax. It exponentiates the raw scores and divides each resulting value by their sum.

P(x[t+1] = k ∣ y[t]) = y[t,k] = exp(r[t,k]) / ∑_{q=1…K} exp(r[t,q])

The class k is one possible text unit, K is the inventory size and q runs over all the alternatives. The function exp is the exponential. The raw score for class k at time t is r[t,k], and its predicted probability is y[t,k]. In the event on the left, x[t+1] denotes the class identity of the next observation. Every class has a positive term and the division sets their sum to one.

L = −∑_{t=1…T} log y[t,kₜ₊₁]

Here L is the text loss, kₜ₊₁ is the recorded next class, and y[t,kₜ₊₁] is the probability assigned to that class at time t. The sum covers T scored predictions and log is the natural logarithm. Even though the loss reads only the observed class’s probability, all the raw scores affect that probability through the common denominator.

∂L/∂r[t,k] = y[t,k] − δ(k,kₜ₊₁)

The symbol ∂ denotes a partial derivative. The indicator δ is one when class k equals the recorded class kₜ₊₁ and zero otherwise. r[t,k] is the raw score and y[t,k] its probability. This derivative asks for an increase in the observed class’s score to the extent that its probability falls short of one, and supplies a downward pressure on competing scores according to their probabilities.

In generation the inventory determines which choices are available at any given step. A word-based predictor samples one item from the dictionary. A character-based predictor samples a symbol that can participate in many different words. In the Wikipedia system, a sampled byte may be a fragment of the representation of a displayed character. Producing the visible unit then requires a compatible continuation at the byte level. The predictor has to learn those continuations from sequences. The output layer supplies a distribution over the same inventory throughout, whether it is currently generating prose or a stretch of markup.

Express uncertainty over the next pen movement

A pen input contains horizontal and vertical offsets from the preceding recorded point and a binary flag marking the end of the current stroke. The displacement concerns where the next point is located relative to the current one. The flag attached to that next point concerns whether the pen leaves the surface after reaching it. These events can have different kinds of uncertainty, so the paper represents them with separate factors in the prediction. The continuous part is a mixture of bivariate Gaussian densities. The binary part is a Bernoulli distribution, meaning a distribution for an event that either occurs or does not.

y[t] = (e[t], {π[t,j], μ[t,j], s[t,j], ρ[t,j]}_{j=1…M})

Here e[t] is the end-of-stroke probability for the next observation. The other entries describe M Gaussian components indexed by j. A component has mixture weight π[t,j], mean μ[t,j], standard-deviation vector s[t,j] and correlation ρ[t,j]. The mean and standard deviation have one entry for each movement axis. The weight and correlation are scalars. This allows a component to describe a region of possible destinations with its own orientation and spread, while the mixture weight controls how often that region is chosen relative to the others.

The raw numbers for these parameters come from the same sum of projected hidden outputs used for text. Each channel is then transformed to give it the appropriate range.

e[t] = 1 / (1 + exp(rₑ[t]))

rₑ[t] is the raw stroke-ending output at time t and e[t] is its probability. The exponential uses a positive sign on the raw score, so increasing this score decreases the probability. This convention is reflected in the sign of the loss derivative.

π[t,j] = exp(rπ[t,j]) / ∑_{q=1…M} exp(rπ[t,q])

The raw score rπ[t,j] belongs to component j, and q enumerates all M components. The exponential exp makes positive values, and the softmax denominator turns them into weights π[t,j] with a total of one for each time t.

μ[t,j] = rμ[t,j]

The raw vector rμ[t,j] is used directly as the mean μ[t,j] for component j at time t. Its entries can be any real displacement values.

s[t,j] = exp(rs[t,j])

The scale vector s[t,j] is the coordinatewise exponential of the raw vector rs[t,j]. Here t and j still identify the prediction step and mixture component. Each resulting standard deviation is positive.

ρ[t,j] = tanh(rρ[t,j])

The scalar rρ[t,j] becomes the correlation ρ[t,j] at time t in component j. The hyperbolic tangent keeps it strictly between negative one and positive one. Varying correlation changes how a component associates horizontal movement with vertical movement.

The joint prediction evaluates the next displacement under all the Gaussian components and multiplies by the appropriate binary probability.

P(x[t+1] ∣ y[t]) = B(z[t+1]; e[t]) ∑_{j=1…M} π[t,j] G(d[t+1] ∣ μ[t,j], s[t,j], ρ[t,j])

The observation x[t+1] comprises displacement d[t+1] and observed stroke flag z[t+1]. B is the Bernoulli factor. It supplies e[t] for a stroke ending and its complement otherwise. G is the Gaussian density evaluated at d[t+1] using the mean, scale and correlation of the indicated component. Each π[t,j] is the corresponding mixture weight in y[t]. With the history fixed, the product treats the flag and displacement as separate draws from distributions determined by the same recurrent state. The flag already in the input history can affect the shape of the next movement prediction.

G(d ∣ μ,s,ρ) = exp(−Z / (2(1−ρ²))) / (2π s₁ s₂ √(1−ρ²))

Here d is a displacement pair, μ is the pair of means, s supplies standard deviations s₁ and s₂ along the two axes, and ρ is the correlation. The symbol π in the denominator is the mathematical constant. √ is the positive square root and exp is the exponential. Z is the following measure of displacement from the mean after accounting for scale and correlation.

Z = (d₁−μ₁)²/s₁² + (d₂−μ₂)²/s₂² − 2ρ(d₁−μ₁)(d₂−μ₂)/(s₁s₂)

The subscripts identify the horizontal and vertical coordinates. The first two terms use squared differences from the respective means, measured relative to the relevant scale. The last term combines the coordinate deviations using the correlation ρ. It allows a movement with departures along both axes to be relatively likely when those departures follow the direction favoured by the component.

L = −∑_{t=1…T} [log (∑_{j=1…M} π[t,j] G(d[t+1] ∣ μ[t,j],s[t,j],ρ[t,j])) + log B(z[t+1];e[t])]

L is the handwriting sequence loss, T is the number of prediction steps, and t and j index time and the M mixture components. The first log concerns displacement d[t+1], evaluated through the weighted Gaussian densities G. The second concerns the observed flag z[t+1], evaluated through B at probability e[t]. The gradient is unchanged by the additive constant associated with quantisation of the recorded positions. Comparing likelihoods for the same representation consequently lets the paper assess the predictive distributions under a common convention.

For a generated point the sampler can first choose a component using its weights, then draw a displacement from that component. It draws a stroke flag from the predicted binary distribution. Feeding back the triple gives the network information about what it actually drew and whether that point ended a stroke. The sampled displacement can be added to the current pen position to obtain a location for drawing. A jump after a stroke ending describes where the next mark begins, with the interval while the pen was lifted absent from the recording.

Work out which component explained the observed point

A component’s mixture weight records the network’s preference before the next point is observed. Once the training example supplies that point, the component’s density there determines how much it helps explain the observation. A component that had a high weight but placed its density far from the observed movement may contribute less than a component that had a modest weight and fits the movement well.

v[t,j] = π[t,j] G(d[t+1] ∣ μ[t,j],s[t,j],ρ[t,j])

The value v[t,j] is component j’s weighted contribution to the observed displacement at step t+1. The current weight π[t,j] multiplies the density G at d[t+1], using the current component parameters μ[t,j], s[t,j] and ρ[t,j].

γ[t,j] = v[t,j] / ∑_{q=1…M} v[t,q]

The responsibility γ[t,j] is the share attributable to component j. The sum runs over contributions v[t,q] from all M components, indexed by q. This is a calculation conditioned on seeing the observed movement. The weights used to draw a sample before seeing any movement are the π values.

∂L/∂rπ[t,j] = π[t,j] − γ[t,j]

Here L is the sequence loss, rπ[t,j] is the raw mixture score, π[t,j] is the weight before observing the movement and γ[t,j] is the component’s responsibility after observing it. The derivative increases with the excess of the predicted weight over that responsibility.

∂L/∂rθ[t,j] = −γ[t,j] ∂log G(d[t+1] ∣ μ[t,j],s[t,j],ρ[t,j])/∂rθ[t,j]

The symbol rθ[t,j] stands for a raw mean, scale or correlation output of component j at time t. The partial derivative of the log density G for the observed displacement d[t+1] specifies how that component responds to the parameter. Its responsibility γ[t,j] scales the result in the derivative of L, with the minus sign coming from minimising negative log likelihood. The component parameters μ, s and ρ in G are the transformed values from the output equations.

∂L/∂rₑ[t] = z[t+1] − e[t]

The stroke flag z[t+1] is the target, e[t] is the predicted probability, and rₑ[t] is the raw output that controls it. The ordering on the right follows from the decreasing transformation of rₑ[t]. The binary term therefore supplies a training signal even when the observed displacement is well explained by the mixture.

The Gaussian derivatives can be written compactly by defining a standardised residual and a correlation factor.

aᵢ = (dᵢ−μᵢ)/sᵢ

Here i selects a displacement axis. The observed movement dᵢ is centred using the component’s mean μᵢ and divided by its standard deviation sᵢ. The result aᵢ measures the residual in units of that component’s scale.

C = 1 / (1−ρ²)

The quantity C depends on the component correlation ρ. It is the reciprocal of the factor that enters the Gaussian’s correlated quadratic term.

∂log G/∂rμ₁ = (C/s₁)(a₁−ρa₂)

The derivative concerns the raw horizontal mean rμ₁ of density G. The horizontal standard deviation is s₁, the residuals are a₁ and a₂, the correlation is ρ and C is its factor above. With correlation, vertical error can influence how the horizontal mean should move.

∂log G/∂rμ₂ = (C/s₂)(a₂−ρa₁)

This is the derivative of the same component log density with respect to the raw vertical mean rμ₂. Now s₂ is the vertical scale and a₂ is the direct residual. The horizontal residual a₁ enters through ρ, with C again scaling the expression.

∂log G/∂rs₁ = C a₁(a₁−ρa₂) − 1

Here rs₁ is the raw horizontal scale, before the exponential that gives s₁. The terms a₁, a₂, ρ and C belong to the same displacement and component. The subtraction accounts for the normalisation of the density, which also changes when the scale changes.

∂log G/∂rs₂ = C a₂(a₂−ρa₁) − 1

The raw vertical scale rs₂ has the analogous derivative, in which the direct residual is a₂ and the correlation associates it with a₁. G, ρ and C have the same meanings as before. The scale derivatives balance covering the observed point with concentrating density into a smaller region.

∂log G/∂rρ = a₁a₂ + ρ(1−CZ)

Here rρ is the raw correlation output before the hyperbolic tangent. a₁ and a₂ are the standardised residuals, ρ is the transformed correlation, C is the reciprocal correlation factor and Z is the quadratic expression in the density. The formula incorporates the effect of the hyperbolic tangent when the gradient is taken with respect to the raw output.

Update handwriting weights using recent derivative statistics

The handwriting experiments use rmsprop in a form with momentum and an estimate based on both the running squared gradient and the running signed gradient. The aim is to regulate how far a weight changes when its recent derivatives have different magnitudes from those of other weights. The gradients here come from the sequence loss after back-propagation through the output and recurrent layers.

εᵢ = ∂L/∂wᵢ

The index i names a network weight wᵢ, and εᵢ is its partial derivative of the sequence loss L.

nᵢ ← a nᵢ + (1−a) εᵢ²

The arrow indicates replacement of the running statistic nᵢ by a weighted average of its previous value and the current squared gradient. a is the averaging coefficient and εᵢ is the derivative for weight i.

gᵢ ← a gᵢ + (1−a) εᵢ

The statistic gᵢ tracks the signed derivative instead of its square. It uses the same coefficient a and weight index i.

Δᵢ ← m Δᵢ − η εᵢ / √(nᵢ−gᵢ²+d)

The increment Δᵢ retains part of its previous value according to the momentum m. The coefficient η sets the scale of the new descent term, with εᵢ divided by the square root of a recent variation estimate formed from nᵢ and gᵢ. The constant d stabilises the denominator.

wᵢ ← wᵢ + Δᵢ

The weight wᵢ is updated by the newly computed increment Δᵢ. In the handwriting experiments the averaging coefficient was 0.95, the momentum was 0.9, the learning-rate coefficient was 0.0001 and the denominator constant was 0.0001. The paper also retrains some networks with adaptive weight noise. The noise scale can be learned along with the weights using a variational objective associated with minimum description length.

Read a short passage of the transcription at each step

Synthesis preserves the pen inputs and output distribution. It adds the requested text as a second source of information inside the recurrent computation. Imagine a set of overlapping windows placed along the string. The network can adjust how strongly each window contributes and how much neighbouring text it covers. It can also slide each window forward. A position near a boundary can give substantial weight to the character being completed and the character that is about to influence the next stroke.

φ(t,u) = ∑_{k=1…K} α[t,k] exp(−βt,k²)

The weight φ(t,u) describes the contribution of text position u at pen step t. The index k ranges over K Gaussian-shaped window components. Their amplitudes are α[t,k], their inverse-width parameters are β[t,k], and their centres along the string are κ[t,k]. The exponential weights positions more heavily when they are close to the centre. A larger β[t,k] causes a faster drop with distance. Each centre can lie between character positions.

v[t] = ∑_{u=1…U} φ(t,u) c[u]

Here v[t] is the vector returned by the window at time t. The transcription has U positions, and c[u] is the one-hot character vector at position u. The coefficient φ(t,u) multiplies the whole vector for that character. Summing leaves one entry per character type in the inventory. Occurrences of the same character at different positions can contribute to the same entry. The weights are unnormalised, so the magnitude of the vector can vary as well as the relative emphasis it gives the characters.

(rα[t], rβ[t], rκ[t]) = W[1→p] h[1,t] + bₚ

The first hidden layer’s current output h[1,t] produces the three raw parameter vectors through matrix W[1→p] and bias bₚ. The destination p denotes the window-parameter output. rα[t], rβ[t] and rκ[t] each hold one raw value per window component at time t. In particular, rκ[t] encodes a change of position.

α[t,k] = exp(rα[t,k])

The amplitude α[t,k] is the exponential of the raw strength rα[t,k] at time t for component k. This makes each contribution positive.

β[t,k] = exp(rβ[t,k])

The inverse-width coefficient β[t,k] is the exponential of the corresponding raw output rβ[t,k]. Its positivity ensures the window weight falls with squared distance from the centre.

κ[t,k] = κ[t−1,k] + exp(rκ[t,k])

The new centre κ[t,k] inherits the previous centre κ[t−1,k] and adds the positive step determined by rκ[t,k]. A very small increment lets the component stay close to the same character for a stretch of the trace. A larger increment moves it forward faster. The author reports that representing position through offsets was essential to getting the text and the trace to align.

Window construction is part of the same step as next-movement prediction. The first recurrent layer produces its output before the current window can be computed. It uses the previous window to avoid a circular dependency. The higher layers can receive the new one immediately.

h[1,t] = H(W[x→1] x[t] + W[1→1] h[1,t−1] + W[v→1] v[t−1] + b[1])

Here H is the LSTM operation, h[1,t] and h[1,t−1] are successive first-layer outputs, and x[t] is the current pen input. The window v[t−1] is from the preceding step. W[x→1], W[1→1] and W[v→1] are the corresponding learned connections into the first layer, and b[1] is its bias.

h[n,t] = H(W[x→n] x[t] + W[n−1→n] h[n−1,t] + W[n→n] h[n,t−1] + W[v→n] v[t] + b[n])

For a higher layer n, the same-time output h[n−1,t] comes from its neighbour below, and the preceding output h[n,t−1] comes from itself. W[n−1→n] and W[n→n] weight those connections. The current pen observation x[t] enters through W[x→n]. The current window v[t] enters through W[v→n]. H and b[n] are the layer operation and bias. The distribution for the following movement is formed from the hidden outputs as before, with the text now contributing through those outputs.

P(X ∣ A) = ∏_{t=1…T} P(x[t+1] ∣ y[t])

A is the supplied transcription and X is the corresponding pen trace. The product over T steps uses the density and stroke probability encoded by y[t] for the next recorded input x[t+1]. At each time t, y[t] depends on both the pen history and the window’s reading of A.

L = −log P(X ∣ A)

Here L is the synthesis loss and log is the natural logarithm of the conditional sequence assignment P(X ∣ A). The training signal still comes from recorded pen observations. The transcription says what the whole line contains, and the movement loss determines whether a particular placement of the reading window is helpful for predicting the trace.

Send the prediction error back into alignment

The window needs no supplied position labels because it is a differentiable part of the network. Back-propagation delivers a derivative for each entry of the vector returned by the window, reflecting its contribution to pen predictions. To get the derivative for one window component, the paper collects the contribution of each position of the string to that vector.

E(k,t,u) = α[t,k] exp(−βt,k²) ∑_{j=1…D} (∂L/∂v[t,j]) c[u,j]

Here E(k,t,u) is the contribution for component k, time t and text position u. The exponential and amplitude are the single component’s weight at that position. The index j ranges over the D entries of the window vector. The derivative ∂L/∂v[t,j] gives the loss sensitivity to entry j, and c[u,j] is that entry in the character vector at position u. For a one-hot character, the sum reads the sensitivity in the coordinate corresponding to that character.

∂L/∂rα[t,k] = ∑_{u=1…U} E(k,t,u)

The derivative of L with respect to raw amplitude rα[t,k] sums over the U positions u. Each contribution E(k,t,u) already includes the component’s current amplitude. This reflects the effect of the exponential parameterisation on the derivative.

∂L/∂rβ[t,k] = −β[t,k] ∑_{u=1…U} E(k,t,u)(κ[t,k]−u)²

The raw inverse-width output rβ[t,k] changes the coefficient β[t,k]. Its derivative weights each position’s contribution E(k,t,u) by squared distance from the centre κ[t,k], over all U positions. The minus sign follows from the negative distance term inside the exponential.

∂L/∂κ[t,k] = ∂L/∂κ[t+1,k] + 2β[t,k] ∑_{u=1…U} E(k,t,u)(u−κ[t,k])

The centre κ[t,k] affects the present reading through each signed difference between position u and the centre. The term with κ[t+1,k] passes back the derivative from the next centre, which inherits the current one. β[t,k] sets the degree of location sensitivity, E(k,t,u) supplies the loss contribution, and the sum runs over the U text positions. A choice about how far to advance can therefore be influenced by the usefulness of the later windows it makes possible.

∂L/∂rκ[t,k] = exp(rκ[t,k]) ∂L/∂κ[t,k]

The raw advance output rκ[t,k] affects the centre through an exponential increment. Its derivative is the derivative for κ[t,k] scaled by that same positive increment. The time and component indices t and k carry through both terms. Together these equations let the training loss influence the timing, spread and strength of the textual information used to draw the line.

Decide when to stop and how much variation to sample

The movement and flag distributions tell the synthesiser how to extend a line. The paper uses a separate heuristic to decide when the requested line is finished. It evaluates the same window function at the first position beyond the text.

φ(t,U+1) > φ(t,u)  for every u with 1 ≤ u ≤ U

Here φ is the sum of window contributions, t is the current pen step, U is the transcription length and u ranges through its real positions. U+1 is a position beyond the last character. Once that position receives greater weight than every in-text position, the current input is treated as the final point. The check uses progress of the window as evidence of completion. It supplies a practical end to sampling from the learned movement distribution.

The ordinary sampler draws from the predicted distribution at each step. The modified sampler biases the movement distribution towards concentrated outcomes, using a non-negative parameter b. There are two places where variation can enter a movement draw. The sampler first chooses a component, then chooses a point from it. The paper changes both choices with the same parameter.

s[t,j] = exp(rs[t,j]−b)

The standard deviations s[t,j] of component j at time t are recalculated from their raw values rs[t,j] with bias b subtracted before exponentiation. Each component’s spread contracts as the bias grows. Its mean stays at its predicted location.

π[t,j] = exp(rπt,j) / ∑_{q=1…M} exp(rπt,q)

The raw mixture scores rπ[t,j] for the M components are multiplied by the factor involving b before the softmax. The index q runs over the denominator’s components, and π[t,j] is the recalculated selection weight. The effect is to give a larger relative share to components the network already prefers. Zero bias recovers ordinary sampling. At very large bias, with a uniquely preferred component, the movement draw approaches that component’s mean. That conclusion concerns the modified Gaussian mixture at a single step. The formula still leaves a separate end-of-stroke draw, and the movement procedure makes local choices as the history evolves.

Priming uses a recorded line to influence that evolving history. The paper supplies the transcription of the real prefix first, followed by the new characters the user wants.

A′ = A ⧺ S

The new conditioning sequence A′ joins the real prefix’s transcription A to the desired continuation S, and ⧺ denotes concatenation. While processing the real prefix, the network receives the observed pen movements and stroke flags in order. It then starts drawing from its own distributions with the recurrent state and window progress accumulated during the prefix. A persistent trait of that prefix can affect later predictions through the same state that holds information needed for ordinary sequence continuation. Bias and priming can be used together because one changes the movement draws and the other sets the history from which the draws begin.

Experiments and results

Penn Treebank compares prediction units and evaluation protocols

The initial text experiments use the Wall Street Journal portion of the Penn Treebank. The training, validation and test splits contain 930,000, 74,000 and 82,000 words, respectively. The benchmark vocabulary is limited to 10,000 words, with a shared unknown-word token for items outside it. The experiment includes sentence-ending symbols in both the inputs and the loss. A sequence already receives a null vector at its start, so the separate sentence-start marker is omitted. These conventions define which events the measured predictions have to cover.

Both the word predictor and the character predictor have one hidden layer, which contains 1,000 LSTM units. The character network has 49 entries at the input and at the output and approximately 4.3M weights. The corresponding word layers have 10,000 entries apiece, with around 54M weights in the whole network. The recurrent width is matched. The total capacity and cost of prediction differ because the larger symbol inventory needs larger connections. The paper treats the comparison as preliminary, intended to gauge predictive performance, and points out that both networks can overfit the corpus.

Training uses stochastic gradient descent with learning rate 0.0001 and momentum 0.99. The LSTM input derivatives are clipped to the range from −1 to 1. To address overfitting, the fixed-noise runs perturb the weights at the beginning of each training sequence with noise of standard deviation 0.075. These runs start from weights already fitted without noise. The adaptive-noise experiments start from the fixed-noise weights, with a learned noise variance. The author reports that increasing regularisation through retraining is quicker than starting the regularised run from random weights. Adaptive noise was too slow to use on the word network, whose regularised results therefore concern fixed weight noise.

The test scores use bits per character and word perplexity. Bits per character represents the average number of base-two log loss units charged per character. For a character prediction, the contribution is obtained by taking the negative base-two logarithm of the assigned probability. The same reporting scale can express word-level loss after accounting for the number of characters. The paper uses an average test word length of about 5.6 characters in relating the two measures.

PPL ≈ 2^(5.6 × BPC)

PPL denotes word perplexity and BPC denotes bits per character. The coefficient 5.6 is the approximate average number of characters per test word. The base 2 converts a quantity in bits to the corresponding perplexity. Lower values on either scale mean that the predictor assigns greater probability to the recorded material under the relevant protocol.

The word network performs better, and regularisation narrows the apparent gap. The paper places the results alongside earlier test scores gathered in Mikolov’s account of language prediction. The chart reports those comparison results. Its starred setting is the strongest of the cited comparisons and pools several predictors.

Earlier systems cited for Penn Treebank test perplexity

The combination of recurrent, count-based and cache predictions achieves the lowest perplexity among these comparisons.

Earlier systems cited for Penn Treebank test perplexitySmoothed 5-gram: 141Smoothed 5-gram141Word-level feedforward predictor: 141.8Word-level feedforward predictor141.8PAQ8 compression algorithm: 131.1PAQ8 compression algorithm131.1Word RNN with dynamic evaluation: 123.2Word RNN with dynamic evaluation123.2RNN, 5-gram and cache ensemble (this paper): 89.4RNN, 5-gram and cache ensemble (thispaper)89.4
The numbers
System or settingperplexity
Smoothed 5-gram141
Word-level feedforward predictor141.8
PAQ8 compression algorithm131.1
Word RNN with dynamic evaluation123.2
RNN, 5-gram and cache ensemble (this paper)89.4

The table of comparisons in the paper’s discussion spans methods with different ways of using context. The fixed-weight protocol scores new text with the learned parameters held steady. Dynamic evaluation also lets the predictor update its weights as it goes. Observations are scored as they arrive and the test stream is traversed once, so the network can benefit on later observations from material encountered earlier in the same pass. This gives adaptive compression and recurrent prediction a more similar opportunity to respond to recently seen material.

The earlier ordinary word RNN in the comparison goes from test perplexity of 124.7 to 123.2 with dynamic evaluation. The paper describes the dynamic gains for its LSTM predictors as substantially larger and suggests that LSTM can adapt more rapidly. This is a statement about adaptation in a stream under the stated evaluation procedure. The fixed-weight network also uses previous observations through its recurrent activations, while dynamic evaluation adds changes to the persistent weights. Both mechanisms can affect the response to recent text, and the score depends on which mechanisms the evaluation permits.

Raw Wikipedia tests byte prediction over changing material

The Hutter Prize setup uses 100 million bytes of English Wikipedia data. The compression challenge includes the code needed to implement the compressor in the size of the submission. For the recurrent experiment, the first 96M bytes are used for training and the remaining 4M for validation. The material contains prose along with addresses, formatting marks, foreign text and XML. The byte inventory has 205 distinct values in the data, and there are 205 input and output entries. Some displayed characters are assembled from multiple units, which gives the system regularities to learn within those characters as well as across familiar text boundaries.

Training divides the stream into sequences of 100 bytes and keeps them in order. The recurrent state is reset every 100 sequences, giving predictions access to a history the paper describes as extending to 10K characters. Back-propagation stops at the start of each 100-byte training segment. The procedure allows the recurrent state to advance through material from the same article while making parameter updates with a shorter backward computation. The distinction is useful for this corpus because a split made for training convenience can fall inside the article, a section or a run of document markup.

The network uses seven layers with 700 LSTM cells each and has approximately 21.3M weights. The stochastic gradient descent learning rate is 0.0001, momentum is 0.9 and LSTM derivatives are limited to the range from −1 to 1. The paper reports convergence after four training epochs. Dynamic evaluation improves validation prediction substantially. The author suggests that vocabulary can become temporarily more useful when an article repeatedly draws on the same subject matter. The paper explains the unusually favourable dynamic validation performance compared with training in terms of underfitting and variations in the difficulty of different stretches of the corpus. Predictable XML can lower the average loss for a region that contains a great deal of it.

For context, the paper gives 1.28 BPC for a PAQ-8 variant on the full Hutter Prize compression task, including the code cost. It also reports 1.54 on held-out data for a character RNN applied to a text-only version and 1.47 when that predictor is combined with a maximum-entropy approach. Those figures have different material and coding conditions. The compression submission accounts for implementation size, while the cleaned-text comparison removes precisely the markup whose regularities are part of the byte-generation demonstration. The validation result for the paper’s own network belongs to the raw Wikipedia stream.

The generated sample makes visible things that a mean score would blend together. Individual strings have the shape of names and words, and punctuation and paragraph breaks occur with a rhythm that resembles the training material. The generator produces apparently plausible web addresses and text in several scripts. It also completes pairs of delimiters, repeats formatting marks in appropriate places and generates some nested XML structure. Opening and closing events are separated by intervening content, which makes their correspondence relevant to the paper’s case for recurrent memory.

There are broader changes in the appearance of the stream. Some passages resemble metadata, some resemble article prose and some resemble lists. Headings and lists can occur in roughly appropriate positions relative to the other material. The corresponding regions are frequently shorter and less cleanly organised than the regions in real Wikipedia. The author also sees echoes of recently encountered article subjects in the generated vocabulary. The sample thus gives evidence about formatting, the persistence of a local kind of text, and sensitivity to recent training. Its longer prose passages lose sense beyond short phrases, even where the surrounding document structure remains recognisable.

IAM-OnDB tests prediction of a real-valued trajectory

The handwriting experiments use IAM-OnDB, a database of lines from 221 writers who copied material from the Lancaster-Oslo-Bergen corpus on a whiteboard that tracked the pen with an infrared device. The original training split has 5364 lines from 775 forms. The validation partitions have 1438 lines from 192 forms and 1518 lines from 216 forms. The original test split has 3859 lines from 544 forms. The paper pools the original training and test splits with the larger validation partition for fitting. It uses the smaller validation partition to decide when to stop. Each line is processed as a separate sequence, making the learning and scoring units independent of any continuity between successive lines of a form.

Missing position readings are filled by interpolation and steps beyond a length threshold are removed. The experiments use pen offsets standardised with training-set mean 0 and standard deviation 1. The procedure retains differences such as slant and scale in the recorded writing. An average letter spans more than 25 timesteps, and a line spans around 700. The length makes a full line a demanding sample for the feedback loop. A letter completed by a later dot or cross gives a particularly concrete example of the gap between a visually local mark and the history relevant to making it.

The input size is 3, and the movement distribution has 20 Gaussian components. Its output requires 120 mixture parameters, consisting of 20 weights, 40 means, 40 standard deviations and 20 correlations. With the stroke-ending probability the output size is 121. The architectural comparison uses a single layer of 900 LSTM cells and a deeper network with three layers of 400 cells each. Both have around 3.4M weights. The deeper network is also retrained with adaptive weight noise starting from a standard deviation of 0.075. Fixed-variance noise proved ineffective for this task. The author suggests that precisely adjusted mixture-output weights may make the network sensitive to that form of perturbation.

Training uses the handwriting rmsprop procedure. The clipping ranges are from −100 to 100 for the raw output derivatives and from −10 to 10 for the derivatives entering the LSTM nonlinearities. Output clipping was crucial to numerical stability in these experiments. Some networks still developed numerical problems late in training, after overfitting had started. The training configuration and the validation-based stopping rule therefore form part of the conditions under which the reported results were obtained.

On the handwriting validation comparison, the three-layer predictor has an average sequence loss 15.3 nats lower than the single-layer predictor. The latter has a slightly lower sum-squared error. Adaptive noise lowers the deeper predictor’s loss by another 16.7 nats per sequence relative to the unregularised deeper network, with little change in squared error. A nat is the unit associated with the natural logarithm in the loss. The likelihood can improve when a distribution better assigns mass around the observed motions, even if the squared-distance measure hardly changes. The author judges the adaptive-noise predictor’s samples to be the best of the prediction-only variants.

The handwriting density illustration helps explain what the distribution contributes. During an ongoing stroke the next-location densities form small concentrations that trace the letters. After a stroke ends the densities spread out, reflecting the unobserved movement before the pen touches down again. The component-weight illustration shows different components becoming active at those boundaries. This is evidence that the mixture uses different portions of its capacity for tightly constrained continuation and uncertain relocation. In the generated sequences, all displayed prediction-only examples are 700 timesteps long. Recognisable letters and a few especially common short words appear alongside strings that look like plausible written forms.

A transcription improves prediction and gives sampling a target

Synthesis uses the same IAM-OnDB split arrangement and coordinate representation, now paired with character transcriptions. The full transcription inventory contains 80 characters. The experiment uses 57 labels, mapping digits and most punctuation to a generic non-letter label. This affects what can be expressly requested. For a position with that label the network may infer a suitable mark from context, or it may choose among possible marks while sampling. The one-hot transcription vectors and the window output have size 57.

The synthesis network keeps three layers of 400 LSTM cells, 20 Gaussian output components and a pen input size of 3. The window has 10 Gaussian functions, with a raw parameter vector of size 30 to describe their strengths, widths and advances. The network has approximately 3.7M weights. It uses the same rmsprop settings and derivative clipping as the prediction-only experiment. The adaptive-noise retraining starts with standard deviation 0.075. Keeping most settings similar gives the prediction and synthesis results a shared context, while the additional window increases the count of weights and supplies information about the target text.

Adaptive noise improves the synthesis validation log loss by around 31.3 nats, with no significant change in sum-squared error. The paper reports a 44% reduction in sum-squared error relative to the best prediction-only network. It attributes much of the improvement to pen relocations after stroke endings, where the next character can make a large difference to the location of the next point. In the density illustrations, predictions from the text-conditioned network form tighter regions, especially around those relocations. The window visualisation shows the weight moving through the transcription, spreading across neighbouring positions during transitions in the trace.

The examples with ordinary sampling include validation text whose complete lines were unseen during training. Generated lines differ visibly in character size, slant and degree of cursive connection, often retaining a recognisable combination of these properties from beginning to end. Some examples were difficult for observers in the author’s informal presentations to distinguish from actual handwriting. Other samples lose letters or produce confused shapes. The author observes a marked increase in mistakes for less common wording, which may reflect interference from the regularities in character sequences the network acquired during training.

The paper also shows how sampling changes the appearance of these outputs. Increasing the bias produces progressively more regular writing, with less diversity across samples. A bias of 0.15 is illustrated on the same validation texts used for ordinary sampling and is judged to offer an appealing compromise between variety and legibility. The examples with real prefixes use training sequences for priming. The continuations write lines absent from the training set, and the displays select for readability. Combining a real prefix with bias 1 yields examples with smoother, more even strokes that retain traits such as the prefix’s slant and connectedness. These comparisons bring the two sources of control into view. The recorded prefix changes the history carried forward into the new line, and the sampling bias changes how broadly each predicted movement distribution is explored.

What the ablations show

Depth changes the quality of the predicted distribution

The handwriting prediction experiment supplies the clearest comparison of network depth. Both systems see the same kind of pen history, use the same family of output distributions and have around 3.4M weights. The shallow system concentrates its recurrent computation in one wide layer. The deeper system distributes it across three narrower layers. Its average validation loss is 15.3 nats lower per handwriting sequence. The shallow system has a slight advantage on the validation sum-squared error. The two measurements therefore give different answers to the question of which architecture predicts better.

The difference matters because the system generates by drawing from a distribution. Squared error assesses a numerical forecast through its distance from the observed value. Log loss assesses the density assigned to the observed displacement, together with the probability assigned to the stroke flag. A distribution can improve on the latter measure by adjusting the spread, orientation or relative weight of its components. Those changes can occur with little movement in a point forecast. The deeper network’s lower loss establishes an improvement in how it scores recorded traces. The results do not identify which output parameters account for the improvement.

A stroke transition makes the distinction concrete. The last point of the old stroke may be followed by a point elsewhere on the line. If the history supports several possible landing places, a forecast that summarises the alternatives with a single location can lie between them. A mixture has room to put a separate concentration near each plausible landing place. Giving more weight to an appropriate concentration can improve the density at the observed point, even if the single location used for a squared-error comparison changes very little. The paper’s density illustration makes this interpretation plausible for handwriting. It does not compare the shallow and deep systems movement by movement, so it cannot attribute the measured gain from depth specifically to stroke transitions.

Holding the weight count approximately steady gives the depth comparison more force than a comparison in which the deeper system also has a substantially larger parameter budget. The intervention still involves several changes in how the computation is organised. The width of any given layer changes, and the stack adds intermediate representations with their own connections to the prediction. The result belongs to these arrangements of recurrent cells and connections on this dataset. It supports using the deeper arrangement for the density objective in the experiment. A different distribution of widths or a different output family would pose a new comparison.

There is also a difference between improving a forecast over recorded inputs and improving the trace that emerges from feedback. The validation loss evaluates a sequence of predictions made with actual pen observations. A generated line can pass through histories that occur less often in those observations. Better predictive density gives the sampler a better starting point for dealing with familiar histories. Its effect on unusual histories depends on how the learned predictions extend to them. The visual samples add a separate kind of evidence about that extension. The paper’s impression that the regularised deep system generates better writing concerns the appearance of those samples, while the depth comparison supplies its strongest numerical evidence about density.

Weight noise helps most clearly on log loss

The regularisation experiments ask whether a network that fits the recorded sequences closely will score new observations better if training allows its weights to fluctuate. In the Penn Treebank comparison, the author introduces fixed noise after fitting without it, and then fits a version with learned noise scales for the character predictor. This progression changes the training objective and begins each stage from a system that has already acquired some predictive ability. Observed differences between stages therefore describe the effect of the retraining procedure as a whole. They do not reveal how the respective objectives would compare if each run began from a fresh initialisation and had the same training budget.

The author finds the staged procedure faster than starting regularised training from randomly chosen weights. That is a practical observation about reaching a usable fit. The resulting comparison also helps interpret the gap between character and word prediction. The gap appears smaller with regularisation, so the ranking in the initial comparison reflects how the systems generalise under their particular training conditions as well as their choice of prediction unit. However, fitting adaptive noise was prohibitively slow for the word system. The character and word predictors therefore did not receive the same range of regularisation treatments. Those runs show that a compact character predictor can approach the word predictor more closely under some regularised settings. They leave open the size of the gap under a common, feasible treatment of both.

For handwriting prediction, the comparison with adaptive noise uses the deeper architecture before and after retraining. The average validation sequence loss improves by 16.7 nats relative to the unregularised deep predictor, with little apparent effect on the sum-squared error. The same separation between metrics appears when the synthesis network is retrained. Its validation log-loss improvement is around 31.3 nats, again without a significant change reported in squared error. The recurring pattern is that adaptive noise helps the density forecasts assign better scores to recorded traces. The paper offers no equivalent quantitative result for the quality of free-running samples. The author’s preference for the regularised synthesis samples is slight enough that the visual difference is described as hard to judge.

Fixed-variance noise was ineffective in handwriting prediction. The paper suggests that indiscriminate perturbation may interfere with the precision required at the mixture output. A small change in a raw output can affect several downstream quantities. Moving a Gaussian mean changes the location of its high-density region. Changing a raw scale alters how tightly samples cluster. Adjusting a mixture score changes how often that component is chosen relative to others. Adaptive noise can in principle allow different weights to tolerate different uncertainty. The reported success of adaptive noise is compatible with the explanation about precision, but the paper does not trace the gain to particular weights or demonstrate that output connections learned smaller noise scales than other connections.

There is a further boundary around the comparison. Validation measures include the probability of the stroke event as well as the density of the displacement. The paper reports the loss for the sequence as a whole. A better total score could reflect improvements in either part, or in both. It could also come from widespread small improvements or from avoiding severe errors on a subset of difficult movements. Without a breakdown, adaptive noise has a clear empirical effect on the full objective and an uncertain effect on each part of the writing process. That distinction is especially important when interpreting the visual examples, in which the visibility of an error may bear little relation to its contribution to the sum of log losses.

Prediction units and evaluation protocols affect different parts of the comparison

Predicting a word gives the network access to a whole lexical item at a time. Predicting characters makes the network use several observations to build and interpret such an item. The Penn Treebank experiments make this difference measurable under one benchmark convention, with a shared scale for reporting loss. They also change the inventory and the number of trainable connections to it. Matching the hidden width holds an important part of the recurrent computation steady, while leaving the word predictor with a much larger set of weights. As a result, the word predictor’s advantage measures the performance of the chosen word system against the chosen character system. It gives a less direct answer to what would happen if the observation unit alone could be changed.

The two predictors also place different burdens on recurrent state. For the character system, the information needed to predict a continuation within a word has to survive alongside any information useful beyond that word. A word observation can express its identity in a single input. In a sequence that ends at the same point in the text, the two systems have taken different numbers of recurrent steps to get there. Even an approximately matched parameter count would leave those differences intrinsic to the units being compared. The paper’s result puts them in perspective by showing that, on this corpus, smaller output units remain practical even though the overall test ranking favours words.

Dynamic evaluation makes a different intervention. It varies what the predictor is allowed to learn from the scored stream as it proceeds. A fixed-weight recurrent network incorporates observations into its current state. In the dynamic protocol, observations that have already been scored can also influence weights used for later predictions. A lower loss under this protocol demonstrates that a stream contains information the update procedure can exploit after training. The improvement need not come from extending the duration of the recurrent cell state. An update to the weights and a change in state provide two routes by which earlier text can influence the next forecast.

The gain in the Wikipedia validation run is consistent with the author’s suggestion that vocabulary is locally repetitive within an article. A recently observed term can become more likely again while its article continues. The raw data also contain changes in format. If the dynamic gain comes in part from adapting predictions to a run of similar markup, the aggregate score will combine that effect with improvements in article prose. The comparison does not break out these regions, and so leaves the source of the gain open. It does establish that permitting adaptation materially changes the result on the raw stream as evaluated.

The comparison with the dynamic gains of an earlier ordinary word RNN gives the author grounds to suggest that LSTM adapts quickly. It leaves more than the recurrent cell type free to vary. The earlier score comes from a different system, and the paper does not run matched ordinary and gated networks through a common adaptation experiment. The safest reading is that the LSTM systems benefited strongly under the paper’s protocol, whereas the cited word RNN had a smaller reported gain. Explaining the difference solely through LSTM memory would require evidence beyond the two sets of results.

The text helps most visibly when the pen is between strokes

The move from pen prediction to synthesis lets the recurrent network consult the transcription. Both versions learn from the same pen records, and the synthesis architecture preserves the deeper predictor’s basic recurrent and output design. The changed system also has additional weights for constructing and receiving the window. It is a close comparison between two prediction tasks, one with textual information and one without it. It tests the benefit of the conditioning pathway as a whole, without separating that benefit from the extra computation used to make the information available.

The validation squared-error result is particularly informative because depth and adaptive noise changed that measure so little in the prediction-only setting. With synthesis the paper reports a 44% reduction relative to the best handwriting predictor. The extra input can help move the predicted location toward the recorded point, rather than merely changing the shape of the density around an existing location. There is a reason to expect this effect at a pen lift. The direction of motion just before a lift says comparatively little about where the next stroke begins. Knowing what is to be written can narrow the possible landing areas. Once a stroke is in progress, the most recent positions already constrain many of the movements available to continue it.

The density figures give a local view of that explanation. In the prediction-only illustration, compact patches along strokes alternate with more diffuse patches at the relocations. The plot of component weights also changes at the relocations. The synthesis illustration shows tighter concentrations especially at those difficult points. Taken together, the images show the kinds of uncertainty the output captures and how they can change with access to a transcription. The paper suggests that the relocation effect explains much of the squared-error gain. It gives no score restricted to post-lift movements, so the images support the proposed explanation without quantifying how much of the overall reduction comes from that part of the trace.

Another aspect of the comparison is the status of text as advance information. For synthesis, the entire string is known before any movements are generated, and the window can already give some emphasis to upcoming characters. For the prediction-only task, inferring what might be written next is part of the uncertainty. Better performance with text therefore shows that the supplied annotation is informative and that the network can act on it. It would be misleading to treat the gain as an improvement in a predictor that has to guess what the writer will say. The useful claim is that a relatively small addition to the recurrent computation enables it to exploit the contents of the line under a different task definition.

The evidence also helps distinguish conditioning from a guarantee of faithful reproduction. The density results show that the network can use the text to anticipate recorded movements when given their actual preceding trace. The validation examples show that it can sometimes produce readable versions of an unfamiliar complete line under feedback. When alignment slips during sampling, the window receives recurrent information shaped by the resulting pen movements, so subsequent decisions can inherit the slip. Both the benefits and the failure modes are therefore consequences of supplying the transcription through a mechanism that moves as part of the writing process.

The alignment illustration tests whether the window behaves as intended

The paper reports that expressing the window position as a succession of positive offsets was essential to obtaining alignment. This is a qualitative design comparison. Predicting an absolute position offers the network freedom to put a window anywhere, and the position chosen at one moment need have little relation to the next. Predicting an increment makes the previous position part of the next decision. The window retains a running record of progress, and learning can focus on when to move slowly and when to move faster. The trace and the text can stretch relative to one another without requiring the system to locate the current character from scratch after every movement.

The change combines two properties. Position accumulates across steps, and the positive offset gives each component a forward direction. The author’s observation concerns the resulting parameterisation. The paper does not report separate comparisons of cumulative updates with and without the direction constraint. Nor does it give losses or alignment accuracy for the earlier attempts. The statement is evidence about what enabled training in this system. On its own it cannot establish that all ways of predicting absolute positions fail, or tell how much of the effect comes from continuity as opposed to the restriction on direction.

The window plot provides a different check. Its bright band progresses through positions in the transcription during a recorded writing sequence. Near some character transitions the band spreads over several positions. That is what the soft reading mechanism was designed to permit. When one letter leads into another, information about both can reach the predictor together. A narrow peak is sensible while the pen is occupied mainly with one character. Broader weights can be helpful when the trajectory has to accommodate neighbouring forms. The figure shows a learned pattern consistent with that account. The weight magnitudes are unnormalised, so the brightness expresses emphasis from the window instead of a measured probability that an independently annotated boundary has been crossed.

Forward motion of each centre does not make all of the text information move at a uniform rate. Strength and width can change, and different window components can carry different amounts of influence. A component with a centre farther ahead may grow stronger while another still gives weight to earlier characters. That flexibility matters to the interpretation of the image. The prominent band is the sum of components as their parameters change. The experiment demonstrates that the combined reading can track a trace in an interpretable way. The paper does not establish a dedicated role for any particular component or determine whether the same visible alignment would emerge with a single component.

The author also reports an unpromising preliminary attempt with a recurrent transducer. The suggested explanation concerns the separation of information between two recurrent computations before their outputs are combined. The account gives neither a numerical comparison nor enough detail about the trials to assess the effect of that separation independently. The soft window is supported here by what it achieves in its own experiments, and the transducer trials explain part of the path to that design. A claim about the relative merit of the two approaches in general would go beyond those trials.

Bias changes the consequences of sampling from the same trained network

The bias illustration makes a direct comparison using a single trained synthesiser and a range of sampling settings. An ordinary draw can select a component that carries modest weight. It can also land away from the centre of the selected component. Bias reduces both sources of movement variation. The visible progression towards more even writing is accordingly attributable to a change in how the learned distribution is used. It does not depend on obtaining a separate fit for each level of legibility.

The observed loss of variety says something about where some stylistic differences enter free generation. A trajectory receives many opportunities to vary, and an early difference can change the options the network offers later. Constraining the movement at every step limits the histories through which samples can diverge. A narrower draw also tends to suppress local irregularities. The paper changes component selection and within-component scale together, so the illustration cannot assign the smoother appearance to one adjustment and the loss of wider stylistic variety to the other. What it shows is the combined effect of the sampling rule.

Repeated letters still differ within highly biased lines. The author points to this as a consequence of feedback. A letter preceded by a different trajectory or followed by different text occurs in a different conditioning situation. Its sequence of likely movements can change even when the sampler is taking points close to the preferred component means. The demonstration separates regularity across draws from uniformity of letter shapes within a line. The former increases as sampling is concentrated. The latter remains conditioned by position, neighbouring letters and the unfolding history. The separate stroke-ending prediction provides another reason to distinguish concentration of the movement mixture from a claim that every aspect of handwriting has become deterministic.

The value 0.15 is used for the slightly biased examples on the same validation texts shown with ordinary sampling. That common text makes the visual comparison easier to interpret. Different lines can vary in their difficulty or in the strokes they require, and showing the same text removes that source of change from the displayed comparison. The author judges the slight bias a good compromise. The figure demonstrates that some variety survives while the writing becomes easier to read. It supplies no distribution of reader preferences or error counts from which to infer a generally best setting.

Priming shows what survives a change from observation to generation

Priming asks a different question about the trained synthesiser. The network first processes a real trace and its transcription, then proceeds into new text while keeping the state built up during the real writing. If the continuation resembles the prefix in size, slant or connectedness, those shared properties can be carried into new pen movements without fitting new weights. The generated text need not repeat the written prefix for the resemblance to be apparent. This makes the demonstration an intervention on the history from which the recurrence starts its own continuation.

The strongest visible effect concerns properties that extend through the line. An immediate tendency to continue in the same direction after the last observed point would be unsurprising. A broadly similar slant or connectedness in later letters is evidence of influence beyond that first movement. The paper interprets such persistence as retention of style information. The test does not identify a cell that stores slant or compare the effect of retaining only selected parts of the state. The history is carried over intact, including the conditions for continuing the text. What the experiment establishes is that the state as used by the full generator is sufficient to transmit some recognisable aspects of the prefix.

The biased priming examples add a second intervention. With a bias of 1, the samples can preserve broad visible resemblances while the individual strokes become smoother. This matters because strong resemblance could have depended on reproducing all the irregularities present in the prefix. The examples show that some of the resemblance survives changes to local variation. The observation also leaves room for interactions. A shift in sampling can affect the recurrent histories through which style is expressed, and a different prefix may respond differently to the same bias. The figures document some successful combinations of the two procedures.

The priming evidence is narrower than the ability to generate different styles from scratch. For the latter, the spread of styles comes from repeated draws without a real prefix specifying a writer. Priming tests whether a specific recorded history can influence which style emerges. The displayed primes come from training, and the resulting samples were selected for legibility. The author finds the procedure more effective on familiar sequences than on unseen ones. That qualification matters when using the examples as evidence of memory. They demonstrate an effect on new writing from certain familiar histories, while leaving its reliability over different writers and unfamiliar prefixes unmeasured.

Limitations

Limits identified by the author

The Wikipedia sample has two different kinds of success. Formatting can persist across a region, and parts of the text resemble the language of encyclopedia articles. The author observes that sense is generally confined to short phrases. A paragraph can continue to look like prose after its claims have stopped adding up to anything coherent. Likewise, an article-like sequence can begin with plausible metadata and end with a list without maintaining a subject in the intervening sentences. The sample supports the reproduction of some long-range regularities in a byte stream. Its overall shape alone cannot establish the ability to write a meaningful article.

The paper considers whether a larger network or a larger corpus could improve the realism of the text. It also expresses doubt about getting meaningful language from a system with no sensory experience of the things language refers to. The latter is the author’s interpretation of the gap between surface regularity and meaning. The experiments observe that gap in the generated text. They give no comparison between different kinds of experience and do not determine how much of the problem could be addressed through capacity or data alone. The finding about short phrases stands independently of the proposed explanation.

In handwriting, the author expressly qualifies the numerical evidence because of the partitioning of IAM-OnDB. The original test lines are used for fitting, together with the standard training material and the larger validation partition. The remaining partition serves for early stopping. It can show how a particular fit behaves on observations outside its training pool, but it also helps decide which fit to keep. That combination is why the author warns of possible overfitting to the validation data. The choice increases the amount of material available to learn from, which suits the paper’s emphasis on constructing convincing samples. It leaves the density and squared-error results without independent confirmation on an untouched test split.

A concrete distinction follows from that partition choice. A validation text can be absent from the training lines while the experimental protocol as a whole still lacks an independent test set. The paper shows synthesis examples on texts from validation and identifies them as unseen during training. Those examples are evidence that the generator can sometimes write a requested line it did not encounter as a full training line. They do not supply an estimate of success across all such texts, and the paper does not describe them as a separate test of performance on previously unseen writers. Novelty of the requested line and independence of an evaluation serve different purposes.

Text fidelity is a limitation the author can see directly in the samples. Missing, confused and malformed letters occur, with more mistakes on unusual words and phrases. The paper suggests that the network has learned tendencies about which characters commonly follow each other from its training material. If a requested transition is rare, those tendencies may make the corresponding pen sequence more difficult for it to produce. This explanation fits a system in which the pen history and the window both influence the prediction. There is no comparison holding writing difficulty steady while varying the frequency of the requested character transitions, so the reason for the increase remains a hypothesis. The increased difficulty itself limits the claim that the system can faithfully render arbitrary wording.

Digit and punctuation handling creates a separate form of content ambiguity. In the synthesis representation, digits and much of the punctuation share an input label. Even if the window reaches the intended position at the right time, it has no distinct label for most of those marks. A useful context can sometimes suggest which mark is appropriate. If the context leaves several possibilities, the written choice can reflect the learned distribution and the draw from it. Such errors cannot all be assigned to the alignment mechanism. Better temporal alignment could ensure a mark appears at the appropriate place without recovering an identity omitted from the input.

The author also identifies numerical difficulties during handwriting training. Some runs encountered problems late in fitting even with derivative clipping, and clipping at the mixture output is described as vital. This matters to how the architecture can be reproduced. The formulas give legal output ranges, but an output can still lie in a region that makes optimisation difficult. A narrow component, for instance, is sensitive to movement away from its mean. Large changes in output derivatives can affect the recurrent computation as well. The paper reports a practical way to obtain usable fits and notes where instability remains. It offers no indication that the same clipping ranges will suffice for a substantially different dataset or output distribution.

Priming carries an explicit qualification about familiarity. The procedure appears more effective on sequences drawn from training than on sequences the network had never seen. The examples demonstrate continuation in a recognisable style after processing certain real traces. The paper offers no matching evaluation of unfamiliar primes with comparable text and visibly comparable styles. The observation about familiarity could reflect differences in how well the network processes the trace, how clearly the trace conveys stylistic characteristics, or both. The experiments do not determine which. General imitation of arbitrary handwriting is a broader claim than the displayed successes support.

Finally, the author presents sampling controls as heuristics. The legibility rule concentrates each local movement distribution. Optimising the complete trajectory would require taking into account how an early move affects all later predictive distributions. A locally favoured draw can lead to a later history in which the remaining text is difficult to write. The steady visual progression in the bias examples makes the local rule understandable, but success in those examples gives no guarantee about which trajectory would score highest as a completed line. The end condition likewise uses the window’s activity near the end of the transcription as a signal that the trace should stop. It has no separate verification step for the contents of the finished writing.

Limits of the evidence on memory

The paper motivates its architecture through the limitations of ordinary recurrent networks and demonstrates structure in outputs from LSTM. Its main generation experiments do not include an ordinary recurrent system matched in architecture, data and sampling procedure with only the memory cell changed. The handwriting depth comparison uses LSTM in both variants. The text comparisons with earlier systems also change other factors. Together the results establish that this LSTM design can produce particular kinds of sustained structure. They provide less direct evidence about how much of the success is specifically due to the cell state, its gate connections or the output design with which it is paired.

The same distinction applies to the direct connections from the input and the hidden stack to the output. The paper gives a reason for including them. They shorten some paths through which activations and their derivatives have to pass. There is no corresponding comparison with those connections removed under the same training conditions. Their contribution to the reported samples is therefore a design rationale. The experiments do not measure whether the stack would still learn the observed regularities with only adjacent layer connections, or which layers make the most useful direct contributions at different stages of writing.

There is evidence of dependence across time in the generated Wikipedia material. A closing delimiter can agree with a much earlier opening, and an extended region can remain in something like the same format. Still, an example of successful closure provides no estimate of how often it occurs or how its likelihood changes with the intervening distance. Local cues may also help the network decide that a closing mark is appropriate. Nested markup can place stronger demands on memory, yet a selected passage with nesting gives no test of exact behaviour across many different nests. The paper’s observations identify phenomena worth explaining through recurrent memory. They do not map a reliable boundary around the distances or structures that the fitted network can handle.

For the same reason, the history made available by the Wikipedia state schedule should be distinguished from the history the network is shown to use. Preserving a cell state across adjacent training segments gives it a channel through which earlier inputs can influence current outputs. The gradient within a segment can train it to use the state it receives. The truncation boundary limits how explicitly a late error can assign credit to a computation that happened in an earlier segment. Availability of that longer context, learning from it and relying on a particular part of it are separate empirical questions. The paper does not present a comparison that varies the reset interval while holding the rest of the training procedure steady.

In handwriting, continuity of style and the completion of letters supply a more tangible indication of persistence. A style visible near the end of a trace can resemble the style visible near the start. Immediate pen movements may themselves carry enough information to sustain some of that resemblance, since an ongoing slant gives clues to the direction and shape of following strokes. The relatively long interval over which a line retains its character is compatible with persistent state. A detailed account would still have to determine how much depends on earlier observations that can no longer be inferred from the recent trace. The priming demonstration strengthens the case by introducing a specific real history. It still does not compare continuation after removing selected parts of that history from the state.

The author suggests that size, slant and cursiveness might be learned independently because a reader can find many combinations by looking through enough samples. A collection in which the traits vary in different ways is consistent with independent control, but it could also be generated by coupled representations with enough flexibility to yield many combinations. The paper does not define separate quantitative measures for these traits, measure their dependence or manipulate one while holding the others steady. It presents the internal organisation of style as a plausible interpretation of visible variation. The demonstrated control is indirect, through the seed trace and the way sampling is biased.

Limits of the measurements and comparison data

The Penn Treebank results assess language prediction under a restricted vocabulary and a particular set of sentence conventions. Words outside the chosen inventory are mapped to a common symbol. The character system’s ability in principle to assemble unfamiliar strings therefore has to be distinguished from what the processed benchmark requires it to recognise or predict. The main comparison tells how well word and character predictions account for that version of the corpus. It cannot measure the benefit of representing every unfamiliar proper name or number exactly, since some distinctions have already been collapsed in the benchmark data.

Two other conditions affect the interpretation of those text scores. The word and character systems differ substantially in trainable weight count, and their regularisation treatments are not symmetric. The resulting ranking is informative for the configurations studied. It leaves no reliable estimate of how an equal-size pair would rank after equivalent optimisation. The use of bits per character and word perplexity places their losses on a related reporting scale. It does not equalise their computation, memory requirements or flexibility at generation time. A reader interested in the resource cost of a predictor or in the diversity of its output needs evidence beyond that common scale.

With dynamic evaluation, the score also depends on what changes the predictor is permitted to make after scoring each observation. Scoring the stream once respects the order of prediction and observation. It defines a setting in which the immediate past can supply training information for the immediate future. If articles are topically clustered, that opportunity may be particularly useful. A fixed-weight predictor is evaluated with a different opportunity to learn. The paper reports a benefit under adaptation, which says how well the network works when that opportunity is available. The result has a different meaning for an application that would keep the weights fixed or process unrelated sequences independently.

The comparison figures for Wikipedia cover different tasks. The Hutter Prize figure concerns compression of the full stream with the implementation included in the submission size. The earlier character prediction figures use a version stripped of markup, measured on held-out text. The paper’s own prediction experiment is on raw bytes and reports validation separately from training. Differences in content can alter the intrinsic predictability of the stream. Including the implementation changes what contributes to a compression result. The reported numbers establish the scale of several relevant tasks. They cannot on their own establish a rank across identical datasets, split policies and accounting conventions.

The handwriting metrics have a related interpretive boundary. Next-observation likelihood measures the score of correctly recorded movements and flags with the actual prefix available. Sum-squared error measures distance in a numerical prediction. Neither provides a count of how many requested letters a person would identify in a sample, or how frequently sampled handwriting needs to be discarded for readability. A relatively large displacement error after a pen lift can have a substantial numerical effect. A subtle shape error can instead decide whether the result looks like the intended letter. The losses are appropriate for assessing the predictive task, while fidelity and legibility require evidence about the completed line.

The database and its use also limit the form of the demonstrated handwriting. The fitted traces come from lines recorded on a whiteboard as writers copied text from a particular corpus. The fitting procedure treats lines separately. Thus the experiment supports generation at the level of those recorded lines, with some newly requested wording and considerable stylistic variation within that setting. It gives no measurements about continuity of style across successive generated lines, layout across a full page or transfer to traces recorded differently. Those are plausible extensions of the generation loop, but the paper’s decision to use independent lines leaves them outside the test.

Limits of alignment and visual judgement

The learned window addresses a specific correspondence: an ordered text line guides a usually much longer trajectory. A component’s centre can slow down and move forward at varying speeds. It cannot deliberately shift backward under the positive-offset rule. The total weight can still include earlier positions thanks to the width and mixture of the components, and the recurrent layers can remember earlier evidence. That distinction is important when considering a delayed dot or cross. Returning the pen to an earlier place on the board need not imply moving the window back over the text. The paper does not determine which route the network uses to produce delayed marks, or how reliably it produces them when they compete with progress into later letters.

The picture of a moving alignment band shows how the mechanism behaves in a particular sequence. It cannot verify a correct treatment of every character boundary. The position weights are also affected by the strength and width of the components, so an apparent shift in emphasis need not be a direct measure of travel by a single centre. For prediction this ambiguity is acceptable. Several neighbouring characters may all be informative at the same moment. For interpreting what the network considers the current character, it means the picture yields an intelligible alignment without imposing a unique character assignment on each pen point.

The stopping rule inherits this ambiguity. It checks the window near the end of the string, with no independent assessment of whether the trajectory includes all requested marks. A window that progresses too quickly can provide a completion signal after passing insufficiently represented letters. A trace that requires a late mark can pose a timing problem even when the main body of the line is present. The reported examples show that the heuristic frequently produces a plausible endpoint. The paper gives no rate of premature or delayed stopping, and does not break down how much of the wrong lettering it observes comes from the stopping choice rather than earlier progress through the line.

The visual tests chiefly show existence and range. Some lines look convincingly handwritten, some preserve a style across an unfamiliar text and some become quite easy to read when biased. The author’s presentation tests supply informal evidence that people can sometimes have trouble telling a sample from real writing. The paper does not report a systematic set of reader judgements, how the viewed material was balanced or a discrimination rate over unselected examples. The display of primed samples explicitly favours legibility. The appearance of those lines can be assessed on its own terms, but their quality does not establish how often an arbitrary run gives a comparable result.

Even a more convincing visual resemblance would need to be tied to the intended claim. Imitating a prime’s principal stylistic traits is different from reproducing how a particular writer would form unfamiliar letters in context. Rendering the requested words is different again. A reviewer could judge a line readable while missing a small substitution, or recognise the writer’s broad slant despite inconsistent letter formation. The paper’s demonstrations make a number of these qualities visible, with no common protocol for measuring their frequency or assessing their agreement. The limits are most evident where a practical claim would require all of them at once, as when a reader needs accurate text in a recognisably imitated style.

Questions left open in the conclusion

The author proposes speech synthesis as a possible use of the conditioning mechanism, while anticipating more difficulty because speech observations are higher dimensional. The handwriting output was chosen in part because it involves a small number of real coordinates and can be rendered directly. A distribution suitable for pen offsets provides no empirical evidence about the appropriate representation of speech. The proposed transfer therefore concerns the general idea of predicting a stream with the aid of an aligned annotation. The suitability of the output and the ability to train the alignment would need to be established in that domain.

The other proposed directions follow from the indirect nature of control in the existing system. One is to understand the internal representation well enough to alter the generation distribution through it. Priming instead relies on the network to pick up whatever stylistic evidence is available in a real trace. The other direction is to infer richer annotations from sequences automatically. In the handwriting setting, an annotation could describe variation in letter form, stroke ordering or style in addition to the text. The paper demonstrates the use of an externally supplied transcription without pen-level alignment. Discovering a descriptive stream and establishing how to use it in generation remain separate tasks.

What came after

Alignment becomes an explicit part of more sequence tasks

The later citation record connects the handwriting work to systems whose outputs also depend on information distributed across an input. The closest connection is the problem of correspondence. In handwriting synthesis, a transcription does not say which movement is associated with each position. Graves gives the generator a differentiable way to obtain information from positions that become relevant as it writes. A later task may ask for a different sort of output, and its relevant input positions may have a different order. The useful comparison is therefore between the roles that alignment plays in the respective problems.

In Neural Machine Translation by Jointly Learning to Align and Translate, alignment is posed as a learning problem alongside machine translation. The later work’s stated task gives correspondence a new purpose. The output consists of material in another language, whereas the earlier handwriting system uses correspondence to determine when the unfolding trace should be informed by each part of the transcription. Both settings make a sequence-level pairing available and place the use of input positions inside the job of producing the output. The citation records the connection, while the window’s moving Gaussian centres and its forward increments belong to the handwriting design. The later paper’s title does not establish that those constraints were transferred.

Sequence to Sequence Learning with Neural Networks takes the mapping from one sequence to another as its subject. The handwriting experiment is a concrete case of such a mapping in which input and output have very different units. A character string gives the requested content, and displacements and flags give it a physical form over time. Looking from the later sequence-learning question back to Graves clarifies why the output has to be treated as a dependent sequence. Even with the transcription known, a plausible pen movement depends on the movement already made. The later citation is evidence that the recurrent generation work was relevant to a broader sequence-learning problem. The relationship by itself supplies no evidence about how a particular stroke-level device was used in the later work.

On the Properties of Neural Machine Translation: Encoder-Decoder Approaches puts the organisation of a translation system at the centre of the inquiry. Its encoder-decoder framing makes it natural to ask how information about a source sequence reaches a generator. In Graves’s design that question has a concrete answer. A recurrent layer takes part in deciding where to read, and the resulting window vector can influence other layers during the same movement prediction. Whether that pattern is useful in another encoder-decoder setting depends on the relationship between source and output. The citation connects the two architectural questions. It does not specify a common implementation or establish a comparison between their results.

Other work takes up alignment for speech. Attention-Based Models for Speech Recognition and End-to-end attention-based large vocabulary speech recognition place attention in recognition systems. Their stated task involves obtaining a symbolic sequence from a spoken signal. Graves’s handwriting experiment begins with the symbolic description and produces the signal, while the conclusion proposes speech synthesis as another possible direction. The recognition citations show a later use of selective access to input information in the other direction of processing. They do not supply a test of the speech synthesis proposal. What connects the problems is the need to relate an output step to an informative portion of a sequence whose units and timing differ from those of the output.

Attention Is All You Need puts Transformer and attention into the later conversation about how sequences make information available. The comparison with Graves is especially clear when the roles of the two mechanisms are stated at the level the citation supports. In handwriting, the window is a selective route from the transcription to the pen predictor, whose recurrent state drives both the window and the movement predictions. The later work’s stated emphasis is attention itself. That emphasis shows how much broader the architectural question became than positioning a cursor in an ordered transcription. The citation does not make the handwriting window a description of the later architecture. Its historical relevance is the explicit use of a learned weighting of sequence positions to inform a prediction while generation is in progress.

There is a common design question across these papers even when their applications differ. The generator has to obtain information that is useful at the current output step. In the handwriting experiment, the best information may include characters on either side of a transition. In a sequence mapping with different correspondence requirements, the appropriate means of finding it may differ. The later titles show alignment, encoder-decoder organisation and attention becoming subjects in their own right. Graves’s paper offers a detailed example of what such a device can accomplish when the source has a strong ordering constraint and the timing must be learned.

Conditioning reaches beyond a supplied character string

Show and Tell: A Neural Image Caption Generator identifies image captioning as a later generation problem. Its input and output have different forms, as in handwriting synthesis, but the direction of the relationship changes. Graves takes words as specified content and generates a visual trace over time. A caption generator takes an image as the basis for producing a descriptive text sequence. The common issue is making a generated sequence depend on something beyond its own recent history. The citation connects the use of conditional sequence generation across these tasks without establishing a role for a handwriting-style window over the image.

Long-term Recurrent Convolutional Networks for Visual Recognition and Description brings long-term recurrent processing into work on visual recognition and description. The connection to Graves is the use of recurrent computation where the result may depend on information spread over time. Description is the especially close point of contact, since the output can itself have parts whose relevance depends on what has already been produced. The handwriting paper exposes that dependence by making each sampled action part of the context for the next. The later work’s stated scope adds visual information and recognition to the set of problems considered in recurring computations. The citation leaves the exact relation between the two designs open.

A further change in conditioning appears in Semantically Conditioned LSTM-based Natural Language Generation for Spoken Dialogue Systems. There, the title places LSTM generation in a dialogue system and identifies semantic information as the condition on its language output. The connection is more specific than the presence of LSTM alone. In both tasks the generated sequence has to satisfy information supplied in addition to the emerging output history. A handwriting transcription specifies an ordered series of characters, so progress through the supplied text is central. Semantic conditioning raises the related question of how an output realises the information it was asked to express. The citation does not establish that this information is read through a forward window. It marks a change in what the condition says about the output.

These connections help explain the significance of internal access to conditioning information. A generator can maintain local fluency or plausible motion while missing some of what it was asked to produce. The lettering errors in Graves’s samples expose this gap in a form that can be seen directly. The later works take up inputs such as images or semantic specifications, for which an output sequence has to serve a different purpose. Across those purposes, the fact of conditioning and the fidelity of the resulting output remain distinct questions. The handwriting experiments offer evidence about both in a case where the requested content and the physical form of the response can be inspected separately.

Recurrent cells and regularisation become direct objects of study

LSTM: A Search Space Odyssey takes the design space of the recurrent cell as its subject. Graves uses a specific form of LSTM and shows what can be generated with it. The gates, diagonal cell-to-gate connections and use of cell state are fixed elements of that form throughout the main demonstrations. By making LSTM design itself a topic, the later work addresses the class of questions left open when a generation experiment uses a single cell configuration. The citation supports that connection between a demonstration and a design inquiry. It supplies no particular finding about which gate or connection explains Graves’s results.

Recurrent Neural Network Regularization focuses on another variable the experiments show to matter. Graves uses weight noise in response to overfitting and obtains likelihood gains from learning its scale in the handwriting networks. His experiments also reveal an obstacle to applying the same procedure everywhere, since adaptive noise is too slow for the word predictor and fixed noise fares poorly in handwriting. Treating regularisation as a research topic allows those difficulties to be considered separately from whether a sequence task calls for characters, words or pen coordinates. The later citation establishes that recurrent regularisation remains in view. It gives no basis for attributing the later method or its effects to Graves’s weight-noise procedure.

Adam addresses stochastic optimisation. The point of contact with Graves is the practical problem of moving weights in response to noisy and uneven gradients. In handwriting, Graves prescribes running derivative statistics, momentum and clipping for a recurrent network with a sensitive continuous output. The later optimisation work has a broader subject than that handwriting configuration. Its inclusion among citing works places the generation paper in a training discussion alongside its better-known role in sequence design. The citation does not amount to a head-to-head comparison with the rmsprop setting used to fit the handwriting systems.

Layer Normalization belongs to this training branch of the citation record as well. Its stated focus is normalisation at the layer level. The earlier generation paper makes a different adjustment at particular points in back-propagation to keep derivatives within workable ranges. The relation is that fitting recurrent systems involves choices about the behaviour of intermediate computations as well as the form of the output distribution. The title and citation do not establish that layer normalisation replaces clipping in this task or that the two procedures have the same effect. The distinction matters because otherwise a history of training methods can obscure the exact circumstances in which the reported handwriting fits were obtained.

Information below the word remains useful in different forms

Character-Aware Neural Language Models directly continues the question of how characters should inform language prediction. Graves’s two Penn Treebank predictors make the unit of input and output a choice between words and characters, and the Wikipedia system pushes prediction to bytes. A later paper about character awareness places importance on character information without its title requiring the same decision about the unit of generation. That distinction is important to the connection. Supporting a prediction with evidence from spelling and emitting a sequence one small unit at a time are related ways to use such evidence, with different consequences for the output inventory. The citation identifies the shared question while leaving the later architecture’s particulars to its own account.

Enriching Word Vectors with Subword Information applies information from below the word to another problem, the construction of word representations. The original paper is interested in the range of strings a network can produce if it has access to smaller units at the output. The later title keeps the word as the object to be represented and asks how information from within words can enrich that representation. In that setting, the value of the smaller unit is what it contributes to a larger representation. In Graves’s generation experiment it is also a unit of choice during sampling. The citation places both uses within work on obtaining information from patterns that a dictionary of complete forms would leave implicit.

Exploring the Limits of Language Modeling returns to the general predictive task in which the two units were compared. Its stated aim connects to the provisional nature of the Penn Treebank experiment. The earlier comparison varies the vocabulary, parameter budget and feasible regularisation along with granularity. That makes its ranking an empirical result about the systems tried and leaves substantial room to explore how far language prediction can be pushed under other conditions. The later work’s citation maintains the link to that question. It supplies no revised Penn Treebank score or result that can be treated as a controlled extension of the earlier comparison.

A movement from words toward smaller units can affect more than predictive scores. The output alphabet determines which strings can be expressed, and the number of steps determines how information about earlier parts of a string has to persist. The sub-word and character citations take up different pieces of that problem. Together with the later work on alignment and conditional generation, they show the range of questions exposed by separating a generator’s observation unit from the structure a reader recognises in its output. In this paper that separation is visible at both ends of the experiment. Bytes can form a recognisable document region even when its prose loses sense, and pen movements can form a recognisable style even when a requested letter goes missing. Those are different accomplishments from faithful composition, and the comparisons throughout the paper are most informative when each is judged on its own evidence.

Cite

Cite as Alex Graves. 2013. Generating Sequences With Recurrent Neural Networks. arXiv:1308.0850.

The paper itself, not this page. BibTeX from the library's record of the work. DOI 10.48550/arxiv.1308.0850 · arXiv 1308.0850

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

↑ back to top

This page in Markdown https://md.research.elamur.ai/free/en/papers/graves-2013-generating-sequences-recurrent-neural-networks/

References

33 references, from the paper's own bibliography.

  1. Y. Bengio, P. Simard, and P. Frasconi. Learning long-term dependencies with gradient descent is difficult. IEEE Transactions on Neural Networks, 5(2):157–166, March 1994. OpenAlex ↗ · Scholar ↗
  2. C. Bishop. Mixture density networks. Technical report, 1994. OpenAlex ↗ · Scholar ↗
  3. C. Bishop. Neural Networks for Pattern Recognition. Oxford University Press, Inc., 1995. OpenAlex ↗ · Scholar ↗
  4. N. Boulanger-Lewandowski, Y. Bengio, and P. Vincent. Modeling temporal dependencies in high-dimensional sequences: Application to polyphonic music generation and transcription. In Proceedings of the Twenty-nine International Conference on Machine Learning (ICML'12), 2012. OpenAlex ↗ · Scholar ↗
  5. J. G. Cleary, Ian, and I. H. Witten. Data compression using adaptive coding and partial string matching. IEEE Transactions on Communications, 32:396–402, 1984. OpenAlex ↗ · Scholar ↗
  6. D. Eck and J. Schmidhuber. A first look at music composition using lstm recurrent neural networks. Technical report, IDSIA USI-SUPSI Instituto Dalle Molle. OpenAlex ↗ · Scholar ↗
  7. F. Gers, N. Schraudolph, and J. Schmidhuber. Learning precise timing with LSTM recurrent networks. Journal of Machine Learning Research, 3:115–143, 2002. OpenAlex ↗ · Scholar ↗
  8. A. Graves. Practical variational inference for neural networks. In Advances in Neural Information Processing Systems, volume 24, pages 2348–2356. 2011. OpenAlex ↗ · Scholar ↗
  9. A. Graves. Sequence transduction with recurrent neural networks. In ICML Representation Learning Worksop, 2012. our card
  10. A. Graves, A. Mohamed, and G. Hinton. Speech recognition with deep recurrent neural networks. In Proc. ICASSP, 2013. our card
  11. A. Graves and J. Schmidhuber. Framewise phoneme classification with bidirectional LSTM and other neural network architectures. Neural Networks, 18:602–610, 2005. OpenAlex ↗ · Scholar ↗
  12. A. Graves and J. Schmidhuber. Offline handwriting recognition with multidimensional recurrent neural networks. In Advances in Neural Information Processing Systems, volume 21, 2008. OpenAlex ↗ · Scholar ↗
  13. P. D. Grünwald. The Minimum Description Length Principle (Adaptive Computation and Machine Learning). The MIT Press, 2007. OpenAlex ↗ · Scholar ↗
  14. G. Hinton. A Practical Guide to Training Restricted Boltzmann Machines. Technical report, 2010. OpenAlex ↗ · Scholar ↗
  15. S. Hochreiter, Y. Bengio, P. Frasconi, and J. Schmidhuber. Gradient Flow in Recurrent Nets: the Difficulty of Learning Long-term Dependencies. In S. C. Kremer and J. F. Kolen, editors, A Field Guide to Dynamical Recurrent Neural Networks. 2001. OpenAlex ↗ · Scholar ↗
  16. S. Hochreiter and J. Schmidhuber. Long Short-Term Memory. Neural Computation, 9(8):1735–1780, 1997. OpenAlex ↗ · Scholar ↗
  17. M. Hutter. The Human Knowledge Compression Contest, 2012. OpenAlex ↗ · Scholar ↗
  18. K.-C. Jim, C. Giles, and B. Horne. An analysis of noise in recurrent neural networks: convergence and generalization. Neural Networks, IEEE Transactions on, 7(6):1424 –1438, 1996. OpenAlex ↗ · Scholar ↗
  19. S. Johansson, R. Atwell, R. Garside, and G. Leech. The tagged LOB corpus user's manual; Norwegian Computing Centre for the Humanities, 1986. OpenAlex ↗ · Scholar ↗
  20. B. Knoll and N. de Freitas. A machine learning perspective on predictive coding with paq. CoRR, abs/1108.3298, 2011. OpenAlex ↗ · Scholar ↗
  21. M. Liwicki and H. Bunke. IAM-OnDB - an on-line English sentence database acquired from handwritten text on a whiteboard. In Proc. 8th Int. Conf. on Document Analysis and Recognition, volume 2, pages 956–961, 2005. OpenAlex ↗ · Scholar ↗
  22. M. P. Marcus, B. Santorini, and M. A. Marcinkiewicz. Building a large annotated corpus of english: The penn treebank. COMPUTATIONAL LINGUISTICS, 19(2):313–330, 1993. our card
  23. T. Mikolov. Statistical Language Models based on Neural Networks. PhD thesis, Brno University of Technology, 2012. OpenAlex ↗ · Scholar ↗
  24. T. Mikolov, I. Sutskever, A. Deoras, H. Le, S. Kombrink, and J. Cernocky. Subword language modeling with neural networks. Technical report, Unpublished Manuscript, 2012. OpenAlex ↗ · Scholar ↗
  25. A. Mnih and G. Hinton. A Scalable Hierarchical Distributed Language Model. In Advances in Neural Information Processing Systems, volume 21, 2008. OpenAlex ↗ · Scholar ↗
  26. A. Mnih and Y. W. Teh. A fast and simple algorithm for training neural probabilistic language models. In Proceedings of the 29th International Conference on Machine Learning, pages 1751–1758, 2012. our card
  27. T. N. Sainath, A. Mohamed, B. Kingsbury, and B. Ramabhadran. Low-rank matrix factorization for deep neural network training with high-dimensional output targets. In Proc. ICASSP, 2013. OpenAlex ↗ · Scholar ↗
  28. M. Schuster. Better generative models for sequential data problems: Bidirectional recurrent mixture density networks. pages 589–595. The MIT Press, 1999. OpenAlex ↗ · Scholar ↗
  29. I. Sutskever, G. E. Hinton, and G. W. Taylor. The recurrent temporal restricted boltzmann machine. pages 1601–1608, 2008. OpenAlex ↗ · Scholar ↗
  30. I. Sutskever, J. Martens, and G. Hinton. Generating text with recurrent neural networks. In ICML, 2011. OpenAlex ↗ · Scholar ↗
  31. G. W. Taylor and G. E. Hinton. Factored conditional restricted boltzmann machines for modeling motion style. In Proc. 26th Annual International Conference on Machine Learning, pages 1025–1032, 2009. OpenAlex ↗ · Scholar ↗
  32. T. Tieleman and G. Hinton. Lecture 6.5 - rmsprop: Divide the gradient by a running average of its recent magnitude, 2012. OpenAlex ↗ · Scholar ↗
  33. R. Williams and D. Zipser. Gradient-based learning algorithms for recurrent networks and their computational complexity. In Back-propagation: Theory, Architectures and Applications, pages 433–486. 1995. OpenAlex ↗ · Scholar ↗