/ Модель

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

Контекст
4 096 токенов
Параметры
135 млн
Лицензия
Apache 2.0
Архитектура
modernbert · dense
Библиотека
transformers
Опубликована
20 окт 2026

SabiBERTa-135M

Заполнение пропусковТекст → текст5 профессий

Базовый энкодер ModernBERT на 69 африканских языках для fill-mask и дообучения под классификацию, поиск и разметку токенов.

32скачиваний за 30 дней0лайковвеса обновлены20 окт 2026

Бенчмарки

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

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

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

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

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

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

SabiBERTa-135M — энкодерная модель семейства ModernBERT от AletheiaAI, предназначенная для дообучения под задачи африканских языков. Она содержит 135,3 млн параметров, использует архитектуру ModernBertForMaskedLM и принимает последовательности длиной до 4096 токенов. Модель обучена для работы с 69 африканскими языками, включая амхарский, хауса, игбо, йоруба и суахили; среди поддерживаемых также английский. Карточка приводит результаты оценки на наборах для анализа тональности, определения позитивности, классификации новостей, многоязычных задачах и распознавании сущностей.

Модель рассчитана на дообучение для классификации, поиска и маркировки токенов, а также может служить основой для фильтрации качества данных на африканских языках. Это базовый masked-language encoder: основной pipeline-тег Hugging Face — fill-mask. По README, результаты ограничены наименее представленными языками; для иджо, кalenjin и га модель не следует использовать для надёжных оценок качества. Карточка сообщает о заметном разбавлении языковой ёмкости при совместной поддержке 69 языков. Лицензия Apache-2.0.

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

  • дообучение классификатора тональности для африканских языков
  • классификация новостных текстов на африканских языках
  • распознавание именованных сущностей в африканских текстах
  • поиск и извлечение релевантных текстов на африканских языках
  • восстановление замаскированных слов при анализе текста

Ограничения

Модель слаба на языках с крайне малым объёмом обучающих текстов, в частности на иджо, kalenjin и га; для них не следует полагаться на оценки качества. Совместная поддержка 69 языков ограничивает ёмкость на каждый язык.

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

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

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

Также подходит для

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

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

Открыть на Hugging Face

SabiBERTa-135M

A 135M-parameter encoder for 70 African languages, pretrained from scratch with masked language modelling. Sabi is Nigerian Pidgin for "to know".

Its point is coverage. AfroXLMR covers 17 African languages and AfriBERTa 11; SabiBERTa covers 70, including languages with no prior encoder at all — Dagbani, Mossi, Kamba, Nuer, Sango, Umbundu, Kimbundu, Tiv, Urhobo, Efik.

Pooling: use mean pooling, not CLS

<cls> and <sep> are reserved in the tokenizer but were never trained. MLM pretraining here never inserts them into a sequence — windows are packed documents separated by </s> — so those two embedding rows only ever received the tied-head softmax gradient that every unused row receives. Measured during training: their gradient magnitude sits at 0.74–0.80x that of an ordinary token that never occurs.

This differs from BERT and from ModernBERT itself, both of which wrap every pretraining sequence as [CLS] ... [SEP] and so train those vectors.

Practically: pool by masked mean over the last hidden state, which is what E5, BGE and sentence-transformers do by default anyway. A CLS-pooling recipe copied from a BERT tutorial will start from an effectively random vector and underperform.

import torch
from transformers import AutoTokenizer, AutoModel

tok = AutoTokenizer.from_pretrained("AletheiaAING/SabiBERTa-135M")
model = AutoModel.from_pretrained("AletheiaAING/SabiBERTa-135M")

def embed(texts):
    b = tok(texts, padding=True, truncation=True, max_length=512, return_tensors="pt")
    h = model(**b).last_hidden_state                      # (B, T, 768)
    m = b["attention_mask"].unsqueeze(-1).float()         # (B, T, 1)
    return (h * m).sum(1) / m.sum(1).clamp(min=1e-9)      # masked mean

For token-level tasks (NER, POS) this does not apply — use the per-token hidden states directly.

Architecture

ModernBERT (Warner et al., 2024), the current best-practice encoder recipe:

layers / dim / heads12 / 768 / 12
context4096
vocabulary65,536 (+1 <mask>)
parameters135.8M
positionsRoPE
FFNGeGLU, pre-norm, no bias
attentionalternating local (128) / global, every 3rd layer global

The small vocabulary is why this is 135M where XLM-R base is 277M at the same depth and width: a 65,536 SabiYarn vocabulary trained on African text costs 50M embedding parameters against XLM-R's 192M for 250k multilingual tokens.

Training data

40.2B tokens drawn from a 100B-token deduplicated corpus (15.7% cross-document duplication removed), allocated by UniMax (Chung et al., ICLR 2023) with a 2-epoch repeat cap, plus a fixed 3B English anchor for cross-lingual transfer and code-switching.

Documents were selected by prior-based filtering (Seo et al., 2025): each document is scored by mean log unigram probability against its own language's prior, and by the standard deviation over equal chunks; those furthest from the language median are dropped, which removes gibberish and boilerplate without a trained classifier.

The corpus is 100% NFC-normalised (verified over ~418k documents).

Training

  • Dynamic masking at 30% — a fresh mask every time a window is seen, per RoBERTa's ablation, at ModernBERT's rate rather than BERT's 15%.
  • Cross-document attention masking — windows pack multiple documents (mean ~246 tokens), so without this a masked token would be predicted partly from an unrelated neighbouring article.
  • Muon (Jordan et al. 2024, Moonlight scaling) on the hidden matrices, AdamW on embeddings, head and 1-D parameters.
  • WSD schedule — constant LR after warmup, decayed over the final 10%, so the token budget stays a decision rather than a commitment.

Best checkpoint: step 76500, loss EMA 1.4818, 40.16B tokens seen.

Downstream evaluation

Fine-tuned per language under identical settings for every model (10 epochs, lr 5e-5, batch 32, max_len 256). Mean pooling is used for the sequence tasks, since <cls> was never trained.

Pretrained weights verified unchanged across the whole run (sha256 7abaa66d66fd6207…).

afrisenti — weighted_f1, mean over 12 languages

modelweighted_f1accuracymacro F1weighted F1
SabiBERTa-135M (this model)0.58960.58800.53730.5896
afro-xlmr-base0.65670.65520.60850.6567
afriberta_large0.59560.59420.54190.5956
serengeti-E2500.64590.64140.60140.6459

masakhapos — accuracy, mean over 20 languages

modelaccuracyaccuracymacro F1weighted F1
SabiBERTa-135M (this model)0.86610.8661——
afro-xlmr-base0.89200.8920——
afriberta_large0.87710.8771——
serengeti-E2500.88690.8869——

masakhanews — weighted_f1, mean over 16 languages

modelweighted_f1accuracymacro F1weighted F1
SabiBERTa-135M (this model)0.87270.87180.73900.8727
afro-xlmr-base0.89000.88900.77490.8900
afriberta_large0.86220.86050.69650.8622
serengeti-E2500.87540.87500.75320.8754

sib200 — weighted_f1, mean over 60 languages

modelweighted_f1accuracymacro F1weighted F1
SabiBERTa-135M (this model)0.63820.64400.61460.6382
afro-xlmr-base0.62860.63680.60080.6286
afriberta_large0.52140.53000.48590.5214
serengeti-E2500.67650.68220.65440.6765

masakhaner2 — span_f1, mean over 20 languages

modelspan_f1accuracymacro F1weighted F1
SabiBERTa-135M (this model)0.78530.9719——
afro-xlmr-base———OutOfMemoryError: CUDA out of memory. Tr
model_skippedamharqaryhauibokinpcmporswatsotwiyor
SabiBERTa-135M (this model)—0.4900.5650.4630.6930.6850.6460.6370.6170.5670.4530.6300.630
afro-xlmr-base—0.6770.6440.5480.7400.7640.6550.6700.6550.5980.5830.6400.708
afriberta_large—0.5340.4430.4130.7470.7540.6130.6340.5520.5960.5020.6230.734
serengeti-E250—0.6230.6160.5160.7730.7790.6450.6570.6300.6050.5400.6350.734
modelbambbjewefonhauibokinlugluomosnyapcmsnaswatsntwiwolxhoyorzul
SabiBERTa-135M (this model)0.8800.7670.8690.8820.8960.7790.9730.8910.8460.8790.7950.8550.8740.9120.8780.8100.9120.8490.9120.862
afro-xlmr-base0.9000.8480.8810.9020.9280.7920.9820.9060.8770.9060.8220.9090.8860.9320.8960.8400.9240.8710.9460.891
afriberta_large0.8870.7980.8720.8820.9280.7900.9770.8900.8610.8940.7940.8950.8770.9290.8850.8260.9150.8400.9430.859
serengeti-E2500.9000.8370.8830.8810.9300.7860.9790.9100.8800.8960.8170.9020.8850.9290.8940.8370.9190.8540.9350.884
modelamhengfrahauibolinlugormpcmrunsnasomswatirxhoyor
SabiBERTa-135M (this model)0.9080.8870.8440.8660.8850.8790.8930.8650.9740.8820.9250.7360.8300.7910.9000.897
afro-xlmr-base0.9260.9080.8750.8800.8830.9160.9000.8650.9790.9120.9240.7760.8380.8200.9400.896
afriberta_large0.9000.8830.7730.8860.8510.8710.8320.8680.9600.9000.8850.7650.8380.8200.8540.909
serengeti-E2500.9170.8900.8430.8730.8670.8670.8630.8890.9770.8790.9010.7340.8430.8400.9150.911
modelaeb_Arabafr_Latnaka_Latnamh_Ethiarb_Arabarb_Latnary_Arabarz_Arabbam_Latnbem_Latncjk_Latndik_Latndyu_Latneng_Latnewe_Latnfon_Latnfra_Latnfuv_Latngaz_Latnhau_Latnibo_Latnkab_Latnkam_Latnkbp_Latnkea_Latnkik_Latnkin_Latnkmb_Latnknc_Arabknc_Latnkon_Latnlin_Latnlua_Latnlug_Latnluo_Latnmos_Latnnso_Latnnus_Latnnya_Latnplt_Latnrun_Latnsag_Latnsna_Latnsom_Latnsot_Latnssw_Latnswh_Latntaq_Latntaq_Tfngtir_Ethitsn_Latntso_Latntum_Latntwi_Latntzm_Tfngumb_Latnwol_Latnxho_Latnyor_Latnzul_Latn
SabiBERTa-135M (this model)0.3780.7900.7290.7790.4160.5390.4560.4460.6890.6960.5080.6150.5320.8160.6830.6580.7340.6090.6730.7600.7940.4970.6000.5720.6470.7230.7820.5940.3450.5300.6690.6770.6190.6420.6070.6530.7500.5860.7390.5890.7430.5980.7120.7000.7600.7040.7890.5020.2530.7510.7220.6940.7330.7120.2730.6100.6790.7760.7080.751
afro-xlmr-base0.8200.8370.5900.7650.8620.5260.8100.8470.5790.6070.5050.5870.5600.8800.5660.5150.8370.5730.5880.7270.7200.4360.5680.5240.6610.6250.7090.5800.3760.5660.6190.6420.5990.5500.6250.5570.6640.4660.6920.7760.7040.5980.6740.7170.6530.6240.7560.5650.2900.6690.6540.5930.6910.6110.2100.5440.5770.6970.6170.736
afriberta_large0.1810.5470.5520.7290.2150.5010.1950.2000.5470.5350.4410.5520.4850.7830.5090.5190.5860.5310.6730.7040.7110.4480.5320.5060.5090.5540.7040.4700.2820.5500.5900.5370.5420.5330.5170.5620.5230.4200.5770.5340.6580.5140.5380.6960.5640.4790.7750.5470.1680.6670.5180.5060.5900.5740.1480.4690.5420.5670.6560.517
serengeti-E2500.7690.8090.6910.8060.8430.5620.7560.8240.6260.6810.5550.5670.5430.8340.6520.6130.8370.6610.7460.7420.7670.5090.6300.5930.7530.7050.7480.5770.3900.5970.7510.7590.6940.6270.6910.6130.7120.5790.7390.7840.7880.6410.6890.7600.7720.6540.8400.5590.3440.7480.6970.7400.7400.6870.2530.5820.6190.7050.6800.754
modelbambbjewefonhauibokinlugluomosnyapcmsnaswatsntwiwolxhoyorzul
SabiBERTa-135M (this model)0.7210.6340.8220.7660.7490.8270.8150.8230.7290.6260.8850.7900.8890.9000.7800.7030.7120.8550.8300.849

Intended use and limits

Designed as a base encoder for fine-tuning: classification, retrieval, token labelling, and as a backbone for data-quality filtering across African languages.

It will be weak on the smallest languages. The repeat cap means languages with very little text contribute a tiny share — ijo has ~4k tokens available, kln ~250, gaa ~44k. Those are present so the model does not treat them as noise, not because it has learned them. Do not rely on it for quality judgements in those languages; there is not enough text in existence to support one.

Untoned Yoruba and Igbo are both well represented (18% of Yoruba documents and 52% of Igbo carry no tone marks), which is deliberate — that is what users type — but it means the model does not assume diacritics are present.

Downstream results

Five benchmarks, four models, one harness. masakhaner2 is fine-tuned per language (the protocol the baseline papers headline); the other four use the multilingual protocol -- one model over every language at once, as in MasakhaNER 2.0's Table 5 and AfriSenti's Task B, and as this encoder would actually be deployed.

taskmetricthis modelafro-xlmr-baseafriberta-largeserengeti-E250
masakhaner2 (per-lang, 20)span F10.7882—83.0 published—
masakhapos (ml, 20)accuracy0.86610.89200.87710.8869
masakhanews (ml, 16)weighted F10.87270.89000.86220.8754
afrisenti (ml, 12)weighted F10.58960.65670.59560.6459
sib200 (ml, 60)weighted F10.63820.62860.5214—

Baseline figures quoted as published are not recomputed: this harness reproduced AfroXLMR-base's published per-language MasakhaNER 2.0 scores to a mean absolute difference of 0.57 F1 over 9 languages, and AfriBERTa-large to within 0.4. Single- language run-to-run variance is about 1.1 F1 (Bambara measured 79.9 and 81.0 on two runs of one configuration) and the papers average 5 runs where these are single runs, so read differences under ~1.5 F1 on one language as noise.

Where the deficit comes from: coverage or capacity?

Splitting each task's per-language results by whether the baseline pretrained on that language separates the two explanations. Capacity dilution predicts a roughly uniform deficit; a coverage advantage should appear precisely where a baseline has no exposure.

sib200, against AfriBERTa-large (11 pretraining languages):

nthis modelafribertaΔwins
covered by AfriBERTa80.75230.6906+6.178/8
not covered520.62060.4953+12.5350/52

The advantage doubles on languages AfriBERTa never saw -- 6.4 F1 wider. Pretraining on 69 languages buys exactly what it should.

sib200, against AfroXLMR-base (20 MAFT languages):

nthis modelafro-xlmrΔwins
covered by AfroXLMR150.75630.7310+2.5411/15
not covered450.59880.5944+0.4433/45

This runs the other way, and the likely reason is that AfroXLMR inherits XLM-R's 100 languages, so "outside the MAFT set" does not mean unseen.

masakhapos, against AfroXLMR-base: −2.52 on covered languages, −2.67 on uncovered, 0/20 wins. The deficit is flat, which is the signature capacity dilution predicts.

So the two effects are both real, on different tasks: a breadth advantage on topic classification across 60 languages, and a uniform ~2.5-point shortfall on POS tagging that coverage does not explain.

Capacity dilution across 69 languages

For the uniform component, the literature gives the mechanism. XLM-R's authors report that "the per-language capacity decreases as we increase the number of languages", that XNLI accuracy falls from 71.8% to 67.7% going from 7 languages to 100, and that "the issue is even more prominent when the capacity of the model is small"; they widened the hidden size 768 → 960 for 30 languages and found 1152 still insufficient for 100. This model sits at 69 languages, d=768, 86M non-embedding parameters, against AfriBERTa's 11 languages, d=768, 72M.

Three alternatives are ruled out by measurement rather than argument:

  • Data volume. Hausa is the weakest NER language (−12.7 against published) and is rank 5 in this corpus at 1.27B tokens -- more than Zulu, the strongest (+2.0).
  • Corpus quality. The Hausa corpus is cleaner than the Zulu one on every axis measured: 0.6% duplicate 7-grams against Zulu's 10.1%, fewer digits, no detectable language contamination, 87% human-sourced.
  • Tokenisation. Fertility over ~92k words of real text is 1.841 tokens/word against AfriBERTa's 2.096 and afro-xlmr's 2.269 -- this tokenizer is the efficient one, on a 65,536 vocabulary against their 70k and 250k.

Two findings remain unexplained. The Hausa corpus uses the hooked consonants ɓ ɗ ƙ at 34.65 per 1,000 words while MasakhaNER 2.0's Hausa is fully ASCII-ised (0.00) -- the only language with that divergence, and the only one with a double-digit gap. But the mechanism does not follow: this tokenizer handles the ASCII-ised benchmark text at 1.237 tokens/word, better than its own corpus, so there is no fragmentation penalty. Separately, Hausa is the only language that got worse with 5× the epochs (75.1 → 72.6), suggesting overfitting there specifically.

No ablation has been run: testing capacity properly means pretraining a wider model or a narrower language set.

Known coverage gap

bbj (Ghomálá') is one of MasakhaNER 2.0's 20 languages and is absent from this corpus entirely, so its 63.8 reflects zero pretraining exposure. The commercially-licensed Ghomálá' text that exists amounts to roughly 88k words (~225k tokens) across stfotso/french-ghomala-bandjoun, masakhane/AfriADR and FineWeb-2 — 0.0006% of this corpus, which would leave it unlearned even if added. masakhane/mafand and aiana94/polynews carry Ghomálá' but are CC-BY-NC and excluded under this project's commercial-use requirement.

Citation

Uses UniMax (Chung et al., ICLR 2023), ModernBERT (Warner et al., 2024), prior-based filtering (Seo et al., 2025), Muon (Jordan et al., 2024), RoBERTa's dynamic masking (Liu et al., 2019).

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

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

GPU в ailist

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

Можно запустить

Подбираем GPU…

Класс архитектуры
ModernBertForMaskedLM
Ревизия весов
d182c11

0 моделей