Transformer
A neural network architecture that processes sequences using a self-attention mechanism to model long-range dependencies between input elements without requiring sequential computation.
Listen to this definition
Uses a voice available on your device
Audio options
On this page 5 sections
Related concepts 5 concepts
What it is
The transformer processes input tokens by calculating a weighted relevance score between every pair of tokens in a sequence simultaneously. This parallel processing relies on a multi-head attention mechanism that creates complex representations of context. Modern models often contain billions of parameters, requiring massive matrix multiplications performed on specialized hardware like GPUs or TPUs. Because the architecture lacks an inherent sense of order, it uses positional encodings to represent the specific sequence of data.
Why it matters
Understanding transformers is essential because the architecture dictates how your system consumes memory and compute during inference. The self-attention mechanism grows quadratically with sequence length, which means doubling your prompt size increases your memory overhead and latency significantly. Ignoring these scaling laws leads to inefficient API usage, unexpected performance bottlenecks when handling long documents, and higher costs due to KV cache memory bloat.
In practice
You manage transformer behavior by tuning the context window limit and adjusting generation parameters like temperature or top-p to control output variability. In production, you monitor the throughput of token generation per second and optimize the KV cache to mitigate latency spikes. If your application requires handling large documents, you must account for the quadratic compute cost by implementing retrieval strategies or chunking inputs.
The tradeoff
The primary tradeoff is between the depth of contextual reasoning and computational cost, as increasing the context window creates massive memory overhead for the KV cache.
Where it appears
Research summaries that use Transformer, each linked to its source paper.
-
Efficient Memory-Saving Transformers Through Recurrent Depth
Gated Recurrent Transformers: Expressive Depth through Recurrent Modulation in Transformers
The Gated Recurrent Transformer reduces memory usage and parameter count by replacing many unique transformer layers with a single shared, repeating block.
-
Predicting Fusion Plasma Stability with Transformers
Physics Attention Transformer Surrogate for Rapid Vertical Instability Growth Rate Prediction: Alcator C-Mod to SPARC
The Physics Attention Transformer predicts tokamak plasma instability growth rates faster by replacing slow traditional solvers with a learned neural architecture.
-
Modular Experts for Multi-Task Video Models
MoTE: Mixture of Task Experts for Multi-Task Video Understanding
The paper introduces a Mixture of Task Experts architecture that uses task-specific modules within a video-language decoder to improve performance across diverse video understanding tasks.
-
Efficient CPU Inference for Large Models
Pipeline-Native Transformers: Co-Designing Model Architecture and CPU Inference for Bandwidth-Efficient Autoregressive Decode
The paper introduces cflow, a model architecture and runtime co-design that optimizes autoregressive decoding on CPUs by prioritizing memory bandwidth constraints.
-
Improving KV Cache Eviction Using Sigmoid Gates
Sigmoid Attention as a Better Substrate for Learned KV Cache Eviction
The paper demonstrates that using learned sigmoid gates for key-value cache eviction leads to better performance than existing methods like H2O and KeyDiff.
-
Prime Agent Self Improving AI Harness
Prime Agent: A Self-Improving RLM Harness
Prime Agent is a framework that enables language models to recursively invoke subagents and manage persistent state to improve performance on complex autonomous tasks.
-
Efficient Memory for Longer Transformer Sequences
ProxyFormer: A Dual-Stream Proxy Architecture for Ultra-Long Context and High-Resolution Generation
ProxyFormer reduces memory overhead by compressing long input sequences into proxy states to allow for significantly larger context processing.
-
Efficient Hybrid Transformer Model for Tabular Data
Tydra: An Efficient Hybrid Model for Tabular Data
Tydra combines transformer and state-space architectures to achieve faster inference on tabular data than the existing TabPFN foundation model.
-
Infinite Streaming Video Editing with InfinityEdit
InfinityEdit: Infinite Video Editing with a Lightweight Edit-Ignition Adapter
InfinityEdit uses a lightweight adapter to enable consistent, long-term video editing for continuous data streams.
-
Selective Safety Routing for Language Models
CLEAR: Continuous Latent Adapter Routing for Utility-Preserving LLM Safety Alignment
The paper introduces a routing mechanism that applies safety interventions only when harmful inputs are detected, preserving model utility for benign prompts.
-
Efficient CPU Inference with Daedalus-150M Architecture
Daedalus-150M: A Convolution-Attention Hybrid Designed for CPU Inference
The paper introduces Daedalus-150M, a hybrid model combining depthwise convolutions and attention mechanisms to optimize CPU inference efficiency by reducing reliance on key-value cache growth.
-
Accelerating Long Context LLM Inference
FlashPrefill V2: Block-Sparse Prefill Attention for Long-Context LLM Serving
FlashPrefill V2 improves large language model serving performance by introducing a block-sparse attention mechanism that integrates natively with paged KV cache and continuous batching systems.
-
Improving Tool Use With Looped Language Models
Looped Language Models Improve Compositional Tool Calling
The researchers developed Ouro models that use recurrent stack iterations to improve performance on complex, compositional tool-calling tasks.
-
Processing Recipe Data with Transformers
RecipeNet: A Hierarchical Transformer for Recipe Data
RecipeNet is a hierarchical transformer model designed to process heterogeneous recipe data with variable schemas and sequential procedural steps.
-
Deploying Nanbeige4.2-3B on Apple Silicon
Nanbeige4.2-3B on Apple Silicon: Fixing Deployment Bugs and Decreasing Looped Transformer Memory Overhead
The paper resolves five deployment bugs and reduces memory overhead to successfully run the Nanbeige4.2-3B model on Apple Silicon.
-
Decoupling Knowledge and Reasoning for LLMs
Intern-S2-Mobius: Foundation Model with Decoupled Knowledge and Reasoning
The paper introduces Intern-S2-Mobius, an architecture that decouples knowledge storage from reasoning to achieve faster inference speeds while maintaining high performance.
-
Foundation Model for Infrared Chemical Sensing
Simulation-to-real transfer learning for infrared spectroscopic chemical sensing and analysis from molecules to complex samples
UltraIR is a foundation model that uses simulation-to-real transfer learning to improve the accuracy and scalability of infrared spectroscopy analysis.
-
Predicting Student Course Selections and Grades
Jointly Predicting Courses and Grades Using a Transformer-Based Model
The TRACE model uses a Transformer architecture to simultaneously forecast which courses a student will take and what grades they will earn.
-
Optimizing Video Latent Spaces for Generation
V-RAE: Rethinking Video Latent Spaces for Generation
V-RAE improves video generation quality by creating compact latent spaces from frozen vision foundation models rather than relying on traditional pixel-level reconstruction.
-
Removing Iterative Rollout from Robot Policies
Keep the Future, Drop the Rollout: RIFT for World Action Models
The RIFT framework enables robot policies to predict future states in a single pass, eliminating the need for iterative video generation during inference.
-
Predicting Transformer Ability to Handle Longer Sequences
Algebraic Decomposition Theory for Transformer Length Generalization
Researchers developed an algebraic method to identify which regular languages allow transformers to generalize to sequence lengths beyond their training data.
-
Optimizing Rotations for 4-Bit Model Quantization
When Local Variance Optimality Is Not Enough: RoPE-Aligned Q/K Rotations for Dynamic 4-Bit Quantisation
The researchers investigated whether using specific rotational transforms that respect RoPE structure improves accuracy during 4-bit model quantization.
-
Monitoring Task Progress in Robotic Models
Decoding Task Progress from VLA Representations
The paper introduces a method to track task progress in vision-language-action models by fitting linear probes on internal embeddings to identify completion status and detect out-of-distribution inputs.
-
Reducing Matrix Multiplication for LLM Inference
Reduced Matrix Multiplication: Input-Adaptive Matrix-Product Reduction for LLM Inference
The paper introduces Reduced Matrix Multiplication, an input-adaptive method to reduce high-dimensional matrix multiplications during transformer inference without modifying model weights.
-
Improving Attention Gating for Language Models
Hybrid Gated Attention
The paper introduces Hybrid Gated Attention, a technique that improves training stability and performance in language models by modifying how attention mechanisms handle gating, matrix factorization, and head interactions.
-
Intern-S2-Preview: Scientific Agentic Foundation Model
Intern-S2-Preview: Scientific Agentic Foundation Model
The paper introduces Intern-S2-Preview, a foundation model designed for multimodal scientific understanding, reasoning, and long-horizon agentic task execution.
-
Transcript Free Cross Lingual Voice Cloning
Confucius4-TTS: Transcript-Free Cross-Lingual Zero-Shot TTS with a Learnable Speaker Encoder
Confucius4-TTS enables zero-shot cross-lingual text-to-speech without requiring transcripts of the reference audio.
-
Optimizing LLM Cache Transfer for Edge Handover
ImpactHO: Importance-Aware KV Cache Transfer for Multi-User Edge LLM Handover
ImpactHO improves LLM performance during user handovers by intelligently prioritizing and transferring essential parts of the KV cache over constrained network links.
-
Generalizing Transformer Attention with Power Laws
Power law graph attention: exact generalization of scaled dot-product attention, empirical collapse at inference
The paper introduces Power Law Graph Attention as a flexible, learned alternative to the standard fixed-operator attention used in modern transformer models.
-
A Large Dataset of Agent Skills
GitSkills: A Dataset of Agent Skills on GitHub
Researchers built GitSkills, a dataset containing over 3.7 million agent instructions scraped from public GitHub repositories.
-
Detecting LLM Hallucinations via Attention Path Fragility
Attention-Path Fragility as an Uncertainty Signal in Large Language Models
The paper introduces a technique called ASMI that measures model uncertainty by observing how responses change when random paths in the transformer's attention mechanism are disrupted.
-
Nesting Language Models for Efficiency
Matryoshka Language Model Suites
The paper introduces a framework for nesting smaller sub-models within a larger architecture to reduce training compute and improve speculative decoding performance.
-
Predicting Future States Without Recursive Steps
Beyond Myopic World Models: Long-Horizon End-to-End Training for Direct Future Prediction
The researchers developed a non-recursive world model that predicts future outcomes in a single pass rather than chaining multiple intermediate steps.
-
Learning Latent Memory States for Athletes
Learning Latent Memory States from Longitudinal Athlete Monitoring Data
The paper introduces a statistical method to represent an athlete's historical data as a reusable latent memory table to improve performance tracking and prediction.
-
Improving Medical Time Series Classification
Is Self-Pretraining really useful to improve diagnosis in medical Time Series?
The researchers applied self-pretraining to transformer models to boost accuracy in medical time series classification without requiring external data.
-
Estimating Hand Pressure from Monocular Video
HOPE: Hand-Object Pressure Estimation from Monocular Videos
The researchers developed a transformer architecture that estimates physical pressure during hand-object interactions using only monocular video input.
-
Improving 3D Gaussian Splatting Geometric Accuracy
Confidence matters: Leveraging Multi-view Geometric Priors for GS-based Reconstruction
The researchers integrate multi-view geometric priors and confidence-based weighting into 3D Gaussian Splatting to fix suboptimal geometry in complex or shiny scenes.
-
Using AI to Reduce Belief in Conspiracy Theories
Reducing belief in conspiracy theories as they unfold using large language models
The researchers evaluated if multi-turn LLM conversations can effectively debunk conspiracy theories as they emerge during crisis events.
-
Adding Syntactic Structure to Language Models
Beyond Sequence Order: Syntax-Informed Positional Embeddings for Transformers
The researchers introduce a method to inject syntactic information into Transformer positional embeddings to improve compositional generalization without modifying the underlying attention mechanisms.
-
Detecting Bias in Automated Speaking Assessments
Bias Analysis of L2 Speaking Assessment Systems Using Concept Activation Vectors
The researchers developed a method using Concept Activation Vectors to identify if Transformer based speaking assessment systems rely on irrelevant speaker attributes rather than proficiency.
-
Teaching Logic Before Language to LLMs
Logic Before Language: Pre-pretraining on Formal Derivations Fosters Skill Acquisition and Compressibility
Researchers improved language model learning efficiency by pre-pretraining a Transformer backbone on formal logic derivation sequences before standard language training.
-
Segment Anything Model for Image Segmentation
Segment Anything
The paper introduces a foundation model and data engine for promptable image segmentation that enables zero shot transfer to downstream tasks.
-
Robust Speech Recognition via Large Scale Weak Supervision
Robust Speech Recognition via Large-Scale Weak Supervision
The paper develops a robust speech recognition system that works reliably out of the box across a broad range of environments, tasks, and languages without requiring supervised fine tuning of a decoder for every deployment distribution.
-
Accelerating Transformer Inference Through Speculative Decoding
Fast Inference from Transformers via Speculative Decoding
The paper introduces speculative decoding, a method to speed up inference in large autoregressive models by using a smaller approximation model to guess tokens in parallel before evaluating them with the target model.
-
8-bit Matrix Multiplication for Large Language Models
LLM.int8(): 8-bit Matrix Multiplication for Transformers at Scale
The paper introduces LLM.int8(), a quantization method that enables zero-degradation inference for large language models up to 175B parameters by isolating emergent outlier features into a 16-bit matrix multiplication.
-
Finding the Optimal Size for Language Models
Training Compute-Optimal Large Language Models
The paper investigates the optimal model size and number of tokens for training a transformer language model under a given compute budget, finding that current large language models are significantly undertrained.
-
GPT-3 Few-Shot Language Learning Performance
Language Models are Few-Shot Learners
The paper introduces a 175-billion parameter model capable of performing tasks with zero or few examples provided in the prompt without needing model weight updates.
-
Training Deep Bidirectional Language Models
BERT: Pre-training of Deep Bidirectional Transformers for Language Understanding
This paper introduces BERT to enable pre-training of deep bidirectional representations by jointly conditioning on both left and right context in all layers.
-
Robotics Transformer for Real-World Control
RT-1: Robotics Transformer for Real-World Control at Scale
The paper introduces RT-1, a large multi-task backbone model built on robotic task data to achieve zero-shot generalization to new tasks, environments, and objects.
-
Using Transformers for Image Recognition
An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale
The paper demonstrates that a pure Transformer architecture, applied directly to sequences of image patches, can achieve excellent image classification results compared to state-of-the-art convolutional networks while requiring substantially fewer computational resources to train.
-
Using RAG for Better Action Selection
Vector Search As Nearest Neighbor Matching: RAG-based Policy Learning in Causal Inference
The paper introduces a causal inference framework to improve how RAG systems select actions by treating vector search as a nearest neighbor matching process.
-
Tuning LLMs for Better Arithmetic Performance
Explaining and Tuning Transformer-based LLMs in Arithmetic Tasks with Human Strategies
This paper investigates why large language models struggle with basic arithmetic and proposes human-inspired strategies, including task decomposition and specific prompting techniques, to improve their performance.
-
Modeling Immune Repertoire Changes for Cancer
DynImmune-BERT: Dynamic Immune Repertoire Modeling with Neural ODE Driven Continuous Transformers
DynImmune-BERT introduces a continuous transformer architecture to predict cancer status by modeling longitudinal immune repertoire data as dynamic, event-driven processes.
-
Universal Node Representation Learning Without Tuning
Node4All: Learning Node Representation Beyond Datasets
Node4All introduces a general-purpose method for learning graph node representations that works across arbitrary datasets without needing dataset-specific optimization or hyperparameter tuning.
-
Learning Particle Physics Patterns Without Simulation
Learning Standard Model structure from LHC data with Riemannian flow matching
The authors developed ShellFlow, a transformer based generative model that learns particle collision patterns directly from ATLAS data without relying on traditional Monte Carlo simulations.
-
Improving Residential Energy Load Forecasting
Behaviour-Conditioned Neural Processes for Adaptive Residential Short-Term Load Forecasting
The paper introduces a behaviour-conditioned neural process model that improves short-term residential energy demand forecasting by incorporating inferred consumption patterns.
-
Efficient Recurrent Transformer Architecture and Scaling
Loop the Loopies!
The paper introduces a novel looped Transformer architecture called Loopie that maximizes pre-training compute efficiency to achieve strong reasoning benchmark performance.
-
Audio-Visual Flamingo for Complex Videos
Audio-Visual Flamingo: Open Audio-Visual Intelligence for Long and Complex Videos
The paper introduces Audio-Visual Flamingo, an open model designed to improve joint perception, temporal alignment, and multi-event reasoning over long videos.
-
Video as World and Event Stream
Video = World + Event Stream
The paper introduces Wan-Streamer v0.3 to enable a general-purpose pretraining objective for native-streaming generation by reframing video as a world plus an event stream.
-
Managing Transformer Rank to Stop Degradation
Transforming Rank: How Architecture Navigates the Spectral Pathologies of Depth
The paper identifies how architecture choices like normalization placement and width expansion prevent gradient rank collapse in deep Transformer models at initialization.
-
Replacing Recurrence with Parallel Attention Mechanisms
Attention Is All You Need
The Transformer architecture replaces sequential neural networks with an attention based mechanism that enables full parallelization during training.
-
Improving Graph Models for Time Series
When GNNs Fail: Quantifying and Overcoming Temporal Correlation Volatility in Time Series
The paper introduces GLIDE, a new Graph Neural Network layer designed to maintain high forecasting accuracy in dynamic environments where temporal correlations shift unpredictably.
-
Fast and Memory Efficient Exact Attention
FlashAttention: Fast and Memory-Efficient Exact Attention with IO-Awareness
The authors introduce FlashAttention, a restructuring of the self-attention mechanism that is fast and memory efficient for long sequences.
-
Efficient Memory-Saving Transformers Through Recurrent Depth
Gated Recurrent Transformers: Expressive Depth through Recurrent Modulation in Transformers
The Gated Recurrent Transformer reduces memory usage and parameter count by replacing many unique transformer layers with a single shared, repeating block.
-
Predicting Fusion Plasma Stability with Transformers
Physics Attention Transformer Surrogate for Rapid Vertical Instability Growth Rate Prediction: Alcator C-Mod to SPARC
The Physics Attention Transformer predicts tokamak plasma instability growth rates faster by replacing slow traditional solvers with a learned neural architecture.
-
Efficient CPU Inference for Large Models
Pipeline-Native Transformers: Co-Designing Model Architecture and CPU Inference for Bandwidth-Efficient Autoregressive Decode
The paper introduces cflow, a model architecture and runtime co-design that optimizes autoregressive decoding on CPUs by prioritizing memory bandwidth constraints.
-
Efficient Reference Caching for Diffusion Transformers
Anchoring Instruction Outside Mask: Exact Reference Caching for Efficient In-Context Diffusion Transformers
The researchers developed a text anchor method to enable high-speed reference image caching in diffusion transformers without sacrificing model performance.
-
Processing Recipe Data with Transformers
RecipeNet: A Hierarchical Transformer for Recipe Data
RecipeNet is a hierarchical transformer model designed to process heterogeneous recipe data with variable schemas and sequential procedural steps.
-
Accelerating Video Diffusion Transformers with Sparse Attention
LoSA: Near-Lossless Sparse Attention for Training-Free Video Diffusion Acceleration
LoSA accelerates video diffusion models by identifying and caching the most important attention blocks to reduce the overhead of quadratic computation in long 3D token sequences.
-
Flexible Timestep Weather Forecasting Models
Timestep-Conditioned Transformers for Global Weather Forecasting
The paper introduces a transformer model that allows for variable forecasting timesteps to better balance atmospheric dynamics with long-term predictive accuracy.
-
Adding Syntactic Structure to Language Models
Beyond Sequence Order: Syntax-Informed Positional Embeddings for Transformers
The researchers introduce a method to inject syntactic information into Transformer positional embeddings to improve compositional generalization without modifying the underlying attention mechanisms.
-
Accelerating Transformer Inference Through Speculative Decoding
Fast Inference from Transformers via Speculative Decoding
The paper introduces speculative decoding, a method to speed up inference in large autoregressive models by using a smaller approximation model to guess tokens in parallel before evaluating them with the target model.
-
8-bit Matrix Multiplication for Large Language Models
LLM.int8(): 8-bit Matrix Multiplication for Transformers at Scale
The paper introduces LLM.int8(), a quantization method that enables zero-degradation inference for large language models up to 175B parameters by isolating emergent outlier features into a 16-bit matrix multiplication.
-
Training Deep Bidirectional Language Models
BERT: Pre-training of Deep Bidirectional Transformers for Language Understanding
This paper introduces BERT to enable pre-training of deep bidirectional representations by jointly conditioning on both left and right context in all layers.
-
Using Transformers for Image Recognition
An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale
The paper demonstrates that a pure Transformer architecture, applied directly to sequences of image patches, can achieve excellent image classification results compared to state-of-the-art convolutional networks while requiring substantially fewer computational resources to train.
-
Modeling Immune Repertoire Changes for Cancer
DynImmune-BERT: Dynamic Immune Repertoire Modeling with Neural ODE Driven Continuous Transformers
DynImmune-BERT introduces a continuous transformer architecture to predict cancer status by modeling longitudinal immune repertoire data as dynamic, event-driven processes.