Transformers and Large Language Models
- 83Unfamiliar
- 0Learning
- 0Familiar
- 0Mastered
83 questions
- 1In the 2010s, language processing commonly used a different model for each_____rather than one general-purpose model.
Hint
Think of tasks such as translation or sentiment classification.
Answer
use case
Explanation
Before broadly capable language models, systems were typically designed for specific tasks, such as translation, sentiment extraction, or identifying names and locations.
- 2A model that determines whether a review is positive, negative, or neutral is performing_____extraction.
Hint
It identifies the attitude expressed in a text.
Answer
sentiment
Explanation
Sentiment extraction classifies the opinion or emotional tone of text, for example as positive, negative, or neutral.
- 3The 2017 paper “Attention Is All You Need” introduced the_____architecture.
Hint
This architecture is based on attention rather than recurrence through tokens.
Answer
transformer
Explanation
The paper introduced the transformer, which uses attention mechanisms to build representations of sequences.
- 4The transformer was considered scalable because increasing data, compute, and model parameters could produce substantial_____gains.
Hint
This is an improvement in how well the model performs.
Answer
performance
Explanation
Scaling the amount of data, compute, and model parameters was associated with performance gains greater than those commonly seen in earlier approaches.
- 5The release of ChatGPT in 2022 was a turning point in how widely people interacted with_____.
Hint
These systems let people communicate with a model through conversation.
Answer
chatbots
Explanation
The release brought many people into direct, conversational interaction with a language model.
- 6Modern LLMs developed in part by scaling transformers in model size and in the number of training_____.
Hint
These are the text units processed by the model during training.
Answer
tokens
Explanation
Transformers were scaled both in the number of model parameters and in the number of tokens on which they were trained.
- 7A system that moves beyond conversation to take actions toward goals exhibits_____behavior.
Hint
This term describes behavior associated with agents that act, not just respond.
Answer
agentic
Explanation
Agentic behavior refers to language-model systems acting in more capable ways, such as through coding agents and other applications.
- 8Because models process numbers rather than raw text, tokenization turns text into units that can ultimately be represented_____.
Hint
Think about the kind of input mathematical models can process.
Answer
numerically
Explanation
Models work with numerical representations, so text must first be divided into units and represented in a numerical form.
- 9Tokenization is the process of dividing text into_____entities.
Hint
Each resulting unit is treated as an atomic piece by the tokenizer.
Answer
indivisible
Explanation
Tokenization divides text into units called tokens, which the tokenizer treats as indivisible entities.
- 10Each unit produced by a tokenizer is called a_____.
Hint
It is one of the text units that a model represents numerically.
Answer
token
Explanation
A token is an individual unit produced by dividing text during tokenization.
- 11The set of all tokens permitted by a tokenizer is its_____.
Hint
It lists the tokenizer’s available token units.
Answer
vocabulary
Explanation
A vocabulary contains the possible tokens that a tokenizer can use to represent text.
- 12For a fixed text, choosing a different vocabulary can change the number of tokens, or the_____length.
Hint
This length counts the units produced when text is split.
Answer
sequence
Explanation
Different vocabularies may divide the same text into different numbers of tokens, changing its sequence length.
- 13A word-level tokenizer can be simple and interpretable because each token corresponds to a_____.
Hint
This approach commonly uses spaces as delimiters.
Answer
word
Explanation
In word-level tokenization, words are tokens, making the mapping between a token and a word straightforward to interpret.
- 14A drawback of word-level tokenization is that many word forms and variations can make its vocabulary very_____.
Hint
Consider how singulars, plurals, and other variations add distinct entries.
Answer
large
Explanation
Word-level tokenization may require separate vocabulary entries for many variations of words, increasing vocabulary size.
- 15If a word-level tokenizer encounters a word absent from its training data and vocabulary, it faces an out-of-vocabulary_____.
Hint
The model lacks a learned representation for the unseen word.
Answer
problem
Explanation
An out-of-vocabulary problem occurs when a token is encountered at inference time but was not included in the vocabulary learned from training data.
- 16Character-level tokenization reduces vocabulary size and can handle misspellings, but typically creates a much longer_____.
Hint
A word must be represented using several small units.
Answer
sequence
Explanation
Representing text character by character uses fewer token types and can be robust to spelling variation, but it increases the number of tokens in an input.
- 17A compromise between word-level and character-level tokenization is_____tokenization.
Hint
Its units are smaller than words but can combine common letter sequences.
Answer
subword
Explanation
Subword tokenization splits text into units between the size of whole words and individual characters.
- 18Subword tokenization can make related forms such as “bear” and “bears” share a common_____.
Hint
This is the central word element shared by related forms.
Answer
root
Explanation
By representing common word roots, subword tokenization can share units across related forms such as singular and plural words.
- 19BPE builds a vocabulary by repeatedly merging the most frequent pairs of tokens until it reaches a desired vocabulary_____.
Hint
This is the target number of available token types.
Answer
size
Explanation
BPE begins with an initial set of tokens, identifies frequent pairs, adds merged tokens, and repeats until reaching a chosen vocabulary size.
- 20For multilingual use, a tokenizer should be trained on a corpus that represents all the languages of_____.
Hint
The data should reflect the languages the application needs to handle.
Answer
interest
Explanation
Training a tokenizer on representative text from the target languages helps ensure that the vocabulary can tokenize those languages effectively.
- 21A special token used to represent text not present in the vocabulary is the_____token.
Hint
It stands in for a piece of text the tokenizer does not recognize.
Answer
unknown
Explanation
The unknown token is a dedicated token used for out-of-vocabulary text.
- 22The token that signals the start of a sequence to be generated is the beginning of sequence, or_____token.
Hint
It is the standard abbreviation for beginning of sequence.
Answer
BOS
Explanation
A BOS token can be supplied to indicate that the model should begin generating text.
- 23The token that signals that generation has finished is the end of sequence, or_____token.
Hint
It is the standard abbreviation for end of sequence.
Answer
EOS
Explanation
An EOS token marks the end of generated text and can tell a system to stop generation.
- 24A special token used to make sequences reach a chosen length is the_____token.
Hint
It fills space so sequences can share dimensions for efficient processing.
Answer
padding
Explanation
Padding tokens can make sequences the same length, which is useful when representing batches as matrices or tensors.
- 25Names and spellings for special tokens are not universal, so different systems may use different_____.
Hint
These are agreed-upon ways of representing tokens and roles.
Answer
conventions
Explanation
The written forms of tokens such as BOS, EOS, and padding vary across systems; the conventions are not universal.
- 26Tokens that identify conversational roles, such as user and assistant, are also represented with_____tokens.
Hint
They are dedicated tokens that convey information beyond ordinary text content.
Answer
special
Explanation
Special tokens can indicate conversational roles, including user and assistant, as well as sequence boundaries or other structural information.
- 27A vocabulary of roughly hundreds of thousands of entries is a typical order of magnitude for some current LLM_____.
Hint
These systems determine how text is divided into tokens.
Answer
tokenizers
Explanation
The lecture described current LLM vocabularies as being on the order of hundreds of thousands of tokens, with an example around 200,000.
- 28A one-hot encoding assigns each token a distinct vector, making different token vectors_____to one another.
Hint
Their pairwise dot products do not indicate semantic similarity.
Answer
orthogonal
Explanation
Different one-hot vectors have zero dot products, so they do not express meaningful relationships between tokens.
- 29Useful token representations should reflect how_____the represented tokens are to one another.
Hint
For example, related concepts should have representations that are close in some sense.
Answer
similar
Explanation
Meaningful representations encode relationships between tokens, such as a teddy bear and the quality “soft.”
- 30Word2vec learns useful representations through a_____task that supports a different end goal.
Hint
It is an intermediate learning objective rather than the final application itself.
Answer
proxy
Explanation
A proxy task is learned to produce representations useful for some other goal, such as language understanding or prediction.
- 31The word2vec variant that predicts a word from its surrounding context words is called continuous bag of_____.
Hint
The name is commonly abbreviated CBOW.
Answer
words
Explanation
Continuous bag of words predicts a target word from context words surrounding it.
- 32The word2vec variant that predicts surrounding words from a given word is called skip_____.
Hint
This is the other commonly discussed word2vec objective.
Answer
gram
Explanation
Skip gram predicts context words that surround a given input word.
- 33In a basic word-prediction network, the hidden or latent representation has dimension_____.
Hint
The lecture used this symbol for a dimension typically smaller than vocabulary size.
Answer
D
Explanation
The hidden representation has size D, a chosen dimension that is typically much smaller than vocabulary size.
- 34A model’s predicted probability vector must have one entry for each vocabulary item, so its size is_____.
Hint
This symbol denotes the vocabulary size.
Answer
V
Explanation
The output layer predicts a probability for every token, giving an output vector of size V, where V is the vocabulary size.
- 35A_____function can normalize predicted token scores so that they form probabilities that sum to one.
Hint
It converts a collection of scores into a probability distribution.
Answer
softmax
Explanation
Softmax transforms output scores into probabilities over the vocabulary, with probabilities summing to one.
- 36When word2vec is trained, its learned hidden representations can place semantically related words near each other in representation_____.
Hint
This is the mathematical space in which vectors can be compared.
Answer
space
Explanation
The learned representations can encode semantic relationships, such as associations between Paris and France or between a teddy bear and softness.
- 37A limitation of static word representations is that a word such as “bank” receives the same representation even when its intended_____changes.
Hint
Compare a river bank with a financial institution.
Answer
meaning
Explanation
A static embedding does not vary with sentence context, so it cannot by itself distinguish different meanings of the same word.
- 38Because word2vec does not encode word order, reversing who hugs whom can leave the same set of word_____and produce indistinguishable input representations.
Hint
These are the vector representations associated with the words.
Answer
embeddings
Explanation
A bag-of-words-style representation ignores order, so sentences containing the same words in different orders may receive the same representations.
- 39An RNN maintains a_____state that summarizes the sequence seen so far.
Hint
This state is updated as each input token is processed.
Answer
hidden
Explanation
An RNN carries a hidden state from one token to the next to represent information about the sequence processed so far.
- 40Unlike a static word embedding, an RNN’s representation can account for word_____by incorporating the hidden state from earlier tokens.
Hint
The sequence in which tokens appear affects the evolving state.
Answer
order
Explanation
Because an RNN processes tokens sequentially and updates its state, it can represent information about their order.
- 41For sequence classification, an RNN can process tokens one at a time and use its evolving state to predict a class such as_____.
Hint
This class describes whether text is positive, negative, or neutral.
Answer
sentiment
Explanation
RNNs were used for classification tasks such as sentiment extraction, where the model predicts a label based on the sequence.
- 42A word-level classification task can use RNN representations to determine whether each word is a noun or a_____.
Hint
This is another grammatical category mentioned as an example.
Answer
verb
Explanation
For tasks such as part-of-speech classification, RNN-based systems can use contextual representations to classify each word.
- 43An RNN may struggle to preserve information about events far back in a sequence, a difficulty known as long-range_____.
Hint
The name describes a relationship between elements separated by a large distance in the sequence.
Answer
dependency
Explanation
Long-range dependency is the difficulty of retaining and using information from much earlier in a sequence.
- 44The long-range dependency problem in RNNs is connected to the_____gradient problem during backpropagation.
Hint
This gradient problem involves signals becoming too small as they propagate.
Answer
vanishing
Explanation
The lecture connected RNN long-range dependency limitations to the vanishing gradient problem during backpropagation.
- 45An LSTM attempts to retain information for longer by adding a_____state alongside the hidden state.
Hint
This additional state is part of the name long short-term memory.
Answer
cell
Explanation
Long short-term memory (LSTM) models maintain both a hidden state and a cell state intended to carry information for longer.
- 46Because a basic RNN must process tokens one at a time, its sequential computation can make training very_____.
Hint
The next step depends on the state produced by the previous step.
Answer
slow
Explanation
RNN computation is sequential: the model must update its hidden state token by token, which can make training slow.
- 47Attention improves access to earlier context by allowing direct connections from a token to relevant tokens in the_____.
Hint
These are tokens that appeared earlier in the sequence.
Answer
past
Explanation
Instead of relying only on a single accumulated hidden state, attention lets a model directly connect to earlier tokens when making a prediction.
- 48In self-attention, a token’s representation is computed as a function of other tokens in the same_____.
Hint
The tokens belong to the input being processed together.
Answer
sequence
Explanation
Self-attention allows each token to use information from other tokens in its sequence when constructing its representation.
- 49In attention, the_____is the representation that searches for relevant information to construct a token’s representation.
Hint
It is compared against keys to determine which tokens are relevant.
Answer
query
Explanation
A query represents what a token is looking for when identifying useful information from other tokens.
- 50In attention,_____are compared with a query to assess how relevant each token is.
Hint
Each token has one of these representations, paired with a value.
Answer
keys
Explanation
Keys are compared with a query, commonly using a dot product, to determine attention weights over tokens.
- 51In attention, the_____vectors provide the information combined using the attention weights.
Hint
After relevance weights are found, these vectors are weighted and summed.
Answer
value
Explanation
Values contain the information that is combined according to the weights computed from query-key similarity.
- 52Query, key, and value representations are produced from input representations using learned_____matrices.
Hint
These matrices map inputs into the query, key, and value spaces.
Answer
projection
Explanation
Learned projection matrices transform input token representations into queries, keys, and values.
- 53A query-key dot product provides a measure of their_____in the attention calculation.
Hint
A larger score can indicate that a token is more relevant to the query.
Answer
similarity
Explanation
The dot product between a query and a key is used as a similarity score that helps determine how strongly the corresponding value contributes.
- 54The original transformer uses an_____and a decoder for machine translation.
Hint
It processes the source-language text before translation is generated.
Answer
encoder
Explanation
The transformer’s encoder computes representations of the source text; its decoder uses them to generate a translation.
- 55The encoder’s role is to compute meaningful representations of the input_____text.
Hint
This is the language from which a translation is made.
Answer
source
Explanation
In machine translation, the encoder processes the source-language text and produces representations used by the decoder.
- 56The decoder uses the encoder’s representations and its own generated context to produce the_____text.
Hint
This is the language into which the source is translated.
Answer
target
Explanation
The decoder produces the target-language sequence using information from the encoded source and the tokens generated so far.
- 57The input representation in the original transformer combines a token embedding with a_____embedding.
Hint
This added information tells the model where a token appears in the sequence.
Answer
position
Explanation
Adding positional information to token embeddings gives the model information about token locations and order.
- 58A limitation of learned position embeddings is that they may not represent positions beyond the largest position seen during_____.
Hint
The model learns its position representations from data during this phase.
Answer
training
Explanation
If learned position embeddings exist only up to a fixed position, a longer input may include positions for which no embedding was learned.
- 59The original transformer also described position representations built from sine and cosine functions at different_____.
Hint
Different rates of variation help distinguish positions.
Answer
frequencies
Explanation
Sinusoidal position representations use sine and cosine functions at different frequencies to encode position information.
- 60The encoder’s self-attention layer computes each token’s representation using information from other tokens in the_____.
Hint
Unlike an RNN state, the computation can directly use other tokens in the input.
Answer
sequence
Explanation
Encoder self-attention creates context-aware token representations by allowing tokens to attend to other tokens in the input sequence.
- 61After self-attention, the encoder uses a feed-forward neural network to project representations and learn_____.
Hint
Activation functions allow the network to model relationships that are not merely linear.
Answer
nonlinearities
Explanation
The feed-forward neural network includes an activation function and provides the transformer with the capacity to learn nonlinear transformations.
- 62In a decoder, masked self-attention prevents a token from using tokens that have not yet been_____.
Hint
Generation proceeds from earlier tokens to later ones.
Answer
decoded
Explanation
Masked self-attention ensures that each position can attend only to itself and earlier generated tokens, not future tokens.
- 63In cross-attention, decoder representations act as queries, while encoder representations provide the keys and_____.
Hint
These encoder quantities supply information about the source text.
Answer
values
Explanation
Cross-attention lets decoder tokens use the encoder’s source-text representations, with decoder states as queries and encoder states as keys and values.
- 64After the decoder produces a token representation, a projection and softmax produce a probability distribution over the_____.
Hint
The model must select its next token from this set.
Answer
vocabulary
Explanation
The output layer maps a decoder representation to scores for vocabulary tokens and uses softmax to produce next-token probabilities.
- 65Generating one token, feeding it back, and repeating the process is called_____generation.
Hint
Each new output depends on previously generated output.
Answer
autoregressive
Explanation
In autoregressive generation, the model predicts a token, adds it to the context, and then predicts the next token.
- 66The decoder stops generating when it produces the_____token.
Hint
This special token marks completion of the output sequence.
Answer
end of sequence
Explanation
An end-of-sequence token signals that generation, such as a translation, is finished.
- 67In the attention calculation, multiplying the query matrix by the transposed key matrix produces pairwise query-key_____scores.
Hint
Each entry compares one query with one key.
Answer
similarity
Explanation
The product QKT contains dot products between queries and keys, giving a score for each query-key pair.
- 68The query-key score matrix for a sequence of length n has dimensions n by_____.
Hint
There is one score for every query-position and key-position pair.
Answer
n
Explanation
With n queries and n keys, the matrix QKT has shape n×n.
- 69Applying softmax to attention scores makes the weights for each query sum to_____.
Hint
They form a probability distribution over the keys.
Answer
one
Explanation
Softmax normalizes the scores into weights that sum to one for each query, allowing a weighted combination of values.
- 70Scaled dot-product attention divides query-key scores by the square root of the key dimension, written as_____outside the blank.
Hint
The scaling factor depends on the dimension of the key vectors.
Answer
DK
Explanation
The attention formula scales dot products by DK to control their variance as key dimension changes.
- 71After attention weights are calculated, they are applied to the_____vectors to produce weighted representations.
Hint
These vectors carry the information being combined.
Answer
value
Explanation
The attention weights multiply the value vectors, and the resulting weighted vectors are summed to form the attention output.
- 72Multi-head attention repeats attention using several different learned query, key, and value projections, called attention_____.
Hint
The original transformer used multiple parallel versions of the attention operation.
Answer
heads
Explanation
Each attention head can learn a different projection and way of attending; the head outputs are combined afterward.
- 73The original transformer paper stacked six encoder blocks and six decoder blocks, so its stack depth was_____for each type.
Hint
This is the value of N given for the original paper.
Answer
six
Explanation
The original transformer used N=6 repeated blocks in both the encoder and decoder stacks.
- 74A residual connection adds the layer input back to the layer’s transformation, helping the model modify rather than completely replace its_____.
Hint
The original information is passed along through the connection.
Answer
input
Explanation
A residual connection makes a layer output resemble a transformation of x plus x, which can help preserve features and improve learning.
- 75Residual connections are useful in deep networks partly because they help with_____propagation.
Hint
This is the direction in which gradients travel to update earlier layers.
Answer
back
Explanation
Passing information directly through residual paths can help backpropagation and make deep models easier to train.
- 76Layer normalization normalizes activations and can help improve training_____.
Hint
It concerns whether training moves toward a stable solution effectively.
Answer
convergence
Explanation
Layer normalization is used to normalize activations and can help a model converge during training.
- 77Dropout randomly removes some units during training so that a model does not rely too strongly on particular_____.
Hint
These are signals in the model’s representation that may be overused.
Answer
features
Explanation
Dropout reduces reliance on particular units or features by dropping them with some probability during training, which can improve generalization.
- 78By reducing over-reliance on particular features, dropout can help a model_____better to new data.
Hint
This means performing well beyond the training examples.
Answer
generalize
Explanation
Dropout is a regularization technique intended to help a model generalize to unseen data.
- 79Label smoothing replaces a fully certain target distribution with a softer one that assigns some probability to other_____.
Hint
The target is a token prediction, but other completions may also be valid.
Answer
words
Explanation
Instead of assigning 100% probability to one target token, label smoothing distributes some probability across alternative vocabulary tokens.
- 80Label smoothing can reflect the fact that language often has multiple valid ways to complete a_____.
Hint
Different words can produce acceptable continuations of the same linguistic context.
Answer
sentence
Explanation
A single next word is not always the only valid continuation, so label smoothing softens the target distribution rather than demanding absolute certainty.
- 81The attention softmax creates weights over keys, whereas the final output softmax creates probabilities over candidate next_____.
Hint
One softmax selects relevant context; the other supports generation.
Answer
tokens
Explanation
Softmax in an attention layer weights source positions, while the final softmax gives probabilities over vocabulary tokens for next-token prediction.
- 82In the transformer, attention enables tokens to exchange contextual information, while the feed-forward network contains much of the model’s parameter_____.
Hint
This refers to how much the network can learn and represent.
Answer
capacity
Explanation
The attention layer is central to token interactions, while the feed-forward networks contain many of the model parameters and provide substantial learning capacity.
- 83The quality of training_____is also an important factor in how well a language model works.
Hint
Models learn from the examples they are trained on.
Answer
data
Explanation
Alongside architecture and training techniques, the quality of the data used to train a model contributes to its performance.

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