एक Transformer decoder में, causal masking सुनिश्चित करता है कि प्रत्येक token केवल पिछले tokens (स्वयं सहित) पर attend कर सकता है। यह softmax से पहले attention scores में future positions को −∞ सेट करके enforce किया जाता है। परिणाम: token 5 का representation केवल tokens 1–5 पर निर्भर करता है। यह constraint ही autoregressive generation को सक्षम बनाता है — आप केवल tokens 1–5 के representations का उपयोग करके token 6 generate कर सकते हैं, जो पहले से compute किए जा चुके हैं।
आधुनिक LLMs (GPT, Claude, Llama) decoder-only हैं: कोई अलग encoder नहीं है, और पूरा मॉडल causal attention उपयोग करता है। Input prompt उन्हीं decoder layers के माध्यम से process किया जाता है जिनसे generated output। यह simplicity ही कारण है कि decoder-only जीता: एक architecture, एक attention pattern, clean scaling। मॉडल सब कुछ generation के रूप में मानता है — input "समझना" भी "अगला क्या आता है" predict करने के रूप में frame किया जाता है।
Stable Diffusion में, diffusion प्रक्रिया एक compressed latent space (512×512 के बजाय 64×64) में operate करती है। VAE decoder इस latent representation को वापस full-resolution image में बदलता है। यह एक अलग neural network है जो latents से images reconstruct करने के लिए trained है। VAE decoder की गुणवत्ता सीधे अंतिम image गुणवत्ता को प्रभावित करती है — एक अच्छा decoder fine details और textures जोड़ता है जो latent representation अपने lower resolution पर capture नहीं कर सकता।