🔑 Key Distinction · Neural Networks
CNN SEES SPACE — RNN REMEMBERS TIME — Transformer ATTENDS TO EVERYTHING
CNN vs RNN vs Transformer — one line each
C
CNN — sees space, designed for spatial data
Convolutional Neural Networks are designed for spatial data like images, detecting features (edges, textures, shapes) regardless of exactly where they appear in the image.
Example: a CNN can detect a cat's ear whether it appears in the top-left or bottom-right of an image, because its convolutional filters slide across the entire spatial area.
R
RNN — remembers time, designed for sequential data
Recurrent Neural Networks are designed for sequential, time-ordered data like text or audio, maintaining a form of memory of past steps as they process each new element in the sequence.
Example: an RNN processing a sentence word by word carries forward some memory of earlier words to help interpret later ones.
T
Transformer — attends to everything, no sequential processing required
Transformers use the attention mechanism to consider all positions in the input simultaneously, without needing to process one step at a time sequentially — this is the architecture powering GPT, BERT, and all modern large language models.
Example: a Transformer processing an entire sentence can directly relate the first word to the last word in a single attention computation, without having to sequentially pass information through every word in between like an RNN would.
1
A team needs to choose an architecture for a new project: classifying objects in photographs.
2
Ask: is this spatial or sequential data? Spatial — the task is fundamentally about detecting patterns across a 2D image.
3
CNN is the natural fit here, since it's specifically designed to detect features regardless of their position within the image.
4
Contrast: if the task instead involved processing a lengthy document and understanding relationships between words far apart in the text, a Transformer's attention mechanism would be the better fit, since it can directly relate distant positions without the sequential bottleneck an RNN would face.

Exams test whether you can match a described task (image-based, sequential/time-based, or requiring long-range relationships) to the correct architecture. Also expect a note that Transformers, powering GPT, BERT, and modern LLMs, have largely superseded RNNs for many sequential tasks specifically because attention avoids RNNs' step-by-step sequential processing bottleneck.

The most common trap is assuming RNNs are still the default choice for all sequential data, simply because they were historically designed for that purpose. In practice, Transformers have become the dominant architecture for most sequential tasks (especially language) specifically because their attention mechanism avoids the sequential processing bottleneck and memory limitations that RNNs face with long sequences.

1. What type of data is CNN specifically designed for?
Spatial data, like images — detecting features regardless of their position.
Tap to reveal / hide
2. What type of data is RNN specifically designed for?
Sequential, time-ordered data, like text or audio, using memory of past steps.
Tap to reveal / hide
3. What mechanism allows Transformers to consider all positions simultaneously?
The attention mechanism.
Tap to reveal / hide
4. Name a well-known model architecture built on Transformers.
GPT or BERT (or any modern large language model).
Tap to reveal / hide
5. Why have Transformers largely superseded RNNs for many sequential tasks?
Because attention avoids the sequential processing bottleneck and long-range memory limitations that RNNs face.
Tap to reveal / hide