What it is
It turns text into vectors, and a head you train turns those into answers
An encoder takes a piece of text and gives you back one vector for every token in it. A token is a word or a piece of a word, and a vector is a list of numbers describing that token in the context of everything around it. Those vectors don't answer anything by themselves. To get an answer out of the model you attach a head, which is a small output layer with one slot for each of your labels, and you train that head on examples of the decision you want it to make.
BERT also puts a special [CLS] token in front of every input you hand it. The paper calls the final vector at that position "the aggregate sequence representation for classification tasks", which is a formal way of saying that one vector stands for the whole piece of text. If you are classifying, your head reads that single vector and picks a label. If you are pulling pieces out of a sentence, say every date in a contract, your head reads every token's vector and labels each one separately.

Every position reads the whole input in both directions, so by the time the model judges a word it has already read the words that come after it. The word charge means one thing in "they charged my card twice" and a different thing in "the battery will not charge", and an encoder has read the rest of the sentence before it settles on either one. The encoder, decoder and encoder-decoder article draws that out with a figure, if you want to see the mechanism.
Keep reading
The rest of this article is free with an account
Create a free account to read the remaining 6 sections. It takes about twenty seconds and there's nothing to pay. The same account opens the slide decks and CV reviews.
- 02Encoders do the small jobs that run on every record
- 03Mask words to pretrain it, then add a head to fine-tune it
- 04These are the checkpoints you'll see, as of September 2026
- 05Choose an encoder when the labels are fixed and the volume is high
- 06How to try it
- and 1 more
