Views
No views yet
Hymba × Mamba-3 × Recurrent Depth Transformer × DeepSeek MoE
A brain-inspired hybrid language model with three distinct memory systems.
| Property | Value |
|---|---|
| Name | Theo Ultimate |
| Made by | Y.AI |
| Parameters | ~800M |
| Architecture | Hymba + Mamba-3 + RDT + MoE |
| dtype | bfloat16 |
| Context length | 512 tokens |
| License | Apache 2.0 |
exp_trap)Δ, B, C projectionsB and CB and CRecurrentHymbaBlock modules loop the same weights 2–6 times,
each pass conditioned on a stable LTI injection:
h_t = A · h_{t-1} + B · eA is sigmoid-bounded so ρ(A) < 1 is mathematically guaranteed
— the model can never diverge regardless of what the optimiser does.| Memory | Mechanism | Brain Analog |
|---|---|---|
| 🧠 Meta Memory | 16 persistent meta tokens prepended to every sequence | Prefrontal cortex |
| 🌊 Fading Memory | Mamba-3 SSM hidden state — decays over distance | Hippocampal short-term |
| 📸 Snapshot Memory | GQA attention with optional sliding window — exact retrieval | Episodic long-term |
1{
2 "vocab_size": 32000,
3 "n_meta_tokens": 16,
4 "sliding_window": 128,
5 "d_model": 1536,
6 "d_state": 128,
7 "d_latent": 1536,
8 "d_ff": 4096,
9 "n_heads": 12,
10 "n_kv_heads": 2,
11 "n_prelude": 1,
12 "n_coda": 1,
13 "max_loop_iters": 6,
14 "max_seq_len": 512,
15 "n_experts": 24,
16 "n_shared": 1,
17 "n_experts_tok": 2,
18 "expert_dim": 2560,
19 "loop_min": 2,
20 "loop_max": 6,
21 "rho_target": 0.37
22}
23Files in This Repo
24text
25
26theo-ultimate/
27├── config.json # Model hyperparameters
28├── tokenizer.json # BPE tokenizer (vocab 32 000)
29├── theo_best.pt # Best checkpoint (lowest val loss)
30├── theo_final.pt # Final epoch checkpoint
31├── corpus.txt # Training corpus
32└── checkpoints/
33 ├── theo_epoch01.pt
34 ├── theo_epoch02.pt
35 └── ... # Per-epoch snapshots
36Quick Start
37Load the tokenizer
38Python
39
40from tokenizers import Tokenizer
41
42tok = Tokenizer.from_file("tokenizer.json")
43enc = lambda t: tok.encode(t).ids
44dec = lambda i: tok.decode(i)
45Reconstruct the model
46Python
47
48import torch
49import torch.nn as nn
50import torch.nn.functional as F
51from dataclasses import dataclass
52import math
53
54device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
55dtype = torch.bfloat16 if torch.cuda.is_available() else torch.float32
56
57# paste the full TheoUltimate class definition here
58# (or import from your local copy of the training script)
59
60import json
61with open("config.json") as f:
62 cfg_dict = json.load(f)
63
64cfg = TheoUltimateConfig(**cfg_dict)
65theo = TheoUltimate(cfg).to(device).to(dtype)
66theo.load_state_dict(
67 torch.load("theo_best.pt", map_location=device)
68)
69theo.eval()
70print("✅ Theo loaded!")
71Chat
72Python
73
74PAD_ID = tok.token_to_id("<pad>")
75EOS_ID = tok.token_to_id("<eos>")
76END_ID = tok.token_to_id("</theo>")
77
78@torch.no_grad()
79def chat(user_input, n_loops=6, max_new=60, temp=0.75, top_p=0.9):
80 ids = enc(f"<bos> <user> {user_input.strip()} <theo>")
81 inp = torch.tensor([ids], dtype=torch.long, device=device)
82 gen = []
83
84 for _ in range(max_new):
85 ctx = inp[:, -cfg.max_seq_len:]
86 with torch.autocast(device_type="cuda", dtype=dtype):
87 logits, _ = theo(ctx, n_loops=n_loops)
88
89 probs = F.softmax(logits[0, -1, :].float() / max(temp, 1e-6), dim=-1)
90 sp, si = torch.sort(probs, descending=True)
91 cum = torch.cumsum(sp, dim=0)
92 sp[cum - sp > top_p] = 0.0
93 sp /= sp.sum().clamp(min=1e-9)
94 nxt = si[torch.multinomial(sp, 1)].item()
95
96 if nxt in (EOS_ID, END_ID):
97 break
98 gen.append(nxt)
99 inp = torch.cat(
100 [inp, torch.tensor([[nxt]], device=device)], dim=1
101 )
102
103 return dec(gen).strip() or "I'm here to help!"
104
105print(chat("hi"))
106# → Hello! I'm Theo, made by Y.AI. How can I help you today?
107
108print(chat("who are you"))
109# → I'm Theo, an AI assistant created by Y.AI.
110
111print(chat("how does your memory work"))
112# → I have three memories: meta, fading SSM, and snapshot attention!
113Training Details
114Setting Value
115Epochs 10
116Batch size 8
117Optimiser AdamW (β₁=0.9, β₂=0.95, wd=0.1)
118Learning rate 3e-4 (cosine decay → 1.5e-5)
119Warmup steps 100
120Grad clip 1.0
121Aux loss weight 0.01
122Loop iters random 2–6 per step
123Hardware RTX Blackwell 6000 96 GB
124Precision bfloat16 (autocast)
125Stability Guarantees
126Property How
127ρ(A) < 1 always A = sigmoid(raw_A) — mathematically bounded
128No RoPE dtype mismatch Cache rebuilt in model dtype on demand
129Inference safe Full torch.autocast wrapping
130Load balancing Auxiliary MoE loss at every forward pass
131Citation
132If you use Theo in your research or product, please cite:
133
134bibtex
135
136@misc{theo_ultimate_2025,
137 title = {Theo Ultimate: A Brain-Inspired Hybrid Language Model},
138 author = {Y.AI},
139 year = {2025},
140 url = {https://huggingface.co/YOUR_USERNAME/theo-ultimate}
141}
142About Y.AI
143Y.AI is a company focused on building helpful, efficient, and
144interpretable AI systems. Theo is our flagship conversational model,
145combining the best ideas from state space models, transformers, recurrent
146depth, and mixture of experts into a single coherent architecture.
147
148Made with ❤️ by Y.AI