Question 1 | MCQ
THIS IS QUESTION PAPER FOR THE SUBJECT "DEGREE LEVEL : MATHEMATICAL FOUNDATIONS OF GENERATIVE AI (COMPUTER BASED EXAM)"
ARE YOU SURE YOU HAVE TO WRITE EXAM FOR THIS SUBJECT?
CROSS CHECK YOUR HALL TICKET TO CONFIRM THE SUBJECTS TO BE WRITTEN.
(IF IT IS NOT THE CORRECT SUBJECT, PLS CHECK THE SECTION AT THE TOP FOR THE SUBJECTS REGISTERED BY YOU)
ARE YOU SURE YOU HAVE TO WRITE EXAM FOR THIS SUBJECT?
CROSS CHECK YOUR HALL TICKET TO CONFIRM THE SUBJECTS TO BE WRITTEN.
(IF IT IS NOT THE CORRECT SUBJECT, PLS CHECK THE SECTION AT THE TOP FOR THE SUBJECTS REGISTERED BY YOU)
Solution
In the context of Denoising Diffusion Probabilistic Models (DDPM), the trained noise predictor
approximates the score function of the noisy data distribution via

Suppose at timestep
, the cumulative noise schedule is
.
For the noisy input
, the model predicts the noise vector:

Compute the estimated score vector
.
Suppose at timestep
For the noisy input
Compute the estimated score vector
Solution
During inference with a Classifier-Free Guidance (CFG) diffusion model, you apply a guidance scale of
.
At a particular denoising timestep, the model produces:
- Unconditional output:

- Conditional output (given text prompt
):

Using the classifier-free guidance formula

compute the guided prediction
.
At a particular denoising timestep, the model produces:
- Unconditional output:
- Conditional output (given text prompt
Using the classifier-free guidance formula
compute the guided prediction
Solution
In a Deep Transformer with Residual connections, the output of layer
is
. Assume that at initialization, the function
(Attention + FFN) outputs values with variance roughly
.
After 10 layers, assuming independence, approximately how much has the signal variance increased relative to the input variance
?
(Approximation:
).
After 10 layers, assuming independence, approximately how much has the signal variance increased relative to the input variance
(Approximation:
Solution
You are performing Beam Search with width
.
At step
, you have two active beams with accumulated log-probabilities:
- Beam A:
(ending in token 'hello')
- Beam B:
(ending in token 'hi')
At step
, the model outputs the following top log-probabilities:
- Given 'hello': 'world' (
), 'there' (
)
- Given 'hi': 'there' (
), 'you' (
)
Using standard beam search with additive log-probabilities, which two paths form the new beams after step
?
At step
- Beam A:
- Beam B:
At step
- Given 'hello': 'world' (
- Given 'hi': 'there' (
Using standard beam search with additive log-probabilities, which two paths form the new beams after step
Solution
DPO eliminates the explicit reward model by defining an implicit reward
based on the optimal policy
and reference policy
.
Given:
-
-
-
(KL penalty coefficient)
Calculate the implicit reward value assigned to this response.
Given:
-
-
-
Calculate the implicit reward value assigned to this response.
Solution
When treating an Auto-Regressive Language Model as an RL policy:
- The State is the context (prompt + previously generated tokens).
- The Action Space is the vocabulary
.
Suppose the vocabulary size is
and we generate a sequence of length
.What is the dimension of the policy’s output distribution at a single timestep, and what is the dimensionality of the full trajectory space?
- The State is the context (prompt + previously generated tokens).
- The Action Space is the vocabulary
Suppose the vocabulary size is
Solution
Trust Region Policy Optimization (TRPO) maximizes the surrogate objective subject to a constraint on the KL divergence between the old and new policies. What is the nature of this constraint?
Solution
The Policy Gradient theorem states
.
If we introduce a baseline
that depends only on state, the term becomes
.
What is the expected value of the baseline term?

If we introduce a baseline
What is the expected value of the baseline term?
Solution
DDIMs are faster than DDPM mainly because:
Solution
An auto-regressive language model predicts the next token
given the history
. In the RL interpretation used for alignment, which of the following correspondences between LM objects and RL objects are correct?
Solution
The sinusoidal positional encoding (PE) for Transformers is defined as:

Based on the properties of sinusoidal positional encodings, identify all correct statements:
Based on the properties of sinusoidal positional encodings, identify all correct statements:
Solution
Consider a single-head self-attention mechanism with
. You are given the following Query (
) and Key (
) matrices for a sequence length of
.

Calculate the raw attention scores (before Softmax) scaled by the factor
. What is the value of the element at position
(row 1, column 2) of the scaled score matrix?
Calculate the raw attention scores (before Softmax) scaled by the factor
Solution
In a decoder-only transformer (GPT-style), we compute attention scores
. Before applying softmax, we add a causal mask
.
Let the raw scores for a sequence
be:

The mask
sets future positions to
.
Calculate the probability
after applying Softmax to the second row.
Let the raw scores for a sequence
The mask
Calculate the probability
Solution
In RLHF (Reinforcement Learning from Human Feedback), the reward used to update the
language model
is defined as
.
Given:
- Reward model score
.
-
.
-
.
- KL coefficient
.
Calculate the total reward. (Use
).
language model
Given:
- Reward model score
-
-
- KL coefficient
Calculate the total reward. (Use
Solution
You are training a Reward Model (RM) using the Bradley–Terry preference model.
For a given prompt
, you have a preferred completion
and a non-preferred completion
. The RM predicts the following scalar rewards:

Compute the negative log-likelihood loss for this comparison:

For a given prompt
Compute the negative log-likelihood loss for this comparison:
Solution
A continuous-time State-Space Model (SSM) has a scalar state parameter
(representing decay). You discretize this system with a step size
using the Zero-Order Hold (ZOH) method.
Compute the discretized state transition parameter
.
Formula:

Compute the discretized state transition parameter
Formula:
Solution
Shape
Thickness [ / ]
3
All colors