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 data distribution via

Consider a specific timestep
where the cumulative noise variance schedule is given by
. At this timestep, for a specific input
, the model predicts a noise vector:

Calculate the estimated score vector,
.
Consider a specific timestep
Calculate the estimated score vector,
Solution
You are performing inference using a Guided Diffusion model with Classifier-Free Guidance (CFG) with a guidance scale
. At a specific step, the model outputs:
- Unconditional prediction:
- Conditional prediction (given class
): 
Using the standard CFG formula, calculate the final guided noise vector
.
- Unconditional prediction:
- Conditional prediction (given class
Using the standard CFG formula, calculate the final guided noise vector
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-probs: Beam A:
(ending in token 'cat') Beam B:
(ending in token 'dog') At step
, the model gives the following top log-probs: Given 'cat': 'sits' (-0.5), 'naps' (-1.0) Given 'dog': 'barks' (-0.1), 'runs' (-0.4) Which two paths form the new beams?
Solution
Solution
When treating an Auto-Regressive Language Model as an RL policy:
- The State is the context (prompt + generated tokens so far).
- The Action Space is the vocabulary
.
If the vocabulary size is
and we generate a sequence of length
. What is the dimension of the policy output distribution at a single timestep, and what is the dimensionality of the trajectory space?
- The State is the context (prompt + generated tokens so far).
- The Action Space is the vocabulary
If 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 following 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
:

Compute the raw attention scores (before Softmax) and scale them by the factor
. What is the value of the element at position
(i.e., row 1, column 2) of the scaled score matrix?
Compute the raw attention scores (before Softmax) and scale them by the factor
Solution
You have a Transformer with model dimension
. You employ
parallel attention heads. The output of the heads is concatenated and projected by a matrix
. If the input batch size is
and sequence length is
, what is the total number of floating point elements in the final output tensor of the Multi-Head Attention block (before the residual connection)?
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
.)
Given:
- Reward model score
-
-
- KL coefficient
Calculate the total reward. (Use
Solution
You are training a Reward Model (RM) using the Bradley-Terry model.
For a specific prompt
, you have a winning completion
and a losing completion
. The RM currently predicts the scalar rewards as:

Calculate the negative log-likelihood loss for this pair:
.
For a specific prompt
Calculate the negative log-likelihood loss for this pair:
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 (or approximation thereom).
Calculate the discretized state transition parameter
.
Formula:
.
Calculate the discretized state transition parameter
Formula:
Solution
Shape
Thickness [ / ]
3
All colors