Building Large Language Models
- 27Unfamiliar
- 0Learning
- 0Familiar
- 0Mastered
Which of the following is NOT one of the five key components for training large language models mentioned in the lecture?
Which of the following is NOT one of the five key components for training large language models mentioned in the lecture?
27 questions
- 1
Which of the following is NOT one of the five key components for training large language models mentioned in the lecture?
- A
Architecture
- B
Data
- C
Training loss and algorithm
- D
User interface design
Correct answer
DUser interface design
Explanation
The five components are architecture, training loss/algorithm, data, evaluation, and systems. User interface design was not listed as a key component.
- A
- 2
What does an autoregressive language model compute?
- A
The product of conditional probabilities of each word given the previous words
- B
The probability of each word independently of the others
- C
The joint probability of a sequence directly
- D
The probability of the entire sequence using a single feedforward pass
Correct answer
AThe product of conditional probabilities of each word given the previous words
Explanation
Autoregressive models decompose the joint distribution using the chain rule: P(x1,x2,...,xL)=∏t=1LP(xt∣x<t).
- A
- 3
In the language modeling task, what loss function is typically used for training?
- A
Hinge loss
- B
Cross-entropy loss
- C
Mean squared error
- D
Pairwise ranking loss
Correct answer
BCross-entropy loss
Explanation
The task is framed as classification of the next token, and cross-entropy loss is used, which is equivalent to maximizing the log-likelihood of the text.
- A
- 4
Why is tokenization necessary for language models?
- A
To reduce the vocabulary size to exactly 50,000 tokens
- B
Because words are too large to process efficiently
- C
To handle typos, languages without spaces, and manage sequence length
- D
Because character-level sequences are too short
Correct answer
CTo handle typos, languages without spaces, and manage sequence length
Explanation
Tokenization handles typos (unseen words), languages like Thai (no spaces), and avoids extremely long sequences from character-level tokenization, which would be computationally expensive due to quadratic attention.
- A
- 5
How does Byte Pair Encoding (BPE) create a tokenizer?
- A
By training a neural network to predict token boundaries
- B
By splitting text into individual characters and then merging the most common adjacent pairs iteratively
- C
By randomly selecting substrings from the corpus
- D
By using a pre-defined dictionary of common words
Correct answer
BBy splitting text into individual characters and then merging the most common adjacent pairs iteratively
Explanation
BPE starts with character-level tokens, then iteratively merges the most frequent pair of consecutive tokens, creating new tokens for common substrings.
- A
- 6
What does perplexity measure in the context of language models?
- A
The total number of parameters in the model
- B
The average number of tokens the model is uncertain about at each step
- C
The fraction of correct predictions made by the model
- D
The speed of text generation
Correct answer
BThe average number of tokens the model is uncertain about at each step
Explanation
Perplexity is 2average loss and ranges from 1 to vocabulary size, representing how many tokens the model is 'hesitating between' on average.
- A
- 7
Why is perplexity not used for academic benchmarking of modern LLMs?
- A
Because it depends on the tokenizer, making comparisons across models unfair
- B
Because it is too computationally expensive to compute
- C
Because it only measures training loss, not generalization
- D
Because it cannot be calculated for autoregressive models
Correct answer
ABecause it depends on the tokenizer, making comparisons across models unfair
Explanation
Perplexity depends on vocabulary size and tokenization choices; different tokenizers lead to incomparable values. It remains useful for development within a fixed tokenizer.
- A
- 8
In the MMLU benchmark, how are models typically evaluated?
- A
By using a separate reward model to score responses
- B
By comparing the likelihood of each answer choice and selecting the most likely one
- C
By generating free-form answers and checking for semantic equivalence
- D
By asking human annotators to rank the outputs
Correct answer
BBy comparing the likelihood of each answer choice and selecting the most likely one
Explanation
MMLU is multiple-choice; models are evaluated by computing the probability of each answer option (e.g., A, B, C, D) and picking the highest, often by comparing likelihoods or conditioning on the prompt.
- A
- 9
What is one approach to detect train-test contamination in language models?
- A
Asking the model to report whether it has seen the data
- B
Measuring perplexity on a held-out set
- C
Using a separate validation set from the same distribution
- D
Checking if the model generates examples in the original order better than in a shuffled order
Correct answer
DChecking if the model generates examples in the original order better than in a shuffled order
Explanation
If the test set was seen during training, the model will have lower perplexity when examples are in their original order (since it may have memorized sequences) compared to a shuffled order.
- A
- 10
Which of the following is a step NOT typically involved in processing Common Crawl data for pre-training?
- A
Extracting text from HTML
- B
Filtering out undesirable content (NSFW, PII)
- C
Deduplicating near-duplicate documents
- D
Labeling every sentence with its source domain
Correct answer
DLabeling every sentence with its source domain
Explanation
While domain classification is done, it is not applied to every sentence but to entire documents or segments. The other steps are standard: text extraction, filtering, and deduplication.
- A
- 11
How is model-based filtering of web data performed?
- A
By using a pre-trained language model to score each document's quality
- B
By selecting only documents that have been cited by academic papers
- C
By training a classifier to distinguish between Wikipedia-referenced pages and random web pages
- D
By removing any document that contains out-of-vocabulary tokens
Correct answer
CBy training a classifier to distinguish between Wikipedia-referenced pages and random web pages
Explanation
A classifier is trained on pages linked from Wikipedia (assumed high-quality) versus random web pages, and documents with high probability of being from the Wikipedia-linked distribution are kept.
- A
- 12
According to scaling laws, what relationship exists between compute, data, model size, and test loss?
- A
Loss is inversely proportional to the square of the number of parameters
- B
Loss decreases as a power-law with compute, data size, and parameter count
- C
Loss plateaus quickly and then increases with more compute
- D
Loss decreases linearly with compute on a log-log scale, independent of data and parameters
Correct answer
BLoss decreases as a power-law with compute, data size, and parameter count
Explanation
Scaling laws show a power-law relationship: on a log-log plot, loss decreases linearly with increases in compute, dataset size, and number of parameters.
- A
- 13
The Chinchilla paper found that for compute-optimal training, the ratio of tokens to parameters should be approximately:
- A
150 tokens per parameter
- B
20 tokens per parameter
- C
1 token per parameter
- D
1000 tokens per parameter
Correct answer
B20 tokens per parameter
Explanation
Chinchilla determined optimal training uses about 20 tokens per parameter. However, considering inference cost, a higher ratio (around 150) is often used in practice to favor smaller models.
- A
- 14
What is one benefit of using scaling laws when deciding between two model architectures?
- A
They provide a theoretical upper bound on model accuracy
- B
They allow extrapolation of performance from small models to larger ones, enabling comparison
- C
They eliminate the need for hyperparameter tuning
- D
They guarantee which architecture will perform better at all scales
Correct answer
BThey allow extrapolation of performance from small models to larger ones, enabling comparison
Explanation
By training both architectures at multiple smaller scales and fitting scaling laws, one can predict which architecture will be better when scaled up, as shown with Transformers vs. LSTMs.
- A
- 15
What is the main purpose of supervised fine-tuning (SFT) in the post-training stage?
- A
To increase the model's vocabulary size
- B
To teach the model entirely new factual knowledge
- C
To reduce the number of parameters for faster inference
- D
To specialize the pre-trained model to follow instructions and produce desired answer formats
Correct answer
DTo specialize the pre-trained model to follow instructions and produce desired answer formats
Explanation
SFT fine-tunes the model on human-written instructions and desired responses, teaching it the format and style of a helpful assistant rather than new knowledge (which is already in pre-training data).
- A
- 16
According to the Lima paper, how does the amount of SFT data affect model performance?
- A
Performance degrades with more data due to overfitting
- B
Performance scales linearly with the amount of data
- C
Performance does not improve much beyond a few thousand examples
- D
Performance improves significantly up to 1 million examples
Correct answer
CPerformance does not improve much beyond a few thousand examples
Explanation
The Lima paper showed that increasing SFT data from 2,000 to 32,000 examples did not yield significant gains, suggesting that SFT mainly teaches format and style, not knowledge.
- A
- 17
Why might supervised fine-tuning contribute to hallucination in LLMs?
- A
Because the model overfits to the small SFT dataset
- B
Because the model is forced to generate plausible-sounding responses for facts it may not know
- C
Because SFT uses a different loss function that encourages creativity
- D
Because the human-written answers may contain factual errors
Correct answer
BBecause the model is forced to generate plausible-sounding responses for facts it may not know
Explanation
If a human provides a reference that the model never saw during pre-training, the model learns to generate that reference even though it has no real knowledge of it, leading to fabricated or hallucinated content.
- A
- 18
In RLHF, what is the role of a reward model?
- A
To compute a continuous reward score for a given output, trained on human preferences
- B
To generate new training examples
- C
To replace the language model during inference
- D
To penalize the model for using certain words
Correct answer
ATo compute a continuous reward score for a given output, trained on human preferences
Explanation
The reward model is a classifier trained on human comparisons of outputs; it outputs a scalar reward (logit) that indicates how much humans would prefer that output.
- A
- 19
Which of the following is a key difference between PPO (used in RLHF) and DPO?
- A
DPO does not require a separate reward model; it directly optimizes the policy using preference data
- B
PPO is simpler and easier to implement than DPO
- C
PPO does not use any regularization, while DPO does
- D
DPO cannot be used with human feedback at all
Correct answer
ADPO does not require a separate reward model; it directly optimizes the policy using preference data
Explanation
DPO bypasses explicit reward modeling by directly using the likelihood of preferred and dispreferred outputs in a loss function that is mathematically equivalent to the RL objective.
- A
- 20
What challenge arises when using humans to provide preference data for RLHF?
- A
Humans cannot distinguish between good and bad answers
- B
Humans tend to focus on superficial features like length rather than correctness
- C
Humans are always perfectly consistent
- D
Humans require extensive training to become annotators
Correct answer
BHumans tend to focus on superficial features like length rather than correctness
Explanation
Human annotators often rely on heuristics such as preferring longer or more verbose answers, which can lead to reward models that over-optimize for those superficial qualities.
- A
- 21
According to the lecture, how do LLMs compare to humans as annotators for preference data?
- A
LLMs cannot be used for preference annotation because they lack understanding
- B
LLMs are cheaper and can achieve higher agreement with the human majority than humans themselves
- C
Humans are always more reliable than LLMs
- D
LLMs are more expensive but more accurate
Correct answer
BLLMs are cheaper and can achieve higher agreement with the human majority than humans themselves
Explanation
The lecture showed that LLMs are much cheaper and their preferences agree with the mode of human judges at a higher rate than individual humans do, reducing variance and cost.
- A
- 22
Why can perplexity not be used to evaluate post-trained (aligned) models?
- A
Because perplexity does not reflect correctness
- B
Because perplexity is only defined for regression tasks
- C
Because aligned models are not trained to maximize likelihood and their perplexity is not meaningful
- D
Because post-training changes the tokenizer
Correct answer
CBecause aligned models are not trained to maximize likelihood and their perplexity is not meaningful
Explanation
After PPO/DPO, models are trained as policies rather than maximum likelihood estimators, so their probability distributions are distorted and perplexity does not reflect generation quality.
- A
- 23
Chatbot Arena evaluates models by:
- A
Automatically checking answers against a golden dataset
- B
Measuring the perplexity of each model on a standard test set
- C
Using a single benchmark like MMLU for all tasks
- D
Having blind pairwise comparisons by random users and aggregating preferences
Correct answer
DHaving blind pairwise comparisons by random users and aggregating preferences
Explanation
Chatbot Arena allows users to chat with two anonymous models and pick the better response, then ranks models based on millions of such comparisons.
- A
- 24
A known bias of LLM-based evaluators (e.g., using GPT-4 to compare outputs) is:
- A
They are perfectly aligned with human judgment
- B
They prefer longer outputs, regardless of quality
- C
They always prefer shorter answers
- D
They cannot detect factual errors
Correct answer
BThey prefer longer outputs, regardless of quality
Explanation
LLM evaluators exhibit a length bias: they tend to favor longer responses, even when humans would not. This can be partially corrected using regression with length as a confounding variable.
- A
- 25
What is Model FLOP Utilization (MFU) and what value is considered good?
- A
The percentage of GPU memory used; 90% is ideal
- B
The speed of data loading; 1 TB/s is required
- C
The ratio of observed throughput to theoretical maximum; ~50% is typical
- D
The number of floating-point operations per second; 100% is common
Correct answer
CThe ratio of observed throughput to theoretical maximum; ~50% is typical
Explanation
MFU measures how efficiently the GPU is used. Values around 45-50% are considered good for large-scale training, indicating communication and memory bottlenecks limit throughput.
- A
- 26
Why is automatic mixed precision training commonly used?
- A
To simplify the training code by removing manual precision choices
- B
To ensure compatibility with older hardware
- C
To reduce memory and speed up computation by using lower precision for most operations while maintaining accuracy
- D
To increase model accuracy by using higher precision for all operations
Correct answer
CTo reduce memory and speed up computation by using lower precision for most operations while maintaining accuracy
Explanation
Mixed precision stores weights in 32-bit but performs forward/backward in 16-bit, speeding up matrix multiplications and reducing memory. Updates are done in 32-bit to preserve small gradient changes.
- A
- 27
What does operator fusion (e.g., via torch.compile) achieve?
- A
It merges multiple model checkpoints into one
- B
It increases the batch size to use all GPU memory
- C
It fuses different training datasets into one stream
- D
It combines multiple sequential operations into a single kernel launch, reducing memory transfers
Correct answer
DIt combines multiple sequential operations into a single kernel launch, reducing memory transfers
Explanation
Operator fusion reduces the number of round trips between GPU memory and compute units by performing all operations in one kernel, significantly improving throughput.
- A

Ask anything
We've read this whole study set, so questions about it get the best answers.