Notice: Due to an ongoing migration of our storage and publishing system, material requested since last month will not be uploaded for the time being, and new requests are paused. All existing notes remain available.
You're offline
Unit 5 MCQsTransformers and Pretrained Language Models
Question 1 of 60 · transformer architecture · Easy
Which foundational 2017 paper introduced the Transformer architecture?
Not quite. Try another option.
Answer: Attention Is All You Need
The Transformer architecture was introduced in the seminal paper 'Attention Is All You Need' by Vaswani et al. in 2017.
Question 2 of 60 · self-attention · Easy
What is the primary function of the self-attention mechanism in a Transformer?
Not quite. Try another option.
Answer: To relate different positions of a single sequence to compute a representation of the sequence
Self-attention allows the model to look at other words in the same input sequence to gather context and better understand the relationships between words.
Question 3 of 60 · multi-head attention · Easy
Why does the Transformer use multi-head attention instead of a single attention function?
Not quite. Try another option.
Answer: It allows the model to jointly attend to information from different representation subspaces at different positions
Multi-head attention runs multiple attention mechanisms in parallel, allowing the model to focus on different aspects of the text (e.g., syntax, semantics) simultaneously.
Question 4 of 60 · positional encoding · Easy
Why is positional encoding necessary in a Transformer model?
Not quite. Try another option.
Answer: Because Transformers process sequences in parallel and lack inherent notions of sequence order
Unlike RNNs, Transformers process all tokens simultaneously. Positional encodings are added to embeddings to inject information about the relative or absolute position of the tokens.
Question 5 of 60 · transformer encoder and decoder blocks · Easy
Which component is present in a standard Transformer decoder block but NOT in an encoder block?
Not quite. Try another option.
Answer: Masked Multi-Head Self-Attention
The decoder contains a masked self-attention layer to prevent positions from attending to subsequent (future) positions during text generation.
Question 6 of 60 · tokenization methods · Easy
What is the primary advantage of subword tokenization methods over traditional word-level tokenization?
Not quite. Try another option.
Answer: They help handle Out-Of-Vocabulary (OOV) words by breaking them into known subwords
Subword tokenization breaks rare or unknown words into smaller, frequent chunks (like prefixes or suffixes), effectively reducing the OOV problem while maintaining a reasonable vocabulary size.
Question 7 of 60 · Byte-Pair Encoding and WordPiece · Easy
How does the Byte-Pair Encoding (BPE) algorithm initially build its vocabulary?
Not quite. Try another option.
Answer: It starts with a vocabulary of individual characters and iteratively merges the most frequent adjacent pairs
BPE is a data compression algorithm adapted for tokenization. It begins with individual characters and merges the most frequently occurring adjacent pairs until a target vocabulary size is reached.
Question 8 of 60 · pretrained transformer models · Easy
What does 'pretraining' mean in the context of large language models?
Not quite. Try another option.
Answer: Training a model on a large corpus of unlabeled text using a self-supervised objective before adapting it to specific tasks
Pretraining involves exposing the model to vast amounts of text data using tasks like predicting hidden words, allowing it to learn general language patterns before being fine-tuned.
Question 9 of 60 · BERT · Easy
What does the acronym BERT stand for?
Not quite. Try another option.
Answer: Bidirectional Encoder Representations from Transformers
BERT stands for Bidirectional Encoder Representations from Transformers, reflecting its architecture (Transformer encoder) and its bidirectional context processing.
Question 10 of 60 · GPT · Easy
The GPT (Generative Pre-trained Transformer) architecture is primarily based on which part of the original Transformer?
Not quite. Try another option.
Answer: The Decoder
GPT models use a decoder-only architecture, which includes masked self-attention to generate text autoregressively (predicting the next token based on previous ones).
Question 11 of 60 · T5 · Easy
What is the defining characteristic of the T5 (Text-to-Text Transfer Transformer) framework?
Not quite. Try another option.
Answer: It casts every NLP task as a text-to-text problem, where both input and output are strings
T5 reformulates all NLP tasks (like translation, summarization, and classification) into a unified text-to-text format, taking text as input and producing text as output.
Question 12 of 60 · masked language modeling · Easy
In Masked Language Modeling (MLM), what is the model trained to do?
Not quite. Try another option.
Answer: Predict the original identity of tokens that have been randomly replaced with a [MASK] token
In MLM (used by BERT), a percentage of input tokens are masked, and the model must use the surrounding bidirectional context to predict what the masked tokens are.
Question 13 of 60 · next sentence prediction · Easy
What is the objective of the Next Sentence Prediction (NSP) task used during BERT's pretraining?
Not quite. Try another option.
Answer: To predict whether Sentence B logically and sequentially follows Sentence A in the original document
NSP is a binary classification task where the model learns to understand sentence relationships by predicting if two sentences appear consecutively in the source text.
Question 14 of 60 · causal language modeling · Easy
Which of the following best describes Causal Language Modeling (CLM)?
Not quite. Try another option.
Answer: Predicting the next token in a sequence given only the previous tokens (left-to-right)
Causal Language Modeling, also known as autoregressive modeling, trains a model to predict the next word in a sequence using only the past (causal) context. This is how GPT models are trained.
Question 15 of 60 · transfer learning for NLP tasks · Easy
What is a major benefit of using transfer learning in NLP?
Not quite. Try another option.
Answer: It allows a model pretrained on a massive corpus to achieve high performance on downstream tasks with relatively little labeled data
Transfer learning allows the rich language understanding gained during pretraining on massive datasets to be transferred to specific, smaller tasks through fine-tuning.
Question 16 of 60 · fine-tuning for text classification · Easy
When fine-tuning BERT for a sequence classification task (like sentiment analysis), which special token's final hidden state is typically passed to the classification layer?
Not quite. Try another option.
Answer: [CLS]
In BERT, the [CLS] (classification) token is prepended to the input sequence. Its final hidden state aggregates sequence-level information and is commonly used as the input to a classification head.
Question 17 of 60 · named entity recognition · Easy
Named Entity Recognition (NER) using Transformers is typically modeled as what type of task?
Not quite. Try another option.
Answer: Token classification
NER involves assigning a label (like Person, Organization, or Location) to each individual word/token in a sequence, making it a token classification task.
Question 18 of 60 · question answering · Easy
In an extractive Question Answering task using a model like BERT, what does the model output?
Not quite. Try another option.
Answer: The start and end token indices of the answer span within the provided context
In extractive QA, the model identifies the exact segment of text that answers the question by predicting a start pointer and an end pointer over the context sequence.
Question 19 of 60 · HuggingFace Transformers · Easy
What is the primary purpose of the HuggingFace Transformers library?
Not quite. Try another option.
Answer: To provide open-source APIs, tools, and pretrained weights for state-of-the-art NLP models
HuggingFace Transformers is a highly popular open-source library that simplifies downloading, utilizing, and fine-tuning state-of-the-art pretrained transformer models.
Question 20 of 60 · transformer architecture · Easy
In the context of the Transformer architecture, what is passed through the Feed-Forward Neural Network in an encoder block?
Not quite. Try another option.
Answer: The output of the multi-head self-attention layer (after add and norm)
Inside an encoder block, the representations first pass through a multi-head self-attention mechanism, are added and normalized, and then pass through a position-wise Feed-Forward Neural Network.
Question 21 of 60 · self-attention · Medium
In the scaled dot-product attention mechanism, why are the dot products scaled by the inverse square root of the dimension of the key vectors ()?
Not quite. Try another option.
Answer: To prevent the softmax gradients from vanishing
When the dimensionality of the key vectors is large, the dot products can grow very large in magnitude, pushing the softmax function into regions where gradients are extremely small. Scaling by counteracts this effect.
Question 22 of 60 · multi-head attention · Medium
What is the primary advantage of using Multi-Head Attention over a single attention function in a Transformer?
Not quite. Try another option.
Answer: It allows the model to jointly attend to information from different representation subspaces at different positions
Multi-head attention projects the queries, keys, and values into multiple different subspaces. This enables the model to focus on different types of relationships (e.g., syntactic vs. semantic) simultaneously.
Question 23 of 60 · positional encoding · Medium
How are sine and cosine functions utilized for positional encoding in the original Transformer architecture?
Not quite. Try another option.
Answer: Different frequencies of sine and cosine are used for different dimensions of the positional encoding vector
The original Transformer uses sine and cosine functions of different frequencies, where sine is used for even dimensions and cosine for odd dimensions. This allows the model to easily learn to attend by relative positions.
Question 24 of 60 · transformer encoder and decoder blocks · Medium
In a standard Transformer decoder block, what is the purpose of the masked multi-head attention layer?
Not quite. Try another option.
Answer: To prevent the decoder from attending to future tokens in the target sequence during training
During training, the masked attention layer ensures that the prediction for position can depend only on the known outputs at positions less than , preserving the autoregressive property.
Question 25 of 60 · Byte-Pair Encoding and WordPiece · Medium
When training a Byte-Pair Encoding (BPE) tokenizer, how are new subwords formed?
Not quite. Try another option.
Answer: By iteratively merging the most frequently occurring pair of adjacent symbols
BPE is a data compression technique adapted for NLP. It initializes the vocabulary with individual characters and iteratively merges the most frequent adjacent pairs of symbols to create new subword tokens.
Question 26 of 60 · BERT · Medium
Which components make up the input representation for a given token in the BERT model?
Not quite. Try another option.
Answer: Token Embeddings, Segment Embeddings, and Position Embeddings
The input representation for BERT is constructed by summing the corresponding token embedding (representing the subword), segment embedding (representing sentence A or B), and position embedding (representing the sequence position).
Question 27 of 60 · masked language modeling · Medium
During the pretraining phase of BERT using Masked Language Modeling (MLM), how are the selected tokens replaced?
Not quite. Try another option.
Answer: 80% with [MASK], 10% with a random token, 10% kept unchanged
To mitigate the mismatch between pretraining (where [MASK] is seen) and fine-tuning (where it isn't), BERT replaces 15% of tokens. Of those, 80% are replaced with [MASK], 10% with a random word, and 10% are left unchanged.
Question 28 of 60 · GPT · Medium
Which of the following best describes the architecture of the Generative Pre-trained Transformer (GPT) models?
Not quite. Try another option.
Answer: Autoregressive decoder-only architecture
GPT models are built using only the decoder part of the original Transformer architecture. They generate text autoregressively, predicting the next token based on previous tokens.
Question 29 of 60 · causal language modeling · Medium
In causal language modeling, what objective function is the model primarily optimizing?
Not quite. Try another option.
Answer: Maximizing the likelihood of predicting the next token given all previous tokens in the sequence
Causal Language Modeling (CLM) trains the model to predict the next token based exclusively on the preceding context. This strictly left-to-right approach is what makes it 'causal'.
Question 30 of 60 · T5 · Medium
How does the Text-to-Text Transfer Transformer (T5) format its input and output for different NLP tasks?
Not quite. Try another option.
Answer: Every task is cast as feeding a text sequence as input and generating a new text sequence as output
T5 uses a unified text-to-text framework. Whether the task is translation, classification, or regression, both the input and the target are represented as text strings.
Question 31 of 60 · fine-tuning for text classification · Medium
When fine-tuning a BERT model for text classification, which vector is typically passed to the final classification layer?
Not quite. Try another option.
Answer: The final hidden state corresponding to the [CLS] token
In BERT, the special [CLS] (classification) token is added to the beginning of every sequence. Its final hidden state aggregates sequence-wide information and is conventionally used for sentence-level classification.
Question 32 of 60 · HuggingFace Transformers · Medium
In the HuggingFace Transformers library, what is the role of the AutoModelForSequenceClassification class?
Not quite. Try another option.
Answer: It automatically instantiates a base model with a sequence classification head on top
The AutoModelForSequenceClassification class loads a pretrained base model and automatically attaches an untrained classification head matching the specified number of labels.
Question 33 of 60 · next sentence prediction · Medium
In BERT's Next Sentence Prediction (NSP) task, what defines a positive pair during pretraining?
Not quite. Try another option.
Answer: Two sentences that appear consecutively in the original corpus
For the NSP task, BERT takes pairs of sentences. A positive pair (label IsNext) consists of two sentences that are actually sequential in the source text, helping the model learn sentence relationships.
Question 34 of 60 · named entity recognition · Medium
How is fine-tuning adapted for a Token Classification task like Named Entity Recognition (NER) using a transformer?
Not quite. Try another option.
Answer: A classification head is applied to the final hidden state of every individual token in the sequence
NER requires classifying each word/token as part of an entity or not. Therefore, the dense classification layer is applied to the final hidden states of all tokens in the sequence, not just the [CLS] token.
Question 35 of 60 · question answering · Medium
When applying a transformer model to Extractive Question Answering (like SQuAD), how is the answer extracted from the context?
Not quite. Try another option.
Answer: By predicting two probabilities for each token in the context: one for being the start of the answer span and one for being the end
In extractive QA, the model does not generate new text. Instead, it places a classification head on top of the context tokens to predict the start and end positions of the answer span.
Question 36 of 60 · transformer encoder and decoder blocks · Medium
Which component exists in a Transformer Decoder block but is ABSENT from a Transformer Encoder block?
Not quite. Try another option.
Answer: Encoder-Decoder Cross-Attention mechanism
The decoder block contains an additional multi-head attention layer that performs cross-attention over the output of the encoder stack. The encoder only contains self-attention.
Question 37 of 60 · transfer learning for NLP tasks · Medium
What is the main benefit of using transfer learning in modern NLP?
Not quite. Try another option.
Answer: Pretraining on massive unlabelled corpora allows models to learn rich language representations, reducing the need for large labeled datasets during fine-tuning
Transfer learning works by initializing models with weights learned from self-supervised tasks on huge datasets. This means they already understand grammar and semantics, requiring far less labeled data to learn a specific task.
Question 38 of 60 · Byte-Pair Encoding and WordPiece · Medium
How does WordPiece tokenization differ primarily from Byte-Pair Encoding (BPE)?
Not quite. Try another option.
Answer: WordPiece chooses symbol pairs that maximize the likelihood of the training data given the language model, rather than just frequency
While BPE purely merges the most frequent pairs, WordPiece evaluates pairs based on how much merging them increases the likelihood of the training data under a unigram language model.
Question 39 of 60 · transformer architecture · Medium
In the standard Transformer architecture, what specific type of neural network follows the attention mechanisms within both encoder and decoder layers?
Not quite. Try another option.
Answer: A Position-wise Feed-Forward Network applied identically to each position separately
Every encoder and decoder block contains a Position-wise Feed-Forward Network (FFN), consisting of two linear transformations with a ReLU activation in between, applied to each token position independently.
Question 40 of 60 · self-attention · Medium
Given an input sequence of length and hidden dimension , what is the computational time complexity of the self-attention operation?
Not quite. Try another option.
Answer:
In self-attention, computing the attention matrix requires taking the dot product of the query and key vectors for every pair of tokens. This results in combinations, each taking operations, leading to a complexity of .
Question 41 of 60 · self-attention · Hard
In the standard scaled dot-product attention, the dot products of queries and keys are divided by . What is the primary theoretical justification for this specific scaling factor?
Not quite. Try another option.
Answer: It prevents the variance of the dot product from scaling linearly with , which would otherwise push the softmax function into regions with extremely small gradients.
Assuming elements of query and key vectors are independent random variables with mean 0 and variance 1, their dot product has a mean of 0 and variance of . Scaling by brings the variance back to 1, preventing the softmax output from approaching a hard max, which would result in vanishing gradients during training.
Question 42 of 60 · multi-head attention · Hard
Consider a Multi-Head Attention layer with heads and a model dimension of . If , how many trainable weights (excluding biases) are present in the query, key, value, and output projection matrices combined for this single layer?
Not quite. Try another option.
Answer:
The projections for Q, K, and V each require a weight matrix of size (since concatenating heads of size reconstructs ), totaling . The final output projection is also . Thus, the total is parameters.
Question 43 of 60 · positional encoding · Hard
Which of the following mathematical properties of the sinusoidal positional encodings proposed by Vaswani et al. is crucial for allowing the model to easily learn to attend by relative positions?
Not quite. Try another option.
Answer: The positional encoding for any offset , , can be represented as a linear function of .
Because of the properties of sine and cosine addition formulas, for any fixed offset , can be computed as a linear transformation (a rotation matrix) of . This allows the attention mechanism to easily learn relative positional relationships regardless of absolute position.
Question 44 of 60 · transformer encoder and decoder blocks · Hard
In standard Transformer architectures, Layer Normalization can be applied either before the sub-layers (Pre-LN) or after the sub-layers (Post-LN). Which of the following best characterizes the impact of choosing Pre-LN over Post-LN?
Not quite. Try another option.
Answer: Pre-LN generally results in more stable training and removes the strict necessity for learning rate warmup, though it may slightly degrade final performance compared to Post-LN.
In Post-LN (used in the original Transformer), gradients near the output layer can be vanishingly small at initialization, necessitating learning rate warmup. Pre-LN keeps the scale of gradients more uniform across layers, allowing training without warmup, though sometimes yielding slightly lower final performance.
Question 45 of 60 · Byte-Pair Encoding and WordPiece · Hard
While both Byte-Pair Encoding (BPE) and WordPiece are subword tokenization algorithms, their merging criteria differ. BPE merges pairs based on frequency. What criterion does WordPiece primarily use to determine which subword pair to merge?
Not quite. Try another option.
Answer: It merges the pair that yields the largest mutual information, calculated as the frequency of the pair divided by the product of individual frequencies.
WordPiece scores pairs based on the formula . This measures how much more likely the pair is to appear together compared to what would be expected if they were independent, essentially maximizing the likelihood of the training data.
Question 46 of 60 · masked language modeling · Hard
In BERT's Masked Language Modeling (MLM), 15% of the tokens are chosen for prediction. Of these chosen tokens, 80% are replaced with [MASK], 10% with a random word, and 10% kept unchanged. What is the primary reason for keeping 10% of the selected tokens unchanged?
Not quite. Try another option.
Answer: To mitigate the discrepancy between pre-training and fine-tuning, teaching the model that the observed token might actually be the correct token and it should maintain its contextual representation.
During fine-tuning, the [MASK] token never appears. By keeping the token unchanged 10% of the time (and replacing it with a random token 10% of the time), BERT is forced to build a robust contextual representation for every token, as it never knows which tokens have been tampered with.
Question 47 of 60 · next sentence prediction · Hard
Which of the following pretrained models completely removed the Next Sentence Prediction (NSP) objective and demonstrated empirically that removing it actually improved performance on downstream tasks?
Not quite. Try another option.
Answer: RoBERTa
The authors of RoBERTa found that the Next Sentence Prediction (NSP) objective used in BERT actually degraded performance. They removed NSP and trained with full-length sequences (often spanning multiple documents) using only Masked Language Modeling, resulting in better downstream performance.
Question 48 of 60 · causal language modeling · Hard
During autoregressive generation in causal language models, a 'KV cache' is often utilized. If a model generates a sequence of length , how does the memory complexity of the KV cache scale with respect to ?
Not quite. Try another option.
Answer:
The KV cache stores the Key and Value vectors for all previously generated tokens to avoid recomputing them. Since each token adds a fixed-size vector for its Keys and Values across all layers, the total memory required for the cache grows linearly, , with the sequence length.
Question 49 of 60 · T5 · Hard
T5 (Text-to-Text Transfer Transformer) uses a unique unsupervised pre-training objective known as 'span corruption'. How does T5 handle the targets for masked spans during pre-training compared to BERT?
Not quite. Try another option.
Answer: T5 replaces contiguous spans with a single unique sentinel token and the decoder must generate only the corrupted spans delimited by those sentinel tokens.
In T5's span corruption, contiguous dropped tokens are replaced by a single unique sentinel token (e.g., <extra_id_0>). The decoder's target sequence consists only of these sentinel tokens followed by the missing span tokens, rather than reconstructing the full original sequence.
Question 50 of 60 · fine-tuning for text classification · Hard
When fine-tuning BERT for text classification, it is standard practice to pass the final hidden state of the [CLS] token to a classification head. If one extracts the [CLS] embedding from a pre-trained BERT without any fine-tuning, why is it generally a poor sentence representation for tasks like semantic textual similarity?
Not quite. Try another option.
Answer: The [CLS] representation is heavily biased towards the Next Sentence Prediction (NSP) objective, acting essentially as a binary feature rather than capturing a continuous semantic space.
In a vanilla pretrained BERT, the [CLS] token's primary role is to aggregate information for the Next Sentence Prediction (NSP) binary classification task. Without fine-tuning (or contrastive learning as seen in Sentence-BERT), this representation does not inherently form a smooth semantic space useful for measuring cosine similarity between sentences.
Question 51 of 60 · named entity recognition · Hard
When fine-tuning a transformer model for Named Entity Recognition (NER), subword tokenization often splits a single word into multiple tokens (e.g., 'Washington' -> 'Wash', '##ington'). What is the standard practice in HuggingFace for assigning labels to these subwords to compute the loss correctly?
Not quite. Try another option.
Answer: Assign the target label (e.g., B-LOC) to the first subword and assign a special ignore index (e.g., -100) to the remaining subwords.
The standard practice in sequence labeling with subwords is to calculate the loss only on the first subword of an entity. By setting the labels of trailing subwords to -100, the PyTorch CrossEntropyLoss function naturally ignores them, preventing the model from over-weighting words that happen to be split into many subwords.
Question 52 of 60 · question answering · Hard
In Extractive Question Answering tasks with unanswerable questions (like SQuAD 2.0), how does a standard BERT-based architecture signal that a question cannot be answered from the given context?
Not quite. Try another option.
Answer: By pointing both the predicted start and end spans to the [CLS] token at index 0.
In BERT models fine-tuned on SQuAD 2.0, the [CLS] token is used as a fallback. If the model determines the answer is not in the text, it maximizes the probability of the start and end indices both pointing to the [CLS] token.
Question 53 of 60 · transformer architecture · Hard
Consider a Transformer block with sequence length and hidden dimension . The attention mechanism computes . If is significantly larger than (e.g., ), which operation becomes the primary computational bottleneck?
Not quite. Try another option.
Answer: The computation of the attention scores , scaling as .
The dot product requires multiplying an matrix by a matrix, which takes operations. When , the quadratic dependency on sequence length makes this step the primary computational bottleneck of the Transformer.
Question 54 of 60 · BERT · Hard
BERT relies on Token Embeddings, Segment (Token Type) Embeddings, and Positional Embeddings. If you are fine-tuning BERT for a single-sequence classification task (e.g., Sentiment Analysis), how are the Segment Embeddings typically handled?
Not quite. Try another option.
Answer: A single segment ID (usually 0) is passed for all tokens in the sequence, mapping to a learned vector that is added to the token embeddings.
For single-sequence tasks, BERT still expects segment IDs as part of its architecture. By convention, a tensor of zeros is passed (indicating segment A), which retrieves a learned embedding that is uniformly added to all tokens in the sequence.
Question 55 of 60 · transfer learning for NLP tasks · Hard
When adapting a large pre-trained language model to a specific task using Low-Rank Adaptation (LoRA), which of the following is true regarding the model's parameters?
Not quite. Try another option.
Answer: LoRA freezes the original pre-trained weights and injects trainable rank decomposition matrices, maintaining the same inference latency as the base model when merged.
LoRA introduces trainable matrices and such that . During training, the base weights are frozen. For deployment, can be explicitly computed and added to the original weights (), meaning there is zero extra latency during inference.
Question 56 of 60 · HuggingFace Transformers · Hard
In the HuggingFace generate() method, when both top_k and top_p (nucleus sampling) parameters are provided (e.g., top_k=50, top_p=0.95), in what order are these filtering operations mathematically applied to the logits?
Not quite. Try another option.
Answer: top_k filtering is applied first, completely truncating the vocabulary to 50 tokens, and then top_p filtering is applied within that restricted set.
In HuggingFace's implementation of the generation mixins (specifically the LogitsProcessors), TopKLogitsWarper is instantiated and applied before TopPLogitsWarper. Therefore, the vocabulary is first truncated to tokens, and nucleus sampling is subsequently applied over this reduced distribution.
Question 57 of 60 · transformer decoder blocks · Hard
In the cross-attention sub-layer of a standard Transformer Decoder, how are the Query (Q), Key (K), and Value (V) matrices derived?
Not quite. Try another option.
Answer: Q is derived from the previous decoder layer, while K and V are derived from the final hidden states of the Encoder.
In cross-attention (or Encoder-Decoder attention), the decoder "queries" the encoder's representations. Therefore, the Queries come from the decoder's previous layer, while the Keys and Values are projections of the encoder's final output.
Question 58 of 60 · tokenization methods · Hard
Unlike BPE which starts with characters and builds up, the Unigram Language Model tokenizer starts with a large vocabulary and prunes it down. What metric does the Unigram algorithm use to decide which tokens to remove at each iteration?
Not quite. Try another option.
Answer: It removes the tokens whose removal results in the smallest increase in the overall negative log-likelihood of the training data.
The Unigram tokenization algorithm iteratively evaluates how much the training data's likelihood would drop if a token were removed from the vocabulary. It prunes the bottom \% of tokens that cause the least degradation to the likelihood.
Question 59 of 60 · GPT · Hard
GPT-3 popularized the concept of 'in-context learning' (few-shot prompting) where the model performs tasks without gradient updates. From a representational perspective, how does the model 'learn' a task dynamically during inference?
Not quite. Try another option.
Answer: By relying on the self-attention mechanism to route the representations of the provided examples to modulate the hidden states of the target query.
During in-context learning, no parameters are updated. The "learning" happens entirely through activations via self-attention: the model dynamically aggregates information from the context examples to appropriately form the output distribution for the new prompt.
Question 60 of 60 · pretrained transformer models · Hard
In the context of the Effective Receptive Field (ERF) of deep neural networks, how does the theoretical receptive field of a token at the very first layer of a Transformer compare to a standard CNN?
Not quite. Try another option.
Answer: A Transformer has a global receptive field encompassing the entire sequence, whereas a CNN has a strictly local receptive field constrained by kernel size.
Because of the self-attention mechanism, every token computes attention scores with every other token in the sequence (in unmasked models like BERT) or all past tokens (in masked models like GPT) starting immediately at layer 1, resulting in a global theoretical receptive field, unlike CNNs which require deep hierarchies to expand their receptive fields.
That's unit 5
Answer a few questions and your score shows up here.
Nearly through. Did unit 5 of CSE472 save you a night before the exam?
LPU Notes is free. A student pays for the servers.
Did unit 5 of CSE472 save you a night before the exam?
Then you can help keep it free for the next batch. Ads cover part of the server bill;
the rest comes out of a student's own pocket: the domain, the storage, and keeping
the site up through the weeks everyone needs it at once.
The payment button didn't load. An ad blocker or a filtered network is the usual reason.
to try again.