Skip to content

What a language model is

A transformer turns text into numbers that carry meaning. Encoders read, decoders write, and which one you need depends on the job.

milkaalpenriegel350gATTENTION · EVERY PIECE READS EVERY OTHERencoder · one vectordecoder · next tokenSEARCH · CLASSIFICATION · RUNS ON CPUGENERATION · CHAT · AGENTS

A language model is a next-word guesser trained until the guessing became something close enough to understanding to be useful. Modern ones are transformers. Text is split into subword pieces, every piece gets a vector, and layers of attention let each piece adjust its meaning by looking at every other piece. That is how “Riegel” next to “Milka” resolves to a chocolate bar rather than a door bolt.

The family splits in two. Encoders read a whole text at once and output vectors: coordinates in a space where distance is meaning. They power search, classification, and clustering, and they are small enough to run fast on a CPU. Decoders generate, one token at a time, each conditioned on everything before it. The chat models everyone knows are decoders, and the L in LLM mostly belongs to them: scale is what made generation good enough to hold a conversation, follow instructions, and write code.

The split matters commercially, not just academically. A categorization or search problem usually wants a fine-tuned encoder: milliseconds, no per-request fees, runs on your hardware. Generation, summarization, and agents want a decoder, which is bigger, slower, and worth it exactly where producing text is the job. A lot of money gets spent pointing a decoder at problems an encoder solves for a hundredth of the cost.

So “do you use AI” is the wrong question. The right one is which model, at what size, sits at which step of the pipeline.

Have data your AI can't use yet?

Tell us what you're sitting on. We'll give you a straight technical read on what's possible. No pitch.