Fill-Mask
Transformers
Safetensors
Turkish
modernbert
turkish
encoder
foundation-model

MoganBERT-TR

Paper Blog Model Collection Buy Me a Coffee

MoganBERT-TR

MoganBERT-TR is a 149.4M-parameter Turkish encoder with an 8,192-token context window, trained from scratch on 237.3B tokens. It follows the ModernBERT architecture — 22 layers, hidden size 768, 12 heads, alternating local/global attention — with a 50,048-token SentencePiece Unigram tokenizer trained for Turkish.

Unlike other Turkish encoders, it is pretrained with a two-stage CLM→MLM curriculum rather than pure MLM.

Usage

from transformers import pipeline

unmask = pipeline("fill-mask", model="moganai/MoganBERT-TR")
unmask("Türkiye'nin başkenti [MASK].")

Use classifier_pooling="mean" (the config default) when fine-tuning — ModernBERT has no NSP, so [CLS] is not pretrained.

For embeddings and retrieval use MoganBERT-Embed or Mogan-ColBERT-TR; the raw encoder is anisotropic and unsuitable for direct cosine similarity.

Training

Pretrained on 4×H100 over 237.3B tokens: causal language modelling for the first 16.6% of the run, masked language modelling for the remainder, with the transition made inside the stable phase of a WSD schedule. Annealing extends the context 1024→8192, scales the global RoPE θ to 160k and lowers the mask rate to 10%. This checkpoint decays the final portion at 1024 context.

The corpus was built from FineWeb2, raw Common Crawl WARC records and printed/institutional sources, filtered with a fastText quality classifier distilled from a fine-tuned Turkish BERT. The mixture is ~73% Turkish, ~17% English and ~10% code.

Results

Evaluated on TrGLUE (8 tasks, 5 official seeds, official run_trglue.py) and TabiBench (28 datasets, 8 categories).

TrGLUE TabiBench

TabiBench is single-seed; sub-one-point margins are not an ordering. Full per-task numbers are in the paper.

Model Family

Model Params Purpose
MoganBERT-TR 149.4M Base encoder (this model)
MoganBERT-Embed 149M Single-vector embeddings
Mogan-ColBERT-TR 148.9M Multi-vector retrieval

Citation

@article{yilmaz2026moganbert,
  title   = {MoganBert-TR: A Turkish Encoder Foundation Model Trained from Scratch with a CLM-MLM Curriculum},
  author  = {Furkan Yilmaz and Habibe Aleyna Tasdemir and Muhammed Faruk Gozay},
  journal = {arXiv preprint arXiv:2608.25768},
  year    = {2026}
}


MoganBERT-TR (Türkçe)

MoganBERT-TR, 8.192 token bağlam penceresine sahip, 237.3 milyar token üzerinde sıfırdan eğitilmiş 149.4M parametreli bir Türkçe encoder'dır. ModernBERT mimarisini izler — 22 katman, gizli boyut 768, 12 başlık, dönüşümlü yerel/küresel dikkat — ve Türkçe için eğitilmiş 50.048 tokenlık bir SentencePiece Unigram tokenizer kullanır.

Diğer Türkçe encoder'lardan farklı olarak saf MLM yerine iki aşamalı bir CLM→MLM müfredatı ile ön-eğitilmiştir.

Kullanım

from transformers import pipeline

unmask = pipeline("fill-mask", model="moganai/MoganBERT-TR")
unmask("Türkiye'nin başkenti [MASK].")

İnce ayarda classifier_pooling="mean" (config varsayılanı) kullanın — ModernBERT'te NSP olmadığı için [CLS] ön-eğitilmiş değildir.

Gömme ve arama için MoganBERT-Embed veya Mogan-ColBERT-TR kullanın; ham encoder anizotropiktir ve doğrudan kosinüs benzerliğine uygun değildir.

Eğitim

4×H100 üzerinde 237.3 milyar token ile ön-eğitildi: eğitimin ilk %16.6'sı nedensel dil modellemesi, kalanı maskeli dil modellemesi; geçiş WSD çizelgesinin durağan fazı içinde yapıldı. Tavlama bağlamı 1024→8192'ye çıkarır, küresel RoPE θ'yı 160k'ya ölçekler ve maske oranını %10'a indirir. Bu checkpoint son bölümü 1024 bağlamda sönümler.

Külliyat FineWeb2, ham Common Crawl WARC kayıtları ve basılı/kurumsal kaynaklardan derlendi; ince ayarlanmış bir Türkçe BERT'ten damıtılan fastText kalite sınıflandırıcısıyla filtrelendi. Karışım ~%73 Türkçe, ~%17 İngilizce ve ~%10 kod.

Sonuçlar

TrGLUE (8 görev, 5 resmî tohum, resmî run_trglue.py) ve TabiBench (28 veri kümesi, 8 kategori) üzerinde ölçüldü.

TrGLUE TabiBench

TabiBench tek tohumludur; bir puanın altındaki farklar bir sıralama değildir. Görev bazlı tüm sayılar makalede.

Model Ailesi

Model Parametre Amaç
MoganBERT-TR 149.4M Temel encoder (bu model)
MoganBERT-Embed 149M Tek vektörlü gömme
Mogan-ColBERT-TR 148.9M Çok vektörlü retrieval

Atıf

@article{yilmaz2026moganbert,
  title   = {MoganBert-TR: A Turkish Encoder Foundation Model Trained from Scratch with a CLM-MLM Curriculum},
  author  = {Furkan Yilmaz and Habibe Aleyna Tasdemir and Muhammed Faruk Gozay},
  journal = {arXiv preprint arXiv:2608.25768},
  year    = {2026}
}

Support MoganAI
If our open Turkish models and datasets are useful to you, you can support our work.
Açık Türkçe modellerimiz ve veri setlerimiz işinize yarıyorsa çalışmalarımıza destek olabilirsiniz.

Buy Me a Coffee

Downloads last month
210
Safetensors
Model size
0.1B params
Tensor type
F32
·
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for moganai/MoganBERT-TR

Finetunes
1 model

Datasets used to train moganai/MoganBERT-TR

Collection including moganai/MoganBERT-TR

Paper for moganai/MoganBERT-TR