Level 1 — RecognitionGenerative Models

Generative Models

20 minutes30 marksprintable — key stays hidden on paper

Difficulty Level: 1 (Recognition — MCQ, Matching, True/False with justification) Time Limit: 20 minutes Total Marks: 30


Section A — Multiple Choice (1 mark each, 10 marks)

Select the single best answer.

Q1. Which type of model directly estimates the joint distribution p(x,y)p(x, y)?

  • (a) Discriminative model
  • (b) Generative model
  • (c) Support vector machine
  • (d) Logistic regression

Q2. In a standard autoencoder, the layer that produces the compressed representation is called the:

  • (a) Decoder output
  • (b) Bottleneck / latent code
  • (c) Loss layer
  • (d) Skip connection

Q3. The reparameterization trick in a VAE rewrites a sample zz as:

  • (a) z=μσz = \mu \cdot \sigma
  • (b) z=μ+σϵ, ϵN(0,I)z = \mu + \sigma \odot \epsilon,\ \epsilon \sim \mathcal{N}(0, I)
  • (c) z=μϵz = \mu - \epsilon
  • (d) z=σϵz = \sigma \odot \epsilon only

Q4. The ELBO objective for a VAE consists of a reconstruction term and a:

  • (a) KL divergence term between the approximate posterior and the prior
  • (b) Cross-entropy classification term
  • (c) Adversarial loss term
  • (d) Total variation term

Q5. In the original GAN minimax game, the discriminator tries to:

  • (a) Minimize the probability of classifying real vs fake correctly
  • (b) Maximize the probability of correctly distinguishing real from generated samples
  • (c) Generate realistic samples
  • (d) Compute the KL divergence

Q6. "Mode collapse" in GAN training refers to:

  • (a) The discriminator overfitting
  • (b) The generator producing limited/repetitive outputs covering few modes
  • (c) The learning rate vanishing
  • (d) The latent space becoming too large

Q7. WGAN improves training stability primarily by using:

  • (a) Binary cross-entropy loss
  • (b) Wasserstein (Earth-Mover) distance
  • (c) A deeper generator only
  • (d) Dropout in the discriminator

Q8. In a DDPM, the forward process gradually:

  • (a) Removes noise from data
  • (b) Adds Gaussian noise to data over many steps
  • (c) Trains the discriminator
  • (d) Encodes text prompts

Q9. Classifier-free guidance combines predictions from:

  • (a) Two different generators
  • (b) A conditional and an unconditional model
  • (c) Two discriminators
  • (d) FID and IS scores

Q10. In Stable Diffusion (latent diffusion), the diffusion process operates in:

  • (a) Raw pixel space
  • (b) A compressed latent space of an autoencoder
  • (c) Frequency space only
  • (d) The text embedding space only

Section B — Matching (1 mark each, 8 marks)

Match each model/term in Column X to its correct description in Column Y. Write pairs like Q11 → (iv).

Column X Column Y
Q11. FID (i) Uses cross-modal image–text embeddings for conditioning
Q12. CLIP (ii) Learns the gradient of the log-density xlogp(x)\nabla_x \log p(x)
Q13. Score-based model (iii) Measures distance between real/generated feature distributions
Q14. StyleGAN (iv) Introduces style-based generator with per-layer control
Q15. Inception Score (IS) (v) Controls how noise variance changes across diffusion steps
Q16. Noise schedule (vi) Uses quality × diversity of class predictions
Q17. DCGAN (vii) Convolutional GAN architecture with conv/deconv layers
Q18. Reverse process (diffusion) (viii) Learned denoising that reconstructs data from noise

Section C — True/False WITH Justification (3 marks each, 12 marks)

State True or False (1 mark) and give a one-line justification (2 marks).

Q19. "A discriminative model can generate new realistic samples as easily as a generative model."

Q20. "The KL divergence term in the ELBO acts as a regularizer that keeps the latent posterior close to the prior."

Q21. "The reparameterization trick is needed so that gradients cannot flow through the sampling operation."

Q22. "A lower FID score indicates better-quality and more realistic generated images."

Answer keyMark scheme & solutions

Section A — MCQ (1 mark each)

Q1 → (b) Generative models model the joint p(x,y)p(x,y) (or p(x)p(x)), from which p(yx)p(y|x) can be derived; discriminative models model p(yx)p(y|x) directly. (1)

Q2 → (b) The bottleneck/latent code is the low-dimensional compressed representation between encoder and decoder. (1)

Q3 → (b) Reparameterization: z=μ+σϵz=\mu+\sigma\odot\epsilon with ϵN(0,I)\epsilon\sim\mathcal N(0,I), moving randomness to ϵ\epsilon so μ,σ\mu,\sigma stay differentiable. (1)

Q4 → (a) ELBO = reconstruction term − KL(q(zx)p(z))(q(z|x)\,\|\,p(z)). (1)

Q5 → (b) Discriminator maximizes correct classification of real vs fake. (1)

Q6 → (b) Mode collapse = generator outputs few modes / repetitive samples. (1)

Q7 → (b) WGAN uses Wasserstein distance for smoother gradients and stability. (1)

Q8 → (b) Forward process progressively adds Gaussian noise. (1)

Q9 → (b) CFG mixes conditional and unconditional predictions: ϵ~=ϵuncond+w(ϵcondϵuncond)\tilde\epsilon=\epsilon_\text{uncond}+w(\epsilon_\text{cond}-\epsilon_\text{uncond}). (1)

Q10 → (b) Latent diffusion runs in the autoencoder's compressed latent space for efficiency. (1)

Section B — Matching (1 mark each)

Q Answer
Q11 FID (iii)
Q12 CLIP (i)
Q13 Score-based (ii)
Q14 StyleGAN (iv)
Q15 IS (vi)
Q16 Noise schedule (v)
Q17 DCGAN (vii)
Q18 Reverse process (viii)

Award 1 mark per correct pair. (8 marks total)

Section C — True/False with Justification (3 each)

Q19. FALSE (1) — Discriminative models learn only decision boundaries p(yx)p(y|x); they lack a model of p(x)p(x) and thus cannot readily generate new samples. (2)

Q20. TRUE (1) — The KL term penalizes divergence of q(zx)q(z|x) from prior p(z)=N(0,I)p(z)=\mathcal N(0,I), regularizing/structuring the latent space. (2)

Q21. FALSE (1) — The trick is used precisely so gradients CAN flow through the deterministic path (μ,σ\mu,\sigma) while randomness is isolated in ϵ\epsilon; direct sampling is non-differentiable. (2)

Q22. TRUE (1) — FID measures Fréchet distance between real and generated feature distributions; lower = closer = better quality/realism. (2)

[
  {"claim": "Reparameterization z = mu + sigma*eps has derivative w.r.t. mu equal to 1",
   "code": "mu, sigma, eps = symbols('mu sigma eps'); z = mu + sigma*eps; result = (diff(z, mu) == 1)"},
  {"claim": "dz/dsigma = eps (gradient flows to sigma via reparameterization)",
   "code": "mu, sigma, eps = symbols('mu sigma eps'); z = mu + sigma*eps; result = (diff(z, sigma) == eps)"},
  {"claim": "CFG blend at w=1 reduces to conditional prediction",
   "code": "e_c, e_u, w = symbols('e_c e_u w'); cfg = e_u + w*(e_c - e_u); result = (simplify(cfg.subs(w,1) - e_c) == 0)"},
  {"claim": "CFG blend at w=0 reduces to unconditional prediction",
   "code": "e_c, e_u, w = symbols('e_c e_u w'); cfg = e_u + w*(e_c - e_u); result = (simplify(cfg.subs(w,0) - e_u) == 0)"}
]