1. Population divergence saturation: When supports separate (e.g., \mathcal{N}(0, 1) vs. \mathcal{N}(7, 1)), \mathrm{JS}(p, q) sits within 0.1\% of \log 2 with derivative 0.0013.
2. Critic function-class geometry (\mathcal{T}): Does the critic D \in \mathcal{T} jump discontinuously between supports, or maintain a nonzero spatial gradient \nabla_x D(x') across the empty gap?
3. Generator loss weighting: Does the generator loss transmit \nabla_x D(x')(w_ns ≈ 1) or multiply it by an exponentially vanishing weight (w_sat ≈ e^D → 0)?
Classification payoffs (\mathcal{T} unconstrained): Nonlinear margin losses (\ell_p, \ell_q) estimate monotone links of \lambda(x) = \log(p/q) and evaluate f-divergences (or product-space JS under pairing).
Integral probability metrics (\mathcal{T} constrained): Linear payoffs \ell_p(t) = t, \ell_q(t) = -t on an RKHS ball (MMD) or 1-Lipschitz ball (W_1).
Convexity in measure space: As a supremum of linear expectations in q, d(p, q) is always convex in q (though nonconvex in generator weights \theta).
From Posterior Probability to Bayes-Risk Gaps
Two-Outcome Intuition
Two-state example (p = (\frac{3}{4}, \frac{1}{4}), q = (\frac{1}{4}, \frac{3}{4})): Every classification loss scores the exact same Bayes posterior \eta(x) = \frac{p(x)}{p(x) + q(x)}(\frac{3}{4} on heads, \frac{1}{4} on tails) against the blind-guess baseline \eta = \frac{1}{2}.
Induced divergences from the Bayes-risk gap \Delta_\ell = L(\frac{1}{2}) - \mathbb{E}_m[L(\eta)]:
Concave conditional Bayes risk:L(\eta) = \inf_t \{-\eta\,\ell(t) - (1 - \eta)\,\ell(-t)\} is concave on [0, 1] as an infimum of affine functions of \eta.
Convex f-divergence generator: Changing to the density ratio u = p(x)/q(x) (where \eta = u/(u+1)) makes f(u) convex on [0, \infty) with f(1) = 0.
Monotone critic link D^\star(\lambda): The pointwise optimal critic is a monotone function of the log density ratio \lambda = \log(p/q).
Standard Classification Losses and Critic Links
Taxonomy of Margin Losses
Each margin loss gives a divergence gap \Delta_\ell and an optimal critic D^\star, a monotone link of \lambda = \log(p/q):
Why asymmetric payoffs \ell_p \neq \ell_q are needed: Any symmetric margin loss has bounded gap \Delta_\ell \le L(\frac{1}{2}) and cannot represent unbounded asymmetric divergences like forward KL D_{\textrm{KL}}(p \,\|\, q).
Fenchel conjugate f^*(t) = \sup_u \{ut - f(u)\}: Tight at T^\star(x) = f'(p(x)/q(x)); for forward KL (f(u) = u\log u),f^*(t) = e^{t-1} and T^\star(x) = 1 + \lambda(x).
Empirical Verification of Critic Link Functions
2D Gaussian Mixture Benchmark
We train fresh 3-layer leaky-ReLU MLP critics (2 \to 64 \to 64 \to 1) for 3{,}000 steps against a fixed 3-component 2D Gaussian mixture q(\mathrm{JS}(p, q) = 0.033 nats) where \lambda(x) = \log(p(x)/q(x)) is known in closed form:
Exact link recovery: Evaluated on 300 real and 300 generated draws, all four trained networks track their theoretical link functions of \lambda:
Logistic: Identity D^\star(\lambda) = \lambda
Least squares: Sigmoid D^\star(\lambda) = \sigma(\lambda)
Hinge: Step function D^\star(\lambda) = \operatorname{sign}(\lambda) (with wider scatter near \lambda = 0, where any D \in [-1, 1] achieves optimal risk)
Forward KL: Shifted line T^\star(\lambda) = 1 + \lambda
Integral Probability Metrics (IPMs) and MMD
Constraining the Critic Class
Whereas f-divergences pair an unconstrained critic with nonlinear payoffs, integral probability metrics (IPMs) use linear payoffs \ell_p(t) = t and \ell_q(t) = -t over a constrained symmetric function class \mathcal{F}:
Maximum Mean Discrepancy (MMD; Gretton et al., 2012): Choosing \mathcal{F} as the unit ball of an RKHS with positive-definite kernel k(x, x') (e.g., Gaussian RBF e^{-\|x - x'\|^2 / (2s^2)}) yields a closed-form squared distance requiring no critic network: \mathrm{MMD}^2(p, q) = \mathbb{E}_{p,p}[k(x, \tilde{x})] + \mathbb{E}_{q,q}[k(x', \tilde{x}')] - 2\mathbb{E}_{p,q}[k(x, x')]
def mmd2_unbiased(K_pp, K_qq, K_pq):"""Unbiased MMD^2 from the kernel matrices within p, within q, and across; the diagonals (a point with itself) are left out.""" m, n =len(K_pp), len(K_qq)return ((K_pp.sum() - K_pp.diagonal().sum()) / (m * (m -1))+ (K_qq.sum() - K_qq.diagonal().sum()) / (n * (n -1))-2* K_pq.mean())
Kantorovich–Rubinstein duality: Constraining the IPM witness class \mathcal{F} to 1-Lipschitz functions(|T(x) - T(y)| \le \|x - y\|) recovers the Earth Mover’s distance W_1(p, q).
Three neural enforcement mechanisms: Weight clipping (restricts capacity), WGAN-GP ray gradient penalty (two-sided unit-slope target creates a barrier at q = p), and spectral normalization (W \leftarrow W/\sigma_{\max}(W)).
Sample Complexity in High Dimensions: MMD vs. W₁
Statistical Scaling Pitfalls
Fixed-kernel MMD (O(n^{-1/2}) in any dimension): The unbiased U-statistic estimator mmd2_unbiased converges at the parametric rate O(n^{-1/2}) independent of d_x.
Empirical W_1(O(n^{-1/d_x}) for d_x > 2): True empirical optimal transport suffers from the curse of dimensionality (Weed & Bach, 2019); WGAN works in practice because its smooth neural architecture acts as a parametric witness.
Variational f-GAN variance explosion: In the forward-KL dual, e^{T^\star(x')-1} = p(x')/q(x') has variance \chi^2(p \,\|\, q), which can diverge even when D_{\textrm{KL}}(p \,\|\, q) < \infty.
Population Divergence Slope vs. Separation
Gradients Far from the Data
Comparing 1D unit-variance Gaussians p = \mathcal{N}(0, 1) and q = \mathcal{N}(\mu, 1) across separation \mu > 0 shows how each population divergence responds when distributions separate:
Wasserstein-1 (W_1(p, q) = \mu): Maintains a constant unit derivative \frac{d}{d\mu}W_1 = 1 at every separation \mu.
Gaussian-kernel \mathrm{MMD}^2 (bandwidth s = 4):\mathrm{MMD}^2(\mu) = \frac{2s}{\sqrt{s^2 + 2}}\!\left(1 - \exp\!\left(-\frac{\mu^2}{2(s^2 + 2)}\right)\right) Its slope peaks at \mu = \sqrt{s^2 + 2} \approx 4.2 before decaying in the Gaussian tail.
Jensen–Shannon \mathrm{JS}(p, q): Its slope drops from 0.20 at \mu = 1 to 0.0013 at \mu = 7 and 1.5 \times 10^{-22} at \mu = 20.
mu = 1: JS slope 0.1987, JS / log 2 = 0.1607, MMD^2 slope 0.1019
mu = 7: JS slope 0.001264, JS / log 2 = 0.9990, MMD^2 slope 0.188
mu = 20: JS slope 1.549e-22, JS / log 2 = 1.0000, MMD^2 slope 3.303e-05
MMD^2 slope peaks at mu = 4.2 with 0.269
Geometry of Optimal Critics on Disjoint Supports
Why Smooth Critics Provide Gradients
Left (Unconstrained JS critic \log(p/q)): Evaluates to +\infty on \operatorname{supp}(p) and -\infty on \operatorname{supp}(q), with zero spatial slope on both clouds.
Middle (W_1 Kantorovich potential): A linear ramp of unit slope connecting q to p, providing a constant restoring gradient across the gap.
Right (MMD witness w(x) = \mathbb{E}_p[k(x, \cdot)] - \mathbb{E}_q[k(x, \cdot)]): A smooth difference of kernel bumps whose tail slopes toward p over distances comparable to the bandwidth s.
Implementing MMD and WGAN-GP Gradient Penalties
Code Primitives
mmd2_loss sums RBF kernels over several bandwidths; mmd2_median sets one bandwidth to the median pairwise distance of the pooled minibatch:
def mmd2_loss(x, y, bandwidths=(0.5, 1.0, 2.0)):"""Unbiased MMD^2 under the sum of RBF kernels of the given bandwidths."""def kernel(a, b): sq_dist = torch.cdist(a, b) **2returnsum(torch.exp(-sq_dist / (2* s **2)) for s in bandwidths)return mmd2_unbiased(kernel(x, x), kernel(y, y), kernel(x, y))def mmd2_median(x, y):"""MMD^2 with one RBF kernel, its bandwidth the median pairwise distance of the pooled batch, held constant in the gradient.""" xy = torch.cat([x, y])return mmd2_loss(x, y, (torch.cdist(xy, xy).median().detach(),))
Implementing MMD and WGAN-GP Gradient Penalties (cont.)
Code Primitives
gradient_penalty evaluates either the two-sided WGAN-GP penalty (|D'(x)| - 1)^2 or the one-sided Lipschitz penalty \max(0, |D'(x)| - 1)^2 at random interpolants \tilde{x} = uX + (1 - u)X':
def gradient_penalty(D, X, fake, u, one_sided=False):"""Mean (|D'(x)| - 1)^2 at the points u X + (1 - u) fake (inputs 1-D); one-sided, only slopes steeper than one pay: max(0, |D'(x)| - 1)^2.""" x = (u * X + (1- u) * fake).requires_grad_() grad, = torch.autograd.grad(D(x).sum(), x, create_graph=True) excess = grad.abs() -1return ((excess.clamp(min=0) if one_sided else excess) **2).mean()
Trained Neural Critics from a Separated Start
Theory vs. Neural Practice
We fit a 1D location generator q_\theta = \mathcal{N}(\theta, 1)(x' = \theta + z) starting at \theta_0 = 6.0 to p = \mathcal{N}(0, 1) using vanilla SGD on \theta (so step sizes directly reflect gradient magnitudes) against a 2-layer ReLU MLP critic updated 5 times per generator step:
Why finite neural critics move even under logistic and hinge loss: Although the unconstrained optimal hinge critic \operatorname{sign}(\lambda) is flat on both clouds, a finite ReLU MLP interpolates linearly across the gap with slope 1.1\text{--}1.7. A distant generator moves whenever its trained critic has a nonzero slope at x'and the generator loss does not saturate (logistic, NS arrives before step 400; logistic, sat. stalls at 5.76).
Why Two-Sided WGAN-GP Overshoots at Equilibrium
The Unit-Slope Barrier Pitfall
Both W_1 arms pull the generator to |\theta| < 0.5 near step 500, yet every two-sided W1 + GP run subsequently overshoots (|\theta| > 1.1, up to > 7), whereas every one-sided W1 + 1-sided GP run settles within 0.06 of the origin:
theta D'(theta) active D'(0) active (of 32 units per layer)
W1 + GP 0 0.30 0.00 14 0 0.00 14 0
W1 + GP 1 -7.18 1.34 11 8 1.35 12 9
W1 + GP 2 -7.61 -0.65 12 7 -0.65 12 7
W1 + 1-sided GP 0 0.02 0.41 30 3 0.41 30 3
W1 + 1-sided GP 1 0.03 0.65 25 4 0.65 25 4
W1 + 1-sided GP 2 -0.05 -0.16 30 7 -0.16 30 7
The zero-slope barrier: Once \theta crosses 0, the critic must reverse its slope D' from negative to positive. Because the two-sided penalty \gamma(|D'| - 1)^2 charges \gamma at D' = 0, the critic either remains trapped on its old slope sign (pushing \theta outward) or kills all hidden ReLU units (active = 0).
One-sided remedy: Penalizing \gamma\max(0, |D'| - 1)^2 charges nothing when |D'| \le 1, allowing the critic slope to pass freely through zero as q reaches p.
Comparing Five Objectives on a 2D Gaussian Mixture
Overlapping Supports Benchmark
When the initial generator already overlaps the data (\mathrm{JS}(p, q_0) = 0.529 nats on our 3-component 2D Gaussian mixture), we compare five objectives over 6{,}000 alternating steps across three seeds each:
All five non-saturating objectives converge: Every arm reduces \mathrm{JS}(p, q_t) from 0.529 nats to a few thousandths of a nat or less.
Direct multi-bandwidth MMD (s \in \{0.5, 1, 2\}): Needs no critic network and achieves the tightest final fit (0.0001 nats).
Smooth links vs. hinge step link: Logistic, least squares, and squared hinge all reach \le 0.0024 nats, whereas the discontinuous hinge link (\operatorname{sign}\lambda) plateaus slightly higher (0.003\text{--}0.007 nats).
Comparing Five Objectives on a 2D Gaussian Mixture (cont.)
Overlapping Supports Benchmark
For each objective and seed, the median JS over the last 2,000 steps and the first steps at which JS drops below 0.1 and 0.01:
three runs: median JS, last 2,000 steps first JS < 0.1 first JS < 0.01
logistic 0.0008 0.0008 0.0008 2000 2000 2200 2400 2400 2400
least squares 0.0009 0.0009 0.0008 2000 2200 1800 2200 2400 2200
hinge 0.0070 0.0071 0.0033 1800 1800 1400 2000 2000 2400
squared hinge 0.0013 0.0008 0.0024 1400 1400 1400 2200 2200 2200
MMD 0.0001 0.0001 0.0001 1200 1200 1200 2600 2600 2600
Concept Check: Divergences, Links, and Critics
Check Your Understanding
Test your understanding of adversarial objectives and integral probability metrics:
Zero–one loss vs. forward KL: The 0\text{--}1 classification loss has conditional Bayes risk L(\eta) = \min(\eta, 1 - \eta). What is its Bayes-risk gap \Delta_\ell(p, q), and why can no symmetric nonnegative classification loss evaluate the forward KL divergence D_{\textrm{KL}}(p \,\|\, q)?
Peak MMD gradient distance: For 1D unit Gaussians p = \mathcal{N}(0, 1) and q = \mathcal{N}(\mu, 1) under a Gaussian RBF kernel of bandwidth s = 4, at what separation \mu is the gradient \frac{d}{d\mu}\mathrm{MMD}^2(p, q) largest?
Answers:
L(\frac{1}{2}) - \mathbb{E}_m[\min(\eta, 1 - \eta)]= \frac{1}{2}\int |p - q|\,\frac{dx}{2}= \mathbf{\frac{1}{2}\mathrm{TV}(p, q)} (half the hinge gap). Any nonnegative loss has L(\eta) \ge 0, so its gap is bounded above by \Delta_\ell(p, q) \le L(\frac{1}{2}) < \infty, whereas D_{\textrm{KL}}(p \,\|\, q) is unbounded and asymmetric.
Differentiating 1 - \exp(-\mu^2 / (2(s^2 + 2))) with respect to \mu yields \propto \mu\exp(-\mu^2 / (2(s^2 + 2))), which peaks at \mu = \sqrt{s^2 + 2} = \sqrt{18} \approx \mathbf{4.24}.
Concept Check: Divergences, Links, and Critics (cont.)
Check Your Understanding
Why hinge critics still move a separated generator: At the theoretical optimum D^\star(x) = \operatorname{sign}(\lambda(x)), the hinge critic has derivative 0 everywhere except on the decision boundary. Why did our trained hinge critic still drive \theta_0 = 6 \to 0?
Answer:
A finite piecewise-linear ReLU network trained with finite steps does not jump discontinuously from +1 to -1; it interpolates linearly across the gap between the two clouds with slope \approx 1.1\text{--}1.7, and the linear generator loss -D(x') passes that slope directly to \theta.