Home › Glossary › Neural Networks › Transformer Architecture

Intermediate · Neural Networks

Transformer Architecture

Visual diagram · (in preparation) · Math · (in preparation) · Worked example · 3 difficulty levels.

TL;DR. A neural network architecture, predominantly used in NLP, that relies heavily on self-attention mechanisms to process sequential data.

Technical Definition

A neural network architecture, predominantly used in NLP, that relies heavily on self-attention mechanisms to process sequential data.

How it works

The transformer architecture revolutionized sequential data processing, largely replacing ANNs and LSTMs. Its key innovation is the attention mechanism, which allows parallel processing of input elements, greatly speeding up training and enabling models to capture long-range dependencies efficiently. It is the architectural foundation for most modern LLMs like GPT and BERT.

Related Concepts

  • Attention Mechanism — A technique that lets models dynamically focus on the most relevant parts of the input when producing each output element.
  • Self-Attention — A mechanism where every token in a sequence attends to every other token to compute context-aware representations.