Zubnet AIसीखेंWiki › Decoder
मूल सिद्धांत

Decoder

Decoder Network, Generator
एक neural network component जो एक representation से output generate करता है। Transformers में, decoder causal (left-to-right) attention का use करता है एक समय में एक token generate करने के लिए। Image generation में, VAE decoder latent representations को वापस images में convert करता है। Autoencoders में, decoder compressed bottleneck से original input reconstruct करता है। Decoders कई architectures का “generation” वाला आधा हिस्सा हैं।

यह क्यों matter करता है

हर generative AI system के core में एक decoder है। GPT, Claude, और Llama decoder-only Transformers हैं। Stable Diffusion images produce करने के लिए एक VAE decoder use करता है। Decoders को समझना explain करता है कि generation sequential क्यों है (हर token पिछले tokens पर depend करता है), output input processing से धीमा क्यों है, और autoregressive paradigm text generation में dominate क्यों करता है।

Deep Dive

In a Transformer decoder, causal masking ensures each token can only attend to previous tokens (including itself). This is enforced by setting future positions to −∞ in the attention scores before softmax. The result: token 5's representation only depends on tokens 1–5. This constraint is what enables autoregressive generation — you can generate token 6 using only the representations from tokens 1–5, which are already computed.

Decoder-Only LLMs

Modern LLMs (GPT, Claude, Llama) are decoder-only: there's no separate encoder, and the entire model uses causal attention. The input prompt is processed through the same decoder layers as the generated output. This simplicity is why decoder-only won: one architecture, one attention pattern, clean scaling. The model treats everything as generation — even "understanding" the input is framed as predicting what comes next.

VAE Decoder in Image Generation

In Stable Diffusion, the diffusion process operates in a compressed latent space (64×64 instead of 512×512). The VAE decoder converts this latent representation back into a full-resolution image. It's a separate neural network that's trained to reconstruct images from latents. The quality of the VAE decoder directly affects the final image quality — a good decoder adds fine details and textures that the latent representation can't capture at its lower resolution.

संबंधित अवधारणाएँ

← सभी Terms
ESC