prefixlm-hybrid-mask-bidirectional-prefix-causal-generation
IN premise — entries/2026/06/21/wiki-Transformer_deep_learning_architecture-chunk-3.md
Created 2026-06-21T09:50:11+00:00
PrefixLM is a decoder-only variant that uses bidirectional attention for prefix tokens and causal masking for generated tokens, resembling encoder-decoder behavior.
Summary
PrefixLM lets a single decoder handle both reading and writing: the input text gets full two-way attention so the model can understand the whole context at once, while the output tokens are generated one-at-a-time looking only backward. In practice, this means you get encoder-decoder quality on tasks like text infilling or translation without needing a separate encoder block, keeping the architecture simpler and easier to serve.