NeoBERT is a
next-generation encoder
model for English text representation, pre-trained from scratch on the RefinedWeb dataset. NeoBERT integrates state-of-the-art advancements in architecture, modern data, and optimized pre-training methodologies. It is designed for seamless adoption: it serves as a plug-and-play replacement for existing base models, relies on an
optimal depth-to-width ratio
, and leverages an extended context length of
4,096 tokens
. Despite its compact 250M parameter footprint, it is the most efficient model of its kind and achieves
state-of-the-art results
on the massive MTEB benchmark, outperforming BERT large, RoBERTa large, NomicBERT, and ModernBERT under identical fine-tuning conditions.
from transformers import AutoModel, AutoTokenizer
model_name = "chandar-lab/NeoBERT"
tokenizer = AutoTokenizer.from_pretrained(model_name, trust_remote_code=True)
model = AutoModel.from_pretrained(model_name, trust_remote_code=True)
# Tokenize input text
text = "NeoBERT is the most efficient model of its kind!"
inputs = tokenizer(text, return_tensors="pt")
# Generate embeddings
outputs = model(**inputs)
embedding = outputs.last_hidden_state[:, 0, :]
print(embedding.shape)
Features
Feature
NeoBERT
Depth-to-width
28 × 768
Parameter count
250M
Activation
SwiGLU
Positional embeddings
RoPE
Normalization
Pre-RMSNorm
Data Source
RefinedWeb
Data Size
2.8 TB
Tokenizer
google/bert
Context length
4,096
MLM Masking Rate
20%
Optimizer
AdamW
Scheduler
CosineDecay
Training Tokens
2.1 T
Efficiency
FlashAttention
License
Model weights and code repository are licensed under the permissive MIT license.
Citation
If you use this model in your research, please cite:
@misc{breton2025neobertnextgenerationbert,
title={NeoBERT: A Next-Generation BERT},
author={Lola Le Breton and Quentin Fournier and Mariam El Mezouar and Sarath Chandar},
year={2025},
eprint={2502.19587},
archivePrefix={arXiv},
primaryClass={cs.CL},
url={https://arxiv.org/abs/2502.19587},
}
Contact
For questions, do not hesitate to reach out and open an issue on here or on our
GitHub
.
Runs of chandar-lab NeoBERT on huggingface.co
6.7K
Total runs
0
24-hour runs
-4.0K
3-day runs
-6.4K
7-day runs
-6.4K
30-day runs
More Information About NeoBERT huggingface.co Model
NeoBERT huggingface.co is an AI model on huggingface.co that provides NeoBERT's model effect (), which can be used instantly with this chandar-lab NeoBERT model. huggingface.co supports a free trial of the NeoBERT model, and also provides paid use of the NeoBERT. Support call NeoBERT model through api, including Node.js, Python, http.
NeoBERT huggingface.co is an online trial and call api platform, which integrates NeoBERT's modeling effects, including api services, and provides a free online trial of NeoBERT, you can try NeoBERT online for free by clicking the link below.
chandar-lab NeoBERT online free url in huggingface.co:
NeoBERT is an open source model from GitHub that offers a free installation service, and any user can find NeoBERT on GitHub to install. At the same time, huggingface.co provides the effect of NeoBERT install, users can directly use NeoBERT installed effect in huggingface.co for debugging and trial. It also supports api for free installation.