UltraBERT: Beyond the Limit of BERT Pre-Training

Jungwoo Park, Taewhoo Lee, Jaewoo KangarXiv 2026

TL;DR

UltraBERT breaks the long-standing performance trade-off in bidirectional encoders, where models typically excel at either classification or retrieval, but rarely both. By scaling pre-training to trillions of tokens and introducing "LM head decoupling" to handle multiple masking ratios simultaneously, UltraBERT achieves state-of-the-art results across GLUE (classification) and BEIR (retrieval) benchmarks.

What Problem Does This Paper Address?

While decoder-only Large Language Models (LLMs) dominate the spotlight, bidirectional encoders (like BERT and RoBERTa) remain workhorses for non-generative tasks like document retrieval in RAG pipelines, reward modeling, and data filtering. However, the "pre-training recipe" for these models hasn't evolved as quickly as their decoder cousins.

Current encoders suffer from a specialization problem: models optimized for classification (often using low masking ratios or Replaced Token Detection) perform poorly on retrieval, and vice versa. Furthermore, most design choices—like the standard 15% masking ratio—were established on small datasets (10B–100B tokens). The authors set out to discover if these rules still hold at the trillion-token scale and how to build a truly "general-purpose" encoder.

Methods

The researchers conducted an extensive scaling study, training models up to 8.8 trillion tokens to identify where performance actually plateaus. Their core innovation, UltraBERT, incorporates three major changes to the standard Masked Language Modeling (MLM) workflow:

  1. LM Head Decoupling: The authors found that low masking ratios (e.g., 5%) and high masking ratios (e.g., 50%) require the model to organize its representation space in fundamentally different ways. To avoid a "tug-of-war" during training, UltraBERT uses two separate output heads—one for low-ratio sequences and one for high-ratio sequences—within the same batch.
  2. Selective Distillation: The model is initialized via pruning from a larger 1.3B teacher. During training, the authors apply logit-based distillation (KL divergence) only to the low-masking head. They discovered that distillation actually degrades retrieval performance at high masking ratios, so the high-ratio head is trained with standard MLM.
  3. Modernized Architecture: UltraBERT adopts modern LLM refinements, including Rotary Position Embeddings (RoPE), SwiGLU activations, and FlashAttention-2, supporting a native context length of 32K tokens.

Datasets

  • Pre-training: A massive 2-trillion token mixture including DCLM and FineWeb-Edu (web), Stack-Edu (code), peS2o (academic), and various math and instruction datasets.
  • Evaluation:
    • Classification: GLUE, SQuAD 2.0, MultiCoNER v2, Few-NERD, and RewardBench.
  • Retrieval: BEIR, RAR-b (reasoning as retrieval), and MLDR (multilingual).
  • Long Context: LongEmbed (including Passkey and Needle-in-a-Haystack tests).

Key Insights and Ideas

  • The Saturation Wall: Unlike decoders, which seem to improve indefinitely with more data, encoders hit a "saturation point" for downstream tasks around 1–2 trillion tokens. Beyond this, pre-training loss continues to drop, but task performance flatlines.
  • Masking Ratio Trade-offs: Classification tasks favor low corruption (3–15%) because they rely on fine-grained semantic preservation. Retrieval tasks favor high corruption (up to 50%) because it forces the model to utilize more dimensions of its representation space—a property measured as "effective rank."
  • Geometric Conflict: Visualizing the embedding space revealed that sharing a single LM head for different masking ratios causes gradient interference. Decoupling the heads allows the model to satisfy both task types simultaneously without compromise.
Figure 1: Classification and retrieval performance of encoders in two size groups, (a) base (≤200M) and (b) medium (≤500M). The classification average is the mean of GLUE, SQuAD 2.0, Multi- CoNER v2, Few-NERD, and RewardBench, and the retrieval average is the mean of BEIR, RAR-b (averaged over its Code and Math subsets), and MLDR. All scores are taken from Table 3.

Key Results

UltraBERT sets a new bar for encoders in the <500M parameter range:

  • SOTA Performance: UltraBERT-380M reached 91.0 on GLUE and 47.7 on BEIR, outperforming specialized models in both categories.
  • Efficiency: The 150M parameter version matches the classification power of RoBERTa-large (355M) while significantly outperforming larger models like Ettin-400M on retrieval.
  • Long Context Mastery: While most encoders struggle beyond 512 or 8K tokens, UltraBERT maintains 99% accuracy on Passkey retrieval up to its full 32K context window.
Figure 2: Downstream performance saturates around 2T tokens, even as pre-training loss continues to decrease.

Limitations and Future Work

The authors acknowledge that while they have pushed the limits of current encoder recipes, the "saturation wall" remains a mystery. Even with 8T tokens, the models eventually stop improving on downstream tasks. Future work might investigate whether different architectural objectives or even larger "teacher" models for distillation could break through this plateau. Additionally, while logit-based distillation was used for efficiency, exploring more compute-intensive distillation methods for long-context windows remains an open area.

Summary updated

BibTeX
@misc{park2026ultrabert,
  author = {Jungwoo Park and Taewhoo Lee and Jaewoo Kang},
  title = {{UltraBERT: Beyond the Limit of BERT Pre-Training}},
  year = {2026},
  eprint = {2610.15028},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2610.15028},
}
Figure