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
Related questions
In the context of deep learning, what is a hyperparameter?
View question →
Which of the following is a common method for initializing weights in deep neural networks?
View question →
What is the purpose of batch normalization?
View question →
Which of the following statements about the cross-entropy loss are correct?
View question →
What is the role of the forget gate in an LSTM cell?
View question →
Which of the following are true about the Adam optimizer?
View question →