What is a Recurrent Neural Network (RNN)?

Answer

An RNN is a neural network architecture designed for sequential data (time series, text, speech). Unlike feedforward networks, RNNs have recurrent connections — the hidden state at time t is a function of the current input and the previous hidden state, creating a form of memory. However, vanilla RNNs suffer from the vanishing gradient problem, making it hard to learn long-range dependencies. This is addressed by LSTM (Long Short-Term Memory) and GRU (Gated Recurrent Unit) architectures that use gating mechanisms to control information flow.