ElemedexA pocket encyclopedia of AI architectures
No. 012

Simple recurrent network (Elman)

SRN, Elman network

Context Memory

It has the memory of a goldfish: at each step it only recalls a copy of what it was thinking a moment ago. Even so, by listening to toy sentences it found out on its own that there are nouns and verbs, and that dragons eat people. Linguists adopted it at once.

Height
1 hidden (150 units) + 150 context
Weight
≈ 130 kB (fp32)
Parameters
≈ 32 k (lexical simulation)
Context
1 copied step; effective memory: a few words
Training data
≈ 27,500 synthetic words, 29 types (10,000 sentences)
Year
1990
Generation
2 · Classical machine learning
Creators
Jeffrey L. Elman (UC San Diego)
Kind
Architecture

Base stats

Total
121

Approximate, ordinal scales meant for comparing species with each other; the hard numbers are in the data sheet.

Weaknesses

  • Short memory: the vanishing gradient keeps it from learning distant dependencies.
  • Tested mostly on toy corpora (29 words, two- and three-word sentences).
  • It processes one step at a time: training cannot be parallelized along the sequence.
  • Its categories were found by averaging states, a technique that can create artifacts (as Elman himself warned).

Habitat

It grew up on synthetic corpora: thousands of short sentences assembled by a program with a tiny lexicon. Today you meet it in cognitive science courses and in the family tree of almost every sequence model; Mikolov et al.'s (2010) RNNLM language model introduced itself explicitly as an Elman network.

Moves

Abilities

Context units
A bank of units that stores an exact copy of the previous step's hidden state and feeds it back as extra input.
Implicit time
Time is not encoded as a spatial dimension of the input but by the trace it leaves on processing.
Representations in context
Each hidden state represents a word together with what came before: the same word leaves different traces in different contexts.

Anatomy

Elman's simple recurrent network (1990), with the sizes of the lexical simulation: at each step the hidden layer receives the current word and a copy of its own previous state. The copy is not trained; the weights into and out of the hidden layer are.

Evolution chain

012 Simple recurrent network (Elman)
  • gates and a protected memory cell015 LSTM

Jeffrey Elman's simple recurrent network is a neural network that reads a sequence one element at a time and, at each step, also receives a copy of its own previous state. With that minimal trick (a loop) time stops being a spatial dimension of the input and is represented implicitly, by the effect it has on processing (Elman, 1990, pp. 180–182).

How it works

The architecture starts from a multilayer perceptron with one hidden layer and adds a bank of context units, as many as there are hidden units. At time t, the hidden layer receives the current input and the contents of the context units, which are exactly the hidden state from time t − 1. The copy connections are fixed at 1 and are not trained; the remaining weights are adjusted with ordinary backpropagation (Elman, 1990, pp. 182–183). The idea came from a network by Michael I. Jordan (1986), the cognitive scientist rather than the basketball player, which fed back the output instead of the hidden state.

Chollet describes any recurrent network as a loop that reuses, at each iteration, what it computed at the previous one (Chollet, 2021, sec. 10.3); Elman's is the most austere version of that recurrence. Since the same weights are applied at every step, the network handles sequences of any length with a fixed number of parameters.

What it found

The paper became a classic because of its simulations, all built on the same task: predict the next element.

  • Words without spaces. Given a stream of letters with no separators, prediction error rose at the beginning of each word and fell as the word became predictable: error peaks marked lexical boundaries, although in a graded way and with ambiguities (Elman, 1990, pp. 191–193).
  • Lexical categories. A generator produced 10,000 two- and three-word sentences over 29 distinct words, coded as orthogonal vectors that said nothing about their class. A network with 150 hidden units learned to predict the next word; Elman then averaged the hidden states for each word and submitted them to hierarchical clustering. The tree separated verbs from nouns, transitives from intransitives, animates from inanimates, humans from animals, and edibles from breakables (Elman, 1990, pp. 195–200).
  • A new word. When man was replaced throughout the corpus by an invented word, zog, the network, without any further learning, gave it a representation located where man had been (Elman, 1990, p. 201).

Elman stressed that these categories were soft and implicit: regions of a space, not named symbols. And since each hidden state represents a word in context, the network offers a way of telling types from tokens (Elman, 1990, pp. 200–203). He himself added a caveat: averaging states can produce spurious clusters, so they should be checked against individual tokens (1990, p. 199, n. 6).

Limits

Its memory is short. In the original network the error does not travel backward in time (the copy is fixed), and when such networks were trained with backpropagation through time, the vanishing gradient showed up: the error signal shrinks or blows up exponentially with distance, and long dependencies become almost impossible to learn, as analyzed by Hochreiter (1991) and by Bengio et al. (1994) (Hochreiter & Schmidhuber, 1997, sec. 3). That is why this entry's context stat is low. Moreover, reading one step at a time rules out parallel training (Alammar & Grootendorst, 2024, p. 14).

Its offspring is huge: the LSTM added gates; recurrent encoder–decoder networks translated text before the transformer (Alammar & Grootendorst, 2024, pp. 11–12); and recent architectures such as RWKV or Mamba are betting on recurrence again (2024, p. 24).

Sources

  • Alammar, J., & Grootendorst, M. (2024). Hands-on large language models: Language understanding and generation. O’Reilly Media. §
  • Bengio, Y., Simard, P., & Frasconi, P. (1994). Learning long-term dependencies with gradient descent is difficult. IEEE Transactions on Neural Networks, 5(2), 157–166. https://doi.org/10.1109/72.279181 §
  • Buckner, C. J. (2024). From deep learning to rational machines: What the history of philosophy can teach us about the future of artificial intelligence. Oxford University Press. https://doi.org/10.1093/oso/9780197653302.001.0001 §
  • Chollet, F. (2021). Deep learning with Python (2nd ed.). Manning Publications. §
  • Elman, J. L. (1990). Finding structure in time. Cognitive Science, 14(2), 179–211. https://doi.org/10.1207/s15516709cog1402_1 §
  • Fodor, J. A., & Pylyshyn, Z. W. (1988). Connectionism and cognitive architecture: A critical analysis. Cognition, 28(1–2), 3–71. https://doi.org/10.1016/0010-0277(88)90031-5 §
  • Hochreiter, S., & Schmidhuber, J. (1997). Long short-term memory. Neural Computation, 9(8), 1735–1780. https://doi.org/10.1162/neco.1997.9.8.1735 §
  • Mikolov, T., Karafiát, M., Burget, L., Černocký, J., & Khudanpur, S. (2010). Recurrent neural network based language model. In Interspeech 2010 (pp. 1045–1048). International Speech Communication Association. https://doi.org/10.21437/Interspeech.2010-343 §