1. Home
  2. Explore
  3. Computer Science
  4. Transformer Neural Networks Explained

Study methods

Flashcards
Quiz
Fill in the blanks
Written test
Lesson
Notes
Podcast
Content

Transformer Neural Networks Explained

  • 25Unfamiliar
  • 0Learning
  • 0Familiar
  • 0Mastered
Topic: Word Embedding
The process of converting words into numbers for neural networks is called
.

25 questions

  1. 1
    The 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

  2. 2
    In 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

  3. 3
    The activation function used in the word embedding example is the
    _____
    function.
    Hint

    It simply passes the input value through unchanged.

    Answer

    identity

  4. 4
    The 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

  5. 5
    The 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

  6. 6
    Transformers 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

  7. 7
    In 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

  8. 8
    In 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

  9. 9
    In 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

  10. 10
    The 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

  11. 11
    In 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

  12. 12
    The 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

  13. 13
    Stacking multiple self-attention cells is called
    _____
    .
    Hint

    The original Transformer used 8 such cells.

    Answer

    multi-head attention

  14. 14
    In the original Transformer manuscript, the number of self-attention heads stacked was
    _____
    .
    Hint

    This number was chosen arbitrarily, not 12 or 16.

    Answer

    8

  15. 15
    The 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

  16. 16
    The 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

  17. 17
    The 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

  18. 18
    The 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

  19. 19
    The 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

  20. 20
    After 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

  21. 21
    The 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

  22. 22
    To 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

  23. 23
    In 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

  24. 24
    To 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

  25. 25
    Transformers can process multiple tokens simultaneously using parallel computing on a
    _____
    .
    Hint

    Graphics Processing Units have many cores for parallel operations.

    Answer

    GPU

1 of 25
Question 1 of 25

Ask anything

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

FlashcardsQuizFill in the blanksWritten testLessonNotesPodcastContent