Title: UNBIASED ONLINE RECURRENT OPTIMIZATION

Abstract: The novel Unbiased Online Recurrent Optimization (UORO) algorithm allows for online learning of general recurrent computational graphs such as recurrent network 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 modification of NoBackTrack Ollivier et al. ( 2015) that bypasses the need for model sparsity and makes implementation easy in current deep learning frameworks, even for complex 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 influence, truncated BPTT diverges unless the truncation span is very significantly 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 final 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.

1. RELATED 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 flows after a fixed 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. 1 . 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. (2002); 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 flows 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.

2. BACKGROUND:

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 := ∂θ 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 fixed 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 exemplified in Fig. 2a .

3. UNBIASED ONLINE RECURRENT OPTIMIZATION:

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. (2015) 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.1. FORWARD 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 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 ∂ 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 modifies 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 st ⊗ θt , where st is a column vector of the same dimension as s t , θt is a row vector of the same dimension as θ , and ⊗ denotes the outer product. The resulting quantity is thus a matrix of the same size as ∂s t /∂θ. The memory cost of storing st 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 st and θt are built to provide unbiasedness.

3.2. RANK-ONE TRICK: FROM RTRL TO UORO:

Given an unbiased estimation of ∂s t /∂θ, namely, a stochastic matrix Gt such that E Gt = ∂s t /∂θ, unbiased estimates of ∂ t+1 /∂θ and ∂s t+1 /∂θ can be derived by plugging Gt in ( 4) and ( 5). Unbiasedness is preserved thanks to linearity of the mean, because both (4) and ( 5) are affine in ∂s t /∂θ.

Thus, assuming the existence of a rank-one unbiased approximation Gt = st ⊗ θt at time t, we can plug it in (5) to obtain an unbiased approximation Ĝt+1 at time t

+ 1 Ĝt+1 = ∂F state ∂θ (x t+1 , s t , θ) + ∂F state ∂s (x t+1 , s t , θ) st ⊗ θt . (6)

However, in general this is no longer rank-one.

To transform Ĝt+1 into Gt+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

Ã := k i=1 ρ i ν i v i ⊗ k i=1 ν i w i ρ i (8)

Then Ã is an unbiased rank-one approximation of A:

E ν Ã = A.

The rank-one trick can be applied for any ρ. The choice of ρ influences the variance of the approximation; choosing

ρ i = w i / v i (9)

minimizes the variance of the approximation, E A -Ã 2 2 Ollivier et al. (2015) .

The UORO update is obtained by applying the rank-one trick twice to (6). First, ∂Fstate ∂θ (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

Applying Prop. 1 again to this rank-two estimate, with variance minimization, yields UORO's estimate Gt+1

EQUATION

which satisfies that E ν Gt+1 is equal to (6). (By elementary algebra, some random signs that should appear in (12) cancel out.) Here

ρ 0 = θt ∂Fstate ∂s (x t+1 , s t , θ) st , ρ 1 = ν ∂Fstate ∂θ (x t+1 , s t , θ) ν (13)

minimizes variance of the second reduction.

The unbiased estimation ( 12) is rank-one and can be rewritten as Gt+1 = st+1 ⊗ θt+1 with the update

EQUATION

Initially, ∂s 0 /∂θ = 0, thus s0 = 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 ∂ t /∂θ. Thanks to the construction above, by induction all these estimates are unbiased. 4We are left to demonstrate that these update rules are scalably implementable.

3.3. IMPLEMENTATION:

Implementing UORO requires maintaining the rank-one approximation and the corresponding gradient loss estimate. UORO's estimate of the loss gradient ∂ t+1 /∂ θ at time t + 1 is expressed by plugging into (4) the rank-one approximation ∂s t /∂θ ≈ st ⊗ θt , which results in 

∂ t+1 ∂o (o t+1 , o * t+1 ) ∂F out ∂s (x t+1 , s t , θ) • st θt + ∂ t+1 ∂o (o t+1 , o * t+1 ) ∂F out ∂θ (x t+1 ,

EQUATION

computable through two applications of F state . This operation is referred to as tangent forward propagation Simard et al. (1991) 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. 1. 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 , e.g. F out .backprop((x t+1 , s t , θ), δo t+1 ) has three components, of the same dimensions as x t+1 , s t and θ .

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. (2010) . 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.4. MEMORY-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 Algorithm 1 becomes 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 t+T t+1 := t+T k=t+1 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 

, θ), (0, st , 0)) (_, _, δθ g ) ← F state .backprop((x t+1 , s t , θ), ν ) /* compute normalizers */ ρ 0 ← θt st+1 + ε + ε , ρ 1 ← δθ g ν + ε + ε with ε = 10 -7 /* reduce */ st+1 ← ρ 0 st+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 significantly 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 = 2 visibly reduced variance in preliminary tests.

4. 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 specifically 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 influence 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 first 10 7 characters of the full works of Shakespeare using UORO. The network is then rerun 100 times on the 10000 first characters of the text, and gradients estimates at each time steps are computed, but not applied. The gradient relative variance, that is

EQUATION

)

is computed, where the average is taken with respect to runs. This quantity appears to be stationary over time (Fig. 1a ).

5. 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 defined in (18), should increase as the number of hidden units increases.

This increase is experimentally verified 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 figure, 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 exemplified 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.

6. EXPERIMENTS ILLUSTRATING TRUNCATION BIAS:

The set of experiments below aims at displaying specific 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.

Influence balancing. The first test case exemplifies learning of a scalar parameter θ which has a positive influence 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. 

1 × 10 -12 1 × 10 -10 1 × 10 -8 1 × 10 -6 1 × 10 -4 1 × 10 -2 1 × 10 0 1 × 10 2 1 × 10 4 1 ×

with A a square matrix of size n with A i,i = 1/2, A i,i+1 = 1/2, and 0 elsewhere; θ ∈ R is a scalar parameter. The second term has p positive-θ entries and np 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 influence 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 first 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 first t characters, 1 t t s=1 s . (Losses for individual characters are quite noisy, as not all characters in the sequence are equally difficult to predict.) This would be the compression rate in bits per character if the models were used as online compression algorithms on the first t characters. In addition, in Table 1 we report a "recent" loss on the last 100, 000 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 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.

DISTANT 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 first s characters between brackets and finally 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. Plots for a few setups are given in Fig. 4 . 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 significantly 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.

CONCLUSION:

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 benefit from its unbiasedness, converging even in cases where truncated BPTT fails to reliably achieve good results or diverges pathologically.

Arguably, truncated BPTT might still learn some dependencies beyond its truncation range, by a mechanism similar to Echo State NetworksJaeger (2002). However, truncated BPTT's gradient estimate has a marked bias towards short-term rather than long-term dependencies, as shown in the first experiment of Section 6.

2 Storage of past activations can be reduced, e.g.Gruslys et al. (2016). However, storage of all past inputs is necessary.

Variance minimization is not used at this step, since computing w i v i for every i is not scalable.

In practice, since θ changes during learning, unbiasedness only holds exactly in the limit of small learning rates. This is not specific to UORO as it also affects RTRL.

Figures and Tables:

Figure 1: (a) The relative variance of UORO gradient estimates does not significantly increase with time. Note the logarithmic scale on the time axis. (b) The relative variance of UORO gradient estimates significantly increases with network size. Note the logarithmic scale on number of units. (c) Variance of larger networks affects learning on a small range copy task.

Figure 2: (a)Results for influence balancing with 23 units and 13 minus; note the vertical log scale. (b)Learning curves on distant brackets (1, 5, 10).

[a]eecbe[a] [j]fbfjd[j] [c]bgddc[c] [d]gjhai[d] [e]iaghb[e] [h]bigaj[h](b) Distant brackets (1, 5, 10).

a n b n (1, 32).

Figure 3: Datasets.

Figure 4: Learning curves on a n b n (1,32)

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 difficulty lies in matching the number of a's and b's.

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 equationsF 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 s (o s , o * s ) := (o so * s ) 2 .Optimization by gradient descent is standard for neural networks. In the spirit of stochastic gradient descent, we can optimize the total loss L =

Table content: <table><tr><td/><td colspan="2">t (o t , o  *  t ) one term at a time and update the</td></tr><tr><td colspan="2">0≤t≤T</td><td/></tr><tr><td>parameter online at each time step via</td><td/><td/></tr><tr><td>θ ← θ -η t</td><td>∂ t ∂θ</td><td>(3)</td></tr><tr><td colspan="3">where η t is a scalar learning rate at time t. (Other gradient-based optimizers can also be used, once</td></tr><tr><td colspan="2">∂ t ∂θ is known.) The focus is then to compute, or approximate, ∂ t ∂θ .</td><td/></tr><tr><td>BPTT computes ∂ t</td><td/><td/></tr></table>

s t , θ). (16) Backpropagating ∂ t+1 /∂o t+1 once through F out returns (∂ t+1 /∂o t+1 • ∂F out /∂x t+1 , ∂ t+1 /∂o t+1 • ∂F out /∂s t , ∂ t+1 /∂o t+1 • ∂F out /∂θ), thus providing all necessary terms to compute (16).

Table content: <table/>

Algorithm 1 -One step of UORO (from time t to t + 1)Inputs:x t+1 , o * t+1 , s t and θ: input, target, previous recurrent state, and parameters st column vector of size state, θt row vector of size params such that E st ⊗ θt = ∂s t /∂θ -SGDOpt and η t+1 : stochastic optimizer and its learning rate Outputs:-t+1 , s t+1 and θ: loss, new recurrent state, and updated parameters -st+1 and θt+1 such that E st+1 ⊗ θt+1 = ∂s t+1 /∂θ -gt+1 such that E gt+1 = ∂ 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 , θ) Draw ν, column vector of random signs ±1 of size state st+1 ← F state .forwarddiff((x t+1 , s t

Table content: <table><tr><td>t+1 ← (o t+1 , o  *  t+1 )</td><td/></tr><tr><td>/* compute gradient estimate */</td><td/></tr><tr><td>(_, δs, δθ) ← F out .backprop (x t+1 , s t , θ), gt+1 ← (δs • st ) θt + δθ</td><td>∂ t+1 ∂o t+1</td></tr><tr><td>/* prepare for reduction */</td><td/></tr></table>

Averaged loss on the 10 5 last iterations on a n b n (1, 32).

Table content: <table><tr><td/><td>Truncation</td><td>LSTM GRU</td></tr><tr><td/><td colspan="2">No memory (default) 0.147 0.155</td></tr><tr><td>UORO</td><td>Memory-2</td><td>0.149 0.174</td></tr><tr><td/><td>Memory-16</td><td>0.154 0.149</td></tr><tr><td/><td>1</td><td>0.178 0.231</td></tr><tr><td>Truncated BPTT</td><td>2</td><td>0.149 0.285</td></tr><tr><td/><td>16</td><td>0.144 0.207</td></tr></table>

Peer review (iclr2018):
 This paper presents a generic unbiased low-rank stochastic approximation to full rank matrices that makes it possible to do online RNN training without the O(n^3) overhead of real-time recurrent learning (RTRL). This is an important and long-sought-after goal of connectionist learning and this paper presents a clear and concise description of why their method is a natural way of achieving that goal, along with experiments on classic toy RNN tasks with medium-range time dependencies for which other low-memory-overhead RNN training heuristics fail. My only major complaint with the paper is that it does not extend the method to large-scale problems on real data, for instance work from the last decade on sequence generation, speech recognition or any of the other RNN success stories that have led to their wide adoption (eg Graves 2013, Sutskever, Martens and Hinton 2011 or Graves, Mohamed and Hinton 2013). However, if the paper does achieve what it claims to achieve, I am sure that many people will soon try out UORO to see if the results are in any way comparable.