Attention and Transformers
- 84Unfamiliar
- 0Learning
- 0Familiar
- 0Mastered
84 questions
- 1A problem that takes one input, such as an image, and produces one output, such as a classification, is called a_____problem.
Hint
Both the input and output consist of a single item.
Answer
one-to-one
- 2Image captioning is an example of a_____problem because one image produces a sequence of words.
Hint
The input is singular, but the output contains multiple sequential elements.
Answer
one-to-many
- 3Inputting a sequence of video frames and producing one classification is an example of a_____problem.
Hint
The input has multiple elements, while the output is a single label.
Answer
many-to-one
- 4Recurrent neural networks were introduced as neural network architectures designed for processing_____data.
Hint
The data elements have an ordered temporal or positional relationship.
Answer
sequences
- 5The ability to process sequences allows neural networks to address problems that traditional_____neural networks could not handle as naturally.
Hint
These networks do not maintain a recurrent state across sequence elements.
Answer
feed forward
- 6The transformer architecture has_____attention at its core.
Hint
The mechanism allows elements within one set to interact with one another.
Answer
self
- 7Transformers are widely used for large state-of-the-art applications involving images, text, and_____.
Hint
This modality includes speech and other sound signals.
Answer
audio
- 8The ideas behind transformers developed historically from work on recurrent neural networks and_____.
Hint
This mechanism lets a model focus on relevant parts of an input.
Answer
attention
- 9Neural machine translation maps an input sequence of English words to an output sequence of words in_____.
Hint
The lecture uses Italian and French as examples.
Answer
another language
- 10In translation, the input and output sequences may differ in both their number of words and their word_____.
Hint
Languages do not necessarily arrange corresponding words identically.
Answer
order
- 11In a recurrent sequence-to-sequence model, the input sequence is first processed by an RNN called the_____.
Hint
This network reads and represents the source sequence.
Answer
encoder
- 12At each time step, a recurrent neural network receives the current input x and the previous_____state.
Hint
This state carries information from earlier sequence positions.
Answer
hidden
- 13Applying the same recurrent unit repeatedly across time allows an RNN to process sequences of potentially_____length.
Hint
The number of sequence elements does not need to be fixed in advance.
Answer
variable
- 14The encoder summarizes the entire input sequence into a single vector called the_____vector.
Hint
This vector provides information about the source sequence to the decoder.
Answer
context
- 15A common way to form the context vector in an encoder RNN is to use the encoder's_____hidden state.
Hint
This state is produced after all input tokens have been processed.
Answer
last
- 16The network that generates the translated output sequence one token at a time is called the_____.
Hint
It converts the source representation into the target sequence.
Answer
decoder
- 17At each time step, the decoder RNN receives the previous output token, its previous hidden state, and the_____vector.
Hint
This third input summarizes the encoded source sequence.
Answer
context
- 18The encoder and decoder may share the same architecture while using different learned_____.
Hint
These include weights and biases learned during optimization.
Answer
parameters
- 19The decoder produces output words one at a time by repeatedly_____the recurrent network across the output sequence.
Hint
This means applying the same recurrent computation at successive time steps.
Answer
unrolling
- 20The fixed-size context vector creates a communication_____between the input and output sequences.
Hint
All source information must pass through one limited representation.
Answer
bottleneck
- 21The fixed length of the context vector does not change when the input or output sequence becomes longer or_____.
Hint
The vector dimension is set by the architecture rather than by sequence length.
Answer
shorter
- 22The bottleneck becomes especially problematic when translating very long sequences such as a paragraph, book, or entire_____.
Hint
This term refers to a large collection of texts or data.
Answer
corpus
- 23Attention addresses the bottleneck by allowing the decoder to look back at the_____input sequence at every output time step.
Hint
The decoder is not restricted to one summary vector.
Answer
entire
- 24To determine what to focus on, attention first computes scalar_____scores between a decoder state and each encoder state.
Hint
These scores measure how well two representations match.
Answer
alignment
- 25A simple alignment function concatenates the decoder hidden state with an encoder hidden state and applies a learned_____layer.
Hint
This layer maps the combined vector to one scalar.
Answer
linear
- 26Because raw alignment scores are unbounded real values, they are converted into attention weights using_____.
Hint
This function transforms scores into nonnegative values that sum to one.
Answer
softmax
- 27The outputs of a softmax lie between 0 and 1 and_____to one.
Hint
These are the defining properties of a discrete probability distribution.
Answer
sum
- 28Attention weights can be interpreted as a probability distribution over the input_____.
Hint
Each position corresponds to an element such as a word in the source sentence.
Answer
tokens
- 29The attention context vector is computed as a weighted_____combination of the encoder hidden states.
Hint
Each encoder state is multiplied by an attention weight and then summed.
Answer
linear
- 30At each decoder step, the attention mechanism computes a new context vector rather than reusing a single_____vector.
Hint
The new representation is selected dynamically for the current output step.
Answer
fixed length
- 31When generating a word corresponding to 'we see,' the model can assign higher attention weights to the input words_____.
Hint
These are the source words most relevant to that output.
Answer
we see
- 32The attention computation is differentiable, so its parameters can be learned end to end through_____descent.
Hint
This optimization method adjusts parameters using derivatives of the loss.
Answer
gradient
- 33The output sequence is commonly trained with a cross-entropy loss applied to predicted output_____.
Hint
The model is trained to predict the correct words or symbols.
Answer
tokens
- 34The initial hidden state of a decoder may be set to zeros, derived from the encoder's final state, or produced by a learned_____transform.
Hint
This transformation maps one representation into the required decoder-state dimension.
Answer
linear
- 35The attention operator takes a query vector and summarizes a collection of data vectors into an output_____.
Hint
The result is the context representation produced for that query.
Answer
vector
- 36In the generalized attention formulation, the decoder hidden states serve as_____vectors.
Hint
They specify what information the model is trying to produce or retrieve.
Answer
query
- 37The encoder hidden states serve as the_____vectors that attention summarizes.
Hint
These vectors contain the information available for retrieval.
Answer
data
- 38The similarity function in attention takes two vectors and returns a scalar_____score.
Hint
The score measures how well the two representations match.
Answer
similarity
- 39The simplest commonly used similarity function for attention is the_____product.
Hint
It multiplies corresponding vector components and sums the results.
Answer
dot
- 40Scaled dot-product attention divides the dot product by the square root of the vector_____.
Hint
The scaling compensates for changes in representation size.
Answer
dimension
- 41The scaling factor in scaled dot-product attention improves gradient flow through the_____function.
Hint
This function can become too concentrated when its inputs grow large.
Answer
softmax
- 42Attention can process many query vectors in parallel by representing them as a_____.
Hint
A collection of vectors can be arranged as rows or columns of one two-dimensional object.
Answer
matrix
- 43All pairwise similarities between query vectors and data vectors can be computed efficiently with a_____multiplication.
Hint
This operation produces inner products between rows or columns.
Answer
matrix
- 44The output of attention is formed by taking linear combinations of the data vectors weighted by the_____matrix.
Hint
This matrix contains the normalized scores produced by softmax.
Answer
attention
- 45Attention separates the roles of matching and retrieval by projecting each data vector into a key and a_____.
Hint
This representation is combined to form the output.
Answer
value
- 46Key vectors are compared with the query vectors to compute_____scores.
Hint
These scores indicate how well a query matches each key.
Answer
alignment
- 47Value vectors are combined using attention weights to produce the attention_____.
Hint
This is the context-like representation returned by the layer.
Answer
output
- 48The key and value projections are implemented with separate learnable_____matrices.
Hint
These parameters are optimized along with the rest of the neural network.
Answer
weight
- 49The separation of keys and values is analogous to a search engine separating what is being looked for from the information returned as the_____.
Hint
The query matches indexed representations, while a different representation is retrieved.
Answer
answer
- 50A cross attention layer receives query vectors and data vectors as two potentially_____sets of inputs.
Hint
The two sets may come from separate sources or represent different modalities.
Answer
different
- 51In machine translation, cross attention can connect representations of an input sentence with representations of the_____sentence.
Hint
This sentence is generated in the target language.
Answer
output
- 52Image captioning can use cross attention to relate image features to generated word_____.
Hint
The generated sequence consists of pieces of text.
Answer
tokens
- 53A self attention layer begins with only one set of input_____.
Hint
The same representations provide the source for all three projections.
Answer
vectors
- 54In self attention, every input vector is separately projected into a query, a key, and a_____.
Hint
This is the third representation used for aggregation.
Answer
value
- 55Self attention produces the same number of output vectors as input_____.
Hint
There is one output associated with each query position.
Answer
vectors
- 56The input and output dimensions of a self attention layer are architectural_____.
Hint
They are chosen when designing the layer rather than learned directly.
Answer
hyperparameters
- 57In practice, the input and output dimensions of self attention are usually the_____.
Hint
Although they can differ in principle, implementations commonly preserve the model width.
Answer
same
- 58The three projections in self attention can be fused into one large matrix multiplication for greater hardware_____.
Hint
Fewer larger operations are often preferable to many smaller ones.
Answer
efficiency
- 59Self attention is particularly suitable for image classification when the model needs to process parts of an image relative to_____.
Hint
There is only one natural input modality in this situation.
Answer
themselves
- 60If the inputs to self attention are permuted, the outputs are permuted in the same way; this property is called permutation_____.
Hint
The operation respects reordering rather than producing order-independent output positions.
Answer
equivariance
- 61Because ordinary self attention does not depend on input order, it fundamentally operates on_____of vectors rather than ordered sequences.
Hint
A set has no inherent ordering.
Answer
sets
- 62To provide sequence order information, a positional_____can be concatenated to each input vector.
Hint
This added representation indicates an element's position.
Answer
embedding
- 63Masked self attention blocks selected interactions by replacing prohibited alignment scores with negative_____.
Hint
After softmax, these values receive zero probability.
Answer
infinities
- 64In causal language modeling, masking prevents a token from looking_____in the sequence.
Hint
The model must not use future words when predicting the current word.
Answer
ahead
- 65Multi-headed self attention runs several independent copies, called_____heads, in parallel.
Hint
Each copy has the same architecture but different learned weights.
Answer
attention
- 66The outputs of the independent attention heads are combined using a final linear_____.
Hint
This learned transformation mixes information across heads.
Answer
projection
- 67Recurrent neural networks operate on one-dimensional ordered sequences but are fundamentally difficult to_____across sequence positions.
Hint
Each hidden state depends on the previous hidden state.
Answer
parallelize
- 68Convolution operates on multidimensional_____and mixes information locally.
Hint
Images are a common two-dimensional example.
Answer
grids
- 69Convolution is highly parallelizable because different kernel positions can, in principle, be computed in_____.
Hint
The computations at separate spatial positions do not inherently depend on one another.
Answer
parallel
- 70Convolution has difficulty building large_____fields without using large kernels or many layers.
Hint
This refers to the region of the input that can influence an output.
Answer
receptive
- 71Unlike convolution, one self attention layer allows every vector to look at_____other vector.
Hint
The interaction is global rather than local.
Answer
every
- 72For a sequence of length n, full self attention has computational complexity proportional to_____.
Hint
Every one of the n positions can compare with all n positions.
Answer
n2
- 73A transformer places_____attention at the center of its neural network architecture.
Hint
This is the attention variant in which queries, keys, and values originate from the same input.
Answer
self
- 74After self attention, a transformer commonly uses a_____connection to help stabilize optimization.
Hint
This connection adds a layer's input back to its output.
Answer
residual
- 75Transformer blocks commonly apply_____normalization after the residual attention operation.
Hint
The normalization is applied across features within each representation.
Answer
layer
- 76The transformer component that processes each vector independently is a two-layer_____perceptron.
Hint
It is commonly abbreviated MLP.
Answer
multi-layer
- 77The per-vector MLP is also called an_____network, abbreviated FFN.
Hint
This name emphasizes that it operates independently on each vector.
Answer
feed-forward
- 78A transformer block consists of attention and an independent-vector MLP, each wrapped with residual connections and layer_____.
Hint
This process helps stabilize the activations and training.
Answer
normalization
- 79A transformer is formed by stacking a sequence of transformer_____.
Hint
Each repeated unit contains self attention and an MLP.
Answer
blocks
- 80To apply a transformer to an image, the image is divided into_____and each patch is projected into a vector.
Hint
These are smaller regions of the original image.
Answer
patches
- 81For image classification, the transformer outputs are aggregated with a_____operation before class scores are predicted.
Hint
This operation combines representations from multiple image patches.
Answer
pooling
- 82The main computational operations in a multi-headed self attention layer can be implemented as approximately four large batched_____multiplies.
Hint
These operations are highly optimized on GPUs.
Answer
matrix
- 83Matrix multiplication makes attention highly scalable because it can be distributed and efficiently run on_____.
Hint
These processors are designed for massively parallel numerical operations.
Answer
GPUs
- 84The transformer architecture has scaled from early models with relatively few blocks to models containing hundreds of blocks and_____of parameters.
Hint
This is a quantity larger than billions.
Answer
trillions

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