Which two pairings of model type and pretraining objective are correct? (Select TWO.)
- Exam domain
- Model Optimization17% of the exam
- Difficulty
- Medium
- In this mock
- 11 questions on this domainPractise this domain
Why the exam asks this
Model Optimization (17% of the exam).
Objective in the exam guide: Train encoder-based foundation LLMs with masked language modeling (MLM) and/or next sentence prediction, and understand quantization, distillation, and model pruning concepts.
Pretraining objectives define model families.
Why B and C are the answers
A multiple-response question. Choose two. There is no credit for picking only some of them.
Decoder-only model: causal language modeling, predicting the next token
Encoder model such as BERT: masked language modeling, predicting hidden tokens
Decoder-only LLMs train with causal language modeling; BERT-style encoders train with masked language modeling.
How it works
Causal language modeling predicts the next token from earlier ones.
Masked language modeling hides some tokens and predicts them from both sides.
BERT used MLM and next sentence prediction.
Clues in the question
The words that point to the answer, and what each one tells you.
- Model type and objective
- CLM for decoders, MLM for encoders.
In detail
- BERT also used next sentence prediction.
- Causal masking blocks attention to future tokens.
Side by side with look-alikes
| Model | Objective | Attention |
|---|---|---|
| Decoder-only | Causal LM | Left to right |
| Encoder (BERT) | Masked LM | Bidirectional |
Every option, checked
Knowing why each wrong option fails is how you rule it out on exam day.
A. Any model: predicting image pixelsWrong
These are language models.
B. Decoder-only model: causal language modeling, predicting the next tokenRight
Decoder-only LLMs train with causal language modeling; BERT-style encoders train with masked language modeling.
C. Encoder model such as BERT: masked language modeling, predicting hidden tokensRight
Decoder-only LLMs train with causal language modeling; BERT-style encoders train with masked language modeling.
D. Decoder-only model: masked language modeling with full bidirectional attentionWrongMost tempting
Decoders use causal, not bidirectional, attention.
Why it tempts: MLM is a real objective. But decoders use causal attention.
E. Encoder model such as BERT: generating long text left to rightWrong
Encoders are not built for left-to-right generation.
In practice
- Choose the objective that matches how the model will be used.
Learn more
- Our lesson: Performance on GPUs
- Practise Model Optimization questions in the mock exam
- Source: Training a causal language model from scratch (Hugging Face LLM Course)
- Source: Fine-tuning a masked language model (Hugging Face LLM Course)
- Source: BERT: Pre-training of Deep Bidirectional Transformers (arXiv)
- TensorRT-LLM on GitHub
- NVIDIA NIM