1. Home
  2. Explore
  3. Computer Science
  4. GPT and Transformer Basics

Study methods

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

GPT and Transformer Basics

  • 22Unfamiliar
  • 0Learning
  • 0Familiar
  • 0Mastered
Topic: Fundamental Concepts

What does the acronym GPT stand for?

22 questions

  1. 1

    What does the acronym GPT stand for?

    1. A

      General Pretrained Transformer

    2. B

      General Purpose Transformer

    3. C

      Generative Pretrained Transformer

    4. D

      Generative Programmable Transformer

    Correct answer
    C

    Generative Pretrained Transformer

    Explanation

    GPT stands for Generative Pretrained Transformer, as stated in the content.

  2. 2

    What is a transformer?

    1. A

      A specific kind of neural network

    2. B

      A data preprocessing technique

    3. C

      A type of recurrent neural network

    4. D

      A machine learning algorithm for classification

    Correct answer
    A

    A specific kind of neural network

    Explanation

    A transformer is a specific kind of neural network, as described in the content.

  3. 3

    For what original use case was the transformer introduced in 2017 by Google?

    1. A

      Generating synthetic speech from text

    2. B

      Translating text from one language into another

    3. C

      Autocomplete stories and essays

    4. D

      Producing images from text descriptions

    Correct answer
    B

    Translating text from one language into another

    Explanation

    The original transformer was invented for translating text from one language into another.

  4. 4

    What is the core task of models like ChatGPT?

    1. A

      To generate random text without any context

    2. B

      To predict the next token in a sequence given the previous context

    3. C

      To classify text into predefined categories

    4. D

      To translate text between languages

    Correct answer
    B

    To predict the next token in a sequence given the previous context

    Explanation

    Models like ChatGPT are trained to take in a piece of text and produce a prediction for what comes next.

  5. 5

    How does a transformer generate longer text from a seed snippet?

    1. A

      It outputs the entire continuation in one forward pass

    2. B

      It uses a separate generative model for each new sentence

    3. C

      It predicts the next token, samples from the distribution, appends it, and repeats

    4. D

      It randomly selects tokens from the vocabulary

    Correct answer
    C

    It predicts the next token, samples from the distribution, appends it, and repeats

    Explanation

    The process involves repeatedly predicting the next token, sampling from the probability distribution, appending, and running again.

  6. 6

    What are tokens in the context of transformer text processing?

    1. A

      Full sentences

    2. B

      Pieces of text such as words or subwords

    3. C

      Randomly sampled numbers

    4. D

      Individual characters only

    Correct answer
    B

    Pieces of text such as words or subwords

    Explanation

    Tokens are pieces of text, typically words or subwords, or common character combinations.

  7. 7

    What does the embedding matrix do?

    1. A

      It computes the attention scores

    2. B

      It maps each token to a vector of numbers

    3. C

      It combines vectors from different positions

    4. D

      It normalizes the output into probabilities

    Correct answer
    B

    It maps each token to a vector of numbers

    Explanation

    The embedding matrix has a column for each token, and its columns determine what vector each token turns into in the first step.

  8. 8

    In word embeddings, what does the direction of a vector often represent?

    1. A

      The length of the word

    2. B

      The frequency of the word in the training data

    3. C

      Semantic meaning such as gender, plurality, or nationality

    4. D

      The position of the word in the sentence

    Correct answer
    C

    Semantic meaning such as gender, plurality, or nationality

    Explanation

    Directions in the embedding space encode semantic meanings; for example, the difference between 'woman' and 'man' encodes gender.

  9. 9

    Which vector operation is used to illustrate semantic relationships like 'king - man + woman = queen'?

    1. A

      Vector addition and subtraction

    2. B

      Matrix multiplication

    3. C

      Softmax normalization

    4. D

      Dot product

    Correct answer
    A

    Vector addition and subtraction

    Explanation

    Vector arithmetic (addition and subtraction) is used to find analogies, as shown with 'king - man + woman' approximating 'queen'.

  10. 10

    What does a dot product of two vectors measure?

    1. A

      How well they align in direction

    2. B

      The angle between them in radians

    3. C

      The sum of their components

    4. D

      Their Euclidean distance

    Correct answer
    A

    How well they align in direction

    Explanation

    The dot product is positive when vectors point in similar directions, zero if perpendicular, negative if opposite.

  11. 11

    What is the role of the attention block in a transformer?

    1. A

      It converts the last vector into a probability distribution

    2. B

      It allows vectors to exchange information and update based on context

    3. C

      It breaks input text into tokens

    4. D

      It processes each vector independently

    Correct answer
    B

    It allows vectors to exchange information and update based on context

    Explanation

    The attention block enables vectors to pass information back and forth to update their meanings based on context.

  12. 12

    What distinguishes the multi-layer perceptron (feed-forward) block from the attention block?

    1. A

      It applies a softmax function to the vectors

    2. B

      It uses dot products to measure similarity between vectors

    3. C

      The vectors do not talk to each other; each goes through the same operation in parallel

    4. D

      It reduces the dimensionality of the vectors

    Correct answer
    C

    The vectors do not talk to each other; each goes through the same operation in parallel

    Explanation

    In the feed-forward block, vectors are processed independently and in parallel, unlike the attention block where they interact.

  13. 13

    In the final layer of a transformer, which vector is used to predict the next token?

    1. A

      The very last vector in the sequence

    2. B

      A random vector from the sequence

    3. C

      All vectors are averaged

    4. D

      The first vector in the sequence

    Correct answer
    A

    The very last vector in the sequence

    Explanation

    After processing, the essential meaning is baked into the last vector, which is then used for prediction.

  14. 14

    What is the context size in GPT-3?

    1. A

      512 tokens

    2. B

      4096 tokens

    3. C

      2048 tokens

    4. D

      1024 tokens

    Correct answer
    C

    2048 tokens

    Explanation

    GPT-3 was trained with a context size of 2048 tokens.

  15. 15

    What is the purpose of the softmax function in a transformer?

    1. A

      To add nonlinearity to the model

    2. B

      To convert a list of numbers into a valid probability distribution

    3. C

      To select the token with the highest score

    4. D

      To increase the magnitude of the output

    Correct answer
    B

    To convert a list of numbers into a valid probability distribution

    Explanation

    Softmax normalizes logits into probabilities that sum to 1 and are between 0 and 1.

  16. 16

    What are the raw, unnormalized outputs from the final linear layer before softmax called?

    1. A

      Probabilities

    2. B

      Scores

    3. C

      Embeddings

    4. D

      Logits

    Correct answer
    D

    Logits

    Explanation

    The components of the raw output before softmax are referred to as logits.

  17. 17

    How does the temperature parameter affect sampling from the probability distribution?

    1. A

      Higher temperature makes the distribution more uniform, increasing randomness

    2. B

      Temperature controls the number of tokens to generate

    3. C

      Temperature does not affect sampling; it only scales the logits

    4. D

      Higher temperature makes the distribution more peaked, favoring top choices

    Correct answer
    A

    Higher temperature makes the distribution more uniform, increasing randomness

    Explanation

    A larger temperature gives more weight to lower-probability tokens, making the distribution more uniform and increasing randomness.

  18. 18

    In GPT-3, approximately how many parameters does the embedding matrix have?

    1. A

      617 million

    2. B

      50,257

    3. C

      175 billion

    4. D

      12,288

    Correct answer
    A

    617 million

    Explanation

    The embedding matrix in GPT-3 has 50,257 columns (vocabulary size) and 12,288 dimensions, totalling about 617 million parameters.

  19. 19

    What is the approximate total number of parameters in GPT-3?

    1. A

      50,257

    2. B

      175 billion

    3. C

      28,000

    4. D

      617 million

    Correct answer
    B

    175 billion

    Explanation

    GPT-3 has about 175 billion parameters.

  20. 20

    How are the parameters of a transformer typically organized?

    1. A

      As a database of examples

    2. B

      Into matrices of tunable weights

    3. C

      As a set of rules and heuristics

    4. D

      Into a single vector

    Correct answer
    B

    Into matrices of tunable weights

    Explanation

    The parameters are organized into matrices, which in GPT-3 fall into eight different categories and about 28,000 distinct matrices.

  21. 21

    What training algorithm is used to adjust the weights in deep learning models?

    1. A

      Reinforcement learning

    2. B

      Backpropagation

    3. C

      Gradient descent without backpropagation

    4. D

      Linear regression

    Correct answer
    B

    Backpropagation

    Explanation

    Deep learning models, including transformers, are trained using backpropagation.

  22. 22

    What is the main reason transformers use matrix multiplications for computation?

    1. A

      To make the model non-differentiable

    2. B

      To reduce the number of parameters

    3. C

      To allow arbitrary mathematical operations

    4. D

      To perform weighted sums efficiently, which is the only allowed interaction between parameters and data

    Correct answer
    D

    To perform weighted sums efficiently, which is the only allowed interaction between parameters and data

    Explanation

    In deep learning, the only way parameters interact with data is through weighted sums, which are packaged as matrix-vector products.

Question 1 of 22
Question 1 of 22

Ask anything

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

FlashcardsQuizFill in the blanksWritten testLessonNotesPodcastContent