Skip to main content

What is a recurrent neural network?

The AI Glossary

In our classes, we often pause to explain the ideas behind AI and the language used to describe it. These posts grew out of those conversations. They’re for anyone who would like to understand AI better, with no technical background assumed.

A recurrent neural network, or RNN, is a neural-network design that processes a sequence while passing information from one step to the next. A sequence could be words in a sentence, measurements over time or parts of an audio signal.

The network maintains a hidden state: a set of numbers summarizing information from earlier steps. At each step, it combines that state with the current input and produces an updated state. “Hidden” means that this is an internal representation, not a directly observed measurement.

Imagine reading a sentence while keeping a brief running note of what has come before. The note affects how you interpret the next word. This is only an analogy: an RNN carries numerical information, not a human memory or written summary.

Basic RNNs can struggle to learn relationships across long sequences. Designs such as long short-term memory networks, or LSTMs, add mechanisms that control what information is retained or updated. These mechanisms are called gates because they regulate the flow of information through calculations.

Some RNNs process a sequence in both directions. This can be useful when the entire sequence is already available, such as analyzing a completed document. It is different from predicting an event in real time, when future measurements must not be used. The evaluation must respect that distinction.

Transformers, which use attention calculations to connect information across positions, became prominent in large-scale language modeling. That does not make RNNs irrelevant: they remain one option for sequence tasks, and different architectures have different resource and performance trade-offs.

For a clinical monitoring application, an RNN might use a sequence of measurements to estimate a future event. The team must distinguish a changing physiological signal from changes in measurement frequency or missingness. A patient measured more often may be sicker, but may also simply be receiving different monitoring. A sequence model can learn either pattern. Its internal state helps process time-ordered information; it does not establish which interpretation is clinically justified.

Sources: Goodfellow, Bengio and Courville — Deep Learning, Chapter 10: Sequence Modeling; Vaswani and colleagues — Attention Is All You Need (2017)

To learn more, take a look at the AI in Health Care Certificate of Specialization from the Advanced Learning Academy at Harvard T.H. Chan School of Public Health. You can take an individual course or work toward the full certificate.


AI is a fast-moving field. This explanation reflects our class discussions and related material at the time of writing. Terminology, capabilities and tools may change.

For suggested additions or corrections, please email me at tpanch@hsph.harvard.edu.

Dr. Trishan Panch
Program Director, AI in Health Care
Harvard T.H. Chan School of Public Health — Advanced Learning Academy

Lead with AI in Health Care

The AI Pragmatist is a monthly newsletter from ALA faculty, with new explainers & essays from the Advanced Learning Academy