Skip to content
ai

Encoder

Transformer Encoder

Definition

The encoder is the transformer component that converts input tokens into rich contextual representations using bidirectional self-attention. Each token's representation incorporates information from all other tokens in the sequence, unlike the masked attention in decoders.

Encoder-only models like BERT excel at tasks requiring full-sequence understanding, such as classification and retrieval.


Ship secure code faster

Crash Override integrates security into the developer workflow. No context switching, no waiting on reviews.