Glossary
ModernBERT
ModernBERT is a 2024 modernised version of the BERT text-understanding model that reads longer inputs faster; Laya's English model is built on ModernBERT-large.
Swiss-hosted inference. Nothing you send is ever stored. Swiss data residency
Definition
What ModernBERT means
ModernBERT is an encoder-only transformer family released in December 2024 by Answer.AI and LightOn as a modernised BERT. It keeps the bidirectional masked-language-model recipe but updates the architecture and data: rotary positional embeddings, alternating local and global attention, unpadding and FlashAttention-friendly kernels, GeGLU layers, a native context of 8,192 tokens and pre-training on about two trillion tokens including code. It comes in base and large sizes.
The practical result is an encoder that is faster and longer-context than classic BERT/RoBERTa while being at least as strong on classification and retrieval benchmarks, which made it a natural backbone for new task heads.
ModernBERT in Laya
The root checkpoint, convaiinnovations/laya, uses ModernBERT-large: 395M parameters in the backbone, fully fine-tuned, plus a decision head trained from scratch for 421M total. The typed-decisions checkpoint uses the same backbone. Configuration details that affect what you can send:
- The English checkpoint runs at 512 tokens per question, of which up to 192 (
head_max_len) go to the question and options, leaving roughly 320 for the state. The typed-decisions checkpoint defaults to 1,024. - Its tokenizer is an English BPE vocabulary (about 50k entries), which is why it cannot read non-Latin scripts and why language routing sends such text to the mmBERT checkpoint.
- The runtime disables ModernBERT's automatic
torch.compilebecause it is a loss at Laya's small batch sizes.
Measured single-question latency on a T4 is 39.5 ms. See ModernBERT and encoder vs decoder models.
Related terms
How ModernBERT connects to the rest of the vocabulary.
Go deeper
- ExplainerModernBERT: a modern encoder for fast classificationWhat ModernBERT is, how it improves on BERT with 8,192-token context and faster inference, what it is good at, and how Laya builds on ModernBERT-large.
- ExplainerEncoder vs decoder models: which architecture should make your decisions?Encoder vs decoder transformers: encoders read text in one pass, decoders write it token by token. What that means for classification cost, speed and output.
Get started
Try it on your own text
Send any text with your own typed questions and get a calibrated probability for every answer. 6k free tokens, no card needed; then $0.0357 per 1M input tokens — 15% below Jev.
Swiss-hosted inference. Nothing you send is ever stored.