Continued-healing checkpoint of Oğuz-MoE-354M-Base (v1): +150M tokens of MoE healing (300M cumulative MoE tokens, ~150M routed tokens per expert), gradient checkpointing re-enabled (non-reentrant), and a new 2048-context training phase. 354.2M total parameters, ~205.5M active per token (top-2 of 4 experts).
Like v1, this is a base (pretrained-only) checkpoint: it completes text, it is not instruction-tuned.
⚠️ This model uses a custom architecture (MoeLlamaForCausalLM). Load it with trust_remote_code=True.
| Property | Value |
|---|---|
| Architecture | LLaMA-style decoder with SwiGLU Mixture-of-Experts FFN |
| Decoder layers | 21 |
| Hidden size | 576 |
| Attention heads | 8 (head dim 72) |
| FFN | MoE: 4 experts per layer, top-2 routing, expert intermediate 2048 |
| Vocabulary | 50,257 (GPT-2-style BPE, Turkish) |
| Max position embeddings | 2048 (trained with contexts up to 2048 in v2) |
| Embeddings | Tied (input embeddings = LM head) |
| Total parameters | 354.2M |
| Active parameters / token | ~205.5M |
| Precision | bfloat16 |
| Language | Turkish (Latin script) |
| Aspect | v1 | v2 |
|---|---|---|
| Cumulative MoE healing tokens | 150M | 300M |
| Routed tokens per expert | ~75M | ~150M |
| Gradient checkpointing | Off (aux-loss graph safety) | On (use_reentrant=False) |
| Max trained context | 1024 | 2048 (20% of v2 tokens) |
| Healing LR | 3e-4 cosine | 1e-4 cosine (continued) |
| Expert load balance (EMA) | 23–28% | 23–26% |
| Aux loss range | 1.00–1.03 | 1.01–1.04 |
| Throughput (RTX 4060) | 7,200–9,400 tok/s | 6,000–8,300 tok/s (checkpointing on) |
Pairwise cosine between expert weight matrices, and relative Frobenius drift of the inherited 1536-dim subspace versus the original dense FFN (the upcycling source), measured on the released checkpoints:
| Metric | v1 (150M tokens) | v2 (300M tokens) | Δ |
|---|---|---|---|
| Mean pairwise expert cosine | 0.8941 | 0.8882 | −0.0059 |
| Min pairwise expert cosine | 0.8046 | 0.7993 | −0.0053 |
| Mean drift vs dense FFN | 0.2613 | 0.2730 | +0.0117 |
| Max drift vs dense FFN | 0.4855 | 0.4909 | +0.0054 |
| New-dim activity ratio | 0.2312 | 0.2361 | +0.0049 |
The in-run monitor (pairwise cosine of down_proj on layers 0/10/20, every 500 optimizer steps) declined monotonically 0.8803 → 0.8736 and plateaued over the final ~10k steps. Interpretation: doubling the per-expert token budget yields continued but strongly diminishing orthogonalization — at this scale, top-2-of-4 upcycled experts remain partially specialized near-ensembles rather than fully distinct domain/syntactic pathways. Divergence concentrates in down_proj/up_proj and middle layers (max per-expert drift 0.49 at layer 6); gate projections stay most similar (0.91–0.94).
Full per-layer reports: divergence_baseline.json and divergence_final.json in this repository.
| Stage | Operation | Tokens | Result |
|---|---|---|---|
| 0 — Pretrain | Dense LLaMA (12 layers, 80M) from scratch | 1.60B | llama-80M-final |
| 1 — Depth upscale | 12 → 17 layers (interleaved duplication + symmetry-breaking noise), healing | 250M | ~96M dense |
| 2 — Depth upscale | 17 → 21 layers (interleaved duplication + noise), healing | 200M | ~112M dense |
| 3 — MoE upcycle | Dense FFN (1536) → 4 experts (2048), top-2; near-function-preserving init; healing | 150M | Oğuz-MoE-354M-Base (v1) |
| 4 — Continued healing | v1 + 150M tokens (40% ctx 512, 40% ctx 1024, 20% ctx 2048); LR 1e-4 cosine; gradient checkpointing on | 150M | Oğuz-MoE-354M-Base-v2 |
Total token exposure across all stages: ~2.35B
tur_Latn).uint16 binary (1.6B tokens), memory-mapped during all stages.from transformers import AutoModelForCausalLM, AutoTokenizer
import torch
repo = "Yigit-Karaman/Oguz-MoE-354M-Base-V2"
tokenizer = AutoTokenizer.from_pretrained(repo)
model = AutoModelForCausalLM.from_pretrained(
repo,
trust_remote_code=True, # required: custom MoE architecture
dtype=torch.bfloat16, # was: torch_dtype=torch.bfloat16,
device_map="auto",
)
prompt = "Türkiye'nin başkenti"
inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
with torch.no_grad():
out = model.generate(**inputs, max_new_tokens=64, do_sample=True, temperature=0.8, top_p=0.9)
print(tokenizer.decode(out[0], skip_special_tokens=True))
uint16 token binary (1.6B tokens), memory-mapped streaming with tail+head wraparound.map_location="cpu" and bitsandbytes move_to_device.Linear(576→4); softmax-normalized top-2 gates; Switch-style aux loss coefficient 0.01; gradient checkpointing use_reentrant=False (keeps the aux-loss autograd graph intact).trust_remote_code=True; review modeling_moe_llama.py before execution.Research and prototyping for Turkish NLP: language-modeling experiments, fine-tuning/adapter studies, and as a worked example of progressive depth expansion + MoE upcycling + continued healing on consumer hardware. Not intended for production deployment or safety-critical applications.
Apache 2.0 (see the LICENSE file in this repository). Upstream attributions:
@misc{Oguz-MoE-354M-Base-V2,
title = {Oğuz-MoE-354M-Base-v2: Continued-Healing Checkpoint of a Turkish Mixture-of-Experts Language Model},
author = {Yiğit Karaman},
year = {2026},
howpublished = {\url{https://huggingface.co/Yigit-Karaman/Oguz-MoE-354M-Base-V2}}
}
Tokenizer and part of the training corpus courtesy of the YTÜ-Cosmos project; Turkish web text from HuggingFace FineWeb-2. Depth-upscaling and MoE upcycling techniques follow the public literature on layer duplication and expert upcycling of dense checkpoints. Built with Hugging Face Transformers, bitsandbytes, and PyTorch.