9. Variational Generative Models

0.0(0)
Studied by 0 people
call kaiCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/32

encourage image

There's no tags or description

Looks like no tags are added yet.

Last updated 10:06 AM on 6/2/26
Name
Mastery
Learn
Test
Matching
Spaced
Call with Kai

No analytics yet

Send a link to your students to track their progress

33 Terms

1
New cards

Explain the difference between Observable Data (xx) and Latent Variables (zz) using a structural analogy.

  • Observable Data (xRDx \in \mathbb{R}^D): High-dimensional, raw data vectors directly accessible to the system (e.g., raw pixel arrays, raw audio waveforms).

  • Latent Variables (zRLz \in \mathbb{R}^L): Lower-dimensional (L < D) explanatory variables that are not directly observed but capture the underlying core mechanisms or factors generating the data.

  • Analogy: Plato's Myth of the Cave—Observable data (xx) represents the high-dimensional shadows projected onto a wall, while latent variables (zz) are the simpler, lower-dimensional structural forms creating those shadows.

2
New cards

Contrast the operational paradigms and density objectives of Autoregressive Models vs. Variational Autoencoders (VAEs).

  • Autoregressive Models: Implement exact, deterministic density estimation. They learn the exact conditional probability of each variable given a history of all past variables using deep sequence predictors (e.g., Transformers).

  • Variational Autoencoders (VAEs): Implement stochastic approximation. They optimize a probabilistic proxy for data likelihood called the Evidence Lower Bound (ELBO) across a probabilistic Encoder-Decoder network.

3
New cards

Contrast the density tracking and architectural elements of Generative Adversarial Networks (GANs), Flow-based Models, and Diffusion Models.

  • Generative Adversarial Networks (GANs): Implicit density modeling. They completely avoid explicit density equations, opting for a two-player zero-sum game where a Generator network (G(z)G(z)) competes directly against an adversarial Discriminator network (D(x)D(x)).

  • Flow-based Models: Exact density calculation. They map simple prior distributions directly to complex data spaces through a sequence of invertible, deterministic mathematical functions (f(x)f(x) and f1(z)f^{-1}(z)).

  • Diffusion Models: Iterative stochastic evaluation. They systematically add Gaussian noise to a data distribution via a forward process and train a network to parameters that reverse it.

4
New cards

State the core mathematical objective function of kk-Means Clustering and its primary structural limitation as a generative model.

Objective: J(M,Z)=n=1Nxnμzn2\text{Objective: } J(M,Z)=\sum_{n=1}^{N}||x_n - \mu_{z_n}||^2

Where xnx_n is a data vector and μzn\mu_{z_n} is its assigned cluster centroid.

  • Core Limitation: It enforces a hard assignment mechanism (znz_n^* belongs exclusively to a single cluster). It provides no probabilistic uncertainty, variance bounds, or continuous density tracking, making it incapable of processing or generating realistic data variations.

5
New cards

Write out the probability density function for a Gaussian Mixture Model (GMM). What algorithms solve its parameters?

p(yθ)=k=1KπkN(yμk,Σk)p(y \mid \theta) = \sum_{k=1}^{K} \pi_k \mathcal{N}(y \mid \mu_k, \Sigma_k)

Where πk\pi_k represents categorical mixing weights (πk=1\sum \pi_k = 1), and μk,Σk\mu_k, \Sigma_k parameterize each separate Gaussian component.

  • Optimization: Because cluster assignments are hidden, it is solved under Maximum Likelihood Estimation via the Expectation-Maximization (EM) algorithm, where the E-step computes the posterior responsibilities (rnkr_{nk}) and the M-step updates the component parameters.

6
New cards

Explain why a Traditional Autoencoder (AE) fails to generate new samples, and how a Variational Autoencoder (VAE) structurally resolves this.

  • Traditional AE: Uses a deterministic bottleneck layer to compute a single static point vector. Because no constraints are placed on the latent space, it forms highly disconnected clusters and severe structural discontinuities. Sampling from empty voids yields corrupted, nonsensical outputs.

  • Variational Autoencoder (VAE): Converts the bottleneck into a continuous, parameter-controlled probability distribution. The encoder outputs statistical parameters—a mean vector (μ\mu) and a variance vector (σ\sigma)—and the latent variable zz is dynamically sampled from this distribution before entering the decoder.

7
New cards

Define Continuity and Completeness as they relate to the geometric optimization of a VAE's latent space.

  • Continuity: The geometric property ensuring that points positioned close together inside the latent representation manifold resolve to highly similar semantic content when mapped through the decoder network.

  • Completeness: The property ensuring that any arbitrary coordinate vector sampled directly from the fixed prior distribution space (N(0,I)\mathcal{N}(0, I)) maps to a valid, realistic, and high-fidelity data generation.

8
New cards

Why is the true mathematical posterior distribution pθ(zx)p_\theta(z \mid x) in a VAE considered completely intractable during standard inference?

Evaluating the true posterior requires computing the total marginal log-likelihood of the observed data:

pθ(zx)=pθ(x,z)pθ(x)wherepθ(x)=pθ(x,z)dzp_\theta(z \mid x) = \frac{p_\theta(x, z)}{p_\theta(x)} \quad \text{where} \quad p_\theta(x) = \int p_\theta(x, z) dz

To solve this integral directly, the model would have to evaluate all possible infinite configurations of the latent space zz. This makes the computation completely intractable (NP-hard). VAEs bypass this by introducing an encoder network (qϕ(zx)q_\phi(z \mid x)) to approximate the true posterior.

9
New cards

Provide the step-by-step mathematical derivation of the Evidence Lower Bound (ELBO) starting from the KL Divergence between qϕ(zx)q_\phi(z \mid x) and pθ(zx)p_\theta(z \mid x).

Start with the analytical KL Divergence definition:

DKL(qϕ(zx)pθ(zx))=Ezqϕ[logqϕ(zx)pθ(zx)]D_{KL}\big(q_\phi(z \mid x) \parallel p_\theta(z \mid x)\big) = \mathbb{E}_{z \sim q_\phi}\left[\log \frac{q_\phi(z \mid x)}{p_\theta(z \mid x)}\right]

Substitute pθ(zx)=pθ(x,z)pθ(x)p_\theta(z \mid x) = \frac{p_\theta(x, z)}{p_\theta(x)} via Bayes' rule:

=Ezqϕ[log(qϕ(zx)pθ(x)pθ(x,z))]= \mathbb{E}_{z \sim q_\phi}\left[\log \left( \frac{q_\phi(z \mid x) \cdot p_\theta(x)}{p_\theta(x, z)} \right)\right]

Expand the log of products into addition/subtraction terms:

=Ezqϕ[logqϕ(zx)logpθ(x,z)+logpθ(x)]= \mathbb{E}_{z \sim q_\phi}\left[\log q_\phi(z \mid x) - \log p_\theta(x, z) + \log p_\theta(x)\right]

Since logpθ(x)\log p_\theta(x) is independent of the latent variable zz, extract it from the expectation:

DKL(qϕ(zx)pθ(zx))=Ezqϕ[logqϕ(zx)logpθ(x,z)]+logpθ(x)D_{KL}\big(q_\phi(z \mid x) \parallel p_\theta(z \mid x)\big) = \mathbb{E}_{z \sim q_\phi}\big[\log q_\phi(z \mid x) - \log p_\theta(x, z)\big] + \log p_\theta(x)

Isolate the marginal log-likelihood (logpθ(x)\log p_\theta(x)):

logpθ(x)=Ezqϕ[logpθ(x,z)logqϕ(zx)]+DKL(qϕ(zx)pθ(zx))\log p_\theta(x) = \mathbb{E}_{z \sim q_\phi}\big[\log p_\theta(x, z) - \log q_\phi(z \mid x)\big] + D_{KL}\big(q_\phi(z \mid x) \parallel p_\theta(z \mid x)\big)

Decompose the joint distribution pθ(x,z)p_\theta(x, z) into pθ(xz)p(z)p_\theta(x \mid z)p(z):

logpθ(x)=Ezqϕ[logpθ(xz)]DKL(qϕ(zx)p(z))+DKL(qϕ(zx)pθ(zx))\log p_\theta(x) = \mathbb{E}_{z \sim q_\phi}\big[\log p_\theta(x \mid z)\big] - D_{KL}\big(q_\phi(z \mid x) \parallel p(z)\big) + D_{KL}\big(q_\phi(z \mid x) \parallel p_\theta(z \mid x)\big)

Because DKL(qϕ(zx)pθ(zx))0D_{KL}\big(q_\phi(z \mid x) \parallel p_\theta(z \mid x)\big) \ge 0, dropping it establishes the strict floor known as the ELBO:

ELBO(ϕ,θ;x)=Ezqϕ(zx)[logpθ(xz)]DKL(qϕ(zx)p(z))\text{ELBO}(\phi, \theta; x) = \mathbb{E}_{z \sim q_\phi(z \mid x)}\big[\log p_\theta(x \mid z)\big] - D_{KL}\big(q_\phi(z \mid x) \parallel p(z)\big)

10
New cards

Break down the specific individual operations and structural roles of Term 1 and Term 2 within the ELBO formula.

ELBO(ϕ,θ;x)=Ezqϕ(zx)[logpθ(xz)]Term 1: Reconstruction LossDKL(qϕ(zx)p(z))Term 2: KL Regularization Loss\text{ELBO}(\phi, \theta; x) = \underbrace{\mathbb{E}_{z \sim q_\phi(z \mid x)}\big[\log p_\theta(x \mid z)\big]}_{\text{Term 1: Reconstruction Loss}} - \underbrace{D_{KL}\big(q_\phi(z \mid x) \parallel p(z)\big)}_{\text{Term 2: KL Regularization Loss}}

  • Term 1 (Reconstruction): Measures how effectively the decoder network converts the latent samples back into high-fidelity reproductions of the training data.

  • Term 2 (KL Regularization): Acts as a statistical penalty that forces the encoder's inferred distribution to match the simple Gaussian prior distribution p(z)=N(0,I)p(z) = \mathcal{N}(0, I), ensuring the latent space remains smooth and continuous.

11
New cards

Explain the mechanical limitation of direct stochastic sampling in neural graphs, and write the mathematical formula for the Reparameterization Trick.

  • Limitation: Standard backpropagation requires fully deterministic paths to compute partial derivatives. Sampling a latent code zz directly from a stochastic distribution node N(μ,σ2)\mathcal{N}(\mu, \sigma^2) breaks this path, making it impossible to pass gradients back through the sampling layer to train the encoder.

  • Formula: The reparameterization trick isolates the stochasticity by shifting it to an external noise variable (ϵ\epsilon):

    z=μ+σϵwhereϵN(0,I)z = \mu + \sigma \odot \epsilon \quad \text{where} \quad \epsilon \sim \mathcal{N}(0, I)

    This allows $\mu$ and $\sigma$ to remain deterministic nodes in the computational graph, enabling unobstructed backpropagation.

12
New cards

Write out the loss objective function for a $\beta$-VAE and explain how configuring $\beta > 1$ alters latent features.

Lβ-VAE=Ezqϕ(zx)[logpθ(xz)]βDKL(qϕ(zx)p(z))\mathcal{L}_{\beta\text{-VAE}} = \mathbb{E}_{z \sim q_\phi(z \mid x)}\big[\log p_\theta(x \mid z)\big] - \beta D_{KL}\big(q_\phi(z \mid x) \parallel p(z)\big)

  • Effect of \beta > 1: Heavily penalizing the KL divergence term forces the model to strictly align with an independent diagonal prior distribution. This compresses the bottleneck, forcing the network to discover the most efficient, uncorrelated, and statistically independent latent factors (e.g., separating head rotation cleanly from facial expression).

  • Trade-off: Excessively high β\beta factors can over-compress the bottleneck, hurting reconstruction quality and washing out fine details.

13
New cards

Detail the multi-modal pipeline of DALL-E 1, explaining how it integrates discrete VAE tokenization with autoregressive text parsing.

1. Discrete VAE Tokenization (VQ-VAE): To circumvent the massive memory footprint of raw pixel spaces, raw images are passed through a Vector Quantized VAE, compressing them into dense grids of discrete codebook tokens.

2. Text Representation: Descriptive language prompt strings are tokenized into contextual representations using standard Byte Pair Encoding (BPE).

3. Autoregressive Integration: Both the text tokens and the discrete image tokens are concatenated into a single continuous sequence. A massive autoregressive Transformer processes this sequence, learning to model their joint distribution to synthesize new images directly from novel textual prompts.

14
New cards

Define Undercomplete and Overcomplete representations in Autoencoders. How does each regime prevent the network from learning a trivial identity mapping.

  • Undercomplete (LDL \ll D): Constrains the latent space dimension (LL) to be significantly smaller than the input dimension (DD). This forces the data through a narrow structural bottleneck, compelling the network to learn only the most salient features.

  • Overcomplete (LDL \gg D): Keeps the latent space dimension larger than the input dimension but limits network capacity via structural regularization. This prevents the identity mapping by injecting input noise, penalizing derivatives, or forcing activation sparsity.

15
New cards

Under what explicit architectural conditions is a Bottleneck Autoencoder mathematically equivalent to Principal Component Analysis (PCA)?

An autoencoder becomes mathematically equivalent to PCA if it satisfies three conditions:

  1. It features a single hidden bottleneck layer (L < D).

  2. It utilizes strictly linear activations (z=W1xz = W_1x and x^=W2z\hat{x} = W_2z).

  3. It minimizes the standard squared reconstruction error.

Under these constraints, the combined weight matrix W^=W2W1\hat{W} = W_2W_1 is forced to learn an orthogonal projection onto the first LL eigenvectors of the data's empirical covariance matrix.

16
New cards

Explain the mathematical relationship between a Denoising Autoencoder's (DAE) residual error and the data distribution as noise variance approaches zero ($\sigma \to 0$).

When trained with Gaussian corruption and squared error loss, the residual error vector field directly approximates the score function of the data density:

Residual Error: e(x)=r(x~)xxlogp(x)\text{Residual Error: } e(x) = r(\tilde{x}) - x \approx \nabla_x \log p(x)

Geometrically, this means the DAE learns a vector field where all error vectors point directly inward toward the nearest region of high probability density along the lower-dimensional data manifold.

17
New cards

Write out the explicit regularization penalty term for a Contractive Autoencoder (CAE) and explain its variables.

The CAE appends the Frobenius norm of the encoder's Jacobian matrix directly to the loss:

Ω(z,x)=λfe(x)xF2=λkxhk(x)22\Omega(z, x) = \lambda \left\| \frac{\partial f_e(x)}{\partial x} \right\|_F^2 = \lambda \sum_k \|\nabla_x h_k(x)\|_2^2

  • λ\lambda: The regularization scaling hyperparameter.

  • fe(x)f_e(x) / hk(x)h_k(x): The activation value of the kk-th hidden latent unit in the encoder.

18
New cards

How do the reconstruction loss and the Jacobian penalty interact dynamically to map a data manifold in a Contractive Autoencoder (CAE)?

  • The Jacobian penalty forces the encoder to become flat or constant, actively minimizing sensitivity to small variations in the input vector (local contraction).

  • The reconstruction loss counters this by demanding that the model preserve vital data traits.

Together, they force the network to remain highly sensitive only along the specific directional vectors that define the true underlying data manifold, while remaining completely insensitive to variations perpendicular to it.

19
New cards

Why do Contractive Autoencoders (CAEs) often utilize tied weights (Wdecoder=WencoderTW_{\text{decoder}} = W_{\text{encoder}}^T), and what is the architecture's primary computational limitation?

  • Tied Weights Rationale: Prevents a degenerate solution where the encoder artificially shrinks the Jacobian by multiplying the input by an infinitesimally small scalar ϵ\epsilon, while the decoder trivially cancels it out by multiplying by 1/ϵ1/\epsilon.

  • Limitation: CAEs are highly computationally expensive and slow to train because tracking and calculating the full encoder Jacobian matrix during backpropagation scales poorly with layer dimensions.

20
New cards

Contrast 1\ell_1 Activity Regularization with KL Divergence Frequency Matching as mechanisms for enforcing sparsity in an autoencoder.

  • \ell_1$$Activity Regularization (\lambda \|z\|_1</strong></span><strong>):</strong>Appliesanabsolutepenaltytoindividualactivations.Thiscanbeaggressive,oftenleadingtoaregimewherespecificneuronsarecompletelyandpermanentlydeactivatedacrosstheentiredataset.</p></li></ul><ul><li><p><strong>KLDivergenceFrequencyMatching:</strong>Trackstheaverageempiricalactivationfrequency<span></strong></span><strong>):</strong> Applies an absolute penalty to individual activations. This can be aggressive, often leading to a regime where specific neurons are completely and permanently deactivated across the entire dataset.</p></li></ul><ul><li><p><strong>KL Divergence Frequency Matching:</strong> Tracks the average empirical activation frequency <span>q_k</span>ofeachhiddenunitacrossaminibatchandpenalizesitsdivergencefromatinytargetdistribution<span></span> of each hidden unit across a minibatch and penalizes its divergence from a tiny target distribution <span>p</span>(e.g.,<span></span> (e.g., <span>p = 0.1</span>):</p><p></span>):</p><p>\Omega = \lambda \sum_k D_{KL}(p \parallel q_k)$$

    This ensures that roughly 90% of the neurons are quiet at any given time step, preventing individual units from shutting down permanently across the whole dataset.

21
New cards

State the explicit mathematical likelihood distributions used by a VAE Decoder (pθ(xz)p_\theta(x \mid z)) for both continuous data and binary data.

Continuous Data (Gaussian Likelihood):

pθ(xz)=N(xfd(z;θ),σ2I)p_\theta(x \mid z) = \mathcal{N}(x \mid f_d(z; \theta), \sigma^2 I)

  • Binary Data (Bernoulli Likelihood):

    pθ(xz)=i=1DBer(xifd(z;θ))p_\theta(x \mid z) = \prod_{i=1}^D \text{Ber}(x_i \mid f_d(z; \theta))

    Where fd(z;θ)f_d(z; \theta) represents the non-linear decoder neural network transformation.

22
New cards

Use Jensen's Inequality to prove that the VAE Evidence Lower Bound (ELBO) establishes a strict analytical lower bound on the true marginal log-evidence logpθ(x)\log p_\theta(x).

Start with the continuous integral form of the ELBO:

L(θ,ϕx)=qϕ(zx)logpθ(x,z)qϕ(zx)dz\mathcal{L}(\theta, \phi \mid x) = \int q_\phi(z \mid x) \log \frac{p_\theta(x, z)}{q_\phi(z \mid x)} dz

Because the logarithm function is concave, applying Jensen's Inequality allows us to pull the log operation outside the expectation integral:

logqϕ(zx)pθ(x,z)qϕ(zx)dz\le \log \int q_\phi(z \mid x) \frac{p_\theta(x, z)}{q_\phi(z \mid x)} dz

Cancel the approximate posterior qϕ(zx)q_\phi(z \mid x) terms inside the integrand:

=logpθ(x,z)dz= \log \int p_\theta(x, z) dz

By definition, integrating out the latent variable zz yields the true marginal evidence:

=logpθ(x)= \log p_\theta(x)

23
New cards

Write out the fast, closed-form analytical equation for the KL Regularization Term when matching an inferred Gaussian distribution against a standard normal prior p(z)=N(0,I)p(z) = \mathcal{N}(0, I).

DKL(qp)=12k=1K(logσk2σk2μk2+1)D_{KL}(q \parallel p) = -\frac{1}{2} \sum_{k=1}^K \left( \log \sigma_k^2 - \sigma_k^2 - \mu_k^2 + 1 \right)

Where KK is the total dimensionality of the latent space bottleneck, and μk,σk2\mu_k, \sigma_k^2 are the localized means and variances output by the inference encoder network.

24
New cards

Contrast Directed PGMs, Autoregressive Models (ARMs), and Generative Adversarial Networks (GANs) on Density Evaluation and Sampling Speed.

  • Directed PGMs: Features Exact, Fast Density Evaluation paired with Fast Sampling Speed over sparse Directed Acyclic Graphs (DAGs).

  • Autoregressive Models (ARMs): Features Exact, Fast Density Evaluation but suffers from Slow, Sequential Sampling Speed because each token must be generated iteratively.

  • Generative Adversarial Networks (GANs): Density evaluation is Not Available (implicit modeling), but features Fast, Parallel Sampling Speed via a single forward pass through the generator network.

25
New cards

Compare VAEs, Normalizing Flows, and Diffusion Models regarding their Latent Space Dimension constraints.

  • Variational Autoencoders (VAEs): Enforces a Compressed latent space (RL\mathbb{R}^L where LDL \ll D), squeezing data through a probabilistic bottleneck.

  • Normalizing Flows: Requires an Uncompressed latent space (RD\mathbb{R}^D where L=DL = D) to maintain full mathematical invertibility across its transformations.

  • Diffusion Models: Utilizes an Uncompressed latent space (RD\mathbb{R}^D where L=DL = D) matching the exact structural dimensions of the input across its forward-reverse denoising steps.

26
New cards

Explain the mathematical formulation and structural rationale behind Latent Space Interpolation.

Given two anchor inputs x1x_1 and $$x_2</span>,theirstructurallatentembeddingsareextractedviaanencoder<span></span>, their structural latent embeddings are extracted via an encoder <span>z_1 = e(x_1)</span>and<span></span> and <span>z_2 = e(x_2)</span>.Alinearblendiscalculatedacrossthelatentspace:</p><p></span>. A linear blend is calculated across the latent space:</p><p>z = \lambda z_1 + (1 - \lambda)z_2 \quad \text{where} \quad 0 \le \lambda \le 1</p><p>Decodingthispath(<span></p><p>Decoding this path (<span>x' = d(z)$$) synthesizes a smooth semantic morph between the inputs. This is highly effective because while the raw pixel space is highly curved and nonlinear, the learned latent manifold has approximately zero curvature.

27
New cards

Write out the mathematical derivation for Latent Space Attribute Arithmetic (e.g., adding sunglasses to a face).

1. Compute an attribute offset vector Δ\Delta by isolating the average embeddings of images possessing the target attribute (z+z^+) and subtracting the average embeddings of images lacking it (zz^-):

Δ=1N+z+1Nz\Delta = \frac{1}{N_+}\sum z^+ - \frac{1}{N_-}\sum z^-

2. To project this attribute predictably onto a novel unaligned image vector's embedding (znewz_{\text{new}}), scale and add the offset vector before decoding:

zmodified=znew+sΔz_{\text{modified}} = z_{\text{new}} + s\Delta

Where ss is a scalar hyperparameter controlling attribute intensity.

28
New cards

What is the core contradiction when evaluating Continuous Probability Densities on discrete image/audio data, and how does Uniform Dequantization resolve it?

Raw images/audio are stored as discrete integers (e.g., pixel intensities from 0 to 255), yet are typically evaluated using continuous probability density functions (p(x)0p(x) \ge 0). Because continuous density peaks can infinitely exceed 1, the continuous Negative Log-Likelihood (NLL) can anomalously tend toward negative infinity.

Uniform Dequantization resolves this by adding uniform noise uU(0,1)u \sim \mathcal{U}(0, 1) directly to the discrete coordinates. Evaluating the density of this dequantized continuous version establishes a mathematically rigorous lower bound on the true discrete model log-likelihood via Jensen's Inequality.

29
New cards

Provide an algebraic example proving that a high Log-Likelihood Score does not guarantee high-quality sample generation.

Consider a model q2(x)q_2(x) that combines 1% of an optimal density model q0(x)q_0(x) with 99% of a white noise model q1(x)q_1(x). This network will generate poor, noisy samples 99% of the time, yet its log-likelihood per pixel changes by a negligible constant factor compared to the perfect model:

logq2(x)log[0.01q0(x)]=logq0(x)log(100)=logq0(x)4.6\log q_2(x) \ge \log [0.01 q_0(x)] = \log q_0(x) - \log(100) = \log q_0(x) - 4.6

The model achieves a stellar likelihood score despite generating visual trash.

30
New cards

Write out the mathematical equation for the Inception Score (IS). Explain its two internal entropy objectives.

IS=exp(Expθ(x)[DKL(pdisc(Yx)pθ(Y))])\text{IS} = \exp \left( \mathbb{E}_{x \sim p_\theta(x)} \left[ D_{KL}(p_{\text{disc}}(Y \mid x) \parallel p_\theta(Y)) \right] \right)

Expanding the logs yields: log(IS)=H(pθ(Y))Expθ(x)[H(pdisc(Yx))]\log(\text{IS}) = H(p_\theta(Y)) - \mathbb{E}_{x \sim p_\theta(x)} [H(p_{\text{disc}}(Y \mid x))]

  • Maximize H(pθ(Y))H(p_\theta(Y)) (Marginal Entropy): The model must generate samples evenly balanced across all known classes, ensuring high variety and avoiding label drop.

  • Minimize H(pdisc(Yx))H(p_{\text{disc}}(Y \mid x)) (Conditional Entropy): Individual generated samples must contain distinct, sharp class features that allow the classifier to identify a single label with high confidence.

31
New cards

Write out the formula for the Fréchet Inception Distance (FID) and state its primary statistical limitation.

FID treats deep features extracted via an Inception classifier as multi-dimensional Gaussians, calculating the Wasserstein-2 distance between the real data (μd,Σd\mu_d, \Sigma_d) and model samples (μm,Σm\mu_m, \Sigma_m):

FID=μmμd22+tr(Σd+Σm2(ΣdΣm)1/2)\text{FID} = \|\mu_m - \mu_d\|_2^2 + \text{tr}\left( \Sigma_d + \Sigma_m - 2(\Sigma_d\Sigma_m)^{1/2} \right)

  • Limitation: FID suffers from significant sample bias, meaning scores systematically shift based on the total count of samples used to evaluate the empirical means and covariances. To circumvent this bias, the Kernel Inception Distance (KID) can be used to calculate maximum mean discrepancy.

32
New cards

How do Precision and Recall in generative evaluation decouple sample quality from sample diversity?

Aggregate metrics like FID collapse all failure modes into a single scalar. Precision and recall fix this by using kk-nearest neighbor boundaries in a classifier's feature space:

  • Precision (Quality Metric): Quantifies the fraction of model-generated samples that fall inside the local neighborhood clusters of the true data distribution. High precision means no low-quality or corrupted samples.

  • Recall (Diversity/Coverage Metric): Quantifies the fraction of real validation samples that fall inside the local neighborhood clusters of the model distribution. High recall means the model has successfully avoided mode collapse.

33
New cards

Write out the mathematical definitions for Precision and Recall based on the binary $k$-nearest neighbor coverage function $f_k(\phi, \Phi)$.

Given the binary coverage function fkf_k (which outputs 1 if feature vector $\phi$ falls within the nearest-neighbor radius of the reference set Φ\Phi), precision and recall are defined as:

precision(Φmodel,Φdata)=1ΦmodelϕΦmodelfk(ϕ,Φdata)\text{precision}(\Phi_{\text{model}}, \Phi_{\text{data}}) = \frac{1}{|\Phi_{\text{model}}|} \sum_{\phi \in \Phi_{\text{model}}} f_k(\phi, \Phi_{\text{data}})

recall(Φmodel,Φdata)=1ΦdataϕΦdatafk(ϕ,Φmodel)\text{recall}(\Phi_{\text{model}}, \Phi_{\text{data}}) = \frac{1}{|\Phi_{\text{data}}|} \sum_{\phi \in \Phi_{\text{data}}} f_k(\phi, \Phi_{\text{model}})