English

GPT or BERT: why not both?

Computation and Language 2024-12-31 v2

Abstract

We present a simple way to merge masked language modeling with causal language modeling. This hybrid training objective results in a model that combines the strengths of both modeling paradigms within a single transformer stack: GPT-BERT can be transparently used like any standard causal or masked language model. We test the pretraining process that enables this flexible behavior on the BabyLM Challenge 2024. The results show that the hybrid pretraining outperforms masked-only or causal-only models. We openly release the models, training corpora and code.

Keywords

Cite

@article{arxiv.2410.24159,
  title  = {GPT or BERT: why not both?},
  author = {Lucas Georges Gabriel Charpentier and David Samuel},
  journal= {arXiv preprint arXiv:2410.24159},
  year   = {2024}
}

Comments

22 pages; submission to the BabyLM Challenge 2024

R2 v1 2026-06-28T19:43:14.192Z