MosaicBERT: A Bidirectional Encoder Optimized for Fast Pretraining
Not on the map. Why?
Abstract (arXiv)
Although BERT-style encoder models are heavily used in NLP research, many researchers do not pretrain their own BERTs from scratch due to the high cost of training. In the past half-decade since BERT first rose to prominence, many advances have been made with other transformer architectures and training configurations that have yet to be systematically incorporated into BERT. Here, we introduce MosaicBERT, a BERT-style encoder architecture and training recipe that is empirically optimized for fast pretraining. This efficient architecture incorporates FlashAttention, Attention with Linear Biases (ALiBi), Gated Linear Units (GLU), a module to dynamically remove padded tokens, and low precision LayerNorm into the classic transformer encoder block. The training recipe includes a 30% masking ratio for the Masked Language Modeling (MLM) objective, bfloat16 precision, and vocabulary size optimized for GPU throughput, in addition to best-practices from RoBERTa and other encoder models. When pretrained from scratch on the C4 dataset, this base model achieves a downstream average GLUE (dev) score of 79.6 in 1.13 hours on 8 A100 80 GB GPUs at a cost of roughly 20. We plot extensive accuracy vs. pretraining speed Pareto curves and show that MosaicBERT base and large are consistently Pareto optimal when compared to a competitive BERT base and large. This empirical speed up in pretraining enables researchers and engineers to pretrain custom BERT-style models at low cost instead of finetune on existing generic models. We open source our model weights and code.
Key facts. Cited by 33 papers in the map (data through 7 Oct 2026). Builds on 48 of its 63 references that are in the map. First posted on arXiv 29 Dec 2023.
Builds on
48 of 63 references.
References · 48
- 2017Attention Is All You Needcited by 59,932
- 2018BERT: Pre-training of Deep Bidirectional Transformers for Language Understandingcited by 40,204
- 2019Exploring the Limits of Transfer Learning with a Unified Text-to-Text Transformercited by 14,491
- 2019RoBERTa: A Robustly Optimized BERT Pretraining Approachcited by 13,266
- 2020Retrieval-Augmented Generation for Knowledge-Intensive NLP Taskscited by 9,160
- 2022PaLM: Scaling Language Modeling with Pathwayscited by 5,304
- 2018GLUE: A Multi-Task Benchmark and Analysis Platform for Natural Language Understandingcited by 4,854
- 2021RoFormer: Enhanced Transformer with Rotary Position Embeddingcited by 4,581
- 2016SQuAD: 100,000+ Questions for Machine Comprehension of Textcited by 4,115
- 2020Dense Passage Retrieval for Open-Domain Question Answeringcited by 3,779
- 2022FlashAttention: Fast and Memory-Efficient Exact Attention with IO-Awarenesscited by 3,611
- 2017A Broad-Coverage Challenge Corpus for Sentence Understanding through Inferencecited by 2,665
36 more
- 2019BioBERT: a pre-trained biomedical language representation model for biomedical text miningcited by 1,935
- 2019Megatron-LM: Training Multi-Billion Parameter Language Models Using Model Parallelismcited by 1,829
- 2020GLU Variants Improve Transformercited by 1,724
- 2019Root Mean Square Layer Normalizationcited by 1,425
- 2019SciBERT: A Pretrained Language Model for Scientific Textcited by 1,404
- 2021DeBERTaV3: Improving DeBERTa using ELECTRA-Style Pre-Training with Gradient-Disentangled Embedding Sharingcited by 1,219
- 2022Text Embeddings by Weakly-Supervised Contrastive Pre-trainingcited by 1,216
- 2021Unsupervised Dense Information Retrieval with Contrastive Learningcited by 1,203
- 2021Train Short, Test Long: Attention with Linear Biases Enables Input Length Extrapolationcited by 1,085
- 2015Aligning Books and Movies: Towards Story-like Visual Explanations by Watching Movies and Reading Bookscited by 1,041
- 2017SemEval-2017 Task 1: Semantic Textual Similarity - Multilingual and Cross-lingual Focused Evaluationcited by 998
- 2020Domain-Specific Language Model Pretraining for Biomedical Natural Language Processingcited by 996
- 2018Neural Network Acceptability Judgmentscited by 952
- 2023BloombergGPT: A Large Language Model for Financecited by 923
- 2023REPLUG: Retrieval-Augmented Black-Box Language Modelscited by 786
- 2023Scaling Vision Transformers to 22 Billion Parameterscited by 690
- 2016Language Modeling with Gated Convolutional Networkscited by 688
- 2022Reducing Activation Recomputation in Large Transformer Modelscited by 300
- 2020Query-Key Normalization for Transformerscited by 266
- 2018A Simple Method for Commonsense Reasoningcited by 223
- 2021Self-attention Does Not Need O(n2) Memorycited by 152
- 2022Should You Mask 15% in Masked Language Modeling?cited by 117
- 2022WHEN FLUE MEETS FLANG: Benchmarks and Large Pre-trained Language Model for Financial Domaincited by 117
- 2021Do Transformer Modifications Transfer Across Implementations and Applications?cited by 87
- 2022Cramming: Training a Language Model on a Single GPU in One Daycited by 81
- 2021How to Train BERT with an Academic Budgetcited by 80
- 2023No Train No Gain: Revisiting Efficient Training Algorithms For Transformer-based Language Modelscited by 41
- 2020Code and Named Entity Recognition in StackOverflowcited by 39
- 2021MathBERT: A Pre-trained Language Model for General NLP Tasks in Mathematics Educationcited by 37
- 2021Pre-train or Annotate? Domain Adaptation with a Constrained Budgetcited by 27
- 2023BTLM-3B-8K: 7B Parameter Performance in a 3B Parameter Modelcited by 19
- 2022Boosting Distributed Training Performance of the Unpadded BERT Modelcited by 15
- 2023Dynamic Masking Rate Schedules for MLM Pretrainingcited by 11
- 2022Fast Benchmarking of Accuracy vs. Training Time with Cyclic Learning Ratescited by 5
- 2022Reduce, Reuse, Recycle: Improving Training Efficiency with Distillationcited by 3
- 2023NarrowBERT: Accelerating Masked Language Model Pretraining and Inferencecited by 3
Built on by
Citing papers per year: 2024: 8; 2025: 13; 2026: 12.
33 papers.
Sort:
By area:
- 2024Nomic Embed: Training a Reproducible Long Context Text Embeddercited by 255
- 2024mGTE: Generalized Long-Context Text Representation and Reranking Models for Multilingual Text Retrievalcited by 233
- 2024Hydra: Bidirectional State Space Models Through Generalized Matrix Mixerscited by 43
- 2025mmBERT: A Modern Multilingual Encoder with Annealed Language Learningcited by 39
- 2025Seq vs Seq: An Open Suite of Paired Encoders and Decoderscited by 34
- 2024LLMs are Also Effective Embedding Models: An In-depth Overviewcited by 32
- 2025Clinical ModernBERT: An efficient and long context encoder for biomedical textcited by 26
- 2025BioClinical ModernBERT: A State-of-the-Art Long-Context Encoder for Biomedical and Clinical NLPcited by 26
- 2024Robust Pronoun Fidelity with English LLMs: Are they Reasoning, Repeating, or Just Biased?cited by 17
- 2025ModernBERT or DeBERTaV3? Examining Architecture and Data Influence on Transformer Encoder Models Performancecited by 11
- 2024TookaBERT: A Step Forward for Persian NLUcited by 7
- 2024100K or 100 Days: Trade-offs when Pre-Training with Academic Resourcescited by 6
21 more
- 2025Breaking the Frozen Subspace: Importance Sampling for Low-Rank Optimization in LLM Pretrainingcited by 6
- 2024Expanding Expressivity in Transformer Models with M"obiusAttentioncited by 4
- 2025On The Role of Pretrained Language Models in General-Purpose Text Embeddings: A Surveycited by 3
- 2025MaxPoolBERT: Enhancing BERT Classification via Layer- and Token-Wise Aggregationcited by 2
- 2025Do We Really Need Specialization? Evaluating Generalist Text Embeddings for Zero-Shot Recommendation and Searchcited by 2
- 2025Retrieval Capabilities of Large Language Models Scale with Pretraining FLOPscited by 2
- 2025Improving Recursive Transformers with Mixture of LoRAscited by 2
- 2025TabiBERT: A Large-Scale ModernBERT Foundation Model and A Unified Benchmark for Turkishcited by 1
- 2026One Script Instead of Hundreds? On Pretraining Romanized Encoder Language Modelscited by 1
- 2026Long-Context Encoder Models for Polish Language Understandingcited by 1
- 2025Patient Trajectory Prediction: Integrating Clinical Notes with Transformerscited by 0
- 2026Large-Scale Aspect-Based Sentiment Analysis with Reasoning-Infused LLMscited by 0
- 2026NanoNet: Parameter-Efficient Learning with Label-Scarce Supervision for Lightweight Text Mining Modelcited by 0
- 2026Avey-Bcited by 0
- 2026DLT-Corpus: A Large-Scale Text Collection for the Distributed Ledger Technology Domaincited by 0
- 2026MANAR: Memory-augmented Attention with Navigational Abstract Conceptual Representationcited by 0
- 2026MTR-Suite: A Framework for Evaluating and Synthesizing Conversational Retrieval Benchmarkscited by 0
- 2026Legal Domain Adaptation of Modern BERT Modelscited by 0
- 2026BERTomelo: Your Portuguese Encoder Best Friendcited by 0
- 2026When Attention Goes Blind: Numerical Failure in ALiBi Positional Encodingscited by 0
- 2026Structure is not mechanism: high-gain gated-FFN rows across text and genomic foundation modelscited by 0
- 2026Structure is not mechanism: high-gain gated-FFN rows across text and genomic foundation models13 Sep 2026
- 2026When Attention Goes Blind: Numerical Failure in ALiBi Positional Encodings4 Aug 2026
- 2026BERTomelo: Your Portuguese Encoder Best Friend27 Jun 2026
- 2026Legal Domain Adaptation of Modern BERT Models26 Jun 2026
- 2026MTR-Suite: A Framework for Evaluating and Synthesizing Conversational Retrieval Benchmarks20 May 2026
- 2026MANAR: Memory-augmented Attention with Navigational Abstract Conceptual Representation19 Mar 2026
- 2026Long-Context Encoder Models for Polish Language Understanding12 Mar 2026
- 2026DLT-Corpus: A Large-Scale Text Collection for the Distributed Ledger Technology Domain25 Feb 2026
- 2026Avey-B17 Feb 2026
- 2026NanoNet: Parameter-Efficient Learning with Label-Scarce Supervision for Lightweight Text Mining Model5 Feb 2026
- 2026One Script Instead of Hundreds? On Pretraining Romanized Encoder Language Models9 Jan 2026
- 2026Large-Scale Aspect-Based Sentiment Analysis with Reasoning-Infused LLMs7 Jan 2026
21 more
- 2025TabiBERT: A Large-Scale ModernBERT Foundation Model and A Unified Benchmark for Turkish28 Dec 2025
- 2025Improving Recursive Transformers with Mixture of LoRAs14 Dec 2025
- 2025mmBERT: A Modern Multilingual Encoder with Annealed Language Learning8 Sep 2025
- 2025Retrieval Capabilities of Large Language Models Scale with Pretraining FLOPs24 Aug 2025
- 2025On The Role of Pretrained Language Models in General-Purpose Text Embeddings: A Survey28 Jul 2025
- 2025Seq vs Seq: An Open Suite of Paired Encoders and Decoders15 Jul 2025
- 2025Do We Really Need Specialization? Evaluating Generalist Text Embeddings for Zero-Shot Recommendation and Search7 Jul 2025
- 2025BioClinical ModernBERT: A State-of-the-Art Long-Context Encoder for Biomedical and Clinical NLP12 Jun 2025
- 2025MaxPoolBERT: Enhancing BERT Classification via Layer- and Token-Wise Aggregation21 May 2025
- 2025ModernBERT or DeBERTaV3? Examining Architecture and Data Influence on Transformer Encoder Models Performance11 Apr 2025
- 2025Clinical ModernBERT: An efficient and long context encoder for biomedical text4 Apr 2025
- 2025Patient Trajectory Prediction: Integrating Clinical Notes with Transformers25 Feb 2025
- 2025Breaking the Frozen Subspace: Importance Sampling for Low-Rank Optimization in LLM Pretraining9 Feb 2025
- 2024LLMs are Also Effective Embedding Models: An In-depth Overview17 Dec 2024
- 2024100K or 100 Days: Trade-offs when Pre-Training with Academic Resources30 Oct 2024
- 2024Expanding Expressivity in Transformer Models with M"obiusAttention8 Sep 2024
- 2024mGTE: Generalized Long-Context Text Representation and Reranking Models for Multilingual Text Retrieval29 Jul 2024
- 2024TookaBERT: A Step Forward for Persian NLU23 Jul 2024
- 2024Hydra: Bidirectional State Space Models Through Generalized Matrix Mixers13 Jul 2024
- 2024Robust Pronoun Fidelity with English LLMs: Are they Reasoning, Repeating, or Just Biased?4 Apr 2024
- 2024Nomic Embed: Training a Reproducible Long Context Text Embedder2 Feb 2024
- 2024Nomic Embed: Training a Reproducible Long Context Text Embeddercited by 255
- 2024mGTE: Generalized Long-Context Text Representation and Reranking Models for Multilingual Text Retrievalcited by 233
- 2025mmBERT: A Modern Multilingual Encoder with Annealed Language Learningcited by 39
- 2025Seq vs Seq: An Open Suite of Paired Encoders and Decoderscited by 34
- 2024LLMs are Also Effective Embedding Models: An In-depth Overviewcited by 32
- 2025Clinical ModernBERT: An efficient and long context encoder for biomedical textcited by 26
- 2025BioClinical ModernBERT: A State-of-the-Art Long-Context Encoder for Biomedical and Clinical NLPcited by 26
- 2025ModernBERT or DeBERTaV3? Examining Architecture and Data Influence on Transformer Encoder Models Performancecited by 11
- 2024TookaBERT: A Step Forward for Persian NLUcited by 7
- 2024100K or 100 Days: Trade-offs when Pre-Training with Academic Resourcescited by 6
- 2025Breaking the Frozen Subspace: Importance Sampling for Low-Rank Optimization in LLM Pretrainingcited by 6
- 2024Expanding Expressivity in Transformer Models with M"obiusAttentioncited by 4
12 most cited of 29 All 29 (JSON)
- 2026Structure is not mechanism: high-gain gated-FFN rows across text and genomic foundation models13 Sep 2026
- 2026When Attention Goes Blind: Numerical Failure in ALiBi Positional Encodings4 Aug 2026
- 2026BERTomelo: Your Portuguese Encoder Best Friend27 Jun 2026
- 2026Legal Domain Adaptation of Modern BERT Models26 Jun 2026
- 2026MANAR: Memory-augmented Attention with Navigational Abstract Conceptual Representation19 Mar 2026
- 2026Long-Context Encoder Models for Polish Language Understanding12 Mar 2026
- 2026DLT-Corpus: A Large-Scale Text Collection for the Distributed Ledger Technology Domain25 Feb 2026
- 2026Avey-B17 Feb 2026
- 2026NanoNet: Parameter-Efficient Learning with Label-Scarce Supervision for Lightweight Text Mining Model5 Feb 2026
- 2026One Script Instead of Hundreds? On Pretraining Romanized Encoder Language Models9 Jan 2026
- 2025TabiBERT: A Large-Scale ModernBERT Foundation Model and A Unified Benchmark for Turkish28 Dec 2025
- 2025Improving Recursive Transformers with Mixture of LoRAs14 Dec 2025
12 newest of 29 All 29 (JSON)