Architecture
Hybrid Mamba-Transformer (MoE)
2024ActivePublished
Key
innovation
Combines Mamba-2 state-space layers with a small number of attention layers and Mixture-of-Experts layers, achieving near-linear scaling in sequence length while retaining Transformer-level quality.
Category
Architecture
Abstraction level
Building block
Operation level
Architecture blockModel
Use cases
Long-context language modelsEfficient reasoning modelsMemory- and throughput-constrained deployments
How it works
Most layers are Mamba-2 and MoE blocks that process the sequence with near-linear complexity. Every few blocks an attention layer is inserted to enable direct long-range token interactions. In the MoE layers a router sends each token to a small subset of experts (e.g. 6 of 128) plus a shared expert.
Problem solved
A pure Transformer scales quadratically with sequence length, making long context expensive, while pure state-space models lose some precise-recall ability. The hybrid reconciles both approaches.
Key mechanisms
Mamba-2 selective state-space layers
Sparse attention layers for long-range recall
Routed Mixture-of-Experts layers with a shared expert
Strengths & limitations
Strengths
✓Near-linear scaling with context length
✓High capacity at low active inference cost
✓Strong long-context quality
Limitations
✗More complex to implement than a pure Transformer
✗Behaviour depends on the Mamba/attention/MoE layer ratio
✗Newer and less widespread than the standard Transformer