Same topic, related formats. Practice these next.
Same topic, related formats. Practice these next.
Each architecture family has a canonical objective that fits its attention mask. Encoder-only uses MLM (bidirectional). Decoder-only uses next-token (causal). Text encoder-decoder uses span corruption.
Think of each transformer family like a different kind of student with a different study method. The encoder-only student (BERT) reads the whole sentence at once with some words hidden behind sticky notes, then guesses what is under each sticky note, this is masked language modeling. The decoder-only student (GPT, Llama) reads one word at a time and tries to predict the next word, never peeking ahead, this is next-token prediction. The text encoder-decoder student (T5) reads a sentence with whole phrases hidden, then has to write out the missing phrases one by one in a separate notebook, this is span corruption. The cross-modal student (Whisper) listens to an audio recording and writes down what was said in text form, this is supervised audio-to-text. Each method matches the architecture's attention pattern, which is why the pairings are not arbitrary.
Everything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example. Click to expand.
Everything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example.
Everything important, quickly.
4 min: state each pairing, explain why the objective matches the attention mask in each case, mention that decoder-only's sample-efficiency advantage drives its dominance at scale.
Real products, models, and research that use this idea.
What an interviewer would ask next. Try answering before peeking at the approach.
Red flags and common mistakes that signal junior thinking. Click to expand.
Assuming any architecture can use any objective. The objective has to match the attention mask: causal masks force next-token prediction, bidirectional masks enable MLM, encoder-decoder masks enable span corruption.
The night-before-the-interview bullets. Scan these on the way to the call.
Primary sources. Skim if you want the original framing.