Downloads · 30 days
98
21% of all-time downloads
Yigit-Karaman/Oguz-MoE-354M-Base
Oguz-MoE-354M-Base is a text generation model from Yigit-Karaman. Use it when you need the model to write or continue text. It is set up for transformers. The card lists the license as apache-2.0.
Oğuz-MoE-354M-Base is a Turkish mixture-of-experts (MoE) causal language model with 354.2M total parameters and ~205.5M active parameters per token. It was produced by a four-stage progressive-scaling pipeline — from-…
Downloads · 30 days
98
21% of all-time downloads
All-time downloads
471
Public
Parameters
354M
708 MB on disk
Likes
1
Public
Click a slice to open those files.
.safetensors708 MB · 99%
How the weights are stored.
BF16354M · 100%
From the Hugging Face model README
Oğuz-MoE-354M-Base is a Turkish mixture-of-experts (MoE) causal language model with 354.2M total parameters and ~205.5M active parameters per token. It was produced by a four-stage progressive-scaling pipeline — from-scratch dense pretraining, two rounds of depth upscaling, and a final FFN→MoE upcycle — executed entirely on a single consumer-grade GPU (NVIDIA GeForce RTX 4060, 8 GB VRAM).
The model is a base (pretrained-only) checkpoint: it completes text, it is not instruction-tuned.
⚠️ This model uses a custom architecture (
MoeLlamaForCausalLM). Load it withtrust_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 ≤ 1024) |
| Embeddings | Tied (input embeddings = LM head) |
| Total parameters | 354.2M |
| Active parameters / token | ~205.5M |
| Precision | bfloat16 |
| Language | Turkish (Latin script) |
MoEBlock containing a linear router (576 → 4) and 4 SwiGLU experts (intermediate size 2048). Per token, the top-2 experts are selected; their softmax-normalized gates sum to 1.0.num_experts × Σ frac_i × prob_i, ideal value 1.0) with coefficient 0.01.down_proj columns ~ N(0, 0.001) so the added capacity starts near-silent (near-function-preserving initialization).| 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 of layers 4–8 + symmetry-breaking noise), healing run | 250M | ~96M dense |
| 2 — Depth upscale | 17 → 21 layers (interleaved duplication of layers 6–9 + noise), healing run | 200M | ~112M dense |
| 3 — MoE upcycle | Every dense FFN (1536-wide) replaced by 4 experts (2048-wide), top-2 routing; near-function-preserving init; healing run | 150M | Oğuz-MoE-354M-Base |
Total token exposure across all stages: ~2.2B
ytu-ce-cosmos/turkish-gpt2 (50,257 tokens).ytu-ce-cosmos/Cosmos-Turkish-Corpus-v1.0HuggingFaceFW/fineweb-2 (tur_Latn split)uint16 binary (1.6B tokens) and streamed via memory-mapping during all stages.from transformers import AutoModelForCausalLM, AutoTokenizer
import torch
repo = "Yigit-Karaman/Oguz-MoE-354M-Base"
tokenizer = AutoTokenizer.from_pretrained(repo)
model = AutoModelForCausalLM.from_pretrained(
repo,
trust_remote_code=True, # required: custom MoE architecture
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))
Metrics below are taken from the actual completed healing run (73,240 microsteps / 9,155 optimizer steps, ~149.996M tokens):
No formal downstream benchmarks have been run yet; this checkpoint is released as a research base model. Evaluation contributions from the community are welcome.
uint16 token binary (1.6B tokens), memory-mapped streaming with tail+head wraparound (no tokens discarded at epoch boundaries).map_location="cpu" and moved to GPU via bitsandbytes move_to_device to avoid VRAM spikes.Linear(576→4) init std 0.01; softmax-normalized top-2 gates; Switch-style aux loss coefficient 0.01; near-function-preserving expert initialization (exact copy of dense FFN into first 1536 dims).trust_remote_code=True; review the modeling code (modeling_moe_llama.py) before execution, per standard practice for custom-code repositories.Research and prototyping for Turkish NLP: language-modeling experiments, fine-tuning/adapter studies, and as a worked example of progressive depth expansion + MoE upcycling on consumer hardware. Not intended for production deployment or safety-critical applications.
This model is released under the Apache 2.0 License (see the LICENSE file in this repository).
As required by the upstream datasets, this model is provided with the following attributions:
@misc{Oguz-MoE-354M-Base,
title = {Oğuz-MoE-354M-Base: A Turkish Mixture-of-Experts Language Model via Progressive Depth Expansion and FFN Upcycling},
author = {Yiğit Karaman},
year = {2026},
howpublished = {\url{https://huggingface.co/Yigit-Karaman/Oguz-MoE-354M-Base}}
}
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.