Encoder-decoder vs decoder-only multimodal serving
Fields
flops/encoder-decoder-vs-decoder-only-multimodal-servingNotes
TWO ARCHITECTURE FAMILIES: (1) Encoder-decoder (Whisper, Flamingo): separate encoder and decoder. The encoder processes the input modality (audio, vision) once, producing a latent representation. The decoder generates output autoregressively, attending to the encoder output. Serving implication: encoder cost is fixed per input, decoder cost scales with output length. The encoder can be cached for repeated inputs. (2) Decoder-only with visual tokens (LLaVA, Pixtral, Qwen2-VL): the vision encoder produces visual tokens that are prepended to the text tokens. The entire sequence is processed in one prefill pass. Serving implication: prefill cost scales with total input length (text + visual), decode cost scales with output length. The vision encoder is a separate forward pass that can be cached. The key difference is that encoder-decoder architectures separate the input processing from the output generation, while decoder-only architectures fuse them. For serving, this means encoder-decoder architectures can cache the encoder output independently of the decoder, while decoder-only architectures must cache the entire prefill. Whisper is the canonical encoder-decoder for speech; LLaVA/Pixtral/Qwen2-VL are the canonical decoder-only for vision.