U NBIASED O NLINE R ECURRENT O PTIMIZATION
A BSTRACT
The novel Unbiased Online Recurrent Optimization (UORO) algorithm allows for online learning of general recurrent computational graphs such as recurrent net work models.
It works in a streaming fashion and avoids backtracking through past activations and inputs.
UORO is computationally as costly as Truncated
Backpropagation Through Time (truncated BPTT) a widespread algorithm for online learning of recurrent networks Jaeger (2002).
UORO is a modiﬁcation of
NoBackTrack Ollivier et al.
(2015) that bypasses the need for model sparsity and makes implementation easy in current deep learning frameworks, even for com - plex models.
Like NoBackTrack, UORO provides unbiased gradient estimates; unbiasedness is the core hypothesis in stochastic gradient descent theory, without which convergence to a local optimum is not guaranteed
On the contrary , truncated BPTT does not provide this property, leading to possible divergence.
On synthetic tasks where truncated BPTT is shown to diverge, UORO converges.
For instance, when a parameter has a positive short-term but negative long-term inﬂuence, truncated BPTT diverges unless the truncation span is very signiﬁcantly longer than the intrinsic temporal range of the interactions, while UORO performs well thanks to the unbiasedness of its gradients.
Current recurrent network learning algorithms are ill-suited to online learning via a single pass through long sequences of temporal data.
Backpropagation Through Time (BPTT Jaeger (2002)), the current standard for training recurrent architectures, is well suited to many short training sequences.
Treating long sequences with BPTT requires either storing all past inputs in memory and waiting for a long time between each learning step, or arbitrarily splitting the input sequence into smaller sequences, and applying BPTT to each of those short sequences, at the cost of losing long term dependencies.
This paper introduces Unbiased Online Recurrent Optimization (UORO), an online and memoryless learning algorithm for recurrent architectures: UORO processes and learns from data samples sequentially, one sample at a time.
Contrary to BPTT, UORO does not maintain a history of previous inputs and activations.
Moreover, UORO is scalable : processing data samples with UORO comes at a similar computational and memory cost as just running the recurrent model on those data.
Like most neural network training algorithms, UORO relies on stochastic gradient optimization.
The theory of stochastic gradient crucially relies on the unbiasedness of gradient estimates to provide convergence to a local optimum.
To this end, in the footsteps of NoBackTrack (NBT) Ollivier et al.
(2015), UORO provides provably unbiased gradient estimates, in a scalable, streaming fashion.
Unlike NBT, though, UORO can be easily implemented in a black-box fashion on top of an existing recurrent model in current machine learning software, without delving into the structure and code of the model.
The framework for recurrent optimization and UORO is introduced in Section 2.
The ﬁnal algorithm is reasonably simple (Alg. 1), but its derivation (Section 3) is more complex.
In Section 6, UORO is shown to provide convergence on a set of synthetic experiments where truncated BPTT fails to display reliable convergence.
An implementation of UORO is provided as supplementary material.
R ELATED WORK
A widespread approach to online learning of recurrent neural networks is Truncated Backpropagation Through Time (truncated BPTT)
Jaeger (2002), which mimics Backpropagation Through Time, but zeroes gradient ﬂows after a ﬁxed number of timesteps.
This truncation makes gradient estimates biased; consequently, truncated BPTT does not provide any convergence guarantee.
Learning is biased towards short-time dependencies.
Storage of some past inputs and states is required.
Online, exact gradient computation methods have long been known ( Real Time Recurrent Learning (RTRL)
Williams & Zipser (1989); Pearlmutter (1995)), but their computational cost discards them for reasonably-sized networks.
NoBackTrack (NBT) Ollivier et al.
(2015) also provides unbiased gradient estimates for recurrent neural networks.
However, contrary to UORO, NBT cannot be applied in a blackbox fashion, making it extremely tedious to implement for complex architectures.
Other previous attempts to introduce generic online learning algorithms with a reasonable computational cost all result in biased gradient estimates.
Echo State Networks (ESNs) Jaeger (2002); Jaeger et al.
(2007) simply set to 0 the gradients of recurrent parameters.
Others, e.g., Maass et al.
Steil (2004), introduce approaches resembling ESNs, but keep a partial estimate of the recurrent gradients.
The original Long Short Term Memory algorithm Hochreiter & Schmidhuber (1997) (LSTM now refers to a particular architecture) cuts gradient ﬂows going out of gating units to make gradient computation tractable.
Decoupled Neural Interfaces Jaderberg et al.
(2016) bootstrap truncated gradient estimates using synthetic gradients generated by feedforward neural networks.
The algorithm in Movellan et al.
(2002) provides zeroth-order estimates of recurrent gradients via diffusion networks; it could arguably be turned online by running randomized alternative trajectories.
Generally these approaches lack a strong theoretical backing, except arguably ESNs.
B ACKGROUND
UORO is a learning algorithm for recurrent computational graphs.
Formally, the aim is to optimize θ , a parameter controlling the evolution of a dynamical system
[Equation]
in order to minimize a total loss L := (cid:80) 0 ≤ t ≤ T (cid:96) t ( o t , o ∗ t ) , where o ∗ t is a target output at time t .
For instance, a standard recurrent neural network, with hidden state s t (preactivation values) and output o t at time t , is described with the update equations F state ( x t +1 , s t , θ ) :
= W x x t +1 +
W s tanh ( s t ) + b and F out ( x t +1 , s t , θ ) :
= W o tanh ( F state ( x t +1 , s t , θ ))
+ b o ; here the parameter is θ =
( W x , W s , b, W o , b o ) , and a typical loss might be (cid:96) s ( o s , o ∗ s ) :
=
( o s − o ∗ s
Optimization by gradient descent is standard for neural networks.
In the spirit of stochastic gradient descent, we can optimize the total loss L = (cid:80)
[Equation]
≤ T (cid:96) t ( o t , o ∗ t ) one term at a time and update the parameter online at each time step via
[Equation]
where η t is a scalar learning rate at time t .
(Other gradient-based optimizers can also be used, once ∂(cid:96)
t ∂θ is known.)
The focus is then to compute, or approximate, ∂(cid:96)
t ∂θ .
BPTT computes ∂(cid:96)
t ∂θ by unfolding the network through time, and backpropagating through the unfolded network, each timestep corresponding to a layer.
BPTT thus requires maintaining the full unfolded network, or, equivalently, the history of past inputs and activations.
2 Truncated BPTT only unfolds the network for a ﬁxed number of timesteps, reducing computational cost in online settings Jaeger (2002).
This comes at the cost of biased gradients, and can prevent convergence of the gradient descent even for large truncations, as clearly exempliﬁed in Fig.
2a.
U NBIASED O NLINE R ECURRENT O PTIMIZATION
Unbiased Online Recurrent Optimization is built on top of a forward computation of the gradients, rather than backpropagation.
Forward gradient computation for neural networks (RTRL) is described in Williams & Zipser (1989) and we review it in Section 3.1.
The derivation of UORO follows in Section 3.2.
Implementation details are given in Section 3.3.
UORO’s derivation is strongly connected to Ollivier et al.
but differs in one critical aspect: the sparsity hypothesis made in the latter is relieved, resulting in reduced implementation complexity without any model restriction.
The proof of UORO’s convergence to a local optimum can be found in Massé (2017).
3. F ORWARD COMPUTATION OF THE GRADIENT
Forward computation of the gradient for a recurrent model (RTRL) is directly obtained by applying the chain rule to both the loss function and the state equation (1), as follows.
Direct differentiation and application of the chain rule to (cid:96) t +1 yields
[Equation]
Here, the term ∂s t /∂θ represents the effect on the state at time t of a change of parameter during the whole past trajectory.
This term can be computed inductively from time t to t + 1 .
Intuitively, looking at the update equation (1), there are two contributions to ∂s t +1 /∂θ :
• The direct effect of a change of θ on the computation of s t +1 , given s t .
• The past effect of θ on s t via the whole past trajectory.
With this in mind, differentiating (1) with respect to θ yields
[Equation]
This gives a way to compute the derivative of the instantaneous loss without storing past history: at each time step, update ∂s t /∂θ from ∂s t − 1 /∂θ , then use this quantity to directly compute ∂(cid:96) t +1 /∂θ .
This is how RTRL Williams & Zipser (1989) proceeds.
A huge disadvantage of RTRL is that ∂s t /∂θ is of size dim ( state ) × dim ( params ) .
For instance, with a fully connected standard recurrent network with n units, ∂s t /∂θ scales as n 3 .
This makes
RTRL impractical for reasonably sized networks.
UORO modiﬁes RTRL by only maintaining a scalable, rank-one, provably unbiased approximation of ∂s t /∂θ , to reduce the memory and computational cost.
This approximation takes the form ˜ s t ⊗ ˜ θ t , where ˜ s t is a column vector of the same dimension as s t , ˜ θ t is a row vector of the same dimension as θ (cid:62) , and ⊗ denotes the outer product.
The resulting quantity is thus a matrix of the same size as ∂s t /∂θ .
The memory cost of storing ˜ s t and ˜ θ t scales as dim ( state ) + dim ( params ) .
Thus UORO is as memory costly as simply running the network itself (which indeed requires to store the current state and parameters).
The following section details how ˜ s t and ˜ θ t are built to provide unbiasedness.
3. R ANK - ONE TRICK : FROM RTRL TO UORO
Given an unbiased estimation of ∂s t /∂θ , namely, a stochastic matrix ˜
G t such that E ˜ G t = ∂s t /∂θ , unbiased estimates of ∂(cid:96) t +1 /∂θ and ∂s t +1 /∂θ can be derived by plugging ˜ G t in (4) and (5).
Unbiasedness is preserved thanks to linearity of the mean, because both (4) and (5) are afﬁne in ∂s t /∂θ .
Thus, assuming the existence of a rank-one unbiased approximation ˜ G t = ˜ s t ⊗ ˜ θ t at time t , we can plug it in (5) to obtain an unbiased approximation ˆ G t +1 at time t +
[Equation]
However, in general this is no longer rank-one.
To transform ˆ G t +1 into ˜ G t +1 , a rank-one unbiased approximation, the following rank-one trick, introduced in Ollivier et al.
(2015) is used:
Proposition 1.
Let A be a real matrix that decomposes as
[Equation]
Let ν be a vector of k independent random signs, and ρ a vector of k positive numbers.
Consider the rank-one matrix
[Equation]
Then ˜ A is an unbiased rank-one approximation of A : E ν ˜
A =
A .
The rank-one trick can be applied for any ρ .
The choice of ρ inﬂuences the variance of the approximation; choosing
[Equation]
minimizes the variance of the approximation,
[Equation]
The UORO update is obtained by applying the rank-one trick twice to (6).
First, ∂F state ∂θ ( x t +1 , s t , θ ) is reduced to a rank one matrix, without variance minimization.
3 Namely, let ν be a vector of independant random signs; then,
[Equation]
This results in a rank-two, unbiased estimate of ∂s t +1 /∂θ by substituting (10) into (6) [Equation] state
[Equation]
Applying Prop. 1 again to this rank-two estimate, with variance minimization, yields UORO’s estimate
˜ G t +
[Equation]
[Equation]
which satisﬁes that E ν ˜
G t +1 is equal to (6).
(By elementary algebra, some random signs that should appear in (12) cancel out.)
Here
[Equation]
minimizes variance of the second reduction.
The unbiased estimation (12) is rank-one and can be rewritten as ˜ G t [-+
-]+ [Equation] [Equation]
˜ θ
[Equation]
1 with the update [Equation]
[Equation]
Initially, ∂s 0 /∂θ = 0 , thus ˜ s 0 = 0 , ˜ θ 0 = 0 yield an unbiased estimate at time 0 .
Using this initial estimate and the update rules (14)–(15), an estimate of ∂s t /∂θ is obtained at all subsequent times, allowing for online estimation of ∂(cid:96)
t /∂θ .
Thanks to the construction above, by induction all these estimates are unbiased.
We are left to demonstrate that these update rules are scalably implementable.
3. I MPLEMENTATION
Implementing UORO requires maintaining the rank-one approximation and the corresponding gradient loss estimate.
UORO’s estimate of the loss gradient ∂(cid:96)
t +1 /∂
θ at time t + 1 is expressed by plugging into (4) the rank-one approximation ∂s t /∂θ ≈ ˜ s t ⊗ ˜ θ t , which results in (cid:18) ∂(cid:96) t +
[Equation]
Backpropagating ∂(cid:96) t +1 /∂o t
+1 once through F out returns ( ∂(cid:96) t +1 /∂o t +1 · ∂F out /∂x t +1 , ∂(cid:96)
t +1 /∂o t +1 · ∂F out /∂s t , ∂(cid:96)
t +1 /∂o t +1 · ∂F out /∂θ ) , thus provid-
ing all necessary terms to compute (16).
Updating ˜ s and ˜ θ requires applying (14)–(15) at each step.
Backpropagating the vector of random signs ν once through F state returns (cid:0) _ , _ , ν (cid:62) ∂F state ( x t +1 , s t , θ ) /∂θ (cid:1) , providing for (15).
Updating ˜ s via (14) requires computing ( ∂F state /∂s t ) · ˜ s t .
This is computable numerically through ∂F state
[Equation] [Equation]
computable through two applications of F state .
This operation is referred to as tangent forward propagation Simard et al.
and can also often be computed algebraically.
This allows for complete implementation of one step of UORO (Alg. 1).
The cost of UORO (including running the model itself) is three applications of F state , one application of F out , one backpropagation through F out and F state , and a few elementwise operations on vectors and scalar products.
The resulting algorithm is detailed in Alg.
F. forward ( v ) denotes pointwise application of
F at point v , F. backprop ( v, δo ) backpropagation of row vector δo through F at point v , and
F. forwarddiff ( v, δv ) tangent forward propagation of column vector δv through F at point v .
Notably, F. backprop ( v, δo ) has the same dimension as v (cid:62) , e.g. F out .
backprop (( x t +1 , s t , θ ) , δo t +1 ) has three components, of the same dimensions as x (cid:62) t +1 , s (cid:62) t and θ (cid:62) .
The proposed update rule for stochastic gradient descent (3) can be directly adapted to other optimizers, e.g. Adaptative Momentum (Adam) Kingma & Ba (2014) or Adaptative Gradient Duchi et al.
Vanilla stochastic gradient descent (SGD) and Adam are used hereafter.
In Alg. 1, such optimizers are denoted by SGDOpt and the corresponding parameter update given current parameter θ , gradient estimate g t and learning rate η t is denoted SGDOpt .
update ( g t , η t , θ ) .
3. M EMORY - T UORO AND RANK - k UORO
The unbiased gradient estimates of UORO injects noise via ν , thus requiring smaller learning rates.
To reduce noise, UORO can be used on top of truncated BPTT so that recent gradients are computed exactly.
Formally, this just requires applying Algorithm 1 to a new transition function F T which is just T consecutive steps of the original model F .
Then the backpropagation operation in Algorithmbecomes a backpropagation over the last T steps, as in truncated BPTT.
The loss of one step of F T is the sum of the losses of the last T steps of F , namely (cid:96) t + T t +1 :
=
t + T (cid:80) k
= t +1 (cid:96) k .
Likewise, the forward tangent propagation is performed through F T .
This way, we obtain an unbiased gradient estimate in which the gradients from the last T steps are computed exactly and incur no noise.
The resulting algorithm is referred to as memory- T UORO.
Its scaling in T is similar to T -truncated BPTT, both in
Inputs:
– x t +1 , o ∗ t +1 , s t and θ : input, target, previous recurrent state, and parameters – ˜ s t column vector of size state , ˜ θ t row vector of size params such that E ˜ s t ⊗ ˜ θ t = ∂s t /∂θ – SGDOpt and η t +1 : stochastic optimizer and its learning rate
Outputs:
– (cid:96) t +1 , s t
+
and θ : loss, new recurrent state, and updated parameters – ˜ s t
+1 and ˜
θ t +1 such that E ˜ s t +1 ⊗ ˜ θ t +1 =
∂s t +1 /∂θ – ˜ g t +1 such that E ˜ g t +1 =
∂(cid:96) t +1 /∂θ
/* compute next state and loss */ s t +1 ← F state .
forward ( x t +1 , s t , θ ) ,
o t +1 ← F out .
forward ( x t +1 , s t , θ ) (cid:96) t +1 ← (cid:96) ( o t +1 , o ∗ t +1 ) /
* compute gradient estimate */ ( _ , δs, δθ ) ← F out .
backprop (cid:18) ( x t +1 , s t , θ ) , ∂(cid:96) t +1 ∂o t + (cid:19) ˜
g t +1 ← ( δs · ˜ s t ) ˜ θ t
+ δθ /* prepare for reduction */
Draw ν , column vector of random signs ± 1 of size state ˜ s t +1 ← F state .
forwarddiff (( x t +1 , s t , θ ) , (0 , ˜ s t , 0))
( _ , _ , δθ g ) ← F state .
backprop (( x t +1 , s t , θ ) , ν (cid:62) ) /
* compute normalizers */ ρ 0 ← (cid:115) (cid:107) ˜
θ t (cid:107) (cid:107) ˜ s t
+1 (cid:107) + ε + ε , ρ 1 ← (cid:115) (cid:107) δθ g (cid:107) (cid:107) ν (cid:107) + ε + ε with ε =
−/* reduce */ ˜ s t +1 ← ρ 0 ˜ s t +1 + ρ 1 ν, ˜ θ t +1 ← ˜ θ t ρ 0 + δθ g ρ 1 /* update θ */
SGDOpt .
update (˜ g t +1 , η t +1 , θ ) terms of memory and computation.
In the experiments below, memory- T UORO reduced variance early on, but did not signiﬁcantly impact later performance.
The noise in UORO can also be reduced by using higher-rank gradient estimates (rank- r instead of rank- 1 ), which amounts to maintaining r distinct values of ˜ s and ˜ θ in Algorithm 1 and averaging the resulting values of ˜ g .
We did not exploit this possibility in the experiments below, although r =visibly reduced variance in preliminary tests.
UORO’ S VARIANCE IS STABLE AS TIME GOES BY
Gradient-based sequential learning on an unbounded data stream requires that the variance of the gradient estimate does not explode through time.
UORO is speciﬁcally built to provide an unbiased estimate whose variance does not explode over time.
A precise statement regarding UORO’s convergence and boundedness of the variance of gradients is provided in Massé (2017).
Informally, when the largest eigenvalue of the differential transition operator ∂F state /∂s is uniformly bounded by a constant δ < 1 (which characterizes stable dynamical systems), the normalizing factors in (14) and (15) enforce that the inﬂuence of previous ν ’s decrease exponentially with time.
We hereby provide an experimental validation of the boundedness of UORO’s variance in Fig. 1a.
To monitor the variance of UORO’s estimate over time, a 64 -unit GRU recurrent network is trained on the ﬁrst 10 7 characters of the full works of Shakespeare using UORO.
The network is then rerun
−
[Figure]
G r a d i e n tr e l a t i v e v a r i a n ce
Timestep (a)
G r a d i e n tr e l a t i v e v a r i a n ce
[Figure] [Figure]
(b)
[Figure] [Figure]
100 times on the 10000 ﬁrst characters of the text, and gradients estimates at each time steps are computed, but not applied.
The gradient relative variance, that is
[Equation]
(18) is computed, where the average is taken with respect to runs.
This quantity appears to be stationary over time (Fig. 1a).
UORO’ S VARIANCE INCREASES WITH THE NUMBER OF HIDDEN UNITS
As the number of hidden units in the recurrent network increases, the rank one approximation that is used to provide an unbiased gradient estimate becomes coarser.
Consequently, the relative variance, as deﬁned in (18), should increase as the number of hidden units increases.
This increase is experimentally veriﬁed in Fig.
1b.
Untrained GRU networks with various number of units are run for 10 timesteps, 100 times for each size, and the UORO gradient estimate after these 10 timesteps is computed (but not applied).
The relative variance of these gradients over the 100 runs is evaluated, for each network size.
As shown in the ﬁgure, the relative variance increases with the number of units.
Note the horizontal log scale.
The increase of the variance of the estimate with network size underlines the need for smaller learning rates when training large networks with UORO, compared to truncated backpropagation.
This can imply slower learning for the kind of dependencies that truncated backpropagation can learn.
The need for lower learning rates with larger networks is exempliﬁed in Fig. 1c.
GRU networks of various hidden sizes are trained with UORO on a simple copy task, as presented in Hochreiter &
Schmidhuber (1997), with a lag of T = 5 .
The networks are all trained with the same decreasing learning rate, η t = 10 − 4 1+3 · 10 − 3 t .
For all network sizes except the largest, the error decreases slowly but steadily.
For the largest network, the variance is too large compared to the learning rate, and the error jumps sharply midway through.
E XPERIMENTS ILLUSTRATING TRUNCATION BIAS
The set of experiments below aims at displaying speciﬁc cases where the biases from truncated
BPTT are likely to prevent convergence of learning.
On this test set, UORO’s unbiasedness provides steady convergence, highlighting the importance of unbiased estimates for general recurrent learning.
Inﬂuence balancing.
The ﬁrst test case exempliﬁes learning of a scalar parameter θ which has a positive inﬂuence in the short term, but a negative one in the long run.
Short-sightedness of truncated algorithms results in abrupt failure, with the parameter exploding in the wrong direction, even with truncation lengths exceeding the temporal dependency range by a factor of 10 or so. [Figure] [Figure] [Figure]
]eecbe[a]
[j]fbfjd[j] [c]bgddc[c] [d]gjhai[d] [e]iaghb[e] [h]
[Figure] h] [Figure] bbbbbb aaaaaaaaaaaaaaaabbbbbbbbbbbbbbbbaaaaaaaabbbbbbbb
[Figure]
Consider the linear dynamics
[Equation]
with A a square matrix of size n with A i,i = 1 / 2 , A i,i +
= 1 / 2 , and 0 elsewhere; θ ∈ R is a scalar parameter.
The second term has p positive- θ entries and n − p negative- θ entries.
Intuitively, the effect of θ on a unit diffuses to shallower units over time (Fig. 3a).
Unit i only feels the effect of θ from unit i + n after n time steps, so the intrinsic time scale of the system is ≈ n .
The loss considered is a target on the shallowest unit s 1 ,
[Equation]
Learning is performed online with vanilla SGD, using gradient estimates either from UORO or Ttruncated BPTT with various T .
Learning rates are of the form η t = η 1+ √ t for suitable values of η .
As shown in Fig.
2a, UORO solves the problem while T -truncated BPTT fails to converge for any learning rate, even for truncations T largely above n .
Failure is caused by ill balancing of time dependencies: the inﬂuence of θ on the loss is estimated with the wrong sign due to truncation.
For n = 23 units, with 13 minus signs, truncated BPTT requires a truncation T ≥ 200 to converge.
Next-character prediction.
The next experiment is character-level synthetic text prediction: the goal is to train a recurrent model to predict the t + 1 -th character of a text given the ﬁrst t online, with a single pass on the data sequence.
A single layer of 64 units, either GRU or LSTM, is used to output a probability vector for the next character.
The cross entropy criterion is used to compute the loss.
At each time t we plot the cumulated loss per character on the ﬁrst t characters, 1 t (cid:80) ts =1 (cid:96) s .
(Losses for individual characters are quite noisy, as not all characters in the sequence are equally difﬁcult to predict.)
This would be the compression rate in bits per character if the models were used as online compression algorithms on the ﬁrst t characters.
In addition, in Table 1 we report a “recent” loss on the last 100 ,characters, which is more representative of the model at the end of learning.
Optimization was performed using Adam with the default setting β 1 = 0 .
9 and β 2 = 0 .
999 , and a decreasing learning rate η t = γ 1+ α √ t , with t the number of characters processed.
As convergence of
[Figure]
A v e r a g e l og - l o ss ( b it s p e r c h a r ac t e r)
[Figure]
UORO requires smaller learning rates than truncated BPTT, this favors UORO.
Indeed UORO can fail to converge with non-decreasing learning rates, due to its stochastic nature.
D ISTANT BRACKETS DATASET ( s, k, a ) .
The distant brackets dataset is generated by repeatedly outputting a left bracket, generating s random characters from an alphabet of size a , outputting a right bracket, generating k random characters from the same alphabet, repeating the same ﬁrst s characters between brackets and ﬁnally outputting a line break.
A sample is shown in Fig.
3b.
UORO is compared to 4 -truncated BPTT.
Truncation is deliberately shorter than the inherent time range of the data, to illustrate how bias can penalize learning if the inherent time range is unknown a priori.
The results are given in Fig.
2b (with learning rates using α = 0 .
015 and γ = 10 − 3 ).
UORO beats 4 -truncated BPTT in the long run, and succeeds in reaching near optimal behaviour both with
GRUs and LSTMs.
Truncated BPTT remains stuck near a memoryless optimum with LSTMs; with
GRUs it keeps learning, but at a slow rate.
Still, truncated BPTT displays faster early convergence.
a n b n ( k, l ) DATASET .
The a n b n ( k, l ) dataset tests memory and counting Gers & Schmidhuber (2001); it is generated by repeatedly picking a random number n between k and l , outputting a string of n a ’s, a line break, n b ’s, and a line break (see Fig. 3c).
The difﬁculty lies in matching the number of a ’s and b ’s.
[Table]
Plots for a few setups are given in Fig.
The learning rates used α = 0 .
03 and γ = 10 − 3 .
Numerical results at the end of training are given in Table 1.
For reference, the true entropy rate is 0 .
14 bpc, while the entropy rate of a model that does not understand that the numbers of a ’s and b ’s coincide is double, 0 .
28 bpc.
Here, in every setup, UORO reliably converges and reaches near optimal performance.
Increasing
UORO’s range does not signiﬁcantly improve results: providing an unbiased estimate is enough to provide reliable convergence in this case.
Meanwhile, truncated BPTT performs inconsistently.
Notably, with GRUs, it either converges to a poor local optimum corresponding to no understanding of the temporal structure, or exhibits gradient reascent in the long run.
Remarkably, with LSTMs rather than GRUs, 16 -truncated BPTT reliably reaches optimal behavior on this problem even with biased gradient estimates.
C ONCLUSION
We introduced UORO, an algorithm for training recurrent neural networks in a streaming, memoryless fashion.
UORO is easy to implement, and requires as little computation time as truncated
BPTT, at the cost of noise injection.
Importantly, contrary to most other approaches, UORO scalably provides unbiasedness of gradient estimates.
Unbiasedness is of paramount importance in the current theory of stochastic gradient descent.
Furthermore, UORO is experimentally shown to beneﬁt from its unbiasedness, converging even in cases where truncated BPTT fails to reliably achieve good results or diverges pathologically.