Home / Study library / Mathematical Foundations of Generative AI / End Term · May 2026 Mathematical Foundations of Generative AI · End Term · May 2026 · FN
Mathematical Foundations of Generative AI · End Term · May 2026 FN
← Course papers · Start practice / exam
Questions and published explanations below are available without starting a test. Some questions may not have a published solution yet.
0 / 19 published solutions
Q2 Q3 Q4 Q5 Q6 Q7 Q8 Q9 Q10 Q11 Q12 Q13 Q14 Q15 Q16 Q17 Q18 Q19 Q20
Question 2 NAT · 2.0 marks An agent receives rewards
over an episode (
) with
the discount factor equal to 0.5. Compute the full discounted return
for the trajectory
. Enter
your answer correct to three decimal places.
A published solution is not available for this question yet.
Report a correction for Q2
Question 3 MSQ · 3.0 marks 6406537372413. Both TRPO and PPO aim to prevent the updated policy from deviating too far
from
.
6406537372414. PPO always produces a smaller policy update than TRPO for the same
and
.
6406537372415. When
is within
, the PPO clip is inactive and
reduces to
the unclipped surrogate
.
6406537372416. Computing the PPO objective requires solving a constrained optimisation
subproblem at each step, making it more expensive than TRPO.
A published solution is not available for this question yet.
Report a correction for Q3
Question 4 MSQ · 3.0 marks In Proximal Policy Optimization (PPO), the clipped surrogate objective for a single state-action pair
is:
Which of the following statements are correct?
6406537372417. When
and
, the clipped objective prevents the gradient
from further increasing
, effectively imposing a trust region.
6406537372418. When
and
, the clipped objective prevents the gradient
from further decreasing
.
6406537372419. The clipping mechanism is equivalent to adding an explicit KL-divergence
penalty
to the objective.
6406537372420. If
, then
regardless of the sign of
.
A published solution is not available for this question yet.
Report a correction for Q4
Question 5 MSQ · 3.0 marks In multi-head self-attention with
heads, the queries, keys, and values for each head have
dimension
where
is the model dimension. Which of the following
correctly explain why this choice makes the implementation efficient?
6406537372421. Choosing
ensures that every head learns the same attention
pattern while reducing the number of parameters.
6406537372422. The total parameters across
query projections
equal
,
the same as a single-head projection
. The same holds for key and value
projections.
6406537372423. Since
, all
heads can be computed as a single batched matrix
multiplication, enabling parallel execution across heads on a GPU.
6406537372424. Using
, the total computational cost across all
heads is reduced
by a factor of
compared to single-head attention with
.
A published solution is not available for this question yet.
Report a correction for Q5
Question 6 NAT · 3.0 marks A published solution is not available for this question yet.
Report a correction for Q6
Question 7 MCQ · 2.0 marks What is the role of layer normalization in a transformer block?
6406537372426. It eliminates the need for residual connections.
6406537372427. It normalizes the hidden representation across its features for each token,
helping maintain a stable scale of activations during training.
6406537372428. It normalizes the hidden representations across different examples in a mini-
batch.
6406537372429. It introduces the nonlinearity needed by the transformer through a learnable
activation function.
A published solution is not available for this question yet.
Report a correction for Q7
Question 8 MCQ · 2.0 marks Which among the following is true for a VAE and a diffusion model?
6406537372451. Both models use an encoder and decoder to map between the input and a
low-dimensional representation.
6406537372452. Both the encoder and decoder are learned in VAE and diffusion.
6406537372453. The hidden variables in a diffusion model are deterministic, whereas the latent
variable in a VAE is stochastic.
6406537372454. Both VAE and diffusion model use stochastic latent representations.
A published solution is not available for this question yet.
Report a correction for Q8
Question 9 MSQ · 2.0 marks Which of the following statements about Denoising Diffusion Implicit Models (DDIMs) are correct?
Select all that apply.
6406537372430. The forward process is non-Markovian, unlike the Markovian forward process
in DDPM.
6406537372431. DDIM achieves a tighter ELBO than DDPM.
6406537372432. DDIM requires a separate training procedure from DDPM.
6406537372433. When
for all
, the DDIM sampling process is deterministic.
A published solution is not available for this question yet.
Report a correction for Q9
Question 10 MSQ · 2.0 marks Consider two DDPMs at the same timestep
. For Model A,
, while for Model B,
.
Recall that
Which of the following statements are correct?
6406537372443. The sample
of Model A is more strongly influenced by the original sample
than that of Model B.
6406537372444. The sample
of Model B is closer to
than that of Model A.
6406537372445. As
decreases, the contribution of
to
increases.
6406537372446. Model B produces a noisier representation at timestep
than Model A.
A published solution is not available for this question yet.
Report a correction for Q10
Question 11 MSQ · 2.0 marks Which of the following statements correctly describe the forward diffusion process in a DDPM?
6406537372447. The forward process gradually corrupts
by adding Gaussian noise
according to a predefined noise schedule.
6406537372448. The parameters of the forward process are learned using the training data.
6406537372449. The forward process requires a neural network to predict the noise added at
every timestep.
6406537372450. Given
,
can be sampled directly without simulating all intermediate
timesteps.
A published solution is not available for this question yet.
Report a correction for Q11
Question 12 MSQ · 2.0 marks You are training a GAN with generator
,
, to generate handwritten digit images
spanning all 10 digit classes. After training, you suspect that
has not converged to
and that
the generator is suffering from mode collapse. Which of the following could be indicators of this
problem? Select all that apply.
6406537372455. Samples
for many different
all resemble the digit "3".
6406537372456. The discriminator loss
drops close to zero while the generator loss
remains persistently high.
6406537372457. The discriminator loss remains persistently high while the generator loss
drops to zero.
6406537372458. The generator loss and discriminator loss both decrease monotonically to
zero, indicating the adversarial objective
has reached a global saddle point.
A published solution is not available for this question yet.
Report a correction for Q12
Question 13 MSQ · 5.0 marks 6406537372434. : both actions are equally good relative to the
policy average in state B, so no policy gradient update will change
.
6406537372435. In state C, action
has a higher advantage than action
; so a policy
gradient update increases
and decreases
.
6406537372436. In state C, action
has a higher advantage than action
; so a policy
gradient update decreases
and increases
.
6406537372437. If a sampled trajectory from state
yields the discounted return
,
then the estimated advantage
; so the policy gradient update will decrease
.
6406537372438. If a sampled trajectory from state
yields the discounted return
,
then the estimated advantage
; so the policy gradient update will increase
.
6406537372439. The expected return obtained by taking
in state
must be negative.
A published solution is not available for this question yet.
Report a correction for Q13
Question 14 NAT · 3.0 marks A transformer processes a sequence of
tokens with model dimension
using
attention heads, each with
.
The input embedding matrix is:
Head 1 uses projections:
Head 2 uses projections:
Use
for scaling. All biases are zero.
Based on the above data, answer the given subquestions.
Compute
,
,
for Head 1 and the scaled score matrix , and enter the value of
the
entry of
. Enter the answer correct to two decimal places.
A published solution is not available for this question yet.
Report a correction for Q14
Question 15 NAT · 3.0 marks A transformer processes a sequence of
tokens with model dimension
using
attention heads, each with
.
The input embedding matrix is:
Head 1 uses projections:
Head 2 uses projections:
Use
for scaling. All biases are zero.
Based on the above data, answer the given subquestions.
Causal masking is applied on
. Compute the attention weights for the third query and enter the
value of the largest weight among the three, correct to two decimal places.
A published solution is not available for this question yet.
Report a correction for Q15
Question 16 NAT · 3.0 marks A transformer processes a sequence of
tokens with model dimension
using
attention heads, each with
.
The input embedding matrix is:
Head 1 uses projections:
Head 2 uses projections:
Use
for scaling. All biases are zero.
Based on the above data, answer the given subquestions.
Using causal masking, compute the attention outputs for the third token from both heads and
concatenate them as
Enter the fourth entry of the third row of
. Enter the answer correct to two decimal places.
A published solution is not available for this question yet.
Report a correction for Q16
Question 17 NAT · 3.0 marks In classifier-free guidance, a single diffusion model is jointly trained for both conditional and
unconditional generation. During training, the conditioning information
is randomly replaced
with a null token
with probability
. During sampling at timestep
, the model produces
two noise predictions:
1. Conditional prediction:
(model receives conditioning
)
2. Unconditional prediction:
(model receives null token)
The classifier-free guided noise prediction is defined as :
where
is the guidance scale. This follows from the guided score formulation:
The predicted clean data point is recovered via .
Following are the values given:
Based on the above data, answer the given subquestions.
Compute the predicted clean data point
. Enter the answer correct to one decimal place.
A published solution is not available for this question yet.
Report a correction for Q17
Question 18 MCQ · 2.0 marks In classifier-free guidance, a single diffusion model is jointly trained for both conditional and
unconditional generation. During training, the conditioning information
is randomly replaced
with a null token
with probability
. During sampling at timestep
, the model produces
two noise predictions:
1. Conditional prediction:
(model receives conditioning
)
2. Unconditional prediction:
(model receives null token)
The classifier-free guided noise prediction is defined as :
where
is the guidance scale. This follows from the guided score formulation:
The predicted clean data point is recovered via .
Following are the values given:
Based on the above data, answer the given subquestions.
If the guidance scale is set to
, which of the following correctly describes the effect on
and
?
6406537372460. reduces to the conditional prediction
alone, giving
.
6406537372461. reduces to the unconditional prediction
alone, giving
.
6406537372462. reduces to the conditional prediction
alone, giving
.
6406537372463. remains unchanged from
case because the guidance scale only
affects the output projection layer of the U-Net.
A published solution is not available for this question yet.
Report a correction for Q18
Question 19 NAT · 4.0 marks Consider a 1-dimensional VAE with:
1. Encoder:
,
,
2. Decoder:
, with fixed decoder variance
Use the reparameterization trick to express the latent sample
. The
reconstruction loss
for a single sample is given by
.
Following are the values given:
,
input
, sampled noise
. Compute
. Enter the answer correct to three
decimal places.
A published solution is not available for this question yet.
Report a correction for Q19
Question 20 MCQ · 1.0 marks Inference in DDPM is much slower as compared to GAN or VAE.
A published solution is not available for this question yet.
Report a correction for Q20