Skip to content
Sign in

What is Encoder?

In deep learning, an encoder is a neural network module that converts raw input data into a compressed, informative representation called an embedding or latent vector.

The encoder processes the input through layers (such as RNNs, CNNs, or transformer blocks) to extract hierarchical features and reduce dimensionality while preserving key information.

It is commonly paired with a decoder in architectures like autoencoders and sequence-to-sequence models, where the encoder's output serves as a bottleneck or context for reconstruction or generation tasks.

Training encourages the encoder to learn useful abstractions, often via objectives like reconstruction loss or masked prediction, enabling downstream tasks such as classification or translation.

Example

In a machine-translation system, the encoder reads an English sentence word-by-word and produces a fixed-size context vector that summarizes its meaning for the decoder to generate the French translation.

Why it matters

Encoders are foundational to modern models such as transformers and variational autoencoders, powering efficient representation learning across NLP, vision, and multimodal AI systems.

Frequently asked questions

Its main job is to turn input data into a compact, meaningful vector that captures essential features for later use by a decoder or classifier.