← Neural Networks & Model Architectures
02 · Neural Networks & Model Architectures

What is a Transformer?

A Transformer is a neural-network architecture that processes relationships between tokens.

KEY IDEA
Transformer = Attention + Stacked Neural Network Layers
It processes relationships between tokens before producing an output.
Core idea

Architecture first. Mechanism inside.

A Transformer is a neural-network architecture that processes relationships between tokens.

Its attention mechanism lets each token weigh information from other relevant tokens.

TOKENSThe bank approved it
→
ATTENTIONcompare relationships
→
LAYER STACKrefine representations
→
OUTPUTprediction / representation
Architecture map

Transformer at a Glance

INPUT TOKENS
↓
TOKEN REPRESENTATIONS
↓
ATTENTION
↓
FEED-FORWARD PROCESSING
↓
REPEAT THROUGH LAYERS
↓
OUTPUT REPRESENTATION / SCORES
A useful analogy

Think of it like a reading group

Thebankapprovedit

Each word can look at the other words and decide which ones are most useful for understanding the current context.

Reading group → Transformer layer
Words → Tokens
Looking at other words → Attention
Repeated discussion → Layer stack

This analogy is for understanding only. A Transformer uses mathematical operations, not human discussion.

The processing story

How it works

STEP 01

Tokens enter the model

Text becomes token representations.

STEP 02

Attention compares relationships

Each position can weigh information from other relevant positions.

STEP 03

Representations are updated

Attention results are combined with additional neural-network processing.

STEP 04

Layers repeat the process

Stacked layers progressively transform the representation.

STEP 05

Output scores are produced

The final representation supports prediction or another model task.

A simplified illustration

Why attention matters

“The bank approved the loan because it had enough information.”

itcan use context from:bankloaninformation

Attention assigns different weights to relationships between token representations. This is a simplified illustration, not a visualization of a specific model’s real attention weights.

Supporting examples

Where Transformers are used

01

Language understanding

Example: Pronouns and context

02

Translation

Input: English
Output: another language

03

Classification

Input: support ticket
Output: category

Concept boundaries

What it is NOT

TRANSFORMER ≠ LLM

Architecture ≠ language model

An LLM is often built with Transformer architecture.

TRANSFORMER ≠ ATTENTION

Full architecture ≠ one mechanism

Attention is one important mechanism inside it.

TRANSFORMER ≠ CHATGPT

Architecture ≠ product

ChatGPT uses models plus other systems.

Remember this
A Transformer uses attention and stacked neural-network layers to process relationships between tokens.
Independent explainer · Azure Neural voice

Watch the visual explanation

See how tokens, attention, layers, and output scores fit together.

↑