1What mechanism allows a Transformer to model relationships between tokens without using recurrence?
Transformer architecture
Easy
A.Max pooling
B.Gradient clipping
C.Self-attention
D.Convolution
Correct Answer: Self-attention
Explanation:
Transformers use self-attention to directly model relationships between tokens in a sequence.
Incorrect! Try again.
2In self-attention, what does each token attend to?
Self-attention
Easy
A.Only the final token
B.Only the previous token
C.Tokens in the same sequence
D.Tokens in another dataset
Correct Answer: Tokens in the same sequence
Explanation:
Self-attention lets each token use information from other tokens in the same input sequence.
Incorrect! Try again.
3What is the main purpose of using multiple attention heads?
Multi-head attention
Easy
A.To replace positional encoding
B.To remove token embeddings
C.To shorten every sentence
D.To learn different relationships
Correct Answer: To learn different relationships
Explanation:
Multiple heads can focus on different types of relationships, such as syntax or long-range dependencies.
Incorrect! Try again.
4Why is positional encoding added to token embeddings in a Transformer?
Positional encoding
Easy
A.To reduce vocabulary size
B.To indicate token order
C.To remove rare words
D.To label training examples
Correct Answer: To indicate token order
Explanation:
Because self-attention does not inherently represent sequence order, positional encoding provides position information.
Incorrect! Try again.
5Which Transformer component typically processes the input sequence into contextual representations?
Transformer encoder and decoder blocks
Easy
A.Encoder stack
B.Loss function
C.Vocabulary index
D.Output tokenizer
Correct Answer: Encoder stack
Explanation:
The encoder stack converts input tokens into contextual representations used by later layers.
Incorrect! Try again.
6What is the purpose of tokenization in NLP?
Tokenization methods
Easy
A.To remove every punctuation mark
B.To translate text automatically
C.To divide text into units
D.To calculate model accuracy
Correct Answer: To divide text into units
Explanation:
Tokenization divides text into units, such as words, subwords, or characters, that a model can process.
Incorrect! Try again.
7How does Byte-Pair Encoding commonly build subword tokens?
Byte-Pair Encoding
Easy
A.By translating words into labels
B.By sorting words alphabetically
C.By merging frequent symbol pairs
D.By deleting frequent word pairs
Correct Answer: By merging frequent symbol pairs
Explanation:
Byte-Pair Encoding repeatedly merges frequent adjacent symbol pairs to form useful subword units.
Incorrect! Try again.
8What kind of units does WordPiece primarily use to represent text?
WordPiece
Easy
A.Audio frames
B.Sentence labels
C.Image patches
D.Subword pieces
Correct Answer: Subword pieces
Explanation:
WordPiece represents text using subword units, helping the model handle rare and unfamiliar words.
Incorrect! Try again.
9What does it mean when a Transformer model is pretrained?
Pretrained transformer models
Easy
A.It runs without tokenization
B.It has learned from a large corpus
C.It supports only one sentence
D.It has no learned parameters
Correct Answer: It has learned from a large corpus
Explanation:
A pretrained model first learns broad language patterns from a large text corpus before task-specific training.
Incorrect! Try again.
10Which Transformer structure is primarily used by the original BERT model?
BERT
Easy
A.Recurrent-only structure
B.Encoder-only structure
C.Convolution-only structure
D.Decoder-only structure
Correct Answer: Encoder-only structure
Explanation:
BERT uses Transformer encoder blocks to learn bidirectional contextual representations.
Incorrect! Try again.
11Which task is GPT especially well suited for?
GPT
Easy
A.Autoregressive text generation
B.Audio noise removal
C.Database table sorting
D.Image edge detection
Correct Answer: Autoregressive text generation
Explanation:
GPT predicts tokens from left to right, making it well suited for generating text.
Incorrect! Try again.
12How does T5 represent many NLP tasks?
T5
Easy
A.As audio-only problems
B.As graph-only problems
C.As text-to-text problems
D.As image-to-image problems
Correct Answer: As text-to-text problems
Explanation:
T5 treats both task inputs and outputs as text, providing one format for many NLP tasks.
Incorrect! Try again.
13What does a model learn to do during masked language modeling?
Masked language modeling
Easy
A.Count all input sentences
B.Generate class identifiers
C.Remove duplicate documents
D.Predict hidden input tokens
Correct Answer: Predict hidden input tokens
Explanation:
Masked language modeling hides selected tokens and trains the model to predict their original values.
Incorrect! Try again.
14What does next sentence prediction ask a model to determine?
Next sentence prediction
Easy
A.Whether two words share a prefix
B.Whether a document has a title
C.Whether one sentence follows another
D.Whether a sentence contains punctuation
Correct Answer: Whether one sentence follows another
Explanation:
Next sentence prediction trains a model to identify whether a second sentence naturally follows a first sentence.
Incorrect! Try again.
15In causal language modeling, which information is used to predict the next token?
Causal language modeling
Easy
A.External images
B.Only future tokens
C.Previous tokens
D.Random class labels
Correct Answer: Previous tokens
Explanation:
A causal language model predicts the next token using tokens that appear earlier in the sequence.
Incorrect! Try again.
16What is transfer learning in NLP?
Transfer learning for NLP tasks
Easy
A.Training without any existing parameters
B.Converting every word into a number
C.Moving text between storage devices
D.Applying learned knowledge to a new task
Correct Answer: Applying learned knowledge to a new task
Explanation:
Transfer learning reuses knowledge from pretraining to improve performance on a different NLP task.
Incorrect! Try again.
17What is typically added to a pretrained Transformer for text classification?
Fine-tuning for text classification
Easy
A.A classification head
B.An image filter
C.A sorting algorithm
D.A speech decoder
Correct Answer: A classification head
Explanation:
A classification head maps the model's representation to labels such as positive, negative, or neutral.
Incorrect! Try again.
18What does named entity recognition identify in text?
Named entity recognition
Easy
A.Pixels, edges, and shapes
B.Rows, columns, and formulas
C.People, places, and organizations
D.Fonts, colors, and margins
Correct Answer: People, places, and organizations
Explanation:
Named entity recognition finds and labels entities such as people, locations, and organizations.
Incorrect! Try again.
19In extractive question answering, where does the answer usually come from?
Question answering
Easy
A.A random model parameter
B.A span in the given passage
C.A hidden image region
D.A separate audio recording
Correct Answer: A span in the given passage
Explanation:
Extractive question answering selects a continuous span of text from the provided context.
Incorrect! Try again.
20What does the HuggingFace Transformers library primarily provide?
HuggingFace Transformers
Easy
A.Pretrained models and NLP tools
B.Spreadsheet templates and formulas
C.Three-dimensional rendering engines
D.Operating system device drivers
Correct Answer: Pretrained models and NLP tools
Explanation:
HuggingFace Transformers provides pretrained models, tokenizers, and utilities for common NLP workflows.
Incorrect! Try again.
21A Transformer processes a sequence without using recurrence. Which mechanism allows each token representation to incorporate information from other tokens in the same layer?
Transformer architecture
Medium
A.Self-attention over token representations
B.A lookup table of sentence labels
C.A recurrent hidden-state update
D.A fixed convolution over characters
Correct Answer: Self-attention over token representations
Explanation:
Self-attention allows every token to assign weights to other tokens and combine their representations, enabling global interaction without recurrence.
Incorrect! Try again.
22In scaled dot-product attention, why is the query-key dot product divided by ?
Self-attention
Medium
A.To guarantee equal attention for all tokens
B.To remove positional information from keys
C.To increase the number of attention heads
D.To reduce the variance of large dot products
Correct Answer: To reduce the variance of large dot products
Explanation:
When the key dimension is large, dot products can have large magnitudes and produce saturated softmax values. Scaling by helps maintain stable gradients.
Incorrect! Try again.
23Why can multi-head attention represent relationships that a single attention head might miss?
Multi-head attention
Medium
A.Each head receives a completely different input sentence
B.Each head replaces the feed-forward sublayer
C.Each head removes the need for tokenization
D.Each head can learn a different projection and relationship pattern
Correct Answer: Each head can learn a different projection and relationship pattern
Explanation:
Different heads project the inputs into different subspaces, allowing them to focus on patterns such as syntax, long-distance dependencies, or semantic similarity.
Incorrect! Try again.
24A Transformer receives the same set of token embeddings in two different orders. What is the main purpose of positional encoding in this situation?
Positional encoding
Medium
A.To make the representations sensitive to token order
B.To convert words into subword vocabulary entries
C.To prevent attention from using query vectors
D.To assign a unique class label to each position
Correct Answer: To make the representations sensitive to token order
Explanation:
Self-attention alone does not inherently distinguish token order. Positional encodings add position-dependent information so different sequences can produce different representations.
Incorrect! Try again.
25During text generation, which attention pattern is required in a Transformer decoder to prevent a token from using future target tokens?
Transformer encoder and decoder blocks
Medium
A.A causal mask on decoder self-attention
B.A padding mask on encoder outputs
C.A larger embedding dimension for target tokens
D.A shared vocabulary for source and target text
Correct Answer: A causal mask on decoder self-attention
Explanation:
A causal mask blocks attention to future positions, ensuring that each generated token depends only on earlier tokens and the current decoding context.
Incorrect! Try again.
26A tokenizer represents an unfamiliar word using several meaningful or partially meaningful pieces instead of mapping it to one unknown token. What advantage does this provide?
Tokenization methods
Medium
A.It guarantees one token per word
B.It reduces out-of-vocabulary problems
C.It removes the need for model training
D.It preserves every word as an unchanged string
Correct Answer: It reduces out-of-vocabulary problems
Explanation:
Subword tokenization can represent rare or unseen words by combining known pieces, reducing reliance on a single unknown-token symbol.
Incorrect! Try again.
27In Byte-Pair Encoding for subword tokenization, a frequent adjacent symbol pair is repeatedly merged. If t and h frequently occur together, what may happen after training?
Byte-Pair Encoding
Medium
A.Every word containing t is deleted
B.The vocabulary is limited to single characters
C.The pair t h may become the token th
D.The pair t h is always replaced by an unknown token
Correct Answer: The pair t h may become the token th
Explanation:
BPE builds subword units by merging frequent adjacent symbols. A frequent pair such as t and h can therefore become a reusable subword token.
Incorrect! Try again.
28A WordPiece tokenizer splits the word "unhappiness" into un, ##happi, and ##ness. What does the ## marker usually indicate?
WordPiece
Medium
A.The piece must be converted into an uppercase token
B.The piece represents a sentence boundary
C.The piece continues a word rather than starting one
D.The piece was generated by a character-level model
Correct Answer: The piece continues a word rather than starting one
Explanation:
In common WordPiece notation, ## marks a subword that attaches to the preceding piece without beginning a new word.
Incorrect! Try again.
29A team has limited labeled data for sentiment analysis but access to a large pretrained Transformer. Which strategy is generally most appropriate?
Pretrained transformer models
Medium
A.Freeze all parameters and omit a task-specific prediction layer
B.Use random labels to adapt the output layer
C.Discard the pretrained weights and train only a tokenizer
D.Fine-tune the pretrained model on labeled sentiment examples
Correct Answer: Fine-tune the pretrained model on labeled sentiment examples
Explanation:
Fine-tuning adapts general language representations learned during pretraining to the target task, which is useful when labeled data is limited.
Incorrect! Try again.
30Why is BERT particularly suitable for classifying a sentence based on both earlier and later context?
BERT
Medium
A.Its training objective removes all sentence context
B.Its tokenizer contains only complete words
C.Its encoder uses bidirectional self-attention
D.Its decoder predicts only the next word
Correct Answer: Its encoder uses bidirectional self-attention
Explanation:
BERT's encoder can attend to tokens on both sides of a position, producing context-sensitive representations that use the full input sequence.
Incorrect! Try again.
31Which task aligns most directly with the original design of a GPT-style Transformer?
GPT
Medium
A.Assigning a label to every input character
B.Predicting masked tokens using both sequence directions
C.Aligning two sentences with no language modeling
D.Generating the next token from preceding tokens
Correct Answer: Generating the next token from preceding tokens
Explanation:
GPT models use decoder-style causal language modeling, where each token is predicted from the tokens that precede it.
Incorrect! Try again.
32A T5 model is fine-tuned to answer questions. How is the task typically represented for the model?
T5
Medium
A.As a sentence pair mapped only to a binary mask
B.As token embeddings mapped directly to attention weights
C.As text input mapped to text output
D.As an image input mapped to a class index
Correct Answer: As text input mapped to text output
Explanation:
T5 uses a text-to-text framework. A question and its context are provided as text, and the answer is generated as text.
Incorrect! Try again.
33During masked language model pretraining, a model sees the sentence "The cat sat on the [MASK]." Which prediction best describes the training target?
Masked language modeling
Medium
A.The position of the sentence in the dataset
B.The original token at the masked position
C.The complete document topic label
D.The token that follows the final period
Correct Answer: The original token at the masked position
Explanation:
Masked language modeling trains the model to reconstruct selected original tokens using their surrounding context.
Incorrect! Try again.
34In the next sentence prediction objective, what does the model typically learn to determine?
Next sentence prediction
Medium
A.Whether a paragraph contains a masked word
B.Whether a token should be split into characters
C.Whether one sentence logically follows another
D.Whether every word is correctly spelled
Correct Answer: Whether one sentence logically follows another
Explanation:
Next sentence prediction uses sentence pairs and asks the model to classify whether the second sentence follows the first in the original text.
Incorrect! Try again.
35For the token sequence , what conditional factorization is used by a causal language model?
Causal language modeling
Medium
A.
B.
C.
D. without conditional terms
Correct Answer:
Explanation:
Causal language modeling factorizes the sequence from left to right. Each token is predicted using only the tokens before it.
Incorrect! Try again.
36What is the main benefit of transferring a pretrained language model to a new NLP task?
Transfer learning for NLP tasks
Medium
A.It eliminates the need to select an evaluation metric
B.It ensures that all downstream tasks use identical labels
C.It guarantees perfect performance without task data
D.It reuses general linguistic representations learned from broad data
Correct Answer: It reuses general linguistic representations learned from broad data
Explanation:
Pretraining captures reusable patterns in language. Transfer learning adapts these patterns to a downstream task with less task-specific data and computation.
Incorrect! Try again.
37A binary text classifier is built with BERT. Which change is normally made to produce the final prediction?
Fine-tuning for text classification
Medium
A.Train only the positional encoding values
B.Add a classification head over a sequence representation
C.Replace all attention layers with a single recurrent cell
D.Remove the tokenizer and classify raw characters
Correct Answer: Add a classification head over a sequence representation
Explanation:
A task-specific classification layer maps a pooled or special-token representation to class scores. The pretrained parameters may then be updated during fine-tuning.
Incorrect! Try again.
38For named entity recognition, why are predictions usually made for individual tokens rather than only for the entire sentence?
Named entity recognition
Medium
A.Token labels prevent the use of pretrained models
B.Sentence-level labels cannot be represented numerically
C.Each token may have a different entity label
D.Every sentence contains exactly one entity
Correct Answer: Each token may have a different entity label
Explanation:
NER is a sequence-labeling task. Tokens can receive labels such as B-PER, I-PER, B-ORG, or O, so predictions are made across the sequence.
Incorrect! Try again.
39In extractive question answering, the answer is contained in a context passage. What does the model typically predict?
Question answering
Medium
A.A new vocabulary for the question
B.The start and end positions of the answer span
C.A single sentiment label for the passage
D.The next sentence after the passage
Correct Answer: The start and end positions of the answer span
Explanation:
Extractive QA models usually assign scores to possible start and end token positions, identifying a span from the supplied context.
Incorrect! Try again.
40When using HuggingFace Transformers for a pretrained model, why should the tokenizer match the model checkpoint?
HuggingFace Transformers
Medium
A.It ensures that every input contains the same number of words
B.It preserves the checkpoint's vocabulary and token-ID mapping
C.It guarantees that the model will not require fine-tuning
D.It changes the Transformer into a recurrent network
Correct Answer: It preserves the checkpoint's vocabulary and token-ID mapping
Explanation:
The model's embedding matrix is indexed by token IDs learned with its associated tokenizer. Using a different tokenizer can produce incompatible or incorrect inputs.
Incorrect! Try again.
41A Transformer processes a sequence of length with hidden size . Ignoring constants and feed-forward layers, which change most directly reduces the asymptotic self-attention cost while preserving ?
Transformer architecture
Hard
A.Reducing each head dimension while keeping fixed
B.Reducing the number of heads from to
C.Reducing the sequence length from to
D.Sharing projection matrices across adjacent layers
Correct Answer: Reducing the sequence length from to
Explanation:
Dense self-attention costs . Halving reduces its leading computation by about a factor of four; changing the head count while preserving does not change this asymptotic cost.
Incorrect! Try again.
42For and , what is the first output row of scaled dot-product self-attention with key dimension and no mask?
Self-attention
Hard
A., where
B., where
C., where
D., where
Correct Answer: , where
Explanation:
The first query has scaled scores , so its attention weights are . Multiplying these weights by gives .
Incorrect! Try again.
43A model has and 12 attention heads. It is changed to 24 heads while all query, key, value, and output projections remain dense matrices. Which statement is correct?
Multi-head attention
Hard
A.Each head dimension becomes 32, while projection parameter counts remain unchanged
B.Each head dimension remains 64, while projection parameter counts double
C.Each head dimension remains 64, while projection parameter counts remain unchanged
D.Each head dimension becomes 32, while projection parameter counts are halved
Correct Answer: Each head dimension becomes 32, while projection parameter counts remain unchanged
Explanation:
With equal-sized heads, . Dense projections still map 768 dimensions to 768 dimensions, so their parameter counts do not depend on the head partition.
Incorrect! Try again.
44Why can sinusoidal positional encodings support reasoning about relative offsets without learning a separate vector for every offset?
Positional encoding
Hard
A.Each frequency is learned so that unseen positions interpolate between training positions
B.The encoding makes attention scores invariant to all permutations of the input tokens
C.A fixed linear transformation relates the encoding at to that at for fixed
D.Every relative offset is represented by a unique one-hot subvector shared across positions
Correct Answer: A fixed linear transformation relates the encoding at to that at for fixed
Explanation:
Angle-addition identities express sine and cosine at as linear combinations of those at . For a fixed offset , this relation is position-independent.
Incorrect! Try again.
45During teacher-forced training of a standard encoder-decoder Transformer, which masking configuration is required?
Transformer encoder and decoder blocks
Hard
A.Encoder padding mask, bidirectional decoder self-attention, and causal cross-attention mask
B.Causal encoder mask, padding decoder self-attention mask, and unmasked cross-attention
The encoder must ignore source padding, the decoder must not see future target tokens, and cross-attention must ignore padded encoder positions.
Incorrect! Try again.
46A production NLP system must accept arbitrary Unicode input without emitting an unknown-token symbol. Which tokenizer design most directly guarantees this property, assuming valid byte input?
Tokenization methods
Hard
A.A word-level tokenizer built from a very large multilingual corpus
B.A morpheme tokenizer with language-specific fallback dictionaries
C.A byte-level tokenizer whose base vocabulary contains every byte value
D.A character tokenizer containing only observed Unicode code points
Correct Answer: A byte-level tokenizer whose base vocabulary contains every byte value
Explanation:
Any encoded string is a sequence of bytes, so a vocabulary covering all byte values can represent arbitrary input. Corpus-derived word or character vocabularies can still encounter unseen units.
Incorrect! Try again.
47A BPE trainer starts with the segmented corpus low low lower represented as characters plus end-of-word markers. If (l,o) and (o,w) have equal maximum frequency, what is required for independently trained tokenizers to produce identical vocabularies?
Byte-Pair Encoding
Hard
A.A deterministic tie-breaking rule and the same ordered training corpus
B.A shared unknown token and the same maximum token length
C.A common normalization form and randomly selected merge ties
D.A larger merge budget and independently shuffled training examples
Correct Answer: A deterministic tie-breaking rule and the same ordered training corpus
Explanation:
Tied pair frequencies can lead to different first merges, which changes later statistics. Deterministic tie resolution and identical preprocessing/order are needed for reproducible merge sequences.
Incorrect! Try again.
48Compared with frequency-only BPE merging, a WordPiece-style merge score favors a pair with high joint frequency relative to its component frequencies. Which pair is therefore most likely to be preferred?
WordPiece
Hard
A., , and
B., , and
C., , and
D., , and
Correct Answer: , , and
Explanation:
Using the common score , the values are , , , and . The first pair has the strongest association despite its lower raw count.
Incorrect! Try again.
49A task requires assigning a label using both left and right context around every token, while inference is non-generative. Which pretrained architecture-objective pairing offers the closest inductive match?
Pretrained transformer models
Hard
A.A decoder-only Transformer trained with causal token prediction
B.An encoder-only Transformer trained with masked token prediction
C.A decoder-only Transformer trained with left-to-right sentence ordering
D.An encoder-decoder Transformer trained only with prefix continuation
Correct Answer: An encoder-only Transformer trained with masked token prediction
Explanation:
Masked-token pretraining develops bidirectional contextual representations at each position, matching token labeling that depends on both left and right context.
Incorrect! Try again.
50In original BERT input construction for sentence-pair classification, what distinguishes tokens from sentence A and sentence B before the encoder layers?
BERT
Hard
A.Their positional indices restart at zero when sentence B begins
B.Their token embeddings are projected through separate encoder parameter sets
C.Their attention heads are partitioned into sentence-specific groups
D.Their token embeddings are summed with different learned segment embeddings
Correct Answer: Their token embeddings are summed with different learned segment embeddings
Explanation:
BERT sums token, position, and token-type embeddings. Token-type IDs distinguish sentence A from sentence B while both pass through the same encoder.
Incorrect! Try again.
51A decoder-only GPT model is trained on packed documents. Which attention mask prevents both future-token leakage and information flow across document boundaries?
GPT
Hard
A.A block-diagonal lower-triangular mask aligned with document boundaries
B.A global bidirectional mask with padding positions removed
C.A global lower-triangular mask spanning every packed document
D.A block-diagonal bidirectional mask aligned with document boundaries
Correct Answer: A block-diagonal lower-triangular mask aligned with document boundaries
Explanation:
Lower-triangular blocks enforce causality within each document, while the block boundaries prevent tokens from attending to unrelated packed documents.
Incorrect! Try again.
52T5 pretraining replaces multiple contiguous spans with sentinel tokens. Which target format is consistent with its span-corruption objective?
T5
Hard
A.Sentinel token, first missing span, next sentinel token, second missing span
B.One sentinel token followed by every uncorrupted token from the input
C.All missing tokens in original order without any sentinel boundary tokens
D.Original input sequence with corrupted spans replaced by ordinary mask tokens
Correct Answer: Sentinel token, first missing span, next sentinel token, second missing span
Explanation:
The encoder input marks each removed span with a distinct sentinel. The decoder target concatenates each sentinel with its corresponding missing span in order.
Incorrect! Try again.
53In BERT-style masking, selected tokens are not always replaced by [MASK]; some remain unchanged or become random tokens. What mismatch is this strategy primarily intended to reduce?
Masked language modeling
Hard
A.The difference between bidirectional and causal attention computation
B.The imbalance between positive and negative next-sentence examples
C.The variation in subword vocabulary size across downstream datasets
D.The absence of the artificial [MASK] token during downstream inference
Correct Answer: The absence of the artificial [MASK] token during downstream inference
Explanation:
Downstream inputs normally contain no [MASK]. Occasionally retaining or randomly replacing selected tokens reduces overdependence on a symbol seen mainly during pretraining.
Incorrect! Try again.
54Why can randomly sampled negative pairs make next sentence prediction solvable through shortcuts rather than discourse understanding?
Next sentence prediction
Hard
A.Negative sentences may differ in topic or document style from positive continuations
B.Positive continuations are encoded causally while negative pairs are bidirectional
D.Negative pairs necessarily reverse the grammatical order of both sentences
Correct Answer: Negative sentences may differ in topic or document style from positive continuations
Explanation:
A model can exploit topic, source, or style mismatch to identify random negatives without learning whether one sentence coherently follows another.
Incorrect! Try again.
55A causal language model assigns token probabilities , , and to the three observed next tokens. Using natural logarithms, what is the mean token negative log-likelihood?
Causal language modeling
Hard
A.
B.
C.
D.
Correct Answer:
Explanation:
The mean is .
Incorrect! Try again.
56A pretrained encoder performs well on general text but overfits a 500-example legal dataset during full fine-tuning. Which intervention most directly reduces trainable capacity while retaining task adaptation?
Transfer learning for NLP tasks
Hard
A.Freeze the encoder and train a task-specific classification head
B.Unfreeze every layer and increase the learning rate uniformly
C.Expand the hidden size and preserve the original dropout rate
D.Reinitialize the encoder and train all parameters from scratch
Correct Answer: Freeze the encoder and train a task-specific classification head
Explanation:
Freezing the pretrained encoder sharply reduces the number of trainable parameters. The new head can adapt representations to labels with less overfitting risk.
Incorrect! Try again.
57A classifier truncates every document to the first 512 tokens, but decisive evidence often appears near the end. Which change addresses the information-loss mechanism most directly?
Fine-tuning for text classification
Hard
A.Apply label smoothing while preserving the same truncated input
B.Increase dropout in the classification head while keeping first-token truncation
C.Classify overlapping chunks and aggregate their document-level evidence
D.Lower the encoder learning rate while keeping first-token truncation
Correct Answer: Classify overlapping chunks and aggregate their document-level evidence
Explanation:
Chunking exposes later content to the encoder, and aggregation combines evidence across the document. The other changes regularize optimization but do not recover discarded text.
Incorrect! Try again.
58The word Washington is split into Wash, ##ing, and ##ton. Under a first-subtoken labeling scheme, how should loss and prediction alignment usually be handled?
Named entity recognition
Hard
A.Assign the entity label to Wash and ignore the other subtokens in the loss
B.Assign B-LOC independently to all three subtokens and score every position
C.Assign the entity label only to ##ton and ignore the preceding subtokens
D.Assign B-LOC, I-LOC, I-LOC and treat them as three gold words
Correct Answer: Assign the entity label to Wash and ignore the other subtokens in the loss
Explanation:
First-subtoken alignment preserves one supervised decision per original word. Continuation subtokens commonly receive an ignore index so they do not distort word-level evaluation or loss.
Incorrect! Try again.
59In extractive QA, a model independently scores start and end positions. Which decoding rule avoids invalid spans while respecting a maximum answer length ?
Question answering
Hard
A.Choose the maximum start and maximum end independently, then reorder them
B.Choose the shortest span containing either the best start or best end position
C.Maximize subject to and
D.Maximize subject only to $i
e j$ and no length restriction
Correct Answer: Maximize subject to and
Explanation:
Joint constrained decoding combines start and end logits while enforcing valid order and length. Independent argmax decisions can produce reversed or implausibly long spans.
Incorrect! Try again.
60A HuggingFace token-classification pipeline pads batches to different lengths. Which setup ensures padded positions neither affect encoder attention nor contribute to cross-entropy loss?
HuggingFace Transformers
Hard
A.Set attention_mask to 1 and labels to 0 at padded positions
B.Set attention_mask to 0 and labels to -100 at padded positions
C.Set input_ids to 0 and labels to the outside tag at padded positions
D.Set token_type_ids to 0 and labels to -1 at padded positions
Correct Answer: Set attention_mask to 0 and labels to -100 at padded positions
Explanation:
The attention mask excludes padding from attention, while HuggingFace token-classification losses conventionally use -100 as the ignored label index.
Incorrect! Try again.
Did this save you a night before the exam?
LPU Notes is free, and it stays free. 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.
Nothing here is ever locked, and nothing unlocks. Chip in only if it was worth it.
What it pays for →