mlsanityData to 7 Oct 2026

MosaicBERT: A Bidirectional Encoder Optimized for Fast Pretraining

arXiv 2312.17482 ↗First posted 29 Dec 2023cs.CL cs.LGcited by 33

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

  1. 2017Attention Is All You Needcited by 59,932
  2. 2018BERT: Pre-training of Deep Bidirectional Transformers for Language Understandingcited by 40,204
  3. 2019Exploring the Limits of Transfer Learning with a Unified Text-to-Text Transformercited by 14,491
  4. 2019RoBERTa: A Robustly Optimized BERT Pretraining Approachcited by 13,266
  5. 2020Retrieval-Augmented Generation for Knowledge-Intensive NLP Taskscited by 9,160
  6. 2022PaLM: Scaling Language Modeling with Pathwayscited by 5,304
  7. 2018GLUE: A Multi-Task Benchmark and Analysis Platform for Natural Language Understandingcited by 4,854
  8. 2021RoFormer: Enhanced Transformer with Rotary Position Embeddingcited by 4,581
  9. 2016SQuAD: 100,000+ Questions for Machine Comprehension of Textcited by 4,115
  10. 2020Dense Passage Retrieval for Open-Domain Question Answeringcited by 3,779
  11. 2022FlashAttention: Fast and Memory-Efficient Exact Attention with IO-Awarenesscited by 3,611
  12. 2017A Broad-Coverage Challenge Corpus for Sentence Understanding through Inferencecited by 2,665
36 more
  1. 2019BioBERT: a pre-trained biomedical language representation model for biomedical text miningcited by 1,935
  2. 2019Megatron-LM: Training Multi-Billion Parameter Language Models Using Model Parallelismcited by 1,829
  3. 2020GLU Variants Improve Transformercited by 1,724
  4. 2019Root Mean Square Layer Normalizationcited by 1,425
  5. 2019SciBERT: A Pretrained Language Model for Scientific Textcited by 1,404
  6. 2021DeBERTaV3: Improving DeBERTa using ELECTRA-Style Pre-Training with Gradient-Disentangled Embedding Sharingcited by 1,219
  7. 2022Text Embeddings by Weakly-Supervised Contrastive Pre-trainingcited by 1,216
  8. 2021Unsupervised Dense Information Retrieval with Contrastive Learningcited by 1,203
  9. 2021Train Short, Test Long: Attention with Linear Biases Enables Input Length Extrapolationcited by 1,085
  10. 2015Aligning Books and Movies: Towards Story-like Visual Explanations by Watching Movies and Reading Bookscited by 1,041
  11. 2017SemEval-2017 Task 1: Semantic Textual Similarity - Multilingual and Cross-lingual Focused Evaluationcited by 998
  12. 2020Domain-Specific Language Model Pretraining for Biomedical Natural Language Processingcited by 996
  13. 2018Neural Network Acceptability Judgmentscited by 952
  14. 2023BloombergGPT: A Large Language Model for Financecited by 923
  15. 2023REPLUG: Retrieval-Augmented Black-Box Language Modelscited by 786
  16. 2023Scaling Vision Transformers to 22 Billion Parameterscited by 690
  17. 2016Language Modeling with Gated Convolutional Networkscited by 688
  18. 2022Reducing Activation Recomputation in Large Transformer Modelscited by 300
  19. 2020Query-Key Normalization for Transformerscited by 266
  20. 2018A Simple Method for Commonsense Reasoningcited by 223
  21. 2021Self-attention Does Not Need O(n2) Memorycited by 152
  22. 2022Should You Mask 15% in Masked Language Modeling?cited by 117
  23. 2022WHEN FLUE MEETS FLANG: Benchmarks and Large Pre-trained Language Model for Financial Domaincited by 117
  24. 2021Do Transformer Modifications Transfer Across Implementations and Applications?cited by 87
  25. 2022Cramming: Training a Language Model on a Single GPU in One Daycited by 81
  26. 2021How to Train BERT with an Academic Budgetcited by 80
  27. 2023No Train No Gain: Revisiting Efficient Training Algorithms For Transformer-based Language Modelscited by 41
  28. 2020Code and Named Entity Recognition in StackOverflowcited by 39
  29. 2021MathBERT: A Pre-trained Language Model for General NLP Tasks in Mathematics Educationcited by 37
  30. 2021Pre-train or Annotate? Domain Adaptation with a Constrained Budgetcited by 27
  31. 2023BTLM-3B-8K: 7B Parameter Performance in a 3B Parameter Modelcited by 19
  32. 2022Boosting Distributed Training Performance of the Unpadded BERT Modelcited by 15
  33. 2023Dynamic Masking Rate Schedules for MLM Pretrainingcited by 11
  34. 2022Fast Benchmarking of Accuracy vs. Training Time with Cyclic Learning Ratescited by 5
  35. 2022Reduce, Reuse, Recycle: Improving Training Efficiency with Distillationcited by 3
  36. 2023NarrowBERT: Accelerating Masked Language Model Pretraining and Inferencecited by 3

Built on by

Cited by year (2026 to 7 Oct)

Citing papers per year: 2024: 8; 2025: 13; 2026: 12.

33 papers.

Sort:

By area:

  1. 2024Nomic Embed: Training a Reproducible Long Context Text Embeddercited by 255
  2. 2024mGTE: Generalized Long-Context Text Representation and Reranking Models for Multilingual Text Retrievalcited by 233
  3. 2024Hydra: Bidirectional State Space Models Through Generalized Matrix Mixerscited by 43
  4. 2025mmBERT: A Modern Multilingual Encoder with Annealed Language Learningcited by 39
  5. 2025Seq vs Seq: An Open Suite of Paired Encoders and Decoderscited by 34
  6. 2024LLMs are Also Effective Embedding Models: An In-depth Overviewcited by 32
  7. 2025Clinical ModernBERT: An efficient and long context encoder for biomedical textcited by 26
  8. 2025BioClinical ModernBERT: A State-of-the-Art Long-Context Encoder for Biomedical and Clinical NLPcited by 26
  9. 2024Robust Pronoun Fidelity with English LLMs: Are they Reasoning, Repeating, or Just Biased?cited by 17
  10. 2025ModernBERT or DeBERTaV3? Examining Architecture and Data Influence on Transformer Encoder Models Performancecited by 11
  11. 2024TookaBERT: A Step Forward for Persian NLUcited by 7
  12. 2024100K or 100 Days: Trade-offs when Pre-Training with Academic Resourcescited by 6
21 more
  1. 2025Breaking the Frozen Subspace: Importance Sampling for Low-Rank Optimization in LLM Pretrainingcited by 6
  2. 2024Expanding Expressivity in Transformer Models with M"obiusAttentioncited by 4
  3. 2025On The Role of Pretrained Language Models in General-Purpose Text Embeddings: A Surveycited by 3
  4. 2025MaxPoolBERT: Enhancing BERT Classification via Layer- and Token-Wise Aggregationcited by 2
  5. 2025Do We Really Need Specialization? Evaluating Generalist Text Embeddings for Zero-Shot Recommendation and Searchcited by 2
  6. 2025Retrieval Capabilities of Large Language Models Scale with Pretraining FLOPscited by 2
  7. 2025Improving Recursive Transformers with Mixture of LoRAscited by 2
  8. 2025TabiBERT: A Large-Scale ModernBERT Foundation Model and A Unified Benchmark for Turkishcited by 1
  9. 2026One Script Instead of Hundreds? On Pretraining Romanized Encoder Language Modelscited by 1
  10. 2026Long-Context Encoder Models for Polish Language Understandingcited by 1
  11. 2025Patient Trajectory Prediction: Integrating Clinical Notes with Transformerscited by 0
  12. 2026Large-Scale Aspect-Based Sentiment Analysis with Reasoning-Infused LLMscited by 0
  13. 2026NanoNet: Parameter-Efficient Learning with Label-Scarce Supervision for Lightweight Text Mining Modelcited by 0
  14. 2026Avey-Bcited by 0
  15. 2026DLT-Corpus: A Large-Scale Text Collection for the Distributed Ledger Technology Domaincited by 0
  16. 2026MANAR: Memory-augmented Attention with Navigational Abstract Conceptual Representationcited by 0
  17. 2026MTR-Suite: A Framework for Evaluating and Synthesizing Conversational Retrieval Benchmarkscited by 0
  18. 2026Legal Domain Adaptation of Modern BERT Modelscited by 0
  19. 2026BERTomelo: Your Portuguese Encoder Best Friendcited by 0
  20. 2026When Attention Goes Blind: Numerical Failure in ALiBi Positional Encodingscited by 0
  21. 2026Structure is not mechanism: high-gain gated-FFN rows across text and genomic foundation modelscited by 0