# AnswerDotAI/ModernBERT

Bringing BERT into modernity via both architecture changes and scaling

Repository: https://github.com/AnswerDotAI/ModernBERT
Canonical: https://ross.abutalabs.com/products/modernbert
Homepage: https://arxiv.org/abs/2412.13663
Language: Python
License: Apache-2.0
License Family: permissive
Topics: bert, embeddings, llm, nlp
Last push: 2026-03-01T18:41:05+00:00

## Health v2 (maintenance only)
Score: 56/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 70, release rhythm 35, longevity 60
- inputs: {"age_days": 842, "days_push": 185, "days_rel": null, "gap_med": null, "n_releases_24m": 0}
- flags: no_releases
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 1713, forks 144 (observed 2026-08-28T04:05:25.958969+00:00)

## What it is
ModernBERT is the research repository for a modernized BERT-family bidirectional encoder trained on 2 trillion tokens with an 8192-token context, featuring FlexBERT modular encoder building blocks and Flash Attention. It contains pre-training and GLUE evaluation code built on MosaicBERT and the Composer framework, with model checkpoints released on HuggingFace.

## Use cases
- pretrain a modern BERT-style encoder from scratch
- fine-tune an encoder for text classification
- build single or multi-vector retrieval embeddings
- reproduce ModernBERT GLUE benchmark results
- experiment with modular encoder architecture blocks via YAML configs
- run long-context (8192 token) encoder inference on consumer GPUs

## When to choose
- you need a fast, memory-efficient encoder for classification or retrieval
- you want to pre-train or fine-tune a BERT-style model with modern optimizations like Flash Attention
- you need long-context encoder support up to 8192 tokens
- you want reproducible research training code for encoder models

## When to avoid
- you just want to use ModernBERT checkpoints in a pipeline - use the HuggingFace integration instead
- you need decoder-only generative LLMs rather than encoder models
- you lack a GPU or cannot install Flash Attention dependencies
- you need a production-hardened, well-documented training framework

## Facets
- artifact type: library
- maturity: active
- function: machine-learning, nlp, llm-training, deep-learning
- domain: machine-learning, deep-learning
- platform: python
- tags: bert, encoder, embeddings, transformer, flash-attention, pretraining, research-code, natural-language-processing, gpu, linux

## Member repositories
- AnswerDotAI/ModernBERT (main) score 56

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:05:25.958969+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T03:34:40.362459+00:00, confidence not recorded.
  - readme: https://github.com/AnswerDotAI/ModernBERT (fetched 2026-08-28T04:05:25.958969+00:00, sha 1555aa66469e)
  - homepage: https://arxiv.org/abs/2412.13663 (fetched 2026-08-29T11:10:39.886019+00:00, sha c0de962bbd82)
  - site_page: https://info.arxiv.org/about/donate.html (fetched 2026-08-29T11:10:39.895143+00:00, sha cca9c3a11c56)
  - site_page: https://info.arxiv.org/about/ourmembers.html (fetched 2026-08-29T11:10:39.899251+00:00, sha 47cbc55ff1de)
  - site_page: https://info.arxiv.org/about (fetched 2026-08-29T11:10:39.901170+00:00, sha a1f16f915a9a)
  - site_page: https://info.arxiv.org/labs/index.html (fetched 2026-08-29T11:10:39.897257+00:00, sha b14a8d05a0ec)
- Data as of 2026-08-30T08:39:29.467469+00:00.
