179 questions
No questions match those filters.
What's the real difference between causal language mode...
This is one of the questions in the full AI/ML interview bank. Pro unlocks all 1789 questions; Premium includes the same bank plus the highest daily Practice limit.
See plansThe distinction is about which direction of context the model is allowed to use during training, and it flows directly from what the model is meant to do afterward. Causal language modeling masks out future tokens with a triangular attention mask, so the loss at each position only ever depends on tokens that came before it. That training-time constraint is identical to the constraint at inference time — you generate the next token from only what’s been generated so far — which is exactly why CLM is the near-universal choice for generative LLMs: there’s no train/inference mismatch.
Masked language modeling, by contrast, randomly replaces a subset of input tokens with a mask token and trains the model to reconstruct them using the full unmasked sequence on both sides. This gives the model genuinely bidirectional representations at every position — useful for building rich embeddings for classification, retrieval, or NER, where you have the whole input available at inference time anyway. But an MLM-trained model has no natural mechanism for producing new text left-to-right, because it was never trained to predict a token without seeing the rest of the sequence around it.
In practice this is why BERT-style encoders (MLM) power search and embedding pipelines, while GPT-style decoders (CLM) power chat and generation — the objective is chosen to match the deployment task, not the other way around.