NEW
A transformer where all model parameters are active for every token, without sparse expert routing.
DESCRIPTION
Dense Transformers apply the full parameter set (attention and feed-forward layers) to each input token, yielding stable training dynamics, predictable latency, and simpler serving compared to sparse Mixture-of-Experts. They trade off parameter efficiency for consistency and often require model or tensor parallelism to scale. Dense models are common as foundation models and baselines for MoE comparisons. They simplify optimization and deployment but can be more compute- and memory-intensive at inference time than sparsely gated architectures.
ALTERNATIVE DEFINITIONS
Switch Transformers (Google Research)
We refer to models where all parameters are activated for every example as dense models.
Explicitly contrasts dense models with sparsely gated MoE, highlighting parameter activation behavior.
Wikipedia
The transformer is a deep learning architecture that relies on the self-attention mechanism.
Defines the baseline transformer architecture that dense models instantiate without sparse routing.
Hugging Face
Mixture-of-Experts (MoE) models activate only a small subset of parameters for each input via a gating network.
Provides the contrasting sparse-routing definition used to differentiate from dense models.
RELATED TERMS
Transformer Model Sparse Activation Self-Attention Multilayer Perceptron Model Parallelism Inference Optimization Scaling Hypothesis Parameter-Efficient Fine-Tuning Sequence Modeling
COMPETING TERMS
Mixture-of-Experts Transformer Sparse Transformer
KNOWLEDGE AREAS
TARGET AUDIENCE
AI Engineer MLOps Engineer Data Scientist Software Architect Cloud Architect
EXTERNAL SOURCES
- Wikipedia - Transformer (machine learning model)
- Switch Transformers (Google Research) - Defines dense vs sparse models
- NVIDIA - MoE training context and contrast
- Hugging Face - MoE background and trade-offs
- DeepSpeed (Microsoft) - MoE vs dense implementation guide
TOP QUESTIONS
Why choose a Dense Transformer over a Mixture-of-Experts Transformer?
Dense Transformers provide predictable latency and simpler serving because all parameters are active. They avoid routing complexity and are often easier to train and debug at scale.
Category: Relevancy
What is the main trade-off of a Dense Transformer?
The main trade-off is higher inference compute per token compared to sparsely routed MoE models, which can raise serving costs and limit parameter counts for a given budget.
Category: Risks
How does a Dense Transformer impact deployment complexity?
Deployment is simpler than MoE because there is no expert routing. However, you may still need tensor or pipeline parallelism for large models and careful memory optimization.
Category: Management
Is a Dense Transformer better for fine-tuning?
Often yes; dense models work well with parameter-efficient fine-tuning methods like LoRA and adapters, avoiding routing-specific behaviors that can complicate adaptation.
Category: Opinion
How do Dense Transformers scale with data and parameters?
They generally follow scaling laws, improving predictably with more data and parameters, though returns diminish; training stability benefits from established optimization practices.
Category: Topic
What are common mistakes when training a Dense Transformer?
Under-provisioning memory bandwidth, ignoring optimizer state sharding, and insufficient data curation can cause instability, slow throughput, or overfitting.
Category: Mistakes
How does a Dense Transformer affect inference latency?
Latency is stable and predictable because every token executes the same layers, but it can be higher than MoE for the same parameter count.
Category: Requirements
What optimizations help Dense Transformer inference?
Use KV cache, tensor parallelism, quantization (e.g., INT8/INT4), and fused kernels to reduce latency and memory footprint.
Category: Best practices
When is a Dense Transformer preferable for safety evaluations?
Dense models avoid routing nondeterminism, making behavior more consistent across inputs and simplifying reproducibility in safety and evaluation pipelines.
Category: Relevancy