Hybrid Mamba + Attention + Mixture-of-Experts · 450M Parameters · Built From Scratch
One of only three published architectures combining Mamba SSM, Multi-Head Attention, and Mixture-of-Experts in a single decoder-only language model. Trained on a single GPU for ~$50.
EMA-based router bias — zero dead experts, no auxiliary loss term
💰 $50 Total Compute
Single NVIDIA L4 GPU (24 GB) on AWS g6.2xlarge
🧑💻 Solo Research
Designed, built, and trained entirely from scratch by one independent researcher
📄 Research Paper
HybridMoE Titan v1: A Decoder-Only Language Model Combining Mamba SSM, Multi-Head Attention with RoPE, and Fine-Grained Mixture-of-Experts at 450M Scale
Mateusz Piesiak — Project Inkblot, Independent ML Research
⚠️ arXiv Submission Pending — This paper is awaiting endorsement for cs.LG (Machine Learning). If you are an active arXiv author endorsed for cs.LG, please consider endorsing — only 1 endorsement is needed. See contact below.
Layer 0: [Attention + MoE] ← Global + Conditional
Layer 1: [Mamba + SwiGLU] ← Local + Dense
Layer 2: [Mamba + SwiGLU] ← Local + Dense
Layer 3: [Mamba + SwiGLU] ← Local + Dense
Layer 4: [Attention + MoE] ← Global + Conditional
...
Layer 15: [Mamba + SwiGLU] ← Local + Dense
📐 Model Configuration
Parameter
Value
Total Parameters
450.4M
d_model
1,024
Attention Heads
16 (head_dim = 64)
Layers
16 (12 Mamba + 4 Attention)
Routed Experts
32
Shared Experts
2
Top-k Routing
2
Max Sequence Length
4,096
Vocabulary
50,258 tokens (GPT-2 BPE)
Precision
bfloat16
🔬 Novel Contributions
1️⃣ Fixed-Shape Expert Dispatch (§3.3.2)
Standard MoE uses torch.nonzero() for dynamic expert assignment — this creates variable-length tensors that break PyTorch gradient checkpointing. We replace it with deterministic fixed-shape tensor operations:
💡 PPL increase at step 20K is due to validation set expansion (50 → 200 shards, more Polish text), not model degradation.
📊 At ~4.2B tokens, Titan v1 is undertrained relative to the Chinchilla-optimal ~9B tokens for a 450M model.
Continued training is expected to reduce PPL further — confirmed by Titan v2 reaching NTP 4.48 at step 7,700
on a cleaner, larger corpus.
🧪 Expert Routing Health
All 32 routed experts maintain healthy utilisation across all 4 MoE layers throughout training:
Expert Utilisation (step 42,850):
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
usage_std range: 0.019 – 0.031
ideal uniform: 0.03125
max single expert: 14.7%
dead experts: 0 / 32
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Not in training data — cannot generate code or solve math
💻 Single GPU
Training throughput limited by L4 24 GB constraints
📐 Scaling History
The architecture's Single Source of Truth design allows scaling the entire model by changing a single configuration value (num_layers). Titan went through four scaling phases:
Version
Params
Layers
Hardware
Status
Titan Tiny (v0)
57.7M
8
Kaggle T4
✅ PPL ~59
Titan Mid (v0.5)
690M
24
Kaggle T4
⚠️ Compute blocked
Titan Little (v1)
450.4M
16
AWS L4
✅ PPL 27.5
Titan v2
464.5M
16
AWS L4
🔄 Training (NTP 4.48 @ step 7,700)
Titan Standard
~1B
TBD
AWS multi-L4
📋 Planned
💡 The reduction from 690M (24 layers) to 450.4M (16 layers) required changing a single configuration value — demonstrating the architecture's modular scalability. This is a key design principle: one codebase, one config class, any scale.
python
1# Scale the model by changing ONE line:2config = HybridModelConfig(num_layers=8)# → Titan Tiny (57.7M)3config = HybridModelConfig(num_layers=16)# → Titan v1 (450.4M) ← trained4config = HybridModelConfig(num_layers=24)# → Titan Mid (690M)
This paper is pending submission to arXiv cs.LG (Machine Learning). As a first-time independent submitter, the author needs endorsement from an established arXiv author.
If you are endorsed for cs.LG and find this work interesting, please consider endorsing this submission. Only 1 endorsement is needed. Contact the author via HuggingFace. This is a genuine independent research project — full model, data, and training pipeline are open under MIT License.
📜 Citation
bibtex
1@article{piesiak2026hybridmoe,
2 title = {HybridMoE Titan v1: A Decoder-Only Language Model Combining
3 Mamba SSM, Multi-Head Attention with RoPE, and Fine-Grained
4 Mixture-of-Experts at 450M Scale},
5 author = {Piesiak, Mateusz},
6 year = {2026},
7 note = {Project Inkblot — Independent ML Research.
8 Available: https://huggingface.co/Mati83moni/HybridMoE-Titan-v1}
9}
📄 License
MIT License — Full model, weights, code, and training pipeline.