Overview
Direct Answer
A Transformer is a neural network architecture that relies exclusively on self-attention mechanisms to process sequential data in parallel, replacing recurrent layers entirely. This design enables efficient computation of long-range dependencies without sequential bottlenecks.
How It Works
The architecture uses multi-head self-attention to compute weighted relationships between all input tokens simultaneously, allowing each position to directly attend to every other position. Positional encodings preserve sequence order information, whilst feed-forward networks and layer normalisation refine representations across stacked encoder and decoder blocks.
Why It Matters
Parallelisation dramatically reduces training time compared to RNNs, whilst attention mechanisms excel at capturing long-range contextual relationships critical for language understanding and generation. This has made large-scale model training computationally feasible and cost-effective for organisations deploying natural language systems.
Common Applications
Transformers power machine translation systems, large language models for text generation and question-answering, document classification, and semantic search. Vision transformers have extended the architecture to image analysis, whilst industry applications span customer support automation, medical record analysis, and code generation.
Key Considerations
Computational cost scales quadratically with sequence length due to attention, requiring careful memory management and techniques like sparse attention for long documents. Pre-training on vast datasets has become essential for performance, raising questions about data quality, reproducibility, and resource requirements.
Cross-References(1)
Cited Across coldai.org6 pages mention Transformer
Industry pages, services, technologies, capabilities, case studies and insights on coldai.org that reference Transformer — providing applied context for how the concept is used in client engagements.
Referenced By9 terms mention Transformer
Other entries in the wiki whose definition references Transformer — useful for understanding how this concept connects across Deep Learning and adjacent domains.
More in Deep Learning
Generative Adversarial Network
Generative ModelsA framework where two neural networks compete — a generator creates synthetic data while a discriminator evaluates its authenticity.
Skip Connection
ArchitecturesA neural network shortcut that allows the output of one layer to bypass intermediate layers and be added to a later layer's output.
Gradient Checkpointing
ArchitecturesA memory optimisation that trades computation for memory by recomputing intermediate activations during the backward pass instead of storing them all during the forward pass.
Sigmoid Function
Training & OptimisationAn activation function that maps input values to a range between 0 and 1, useful for binary classification outputs.
State Space Model
ArchitecturesA sequence modelling architecture based on continuous-time dynamical systems that processes long sequences with linear complexity, offering an alternative to attention-based transformers.
Pretraining
ArchitecturesTraining a model on a large general dataset before fine-tuning it on a specific downstream task.
Rotary Positional Encoding
Training & OptimisationA position encoding method that encodes absolute position with a rotation matrix and naturally incorporates relative position information into attention computations.
Self-Attention
Training & OptimisationAn attention mechanism where each element in a sequence attends to all other elements to compute its representation.