Encoder

Domain: LLM Concepts

🎯 Motivation

The encoder part of a transformer processes the entire input simultaneously, building a rich understanding (contextualized representations) of the text.

πŸ“‹ Concrete Example

Input β€˜The cat sat’ goes through encoder layers. Each token’s representation is enriched with context from other tokens. Output: deep understanding vectors for each token.

πŸ”— Analogy

A scholar studying a text - they read the whole thing, cross-reference, take notes, and build a deep understanding. The encoder does this mathematical version of deep reading.