Smarter, Better, Faster, Longer: A Modern Bidirectional Encoder for Fast, Memory Efficient, and Long Context Finetuning and Inference
Benjamin Warner, Antoine Chaffin, Benjamin Clavi\'e, Orion Weller,, Oskar Hallstr\"om, Said Taghadouini, Alexis Gallagher, Raja Biswas, Faisal, Ladhak, Tom Aarsen, Nathan Cooper, Griffin Adams, Jeremy Howard, Iacopo Poli

TL;DR
ModernBERT is a highly optimized encoder model that achieves state-of-the-art performance, efficiency, and long-context capabilities, making it suitable for diverse tasks and inference on standard GPUs.
Contribution
Introduces ModernBERT, a new encoder model with significant Pareto improvements in speed, memory, and long-context handling, trained on 2 trillion tokens.
Findings
State-of-the-art results on diverse classification tasks
Superior speed and memory efficiency for inference
Effective long-context processing up to 8192 tokens
Abstract
Encoder-only transformer models such as BERT offer a great performance-size tradeoff for retrieval and classification tasks with respect to larger decoder-only models. Despite being the workhorse of numerous production pipelines, there have been limited Pareto improvements to BERT since its release. In this paper, we introduce ModernBERT, bringing modern model optimizations to encoder-only models and representing a major Pareto improvement over older encoders. Trained on 2 trillion tokens with a native 8192 sequence length, ModernBERT models exhibit state-of-the-art results on a large pool of evaluations encompassing diverse classification tasks and both single and multi-vector retrieval on different domains (including code). In addition to strong downstream performance, ModernBERT is also the most speed and memory efficient encoder and is designed for inference on common GPUs.
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Code & Models
- 🤗lightonai/LightOnOCR-2-1Bmodel· 577k dl· ♡ 636577k dl♡ 636
- 🤗answerdotai/ModernBERT-basemodel· 7.5M dl· ♡ 10157.5M dl♡ 1015
- 🤗answerdotai/ModernBERT-largemodel· 284k dl· ♡ 463284k dl♡ 463
- 🤗lightonai/LightOnOCR-1B-1025model· 169k dl· ♡ 247169k dl♡ 247
- 🤗DeepMount00/ModernBERT-base-itamodel· 75 dl· ♡ 1275 dl♡ 12
- 🤗knowledgator/modern-gliner-bi-base-v1.0model· 26 dl· ♡ 2726 dl♡ 27
- 🤗knowledgator/modern-gliner-bi-large-v1.0model· 176 dl· ♡ 64176 dl♡ 64
- 🤗disham993/electrical-ner-bert-basemodel· 4 dl· ♡ 14 dl♡ 1
- 🤗disham993/electrical-ner-distilbert-basemodel· 3 dl3 dl
- 🤗disham993/electrical-ner-bert-largemodel· 7 dl· ♡ 27 dl♡ 2
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsVideo Analysis and Summarization · Human Pose and Action Recognition · Advanced Data Compression Techniques
MethodsRefunds@Expedia|||How do I get a full refund from Expedia? · Attention Is All You Need · Linear Layer · Dense Connections · Dropout · Multi-Head Attention · SPEED: Separable Pyramidal Pooling EncodEr-Decoder for Real-Time Monocular Depth Estimation on Low-Resource Settings · Adam · Layer Normalization · Residual Connection
