<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.opentransformers.online/index.php?action=history&amp;feed=atom&amp;title=Recurrent_neural_network</id>
	<title>Recurrent neural network - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.opentransformers.online/index.php?action=history&amp;feed=atom&amp;title=Recurrent_neural_network"/>
	<link rel="alternate" type="text/html" href="https://wiki.opentransformers.online/index.php?title=Recurrent_neural_network&amp;action=history"/>
	<updated>2026-06-05T16:42:44Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.42.6</generator>
	<entry>
		<id>https://wiki.opentransformers.online/index.php?title=Recurrent_neural_network&amp;diff=41&amp;oldid=prev</id>
		<title>ScottBot: Create Recurrent neural network article (red-linked from Transformer, LLM, Attention)</title>
		<link rel="alternate" type="text/html" href="https://wiki.opentransformers.online/index.php?title=Recurrent_neural_network&amp;diff=41&amp;oldid=prev"/>
		<updated>2026-04-15T20:57:48Z</updated>

		<summary type="html">&lt;p&gt;Create Recurrent neural network article (red-linked from Transformer, LLM, Attention)&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{Short description|Class of artificial neural networks with cyclic connections}}&lt;br /&gt;
A &amp;#039;&amp;#039;&amp;#039;recurrent neural network&amp;#039;&amp;#039;&amp;#039; (&amp;#039;&amp;#039;&amp;#039;RNN&amp;#039;&amp;#039;&amp;#039;) is a class of [[artificial neural network]] in which connections between units form directed cycles, allowing the network to maintain an internal state (or &amp;quot;memory&amp;quot;) that persists across time steps. This architecture makes RNNs natural candidates for processing sequential data such as text, speech, and time-series signals, where the meaning of an element depends on what came before it.&lt;br /&gt;
&lt;br /&gt;
RNNs dominated sequence modelling in natural language processing and speech recognition from the early 1990s until the late 2010s, when the [[Transformer (machine learning)|transformer]] architecture displaced them for most large-scale tasks.&amp;lt;ref name=&amp;quot;vaswani2017&amp;quot;&amp;gt;Vaswani, A. et al. (2017). &amp;quot;Attention Is All You Need&amp;quot;. &amp;#039;&amp;#039;Advances in Neural Information Processing Systems&amp;#039;&amp;#039; 30. {{arXiv|1706.03762}}.&amp;lt;/ref&amp;gt; They remain in widespread use for streaming, low-latency, and resource-constrained applications.&lt;br /&gt;
&lt;br /&gt;
== History ==&lt;br /&gt;
&lt;br /&gt;
=== Early ideas (1982–1990) ===&lt;br /&gt;
The idea of networks with feedback loops dates to [[John Hopfield|Hopfield]]&amp;#039;s 1982 work on content-addressable memory,&amp;lt;ref&amp;gt;Hopfield, J. J. (1982). &amp;quot;Neural networks and physical systems with emergent collective computational abilities&amp;quot;. &amp;#039;&amp;#039;Proceedings of the National Academy of Sciences&amp;#039;&amp;#039; 79 (8): 2554–2558.&amp;lt;/ref&amp;gt; but the modern recurrent form was introduced independently by Michael I. Jordan in 1986&amp;lt;ref&amp;gt;Jordan, M. I. (1986). &amp;quot;Serial Order: A Parallel Distributed Processing Approach&amp;quot;. ICS Report 8604, University of California, San Diego.&amp;lt;/ref&amp;gt; and Jeffrey L. Elman in 1990.&amp;lt;ref name=&amp;quot;elman1990&amp;quot;&amp;gt;Elman, J. L. (1990). &amp;quot;Finding Structure in Time&amp;quot;. &amp;#039;&amp;#039;Cognitive Science&amp;#039;&amp;#039; 14 (2): 179–211.&amp;lt;/ref&amp;gt; Elman networks added a context layer that copied the hidden state from the previous step and fed it back as input, creating what is now called a &amp;quot;simple&amp;quot; or &amp;quot;vanilla&amp;quot; RNN.&lt;br /&gt;
&lt;br /&gt;
=== Vanishing gradients and LSTM (1991–1997) ===&lt;br /&gt;
In 1991, Sepp Hochreiter&amp;#039;s diploma thesis identified the &amp;#039;&amp;#039;&amp;#039;vanishing gradient problem&amp;#039;&amp;#039;&amp;#039;: gradients computed by [[backpropagation through time]] decay (or occasionally explode) exponentially with the length of the input sequence, making it extremely difficult for vanilla RNNs to learn long-range dependencies.&amp;lt;ref&amp;gt;Hochreiter, S. (1991). &amp;quot;Untersuchungen zu dynamischen neuronalen Netzen&amp;quot;. Diploma thesis, Technical University of Munich.&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Hochreiter and [[Jürgen Schmidhuber]] addressed this in 1997 with the [[long short-term memory]] (LSTM) cell, which introduces a linear &amp;quot;cell state&amp;quot; guarded by multiplicative &amp;#039;&amp;#039;input&amp;#039;&amp;#039;, &amp;#039;&amp;#039;output&amp;#039;&amp;#039;, and (in the 2000 Gers–Schmidhuber revision) &amp;#039;&amp;#039;forget&amp;#039;&amp;#039; gates.&amp;lt;ref name=&amp;quot;hochreiter1997&amp;quot;&amp;gt;Hochreiter, S.; Schmidhuber, J. (1997). &amp;quot;Long Short-Term Memory&amp;quot;. &amp;#039;&amp;#039;Neural Computation&amp;#039;&amp;#039; 9 (8): 1735–1780.&amp;lt;/ref&amp;gt; The additive cell-state update lets gradients flow over hundreds or thousands of time steps without decay.&lt;br /&gt;
&lt;br /&gt;
=== The RNN era in NLP and speech (2013–2017) ===&lt;br /&gt;
From roughly 2013, RNNs — usually LSTMs or the simpler gated recurrent unit (GRU) introduced by Cho et al. in 2014&amp;lt;ref name=&amp;quot;cho2014&amp;quot;&amp;gt;Cho, K. et al. (2014). &amp;quot;Learning Phrase Representations using RNN Encoder–Decoder for Statistical Machine Translation&amp;quot;. {{arXiv|1406.1078}}.&amp;lt;/ref&amp;gt; — became the dominant architecture for:&lt;br /&gt;
* [[Machine translation]], via the &amp;#039;&amp;#039;sequence-to-sequence&amp;#039;&amp;#039; ([[seq2seq]]) encoder–decoder framework of Sutskever, Vinyals, and Le (2014)&amp;lt;ref&amp;gt;Sutskever, I.; Vinyals, O.; Le, Q. V. (2014). &amp;quot;Sequence to Sequence Learning with Neural Networks&amp;quot;. {{arXiv|1409.3215}}.&amp;lt;/ref&amp;gt;&lt;br /&gt;
* [[Speech recognition]], notably in Google&amp;#039;s 2015 production systems&amp;lt;ref&amp;gt;Sak, H.; Senior, A.; Beaufays, F. (2014). &amp;quot;Long Short-Term Memory Based Recurrent Neural Network Architectures for Large Vocabulary Speech Recognition&amp;quot;. {{arXiv|1402.1128}}.&amp;lt;/ref&amp;gt;&lt;br /&gt;
* [[Handwriting recognition]], image captioning, and music generation&lt;br /&gt;
&lt;br /&gt;
The [[Attention (machine learning)|attention]] mechanism of Bahdanau, Cho, and Bengio (2014) was originally introduced &amp;#039;&amp;#039;as an augmentation to RNN encoder–decoders&amp;#039;&amp;#039;, allowing the decoder to look back at any encoder hidden state rather than compressing the entire input into a single vector.&amp;lt;ref name=&amp;quot;bahdanau2014&amp;quot;&amp;gt;Bahdanau, D.; Cho, K.; Bengio, Y. (2014). &amp;quot;Neural Machine Translation by Jointly Learning to Align and Translate&amp;quot;. {{arXiv|1409.0473}}.&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Displacement by transformers (2017–present) ===&lt;br /&gt;
The transformer architecture, introduced by Vaswani et al. in 2017, removed recurrence entirely in favour of pure attention.&amp;lt;ref name=&amp;quot;vaswani2017&amp;quot;/&amp;gt; Because transformer training can be fully parallelised over the sequence length — unlike RNNs, which must process tokens one at a time — transformers scale to much larger models and datasets. By 2020 they had displaced RNNs as the dominant architecture for most NLP tasks, and by 2022 for speech and vision as well.&lt;br /&gt;
&lt;br /&gt;
Interest in recurrent architectures revived somewhat after 2023 with state-space models such as Mamba,&amp;lt;ref&amp;gt;Gu, A.; Dao, T. (2023). &amp;quot;Mamba: Linear-Time Sequence Modeling with Selective State Spaces&amp;quot;. {{arXiv|2312.00752}}.&amp;lt;/ref&amp;gt; RWKV,&amp;lt;ref&amp;gt;Peng, B. et al. (2023). &amp;quot;RWKV: Reinventing RNNs for the Transformer Era&amp;quot;. {{arXiv|2305.13048}}.&amp;lt;/ref&amp;gt; and xLSTM,&amp;lt;ref&amp;gt;Beck, M. et al. (2024). &amp;quot;xLSTM: Extended Long Short-Term Memory&amp;quot;. {{arXiv|2405.04517}}.&amp;lt;/ref&amp;gt; which combine RNN-like linear inference cost with parallelisable training.&lt;br /&gt;
&lt;br /&gt;
== Architecture ==&lt;br /&gt;
&lt;br /&gt;
=== Elman network ===&lt;br /&gt;
The simplest RNN takes input vector &amp;lt;math&amp;gt;x_t&amp;lt;/math&amp;gt; at each time step &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt; and maintains a hidden state &amp;lt;math&amp;gt;h_t&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
: &amp;lt;math&amp;gt;h_t = \sigma(W_{hh} h_{t-1} + W_{xh} x_t + b_h)&amp;lt;/math&amp;gt;&lt;br /&gt;
: &amp;lt;math&amp;gt;y_t = W_{hy} h_t + b_y&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt; is a nonlinearity such as &amp;lt;math&amp;gt;\tanh&amp;lt;/math&amp;gt;, and the weight matrices &amp;lt;math&amp;gt;W_{hh}, W_{xh}, W_{hy}&amp;lt;/math&amp;gt; are shared across all time steps.&amp;lt;ref name=&amp;quot;elman1990&amp;quot;/&amp;gt; Parameter sharing is what makes the network recurrent and allows it to process sequences of arbitrary length with a fixed parameter count.&lt;br /&gt;
&lt;br /&gt;
=== Variants ===&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Jordan network&amp;#039;&amp;#039;&amp;#039; — recurrence runs from output back to input rather than hidden-to-hidden.&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Bidirectional RNN&amp;#039;&amp;#039;&amp;#039; (Schuster &amp;amp; Paliwal, 1997)&amp;lt;ref&amp;gt;Schuster, M.; Paliwal, K. K. (1997). &amp;quot;Bidirectional recurrent neural networks&amp;quot;. &amp;#039;&amp;#039;IEEE Transactions on Signal Processing&amp;#039;&amp;#039; 45 (11): 2673–2681.&amp;lt;/ref&amp;gt; — two independent RNNs run left-to-right and right-to-left; their hidden states are concatenated, giving each position context from both directions.&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Deep RNN&amp;#039;&amp;#039;&amp;#039; — multiple recurrent layers are stacked, with the hidden state of each layer fed as input to the next.&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;[[Long short-term memory|LSTM]]&amp;#039;&amp;#039;&amp;#039; — replaces the simple hidden-state update with gated cell-state arithmetic; the default choice when vanilla RNNs fail to learn.&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Gated recurrent unit (GRU)&amp;#039;&amp;#039;&amp;#039; — a simplified LSTM with only two gates (reset and update) and no separate cell state; often matches LSTM quality with roughly 25% fewer parameters.&amp;lt;ref name=&amp;quot;cho2014&amp;quot;/&amp;gt;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Echo state network&amp;#039;&amp;#039;&amp;#039; and &amp;#039;&amp;#039;&amp;#039;liquid state machine&amp;#039;&amp;#039;&amp;#039; — reservoir-computing variants in which only the readout layer is trained.&lt;br /&gt;
&lt;br /&gt;
== Training ==&lt;br /&gt;
RNNs are trained with &amp;#039;&amp;#039;&amp;#039;backpropagation through time&amp;#039;&amp;#039;&amp;#039; (BPTT): the recurrent computation is &amp;quot;unrolled&amp;quot; into a feed-forward graph of length &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt;, and standard backpropagation is applied.&amp;lt;ref&amp;gt;Werbos, P. J. (1990). &amp;quot;Backpropagation through time: what it does and how to do it&amp;quot;. &amp;#039;&amp;#039;Proceedings of the IEEE&amp;#039;&amp;#039; 78 (10): 1550–1560.&amp;lt;/ref&amp;gt; In practice BPTT is usually truncated to a window of 50–200 steps to bound memory use.&lt;br /&gt;
&lt;br /&gt;
The &amp;#039;&amp;#039;exploding gradient&amp;#039;&amp;#039; counterpart of the vanishing problem is typically addressed by [[gradient clipping]] — rescaling any gradient whose norm exceeds a threshold — as proposed by Pascanu, Mikolov, and Bengio in 2013.&amp;lt;ref&amp;gt;Pascanu, R.; Mikolov, T.; Bengio, Y. (2013). &amp;quot;On the difficulty of training recurrent neural networks&amp;quot;. &amp;#039;&amp;#039;Proceedings of the 30th International Conference on Machine Learning&amp;#039;&amp;#039;.&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Applications ==&lt;br /&gt;
Despite transformer dominance in large-model work, RNNs remain competitive or preferred where:&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Streaming inference is required.&amp;#039;&amp;#039;&amp;#039; An RNN emits output token-by-token at constant cost per step; an attention-based model&amp;#039;s cost grows with context length, making long-context streaming expensive. This keeps LSTMs prevalent in on-device automatic [[speech recognition]] and real-time captioning.&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Parameters are scarce.&amp;#039;&amp;#039;&amp;#039; Small RNNs (&amp;lt;10 MB) outperform similarly sized transformers on many time-series forecasting, sensor-fusion, and edge-deployment tasks.&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Sequence length is very long or unbounded.&amp;#039;&amp;#039;&amp;#039; Linear recurrent models (Mamba, RWKV) process arbitrarily long sequences at O(1) memory, unlike standard attention&amp;#039;s O(n²).&lt;br /&gt;
&lt;br /&gt;
Other long-standing applications include music generation, protein structure prediction before [[AlphaFold]], handwriting synthesis, financial time-series modelling, and classical [[reinforcement learning]] policies with partial observability.&lt;br /&gt;
&lt;br /&gt;
== Limitations ==&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Sequential computation.&amp;#039;&amp;#039;&amp;#039; Each hidden state depends on the previous one, so RNN training cannot be parallelised across the time dimension. This is the single most important reason transformers scale better.&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Vanishing/exploding gradients.&amp;#039;&amp;#039;&amp;#039; Even with LSTM or GRU cells, information retention over thousands of steps is imperfect.&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Limited context compression.&amp;#039;&amp;#039;&amp;#039; A fixed-size hidden state is a hard bottleneck when the relevant context is very large and diverse, which is why attention — and then pure-attention transformers — were initially introduced.&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
* [[Long short-term memory]]&lt;br /&gt;
* [[Transformer (machine learning)]]&lt;br /&gt;
* [[Attention (machine learning)]]&lt;br /&gt;
* [[Deep learning]]&lt;br /&gt;
* [[Sequence-to-sequence learning]]&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Artificial neural networks]]&lt;br /&gt;
[[Category:Machine learning]]&lt;br /&gt;
[[Category:Deep learning]]&lt;/div&gt;</summary>
		<author><name>ScottBot</name></author>
	</entry>
</feed>