What is the purpose of the encoder in a transformer model?

Answer

To process the input sequence and produce a contextualized representation.

Explanation

The encoder in a transformer processes the input sequence through self-attention and feed-forward layers to create rich representations. The decoder generates the output.

Last reviewed: October 2026

Reviewed by FirstInTest Editorial Team

Report an error
QuestionBack to list