Skip to main content
Interactive 3D/Hybrid Attention-SSM Architecture - Jamba, Zamba, Hymba
Layer Stack - Jamba (4 Attn + 28 SSM = 32 layers)
A
S
S
S
S
S
S
S
A
S
S
S
S
S
S
S
A
S
S
S
S
S
S
S
A
S
S
S
S
S
S
S
Attention (global context, retrieval)
SSM/Mamba (local patterns, efficiency)
Attention ratio
12.5%
Attn layers
4
SSM layers
28
Perplexity by Task Type
Retrieval task
8.46
perplexity
Benefits from attention
Local pattern task
6.00
perplexity
Benefits from SSM
Memory Breakdown (per seq at runtime)
Attention KV cache2048MB (86%)
SSM hidden states336MB (14%)
Total: 2384MB. Attention layers dominate memory; SSM layers are lightweight.
Controls
Architecture Preset
Jamba
Zamba
Hymba
Custom
Hybrid insight: Attention handles retrieval and long-range dependencies; SSM handles sequential patterns cheaply. Interleaving them gets the best of both at lower cost than pure-attention models.

Hybrid Attention-SSM Architecture - Jamba, Zamba, Hymba - Interactive Visualization

Hybrid architectures interleave attention and SSM (Mamba-style) layers to get the best of both. Attention handles global context and retrieval (critical for in-context learning), while SSM handles sequential patterns cheaply. Jamba uses 1 attention layer per 7 SSM layers (12.5% ratio). Zamba uses ~6% attention. The right ratio depends on your task: retrieval-heavy tasks need more attention, while generation tasks can use mostly SSM.

  • Jamba: 1:7 attention:SSM ratio - one of the first production hybrid models
  • Zamba: ~6% attention ratio - even more SSM-heavy for efficiency
  • Attention layers handle global context, long-range dependencies, retrieval
  • SSM layers handle local patterns, sequential processing, at lower compute cost
  • Memory: attention KV cache dominates (512MB+ per layer), SSM states are tiny (~12MB)

Part of the EngineersOfAI Interactive 3D - free interactive visualizations covering every major concept in machine learning and AI engineering. Hover any element for a plain-English explanation. No code required.