Encoder-only
BERT and its family: read the whole text at once to understand it. 22 models on EveryLLM so far.
Encoder-only models read a whole text in both directions at once and output a vector for each token, rather than generating text. Trained to fill in masked words, they learn rich representations of meaning and are then fine-tuned for classification, picking out names and places, question answering and search. Google's BERT (2018) defined the type; RoBERTa, ALBERT, DistilBERT, ELECTRA and multilingual variants followed.
Masked language modelling
BERT hides about 15% of the tokens in each training passage and learns to predict them from the words on both sides, which a left-to-right decoder cannot do. It was trained on English Wikipedia and a large collection of books. BERT-base has 110 million parameters and BERT-large 340 million, tiny by today's standards. Facebook's RoBERTa (July 2019) showed that BERT had been undertrained and improved it with more data and longer training.
Still in daily use
Encoders are rarely in the headlines but run at huge scale: they rank web search results, flag harmful posts, route support tickets and turn documents into vectors for retrieval. Because they are small and process a passage in a single pass, they are cheap to run. ModernBERT (December 2024), from Answer.AI and LightOn, updated the design for current hardware and extended its context to 8,192 tokens.