/ Модель

Характеристики

Контекст
2 048 токенов
Параметры
113 млн
Лицензия
Apache 2.0
Архитектура
moe_llama · MoE
Библиотека
transformers
Опубликована
19 сен 2026

Oguz-MoE-354M-Base

Генерация текстаТекст → текст3 профессии

Турецкая базовая MoE-модель в стиле LLaMA для продолжения текста, языковых экспериментов и дальнейшего дообучения.

384скачиваний за 30 дней1лайквеса обновлены4 окт 2026

Бенчмарки

Как модель справилась с задачами пользователей ailist и что о ней публикуют открытые лидерборды

Публичные оценки

Из открытых лидербордов. Сравнивайте результаты одного теста при одинаковых условиях — отсутствие оценки не значит, что модель хуже.

В подключённых источниках результатов для этой модели пока нет.

Что умеет модель

Описание составлено по карточке модели и метаданным Hugging Face

Oğuz-MoE-354M-Base — турецкая базовая причинно-языковая модель, разработанная автором репозитория Yigit-Karaman. Это предварительно обученный чекпойнт без настройки на инструкции: он продолжает текст, а не ведёт диалог. Модель построена на декодере в стиле LLaMA с 21 слоем и блоками SwiGLU Mixture-of-Experts: в каждом блоке маршрутизатор выбирает двух из четырёх экспертов. В README указано 354,2 млн параметров, из которых около 205,5 млн активны для каждого токена; метаданные Hugging Face указывают 112,6 млн параметров. Контекст модели — 2048 токенов по метаданным, при этом README отмечает, что эффективный обученный контекст составляет 1024 токена.

Модель предназначена для продолжения текста на турецком языке, экспериментов с языковым моделированием и дообучения для турецких NLP-задач. Она создана поэтапно: обучение плотной модели с нуля, два этапа расширения глубины и преобразование FFN-блоков в MoE. Обучение проводилось на турецком корпусе Cosmos-Turkish-Corpus и турецкой части FineWeb-2; веса опубликованы в формате Safetensors. Лицензия — Apache-2.0.

Модель компактна и пригодна для исследований и прототипирования, включая эксперименты с MoE и дообучением на потребительском оборудовании. Она не настроена на инструкции, поэтому без дополнительного дообучения не подходит для диалогового использования. Ожидаются слабые результаты на других языках и на турецком в нелатинской письменности; возможны фактические ошибки, галлюцинации и слабое рассуждение на длинном контексте. Для загрузки требуется пользовательский код Transformers и параметр trust_remote_code=True.

Сценарии применения

  • продолжение текста на турецком языке
  • эксперименты с турецким языковым моделированием
  • дообучение модели для турецких NLP-задач
  • изучение расширения глубины и преобразования плотной модели в MoE
  • прототипирование адаптеров для турецкого текста

Ограничения

Модель обучена преимущественно на турецком в латинской письменности, не настроена на инструкции и может давать фактические ошибки, галлюцинации и слабые ответы при длинном контексте. Для загрузки требуется пользовательский код с trust_remote_code=True; заявленные размеры и контекст в README расходятся с метаданными.

Для каких профессий подходит3

Разделы каталога профессий, в задачах которых используется эта модель

Все профессии

Карточка модели

README от автора на Hugging Face, как он его опубликовал

Открыть на Hugging Face

Oğuz-MoE-354M-Base

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 with trust_remote_code=True.


Model Summary

PropertyValue
ArchitectureLLaMA-style decoder with SwiGLU Mixture-of-Experts FFN
Decoder layers21
Hidden size576
Attention heads8 (head dim 72)
FFNMoE: 4 experts per layer, top-2 routing, expert intermediate 2048
Vocabulary50,257 (GPT-2-style BPE, Turkish)
Max position embeddings2048 (trained with contexts ≤ 1024)
EmbeddingsTied (input embeddings = LM head)
Total parameters354.2M
Active parameters / token~205.5M
Precisionbfloat16
LanguageTurkish (Latin script)

Architecture

  • Routing: Each layer's FFN is replaced by a 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.
  • Dispatch: Tokens are flattened across top-k, sorted by expert index, split into contiguous per-expert tensors, processed, and restored via inverse permutation (fully differentiable, autograd-safe).
  • Load balancing: Switch-transformer-style auxiliary loss (num_experts × Σ frac_i × prob_i, ideal value 1.0) with coefficient 0.01.
  • Upcycling initialization: The trained 1536-wide dense FFN weights were copied exactly into the first 1536 intermediate dimensions of every expert; new gate/up dimensions ~ N(0, 0.01); new down_proj columns ~ N(0, 0.001) so the added capacity starts near-silent (near-function-preserving initialization).

Training Pipeline (Lineage)

StageOperationTokensResult
0 — PretrainDense LLaMA (12 layers, 80M) from scratch1.60Bllama-80M-final
1 — Depth upscale12 → 17 layers (interleaved duplication of layers 4–8 + symmetry-breaking noise), healing run250M~96M dense
2 — Depth upscale17 → 21 layers (interleaved duplication of layers 6–9 + noise), healing run200M~112M dense
3 — MoE upcycleEvery dense FFN (1536-wide) replaced by 4 experts (2048-wide), top-2 routing; near-function-preserving init; healing run150MOğuz-MoE-354M-Base

Total token exposure across all stages: ~2.2B

Stage details

  • Stage 0 (pretrain): AdamW (fused), lr 5e-4, weight decay 0.1, cosine schedule, bf16 autocast. Two-phase context curriculum: 80% of tokens at context 512, 20% at context 1024.
  • Stages 1–2 (depth healing): Duplicated layers inserted interleaved next to their source layers to preserve activation-distribution continuity; small Gaussian noise (σ = 0.02) for symmetry breaking. Fresh AdamW (lr 5e-4, wd 0.1, cosine) per stage, bf16.
  • Stage 3 (MoE upcycle): Optimizer: 8-bit AdamW (bitsandbytes), lr 3e-4, wd 0.1, cosine decay over 9,155 optimizer steps (73,240 microsteps, gradient accumulation 8). Constant 16,384 tokens per optimizer update in both context phases. Gradient clipping 1.0. No gradient checkpointing (aux-loss graph compatibility); VRAM verified empirically instead.

Datasets & Tokenizer


Usage

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))

Training Monitoring (Stage 3, Final Run)

Metrics below are taken from the actual completed healing run (73,240 microsteps / 9,155 optimizer steps, ~149.996M tokens):

  • VRAM preflight (measured with a real optimizer step): 4.42 GB (batch 4 × ctx 512) and 5.15 GB (batch 2 × ctx 1024) on an 8 GB RTX 4060 — no system-memory offloading during training.
  • Checkpoint/resume validated in production: the run was interrupted and successfully resumed at microstep 52,824 from a 30-minute checkpoint, including full 8-bit AdamW state restoration.
  • Phase transition (512 → 1024 context) occurred at microstep 58,550 with a phase-1 snapshot checkpoint; no loss discontinuity beyond normal microbatch noise.
  • Expert load balance (EMA): remained within 23–28% per expert for the entire run; final balance [24%, 27%, 24%, 25%] — no expert collapse at any point.
  • Auxiliary (load-balance) loss: 1.00 – 1.03 throughout (ideal ≈ 1.0).
  • LM loss behavior: per-microbatch loss (2,048 tokens of heterogeneous web text) fluctuates in the ~1.3–5.4 range. The run shows the classic MoE-upcycling disruption–recovery pattern: loss rises to ~4.6 around step 250 while the router learns, then recovers below the dense baseline by step ~400. Occasional near-zero-loss microbatches (< 0.1) correspond to highly repetitive web content (memorization), not training instability.
  • Learning rate: cosine decay from 3e-4 to 2.2e-10 (full schedule completed).
  • Throughput: 7,200 – 9,400 tokens/s on a single RTX 4060 (bf16, no gradient checkpointing).

No formal downstream benchmarks have been run yet; this checkpoint is released as a research base model. Evaluation contributions from the community are welcome.


Reproducibility

  • Global seed: 4242361 (Python / NumPy / PyTorch / CUDA), also used for dataset interleaving.
  • Hardware: 1× NVIDIA GeForce RTX 4060 (8 GB), Windows.
  • Software: PyTorch (bf16 autocast, SDPA attention), Hugging Face Transformers (custom-code loading), bitsandbytes 0.50.2 (AdamW8bit), Safetensors serialization.
  • Data pipeline: offline uint16 token binary (1.6B tokens), memory-mapped streaming with tail+head wraparound (no tokens discarded at epoch boundaries).
  • Optimizer (Stage 3): AdamW8bit, lr 3e-4, wd 0.1, cosine over 9,155 steps; gradient accumulation 8; 16,384 tokens per update in both phases; grad-norm clip 1.0.
  • Checkpointing: time-based (30 min), saved only immediately after optimizer steps; loaded with map_location="cpu" and moved to GPU via bitsandbytes move_to_device to avoid VRAM spikes.
  • MoE specifics: 4 experts / top-2; expert intermediate 2048; router 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).

Limitations & Biases

  • Turkish (Latin script) only. Performance on other languages, or on Turkish in non-Latin scripts (e.g., Ottoman Turkish), is expected to be poor.
  • Web-text biases. The model inherits stereotypes, errors, and topical biases present in public Turkish web corpora.
  • Memorization. Occasional near-zero-loss microbatches during training indicate some memorization of repetitive web content.
  • Small model. Prone to factual errors, hallucination, and weak long-range reasoning; effective trained context is 1024 tokens.
  • Base model. Not aligned or instruction-tuned; unsuitable for conversational use without further fine-tuning.
  • Custom code. Loading requires trust_remote_code=True; review the modeling code (modeling_moe_llama.py) before execution, per standard practice for custom-code repositories.

Intended Use

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.


License

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:


Citation

@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}}
}

Acknowledgements

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.

Как запустить

На своей GPU в ailist. Цена — по текущим предложениям провайдеров

GPU в ailist

Универсальный рантайм · transformers

Нельзя запустить

Модели нужен код из репозитория; автор пока не в списке доверенных организаций.

Класс архитектуры
MoeLlamaForCausalLM
Ревизия весов
5cfde2a

0 моделей