Transformer Neural Networks Explained
- 25Unfamiliar
- 0Learning
- 0Familiar
- 0Mastered
25 questions
- 1The process of converting words into numbers for neural networks is called_____.
Hint
It involves a simple neural network that maps each token to a vector.
Answer
word embedding
- 2In word embedding, each input word or symbol is called a_____.
Hint
This term is used because the vocabulary can include words, word fragments, and symbols like EOS.
Answer
token
- 3The activation function used in the word embedding example is the_____function.
Hint
It simply passes the input value through unchanged.
Answer
identity
- 4The same word embedding network weights are_____for each input token, allowing flexibility with sentence length.
Hint
They are not unique per token; the same set is applied to every token.
Answer
reused
- 5The process of optimizing weights in a neural network using known input-output pairs is called_____.
Hint
It iteratively adjusts weights to minimize error, often used in training Transformers.
Answer
backpropagation
- 6Transformers use_____to keep track of word order in a sentence.
Hint
It adds a set of numbers based on sine and cosine functions to the word embeddings.
Answer
positional encoding
- 7In positional encoding, the numbers are derived from alternating_____functions.
Hint
These periodic functions provide distinct values for each position across embedding dimensions.
Answer
sine and cosine
- 8In self-attention, the values used to calculate similarity between words are called_____.
Hint
They are derived from the position-encoded embeddings using learned weights.
Answer
queries
- 9In self-attention, the similarity between a query and a key is calculated using the_____product.
Hint
It multiplies corresponding entries and sums them.
Answer
dot
- 10The softmax function converts similarity scores into values between 0 and 1 that sum to_____, representing percentages.
Hint
This is a property of probability distributions.
Answer
1
- 11In self-attention, the vectors that are scaled by softmax percentages and summed are called_____.
Hint
They carry the actual content of each token.
Answer
values
- 12The weights for computing queries, keys, and values are_____across all tokens in self-attention.
Hint
Just like word embedding weights, these are the same for each token.
Answer
reused
- 13Stacking multiple self-attention cells is called_____.
Hint
The original Transformer used 8 such cells.
Answer
multi-head attention
- 14In the original Transformer manuscript, the number of self-attention heads stacked was_____.
Hint
This number was chosen arbitrarily, not 12 or 16.
Answer
8
- 15The bypass connections that add the input position-encoded values to the self-attention output are called_____.
Hint
They help preserve original information and ease training.
Answer
residual connections
- 16The part of the transformer that processes the input sentence is called the_____.
Hint
It uses word embedding, positional encoding, self-attention, and residual connections.
Answer
encoder
- 17The part of the transformer that generates the output translation is called the_____.
Hint
It starts with an EOS token and uses self-attention, encoder-decoder attention, and a fully connected layer.
Answer
decoder
- 18The decoder typically starts with an_____token to initialize the output generation.
Hint
It stands for 'end of sequence' and is commonly used for this purpose.
Answer
EOS
- 19The mechanism that allows the decoder to focus on important words in the input sentence is called_____.
Hint
It uses queries from the decoder and keys and values from the encoder.
Answer
encoder-decoder attention
- 20After encoder-decoder attention, the decoder outputs values that pass through a_____layer to select the next token.
Hint
It is a simple neural network with one output per token in the output vocabulary.
Answer
fully connected
- 21The final selection of the output token is done by applying a_____function to the outputs of the fully connected layer.
Hint
It converts logits into probabilities.
Answer
softmax
- 22To improve stability and performance, Transformers often apply_____after each sublayer like self-attention and positional encoding.
Hint
It normalizes values across the embedding dimension.
Answer
layer normalization
- 23In the original Transformer, the dot product similarity was scaled by dividing by the square root of the number of_____per token.
Hint
This prevents the dot product from growing too large with high dimensions.
Answer
embedding values
- 24To increase model capacity, Transformers can add additional_____with hidden layers in both encoder and decoder.
Hint
These are often feed-forward networks applied after attention layers.
Answer
neural networks
- 25Transformers can process multiple tokens simultaneously using parallel computing on a_____.
Hint
Graphics Processing Units have many cores for parallel operations.
Answer
GPU

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