When would you choose an encoder-only architecture over a decoder-only architecture?
Last updated
Choose encoder-only for understanding tasks (classification, NER, embeddings, retrieval, reranking), where bidirectional context gives each token both left and right information.
It is cheap and fast: one forward pass with no autoregressive loop. 100M to 400M parameter models often match large LLMs on narrow labeled tasks and give calibrated class probabilities.
Pick decoder-only instead when you need generation, reasoning, or few-shot flexibility with scarce labels.