SAVRN
Search Contact SAVRN

Open-weight model · Fill mask

ModernBERT-large

by Answer.AI answerdotai/ModernBERT-large

ModernBERT is a modernized bidirectional encoder-only Transformer model (BERT-style) pre-trained on 2 trillion tokens of English and code data with a native context length of up to 8,192 tokens.

Parameters396M
Context8,192
Weights7.9 GB
Licenseapache-2.0
AccessOpen weights
Monthly Downloads750.2k

Runs On

What it takes to serve ModernBERT-large (396M parameters): the memory its weights need at each precision, and the cheapest way to rent enough data-center GPUs to hold them.

PrecisionWeightsMemory neededCheapest setupPer hourAlso fits
16-bit 0.8 GB 1.0 GB 1x MI300X (192 GB)
Vultr
$1.85 1x H100 $1.99 · 1x MI325X $2.00
8-bit 0.4 GB 0.5 GB 1x MI300X (192 GB)
Vultr
$1.85 1x H100 $1.99 · 1x MI325X $2.00
4-bit 0.2 GB 0.2 GB 1x MI300X (192 GB)
Vultr
$1.85 1x H100 $1.99 · 1x MI325X $2.00

Memory is the weights at that precision plus 20% for the runtime and a short context; a long context needs more. Prices are the lowest on-demand hourly rates in the SAVRN Index, read Sep 18, 2026.

SAVRN's Notes on ModernBERT-large

Nothing here generates text. Answer.AI built ModernBERT-large as an encoder, trained on 2 trillion tokens of English and code, and our reading is retrieval and classification over long documents, up to its 8,192-token context. Memory is the smallest line item in the rack: 1.0 GB at 16-bit, 0.2 GB at 4-bit, against a cheapest slot of one MI300X with 192 GB at $1.85 an hour, so it rides alongside a generation model rather than earning its own card.

The license is Apache 2.0: commercial use, modification and redistribution are allowed, notices stay, significant changes get stated, and contributors grant patents. Access is open. Check the disk footprint first, 16 files and 7.86 GB stored in float32, several times what loads into memory at 16-bit. It ships in safetensors, onnx and pytorch. The design paper is arXiv:2412.13663; read it for the local-global alternating attention behind the 8,192-token window.

Model Card

By Answer.AI, published under apache-2.0, revision 45bb4654a4d5.

ModernBERT

Table of Contents

  1. Model Summary
  2. Usage
  3. Evaluation
  4. Limitations
  5. Training
  6. License
  7. Citation

Model Summary

ModernBERT is a modernized bidirectional encoder-only Transformer model (BERT-style) pre-trained on 2 trillion tokens of English and code data with a native context length of up to 8,192 tokens. ModernBERT leverages recent architectural improvements such as:

  • Rotary Positional Embeddings (RoPE) for long-context support.
  • Local-Global Alternating Attention for efficiency on long inputs.
  • Unpadding and Flash Attention for efficient inference.

ModernBERT’s native long context length makes it ideal for tasks that require processing long documents, such as retrieval, classification, and semantic search within large corpora. The model was trained on a large corpus of text and code, making it suitable for a wide range of downstream tasks, including code retrieval and hybrid (text + code) semantic search.

It is available in the following sizes:

Read the full model card (899 words)

Configuration

Architecture
ModernBertForMaskedLM
Context length (tokens)
8,192
Layers
28
Hidden size
1,024
Feed-forward size
2,624
Attention heads
16
Vocabulary size
50,368
Stored precision
float32
Model type
modernbert

Identity and Version

Repository
answerdotai/ModernBERT-large
Publisher
Answer.AI
Task
Fill mask
Modality
Text
Library
transformers
Parameters
396M parameters
Languages
en
Revision
45bb4654a4d5aaff24dd11d4781fa46d39bf8c13
First published
2024-12-11
Last updated
2025-01-15

Files and Weights

16 files, 7.9 GB in total. The weights are 10 files totalling 7.9 GB in bin, onnx, safetensors.

Weights10 files · 7.9 GB
Configuration2 files · 1.9 KB
Tokenizer2 files · 2.2 MB
Documentation1 file · 8.4 KB
Repository1 file · 1.5 KB
Every file
FileTypeSizeSHA-256
model.safetensorsWeights1.6 GB 44510fec5d3a
onnx/model.onnxWeights1.6 GB 6bab50009674
onnx/model_bnb4.onnxWeights400.9 MB 8b179381ce3c
onnx/model_fp16.onnxWeights792.2 MB 29cef3547cd4
onnx/model_int8.onnxWeights398.3 MB 84baefd65fac
onnx/model_q4.onnxWeights422.4 MB b480f884c31d
onnx/model_q4f16.onnxWeights297.5 MB 0a12b6229a1f
onnx/model_quantized.onnxWeights398.3 MB 84baefd65fac
onnx/model_uint8.onnxWeights398.3 MB 9020c46e799c
pytorch_model.binWeights1.6 GB fabb014a0b62
config.jsonConfiguration1.2 KB
special_tokens_map.jsonConfiguration694 B
README.mdDocumentation8.4 KB
.gitattributesRepository1.5 KB
tokenizer.jsonTokenizer2.1 MB
tokenizer_config.jsonTokenizer20.8 KB

License and Download

License
apache-2.0
Access
Open weights, no gate
Download size
7.9 GB
Download from Answer.AI

Released by Answer.AI through its official repository on Hugging Face. Read the license.

Built From

Memory Requirements

PrecisionWeights in memory
As published7.9 GB
16-bit0.8 GB
8-bit0.4 GB
4-bit0.2 GB

Weights only, from the published parameter count; the key-value cache and runtime add to this.

Built on This Model

Compare ModernBERT-large

Questions About ModernBERT-large

How much GPU memory does ModernBERT-large need?

About 1 GB at 16-bit and 0.2 GB at 4-bit: the weights (396M parameters) plus a working margin. A long context needs more.

What is the cheapest GPU to run ModernBERT-large on?

At 16-bit, 1x MI300X from $1.85 an hour; at 4-bit, 1x MI300X from $1.85 an hour, at the lowest on-demand prices the SAVRN Index lists.

Can I use ModernBERT-large commercially?

Yes. ModernBERT-large is released under Apache License 2.0. The Apache License 2.0 is a permissive open-source license. It permits commercial use, modification and redistribution. It requires keeping the license and copyright notices and any NOTICE file, stating significant changes, and it includes an express patent grant from contributors.

What is ModernBERT-large's context length?

8,192 tokens, from the maximum position embeddings in its published configuration.

Similar Models

Pretrained model on English language using a masked language modeling (MLM) objective. It was introduced in this paper and first released in this repository. This model is case-sensitive: it makes a difference between english and English. Disclaimer: The team releasing RoBERTa did not write a model card for this model so this model card has been written by the Hugging Face team. RoBERTa is a transformers model pretrained on a large corpus of English data in a self-supervised fashion. This means it was pretrained on the raw texts only, with no humans labelling them in any way (which is why it can use lots of publicly available data) with an automatic process to generate inputs and labels…

Open weights mit 355M parameters 514 tokens transformers

Model · Fill mask

bert-large-uncased

BERT community

Pretrained model on English language using a masked language modeling (MLM) objective. It was introduced in this paper and first released in this repository. This model is uncased: it does not make a difference between english and English. Disclaimer: The team releasing BERT did not write a model card for this model so this model card has been written by the Hugging Face team. BERT is a transformers model pretrained on a large corpus of English data in a self-supervised fashion. This means it was pretrained on the raw texts only, with no humans labelling them in any way (which is why it can use lots of publicly available data) with an automatic process to generate inputs and labels from…

Open weights apache-2.0 336M parameters 512 tokens transformers

This is a Japanese DeBERTa V2 large model pre-trained on Japanese Wikipedia, the Japanese portion of CC-100, and the Japanese portion of OSCAR. This model is trained with character-level tokenization and whole word masking. You can use this model for masked language modeling as follows: You can also fine-tune this model on downstream tasks. There is no need to tokenize texts in advance, and you can give raw texts to the tokenizer. The texts are tokenized into character-level tokens by sentencepiece. We used the following corpora for pre-training: - Japanese Wikipedia (as of 20221020, 3.2GB, 27M sentences, 1.3M documents) - Japanese portion of CC-100 (85GB, 619M sentences, 66M documents)…

Open weights cc-by-sa-4.0 330M parameters 512 tokens transformers

XLM-RoBERTa model pre-trained on 2.5TB of filtered CommonCrawl data containing 100 languages. It was introduced in the paper Unsupervised Cross-lingual Representation Learning at Scale by Conneau et al. and first released in this repository. Disclaimer: The team releasing XLM-RoBERTa did not write a model card for this model so this model card has been written by the Hugging Face team. XLM-RoBERTa is a multilingual version of RoBERTa. It is pre-trained on 2.5TB of filtered CommonCrawl data containing 100 languages. RoBERTa is a transformers model pretrained on a large corpus in a self-supervised fashion. This means it was pretrained on the raw texts only, with no humans labelling them in…

Open weights mit 279M parameters 514 tokens transformers

XLM-RoBERTa model pre-trained on 2.5TB of filtered CommonCrawl data containing 100 languages. It was introduced in the paper Unsupervised Cross-lingual Representation Learning at Scale by Conneau et al. and first released in this repository. Disclaimer: The team releasing XLM-RoBERTa did not write a model card for this model so this model card has been written by the Hugging Face team. XLM-RoBERTa is a multilingual version of RoBERTa. It is pre-trained on 2.5TB of filtered CommonCrawl data containing 100 languages. RoBERTa is a transformers model pretrained on a large corpus in a self-supervised fashion. This means it was pretrained on the raw texts only, with no humans labelling them in…

Open weights mit 561M parameters 514 tokens transformers

Pretrained model on the top 104 languages with the largest Wikipedia using a masked language modeling (MLM) objective. It was introduced in this paper and first released in this repository. This model is case sensitive: it makes a difference between english and English. Disclaimer: The team releasing BERT did not write a model card for this model so this model card has been written by the Hugging Face team. BERT is a transformers model pretrained on a large corpus of multilingual data in a self-supervised fashion. This means it was pretrained on the raw texts only, with no humans labelling them in any way (which is why it can use lots of publicly available data) with an automatic process to…

Open weights apache-2.0 179M parameters 512 tokens transformers