/ Модель

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

Контекст
8 192 токена
Параметры
354 млн
Лицензия
MIT
Архитектура
nexterabert · dense
Библиотека
transformers
Опубликована
12 сен 2026

NexteraBERT-Mezzoforte-220M-1.3B-en

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

Англоязычный энкодер NexteraBERT для заполнения масок и дообучения на классификацию текстов.

19скачиваний за 30 дней0лайковвеса обновлены25 сен 2026

Бенчмарки

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

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

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

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

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

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

NexteraBERT-Mezzoforte-220M-1.3B-en — англоязычный двунаправленный энкодер NexteraBERT, опубликованный независимым исследователем RikkaBotan. Это отдельный запуск модели с 212,6 млн параметров, обученный методом masked language modeling на 1,3 млрд токенов; значение 353,6 млн в метаданных каталога расходится с размером, указанным в README. Архитектура включает 18 блоков со смешиванием токенов, полносвязными слоями и несколькими видами внимания; модель предназначена для предсказания маскированных токенов и последующей адаптации к задачам классификации.

Энкодер можно применять для классификации текстов после дообучения. Для поиска и оценки сходства предложений README рекомендует сначала дообучить модель контрастивным методом: исходный чекпойнт не является готовой моделью эмбеддингов. В опубликованных сравнениях он показал результаты на GLUE и английском MTEB v2, но уступил более крупным запускам того же семейства. Для загрузки с Transformers требуется trust_remote_code=True. Модель распространяется по лицензии MIT.

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

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

Ограничения

Для поиска и оценки сходства предложений требуется контрастивное дообучение; модель не является готовым энкодером эмбеддингов. README указывает, что запуск на 1,3 млрд токенов уступает моделям того же семейства, обученным на больших бюджетах.

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

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

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

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

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

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

Открыть на Hugging Face

NexteraBERT Logo

NexteraBERT-Mezzoforte-220M-1.3B-en

NexteraBERT is a fast, long-context bidirectional encoder. This repository holds the 1.3B-token model of the NexteraBERT paper: the same 212.6M-parameter English model as NexteraBERT-Mezzoforte-220M-en, pretrained with masked language modeling (MLM) on 1.3B tokens instead of 130B.

The paper trains one architecture at three budgets, 1.3B, 13B, and 130B tokens, to show how quality scales with pretraining. Each budget is a separate run of the same recipe, not an intermediate checkpoint of the 130B run. At 1.3B tokens, NexteraBERT scores 0.42 points above OptiBERTneo trained on the same number of tokens on MTEB v2, at 30% lower estimated compute. For downstream use, the 130B model NexteraBERT-Mezzoforte-220M-en scores higher on every GLUE task and every MTEB task type.

The encoder has 18 blocks. Each block has a token mixer and a squared-ReLU MLP, both with pre-normalization and a residual connection. The token mixers are:

  • SnowLily (8 blocks): an input-dependent gating liquid mixer derived from liquid time-constant networks. Its cost is linear in input length.
  • NexteraSWA (5 blocks): sliding-window attention with a 256-token window.
  • NexteraSelfAttention (3 blocks): full attention.
  • NexteraHRA (2 blocks): attention over bands of 4 tokens, a cheaper global path.

All attention blocks use grouped-query attention (16 query heads, 8 key/value heads). The full-attention and HRA blocks use SSSMax (Stable Scalable-Softmax), which scales the attention logits with the number of keys so that attention stays selective on long inputs.

NexteraBERT Layers

Results

Main results of NexteraBERT

(a, b) GLUE and MTEB v2 against pretraining tokens: NexteraBERT at 1.3B (this model), 13B, and 130B tokens, with ModernBERT-base (2T) and NeoBERT (2.1T) evaluated under the same protocol; OptiBERTneo values are published. (c) H200 NVL throughput with 65,536 tokens per batch. (d) Exponentiated masked-token loss; the dotted line marks 8,192 tokens, the longest training length, and the percentages give the increase from 8,192 to 65,536 tokens. Panels (c) and (d) show the 130B model. Throughput depends only on the architecture, which this model shares; length extrapolation was not measured at 1.3B tokens.

Comparison across pretraining budgets

All three budgets are fine-tuned and evaluated under the same protocol.

BenchmarkMetric1.3B (this model)13B130B
GLUEmean of 8 tasks77.5485.4587.90
MTEB v2 (English, 41 tasks)mean over task types47.8251.9254.70

Retrieval (BEIR, NanoBEIR, code, and MLDR) and length extrapolation were evaluated for the 130B model only; see NexteraBERT-Mezzoforte-220M-en.

Comparison with OptiBERTneo at 1.3B tokens

OptiBERTneo (Dervishi et al., 2025) is a standard Transformer encoder with the NeoBERT architecture (198M non-embedding parameters), trained on FineWeb-Edu with 1,024-token inputs at the same token budgets as NexteraBERT; 90.25% of NexteraBERT's data comes from the same corpus. Its scores are published values, not re-evaluated under our protocol: they come from another tokenizer and the fine-tuning runs of that study, so the comparison rules out the data as the explanation but is not fully controlled. The better score is in bold.

BenchmarkMetricNexteraBERTOptiBERTneo
GLUEmean of 8 tasks77.5476.0
MTEB v2 (English, 41 tasks)mean over task types47.8247.40
Estimated pretraining computeFLOPs (lower is better)1.33 × 10¹⁸1.9 × 10¹⁸

Compute is estimated with the OptiBERT convention (six FLOPs per non-embedding parameter per token, plus the pairwise attention terms at 1,024 tokens), not measured.

GLUE (validation sets)

TaskMetric1.3B (this model)13B130B
CoLAMCC39.5961.3364.64
SST-2accuracy86.7792.5894.07
MRPCF188.4291.1592.81
STS-BSpearman85.1690.3091.93
QQPaccuracy89.2291.1291.58
MNLI-maccuracy76.7984.9588.33
QNLIaccuracy84.9991.3693.50
RTEaccuracy69.3980.7986.35
Mean77.5485.4587.90

Scores are means over 5 seeds (MRPC, STS-B, RTE), 4 (CoLA), 3 (SST-2), or 1 (QQP, MNLI, QNLI). MRPC, STS-B, RTE, and QNLI start from the MNLI-tuned encoder.

MTEB v2 (English)

Task type1.3B (this model)13B130B
Classification64.6671.3974.57
Clustering39.6442.3143.07
Pair classification67.3674.9280.30
Reranking40.0641.2641.81
Retrieval22.0723.2229.51
STS73.1378.9681.65
Summarization27.8131.3732.00
Mean (types)47.8251.9254.70
Mean (tasks)49.3553.4456.77

Each model is fine-tuned with supervised SimCSE on 312,663 NLI triplets (contrastive loss, maximum length 64) and evaluated at maximum length 512.

Usage

The model code is included in this repository, so pass trust_remote_code=True. Tested with transformers 5.12 and PyTorch 2.12.

Masked-token prediction

from transformers import AutoModelForMaskedLM, AutoTokenizer, pipeline

repo = "RikkaBotan/NexteraBERT-Mezzoforte-220M-1.3B-en"
tokenizer = AutoTokenizer.from_pretrained(repo)
model = AutoModelForMaskedLM.from_pretrained(repo, trust_remote_code=True)

fill = pipeline("fill-mask", model=model, tokenizer=tokenizer)
print(fill("The capital of France is [MASK]."))

Hidden states

import torch
from transformers import AutoModel, AutoTokenizer

repo = "RikkaBotan/NexteraBERT-Mezzoforte-220M-1.3B-en"
tokenizer = AutoTokenizer.from_pretrained(repo)
model = AutoModel.from_pretrained(repo, trust_remote_code=True).eval()

batch = tokenizer(["hello world", "a second sentence"], padding=True, return_tensors="pt")
with torch.no_grad():
    hidden = model(**batch).last_hidden_state          # (batch, length, 1024)

mask = batch["attention_mask"].unsqueeze(-1).to(hidden.dtype)
embedding = (hidden * mask).sum(1) / mask.sum(1)       # mean pooling

This is a pretrained encoder, not a sentence-embedding model. Fine-tune it (for example with contrastive learning) before using it for retrieval or similarity.

Unpadded inference

import torch
from transformers import AutoModel, AutoTokenizer

repo = "RikkaBotan/NexteraBERT-Mezzoforte-220M-1.3B-en"
tokenizer = AutoTokenizer.from_pretrained(repo)
model = AutoModel.from_pretrained(repo, trust_remote_code=True, unpadding=True).cuda().eval()

texts = ["a short query", "a much longer passage about something else entirely"]
batch = tokenizer(texts, padding=True, return_tensors="pt").to("cuda")
with torch.no_grad(), torch.autocast("cuda", dtype=torch.bfloat16):
    hidden = model(**batch).last_hidden_state          # (batch, length, 1024)

Fine-tuning for classification

from transformers import AutoModelForSequenceClassification

model = AutoModelForSequenceClassification.from_pretrained(
    "RikkaBotan/NexteraBERT-Mezzoforte-220M-1.3B-en",
    trust_remote_code=True,
    num_labels=3,
)

The classification head is newly initialized and must be trained.

Training

ObjectiveMLM, 80/10/10 replacement
DataFineWeb-Edu 90.25%, DCLM 4.75%, StarCoderData 5%
TokenizerModernBERT tokenizer (vocabulary 50,368)
Phase 11.2B tokens, inputs up to 1,024 tokens, masking rate 40% → 20% (linear)
Phase 20.1B tokens, inputs up to 8,192 tokens, masking rate 20%, short-context batches on 40% of steps
OptimizerAdamW, β = (0.9, 0.95), weight decay 0.1, gradient clipping 1.0
Peak learning rate8e-4 (phase 1), 8e-5 (phase 2)
Precisionbf16
MLM training loss2.16 (end of phase 1), 2.10 (end of phase 2)

The recipe is the same at every budget. The masking-rate and learning-rate schedules (linear warm-up, cosine decay) span each phase of this run, so they are shorter than in the 130B run.

Architecture

Blocks / width / MLP width18 / 1,024 / 2,304
Query heads / key-value heads16 / 8 (head width 64)
Token mixers8 SnowLily, 5 window attention, 3 full attention, 2 HRA
Window attentionwindow 256
HRAband size 4
RoPE base100,000 (full attention, HRA); 10,000 (window attention)
Parameters212.6M (161.1M non-embedding)

Files

  • config.json: model configuration, including the auto_map for trust_remote_code
  • model.safetensors / pytorch_model.bin: encoder weights
  • mlm_head.safetensors: masked-LM prediction head, loaded by AutoModelForMaskedLM
  • tokenizer.json, tokenizer_config.json: tokenizer
  • modeling_nexterabert_hf.py: transformers model classes
  • modeling_nexterabert.py, configuration_nexterabert.py: model and configuration code
  • loading.py, export.py, __init__.py: loading and export helpers

🩵 About me 🩵

Japanese independent researcher having shy and pampered personality. Twin-tail hair is a charm point. Interested in nlp. Usually using python and C.

X(Twitter): https://twitter.com/peony__snow

RikkaBotan Logo

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

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

GPU в ailist

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

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

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

Ревизия весов
b3039ea

0 моделей