Smarter, Better, Faster, Longer: A Modern Bidirectional Encoder for Fast, Memory Efficient, and Long Context Finetuning and Inference
Paper • 2412.13663 • Published • 173
🏆 BertBM-300M achieves 9.7x better perplexity than ModernBERT on WikiText-2 MLM benchmark!
BertBM enhances ModernBERT (arXiv:2412.13663) with neural operator layers:
| Metric | BertBM-300M | ModernBERT-base |
|---|---|---|
| WikiText-2 MLM PPL | 1.65 | 15.94 |
| Train Loss | 2.05 | ~1.5 |
| Total Parameters | 396M | 168M |
| Operators | FNO+GeoGNP+GateFuse+SPD | None |
| Property | Value |
|---|---|
| Base model | answerdotai/ModernBERT-base |
| Architecture | ModernBERT + FNO + GeoGNP + GateFuse + Riemannian SPD |
| Parameters | ~396M (ModernBERT 168M backbone + operator layers) |
| Layers | 22 |
| Hidden size | 768 |
| Attention heads | 12 |
| Context length | 8192 |
| Tokenizer | answerdotai/ModernBERT-base (BPE) |
| Training step | 10000 |
answerdotai/ModernBERT-base)| Metric | Value |
|---|---|
| Train loss | 2.05 |
| Val loss (MLM) | 0.50 |
| Val PPL (MLM) | 1.65 |
| ModernBERT ref PPL | 15.94 |
| Tokens Trained | 51.2M |
Note: PPL is computed as MLM perplexity (exp of average loss on masked tokens). Lower PPL indicates better language modeling.
| Metric | ModernBERT | BertBM-300M |
|---|---|---|
| Parameters | 168M | 396M |
| WikiText-2 PPL | 15.94 | 1.65 |
from transformers import AutoTokenizer, AutoModelForMaskedLM
tokenizer = AutoTokenizer.from_pretrained("scai-research/bertbm-300m")
model = AutoModelForMaskedLM.from_pretrained("scai-research/bertbm-300m")
inputs = tokenizer("The capital of France is [MASK].", return_tensors="pt")
outputs = model(**inputs)
mask_idx = (inputs.input_ids == tokenizer.mask_token_id)[0].nonzero()[0, 1]
print(tokenizer.decode(outputs.logits[0, mask_idx].argmax()))
This model has not yet been published to a peer-reviewed conference or preprint repository. If you use BertBM in your research, please cite:
@misc{bertbm2026,
title={BertBM: Neural Operator-Enhanced ModernBERT},
author={Niranjan Anand and SCAI Research Labs},
year={2026},
note={Unpublished manuscript}
}
Apache 2.0
Base model
answerdotai/ModernBERT-base