xTimeCrystal/nanochat-d18-moe-fbt2
Base language model with MoE and FBT architecture
2 min read
A new language model trained from scratch using a nanochat fork. The model features 18 layers and a mixture of experts (MoE) architecture consisting of 64 routed experts and 1 shared expert, utilizing a feedback mechanism (FBT, K = 2) for sequence processing. It has a total of 1.035 billion parameters, with 324 million active parameters. Training was performed on the 7.79 billion token ClimbMix dataset using 8 RTX 5090 GPUs in 12 hours. This model is useful for transformer architecture researchers and custom language model developers.
Key features
- MoE architecture: 1 shared expert and 64 routed experts (top-8) without expert drop
- FBT mechanism (Feedback Training, K = 2): the network performs two passes over the sequence at each training step
- Context and parameters: 18 layers, width 1152, 9 heads of 128, 2048 token sequence length
- Training: 7.79 billion tokens (ClimbMix dataset) in 7,425 steps on 8x RTX 5090
What you can do
- Run model inference using the weights loading script from the card
- Use the included training code for experiments with your own architecture modifications
- Explore parallel (Jacobi) sequential decoding for FBT passes
Example
Loading weights and model configuration to run inference:
import sys, json, torch
sys.path.insert(0, "code")
from nanochat.gpt import GPT, GPTConfig
cfg = json.load(open("meta_007425.json"))["model_config"]
sd = {k.removeprefix("_orig_mod."): v for k, v in torch.load("model_007425.pt", map_location="cuda", weights_only=True).items()}
with torch.device("meta"):
model = GPT(GPTConfig(**cfg))
model.to_empty(device="cuda"); model.init_weights()
model.load_state_dict(sd, strict=True, assign=True)
model.eval()Read more
Details• Validation bpb: 0.7059 (on base_train split, 41.9M tokens)
• CORE metric: 0.2765 (maximum 500 examples per task)
• Requirements: CUDA GPU, bf16 (no extra settings needed for Hopper, set USE_FA3 = False on other GPUs)
• The package includes model_007425.pt weights, meta_007425.json config, tokenizer, and launch code










Comments