GPT and Transformer Basics
- 22Unfamiliar
- 0Learning
- 0Familiar
- 0Mastered
What does the acronym GPT stand for?
What does the acronym GPT stand for?
22 questions
- 1
What does the acronym GPT stand for?
- A
General Pretrained Transformer
- B
General Purpose Transformer
- C
Generative Pretrained Transformer
- D
Generative Programmable Transformer
Correct answer
CGenerative Pretrained Transformer
Explanation
GPT stands for Generative Pretrained Transformer, as stated in the content.
- A
- 2
What is a transformer?
- A
A specific kind of neural network
- B
A data preprocessing technique
- C
A type of recurrent neural network
- D
A machine learning algorithm for classification
Correct answer
AA specific kind of neural network
Explanation
A transformer is a specific kind of neural network, as described in the content.
- A
- 3
For what original use case was the transformer introduced in 2017 by Google?
- A
Generating synthetic speech from text
- B
Translating text from one language into another
- C
Autocomplete stories and essays
- D
Producing images from text descriptions
Correct answer
BTranslating text from one language into another
Explanation
The original transformer was invented for translating text from one language into another.
- A
- 4
What is the core task of models like ChatGPT?
- A
To generate random text without any context
- B
To predict the next token in a sequence given the previous context
- C
To classify text into predefined categories
- D
To translate text between languages
Correct answer
BTo 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.
- A
- 5
How does a transformer generate longer text from a seed snippet?
- A
It outputs the entire continuation in one forward pass
- B
It uses a separate generative model for each new sentence
- C
It predicts the next token, samples from the distribution, appends it, and repeats
- D
It randomly selects tokens from the vocabulary
Correct answer
CIt 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.
- A
- 6
What are tokens in the context of transformer text processing?
- A
Full sentences
- B
Pieces of text such as words or subwords
- C
Randomly sampled numbers
- D
Individual characters only
Correct answer
BPieces of text such as words or subwords
Explanation
Tokens are pieces of text, typically words or subwords, or common character combinations.
- A
- 7
What does the embedding matrix do?
- A
It computes the attention scores
- B
It maps each token to a vector of numbers
- C
It combines vectors from different positions
- D
It normalizes the output into probabilities
Correct answer
BIt 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.
- A
- 8
In word embeddings, what does the direction of a vector often represent?
- A
The length of the word
- B
The frequency of the word in the training data
- C
Semantic meaning such as gender, plurality, or nationality
- D
The position of the word in the sentence
Correct answer
CSemantic 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.
- A
- 9
Which vector operation is used to illustrate semantic relationships like 'king - man + woman = queen'?
- A
Vector addition and subtraction
- B
Matrix multiplication
- C
Softmax normalization
- D
Dot product
Correct answer
AVector addition and subtraction
Explanation
Vector arithmetic (addition and subtraction) is used to find analogies, as shown with 'king - man + woman' approximating 'queen'.
- A
- 10
What does a dot product of two vectors measure?
- A
How well they align in direction
- B
The angle between them in radians
- C
The sum of their components
- D
Their Euclidean distance
Correct answer
AHow well they align in direction
Explanation
The dot product is positive when vectors point in similar directions, zero if perpendicular, negative if opposite.
- A
- 11
What is the role of the attention block in a transformer?
- A
It converts the last vector into a probability distribution
- B
It allows vectors to exchange information and update based on context
- C
It breaks input text into tokens
- D
It processes each vector independently
Correct answer
BIt 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.
- A
- 12
What distinguishes the multi-layer perceptron (feed-forward) block from the attention block?
- A
It applies a softmax function to the vectors
- B
It uses dot products to measure similarity between vectors
- C
The vectors do not talk to each other; each goes through the same operation in parallel
- D
It reduces the dimensionality of the vectors
Correct answer
CThe 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.
- A
- 13
In the final layer of a transformer, which vector is used to predict the next token?
- A
The very last vector in the sequence
- B
A random vector from the sequence
- C
All vectors are averaged
- D
The first vector in the sequence
Correct answer
AThe very last vector in the sequence
Explanation
After processing, the essential meaning is baked into the last vector, which is then used for prediction.
- A
- 14
What is the context size in GPT-3?
- A
512 tokens
- B
4096 tokens
- C
2048 tokens
- D
1024 tokens
Correct answer
C2048 tokens
Explanation
GPT-3 was trained with a context size of 2048 tokens.
- A
- 15
What is the purpose of the softmax function in a transformer?
- A
To add nonlinearity to the model
- B
To convert a list of numbers into a valid probability distribution
- C
To select the token with the highest score
- D
To increase the magnitude of the output
Correct answer
BTo 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.
- A
- 16
What are the raw, unnormalized outputs from the final linear layer before softmax called?
- A
Probabilities
- B
Scores
- C
Embeddings
- D
Logits
Correct answer
DLogits
Explanation
The components of the raw output before softmax are referred to as logits.
- A
- 17
How does the temperature parameter affect sampling from the probability distribution?
- A
Higher temperature makes the distribution more uniform, increasing randomness
- B
Temperature controls the number of tokens to generate
- C
Temperature does not affect sampling; it only scales the logits
- D
Higher temperature makes the distribution more peaked, favoring top choices
Correct answer
AHigher 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.
- A
- 18
In GPT-3, approximately how many parameters does the embedding matrix have?
- A
617 million
- B
50,257
- C
175 billion
- D
12,288
Correct answer
A617 million
Explanation
The embedding matrix in GPT-3 has 50,257 columns (vocabulary size) and 12,288 dimensions, totalling about 617 million parameters.
- A
- 19
What is the approximate total number of parameters in GPT-3?
- A
50,257
- B
175 billion
- C
28,000
- D
617 million
Correct answer
B175 billion
Explanation
GPT-3 has about 175 billion parameters.
- A
- 20
How are the parameters of a transformer typically organized?
- A
As a database of examples
- B
Into matrices of tunable weights
- C
As a set of rules and heuristics
- D
Into a single vector
Correct answer
BInto 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.
- A
- 21
What training algorithm is used to adjust the weights in deep learning models?
- A
Reinforcement learning
- B
Backpropagation
- C
Gradient descent without backpropagation
- D
Linear regression
Correct answer
BBackpropagation
Explanation
Deep learning models, including transformers, are trained using backpropagation.
- A
- 22
What is the main reason transformers use matrix multiplications for computation?
- A
To make the model non-differentiable
- B
To reduce the number of parameters
- C
To allow arbitrary mathematical operations
- D
To perform weighted sums efficiently, which is the only allowed interaction between parameters and data
Correct answer
DTo 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.
- A

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