AI engineering glossary · Transformers LLM architecture

What is encoder?

Encoder: The part of a Transformer that reads the whole input with bidirectional attention and turns it into a set of context-aware vectors, one per token. Those vectors can be used for classification, search embeddings or as input to a decoder.

Level: beginnerTopic: Transformers LLM architecture

Encoder: an example

A BERT encoder turns a 20-token customer review into 20 vectors of size 768.

Related terms

More Transformers LLM architecture terms

Where you learn it

Encoder is part of the AI Engineering Program, which teaches it with notes, a hands-on lab and an exam. The first lesson is free.

Before you go

Take the cheat sheet with you

One free PDF: the key AI-engineering terms, formulas and Python idioms. No spam; unsubscribe any time.