{'fraction_non_alphanumeric': 0.028518641337817993, 'fraction_numerical': 0.004500450045004501, 'mean_word_length': 4.854132002218525, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 0, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
On the Implicit Assumptions of GANs

Generative adversarial nets (GANs) have generated a lot of excitement. Despite their popularity, they exhibit a number of well-documented issues in practice, which apparently contradict theoretical guarantees. A number of enlightening papers have pointed out that these issues arise from unjustified assumptions that are commonly made, but the message seems to have been lost amid the optimism of recent years. We believe the identified problems deserve more attention, and highlight the implications on both the properties of GANs and the trajectory of research on probabilistic models. We recently proposed an alternative method that sidesteps these problems.


Introduction
Generative adversarial nets (GANs) Gutmann et al., 2014) are one of the most popular generative models today. In the ensuing discussion, we separate the model, also known as the generator, from the training objective for clarity. The model is an example of an implicit probabilistic model (Diggle & Gratton, 1984;Mohamed & Lakshminarayanan, 2016), which is a probabilistic model that is defined most naturally in terms of a sampling procedure. In the case of GANs, the sampling procedure associated with the model is the following: 1. Sample z ∼ N (0, I) 2. Return x := T θ (z) where T θ (·) is a neural net.
For implicit models, marginal likelihood in general cannot be expressed analytically or computed numerically. Consequently, implicit models cannot be trained by directly maximizing likelihood and must instead be trained using likelihood-free approaches, which do not require evaluation of the likelihood or any derived quantities. GANs use adversarial loss as their training objective, which penalizes dissimilarity of samples to data. It has been shown that when given access to an infinitely powerful discriminator, the original GAN objective minimizes the Jensen-Shannon divergence, the − log D variant of the objective minimizes the reverse KL-divergence minus a bounded quantity (Arjovsky & Bottou, 2017), and later extensions (Nowozin et al., 2016) minimize arbitrary f -divergences. Various papers (Arora et al., 2017;Sinn & Rawat, 2017;Cornish et al., 2018) have pointed out that these results only hold under strong assumptions, but these are often forgotten. These assumptions have far-reaching implications on both the properties of adversarial loss and the trajectory of research on probabilistic models, and so we believe these deserve more attention than they have received. In this paper, we highlight the most important issues, discuss their implications and propose an alternative method that bypasses these issues.

True vs. Empirical Data Distribution
As pointed out by (Arora et al., 2017;Sinn & Rawat, 2017;Cornish et al., 2018), theoretical analysis of GANs often disregards the distinction between the true and the empirical data distribution. More concretely, the original adversarial training objective is: where p data is the true data distribution. Ideally, both expectations should be approximated with Monte Carlo estimates during training to ensure unbiased gradient estimates. However, because drawing samples from the true data distribution is expensive and usually cannot be done during training, E x∼p data [log D θD (x)] is in practice approximated with samples drawn from the training dataset rather than from the true data distribution. Drawing samples from the training dataset effectively results in a Monte Carlo estimate of the expectation w.r.t. the empirical data distribution. While this is an unbiased estimate of the expectation w.r.t. the empirical data distribution, it is not necessarily an unbiased estimate of the expectation w.r.t. the true data distribution, because the randomness in the data collection process is not marginalized out when training the model. 1 While seemingly innocuous, the replacement of the true data distribution with the empirical version has important consequences. For example, Arora et al. (2017) pointed out that because the empirical data distribution is discrete, the Jensen-Shannon divergence between the empirical data distribution and any continuous model distribution is always log 2, which is the maximum possible value of the Jensen-Shannon divergence. Therefore, minimizing the Jensen-Shannon divergence between the empirical data distribution and the model distribution does not necessarily recover the true data distribution.
Minimizing reverse KL-divergence, i.e. the KL-divergence from the empirical data distribution to the model distribution, D KL (p θ p data ), is similarly problematic. Recall that D KL (p q) is only defined and finite if the p is absolutely continuous w.r.t. q, i.e. for any x such that q(x) = 0, p(x) = 0. Therefore, for reverse KL-divergence to be defined and finite, the support of the model distribution must be contained in the support of the empirical data distribution, which is just the set of training examples. Therefore, any model that can produce a novel sample that is not in the training set will give rise to an undefined or infinite reverse KL-divergence. In particular, the reverse KL-divergence for any continuous model distribution is undefined, and so minimizing reverse KL-divergence does not make sense. 2 Therefore, claims about GANs minimizing Jensen-Shannon divergence or the reverse KLdivergence minus a bounded quantity implicitly carry the assumption of access to the true data distribution during training. Because this is a strong assumption that rarely holds in practice, it is important to keep this assumption in mind when interpreting theoretical results and applying GANs in practice.

Asymptotic Consistency
It is often claimed that the parameter estimate obtained by optimizing the original adversarial objective when the discriminator has infinite capacity (which corresponds to minimizing the Jensen-Shannon divergence) (Goodfellow, 2014) or by minimizing the reverse KL-divergence (Huszár, 2015) is asymptotically consistent. The notion of asymptotic consistency used in the sense here refers to the fact that when the true data distribution is given and the model has sufficient capacity to reproduce the true data distribution, the objective attains the unique global optimum when the model distribution coincides with the true data distribution. It is important to note, however, that this notion of asymptotic consistency is different from the classical notion of asymptotic consistency in statistics, and the two should not be conflated. In fact, minimizing any divergence from or to the true data distribution is asymptotically consistent in the sense as used in the GAN literature, since by definition of divergences, they must always be non-negative and can only evaluate to zero if and only if the two distributions passed in as arguments are equal, implying that the optimum must occur when the model distribution is equal to the true data distribution.
Unfortunately, the notion of asymptotic consistency used in the GAN literature does not characterize the behaviour of the optima of various objectives in practice, because the true data distribution is almost never available. (If it were available, there would be no need to train a generative model, since we can simply use the true data distribution as given in place of the generative model.) What is more useful is to look at how the parameter estimate behaves when given a finite set of training examples, and examine what this parameter estimate converges to as the number of training examples tends to infinity. This is what the classical notion of asymptotic consistency in statistics refers to.
More precisely, given an infinite sequence of i.
where the true parameter θ is unknown, letθ n be a parameter estimator that depends on only the first n samples where the probability is over the randomness in the process of drawing samples {x i } ∞ i=1 from p θ . Let's now compare this notion of asymptotic consistency to the notion of asymptotic consistency used in the GAN literature by way of examples. Recall that the Jensen-Shannon divergence between the empirical data distribution and any continuous model distribution is log 2, regardless of what the model distribution is or how many samples there are. Therefore, any parameter value minimizes the Jensen-Shannon divergence, because it is a constant function in the parameter value. Therefore, the parameter estimate obtained by minimizing the Jensen-Shannon divergence is not asymptotically consistent in the classical statistical sense. Similarly, because the reverse KL-divergence is undefined for any continuous model distribution, the parameter value that minimizes reverse KL-divergence is undefined, and so the parameter estimate obtained by minimizing reverse KL-divergence is not asymptotically consistent either.
Therefore, even though minimizing any divergence is consistent according to the notion of asymptotic consistency used in the GAN literature, this is not true if the notion of asymptotic consistency considered were to agree with the definition in the statistical literature. One divergence that is asymptotically consistent in both the statistical sense and the GAN sense is the standard KL-divergence, i.e. the KL-divergence from the model distribution to the empirical data distribution, D KL ( p data p θ ), which is equivalent to maximum likelihood.

Mode Dropping and Its Implications
Mode dropping is a well-documented issue in GANs and refers to the phenomenon where the model disregards some modes in the data distribution and assigns them low density. Various theoretical explanations have been proposed (Arora et al., 2017;Arjovsky & Bottou, 2017), which suggest that it could be caused by a combination of factors, including the polynomial capacity of the discriminator and the minimization of reverse KL-divergence. More specifically, Arora et al. (2017) showed that a discriminator with a polynomial number of parameters in the dimensionality of the data cannot in general detect mode dropping, leading to the generator at convergence dropping an exponential number of modes. Arjovsky & Bottou (2017) demonstrated that even if we assume access to the true data distribution and a discriminator with infinite capacity, the − log D variant of the adversarial objective, which is more commonly used than the original objective due to issues with vanishing gradients, minimizes the reverse KL-divergence minus a bounded quantity. Because reverse KLdivergence heavily penalizes the model assigning high density to unlikely data and only mildly penalizes the model assigning low density to likely data, it tends to lead to a model distribution that misses some modes of the data distribution.
The freedom that GANs have to drop modes has important implications on the evaluation of generative models and the trajectory of research on generative models more broadly. It is instructive to think of the performance of a generative model along two axes: precision, i.e.: its ability to generate plausible samples, and recall, i.e.: its ability to model the full diversity of the data distribution. Ideally, we would like to learn a model that scores high along both axes. Traditionally, generative models were trained using maximum likelihood. Because likelihood is the product of densities at each of the training examples, such models are not allowed to assign low density to any of the training examples, because overall likelihood would become low. So, mode dropping is effectively disallowed and full recall is guaranteed. Evaluation in this case is straightforwardsince recall is fixed, an increase in precision implies an upward shift in the precision-recall curve, which indicates better modelling performance. So, models trained using maximum likelihood can be compared solely on the basis of precision. Precision can be easily measured -a simple way is by visual assessment of sample quality. This is why sample quality has historically been an important indicator of modelling performance and why sample quality used to correlate with log-likelihood (or estimates/lower bounds thereof).
On the other hand, GANs are allowed to drop modes and can effectively choose the data examples that it wants to model. Because the model designer has no control over which or how many training examples are ignored, there is no guarantee on the level of recall, and so it is critical to measure both precision and recall. To see why both precision and recall are important, consider a model with low capacity that drops all but a few modes. Such a model is able to trivially achieve high precision by dedicating all its modelling capacity to the few modes, but cannot explain most of the data. Evaluation in this case becomes tricky -an increase in precision could mean either a movement along the precision-recall curve, where the increase in precision comes at the expense of a decrease in recall, or an upward shift in the precision-recall curve, where recall is maintained or increased together with the improvement in precision. Only the latter implies an improvement in modelling performance. As a result, evaluation by precision no longer suffices and can be misleading. Instead, both precision and recall must be measured and care must be taken to interpret the results.
Unfortunately, to date, there has been no reliable method to measure recall. Visualization of samples no longer works because human memory constraints limit our ability to detect a deficiency in diversity compared to the training data. Comparison to the nearest training example is also problematic because it only detects almost exact memorization of a training example. As a result, recall is typically not measured. This is dangerous -without measuring recall, we do not know how much recall was given up in order to achieve an improvement in sample quality.
This has had an impact on the trajectory of research in probabilistic modelling, which has deviated somewhat from the original goal, which is to model the inherent uncertainty in inference/prediction. Performance of generative models was traditionally measured in terms of log-likelihood or a lower bound on log-likelihood, and assessment of sample quality was a way of visualizing performance. Later on, estimated log-likelihoods replaced lower bounds on log-likelihoods as a performance metric, since there was no straightforward way to compute lower bounds on log-likelihoods for some models. Fortunately, sample quality was unaffected by this limitation and served to validate conclusions drawn from estimated log-likelihoods, which may be unreliable in high dimensions. The advent of models that can drop modes brought about a shift from the full-recall setting to a setting where a level of recall is not guaranteed. Consequently, conclusions drawn from estimated log-likelihood and sample quality diverged. Due to the unreliability of estimated log-likelihood, it has gradually fallen out of favour as a performance metric, leaving sample quality as the sole performance metric. However, it is sometimes forgotten that because full recall is no longer enforced, sample quality no longer reflects how well the model learns the underlying distribution. As a result, research in the area has undergone a largely unnoticed change in focus, from trying to learn the distribution to trying to synthesize visually pleasing images. While the latter is a worthy goal, the former should not be abandoned and researchers should be mindful of the fact that impressive advances in sample quality in recent years do not mean that we are now within reach of being able to model the distribution of natural images. We can only claim to have achieved the latter when we can produce realistic samples at full recall, which could be considerably more challenging than producing realistic samples at some unknown level of recall.

Proposed Solution: Implicit Maximum Likelihood Estimation
How can we as a community progress towards generative models that are capable of learning the underlying data distribution? We argue that the first step is to return to the principle of maximum likelihood and insist on full recall, for the following reason: when the model is given the freedom to drop modes and effectively ignore training data that it does not want to model, it is difficult to design high-capacity models. Even when a model is trained on a large and diverse dataset, model may appear to overfit to a small subset of training examples and fail to generalize, because a lot of examples in the dataset are effectively ignored. The natural course of action to mitigate this would be to reduce the capacity of the model, however, this would result in a low-capacity model that captures only the modes represented by a small subset of the training examples.
This does not mean that we would have to give up implicit probabilistic models, which do offer a lot more modelling flexibility compared to classical probabilistic models. Previously, it was unclear how to train implicit models to maximize likelihood when the likelihood and derived quantities can neither be expressed analytically or computed numerically. Recently, we introduced a simple likelihood-free parameter estimation technique that can be shown to be equivalent to maximum likelihood under some conditions, which we call Implicit Maximum Likelihood Estimation (Li & Malik, 2018).

Appendix A Monte Carlo Estimates of Expectations
We first show that a Monte Carlo estimate based on samples from the training data is an unbiased estimate of the expectation w.r.t. the empirical data distribution, i.e.: E x∼ p data [f ( Eu n n j=1 f (xj) is a random variable (because x1, . . . , xn are random), and so cannot be equal to Ex∼p data [f (x)], which is a constant. Below we show that we can obtain an unbiased estimate of the expectation w.r.t. the true data distribution, i.e.: Ex∼p data [f (x)], by taking the expectation over the training examples x1, . . . , xn, which essentially marginalizes out the randomness during the data collection process and requires drawing fresh samples from the true data distribution during training. Ex∼p

Appendix B KL-Divergence between Discrete and Continuous Distributions
KL-divergence is typically defined as: where P and Q denote two probability measures and dP dQ denotes the Radon-Nikodym derivative of P w.r.t. Q. This notion of KL-divergence is well-defined when P and Q are both continuous or are both discrete. However, it is not well-defined when one distribution is discrete and the other is continuous. Therefore, under this definition, neither DKL( p data p θ ) nor DKL(p θ p data ) is well-defined.
However, we will show below that under a slightly more general definition of KL-divergence, DKL (P Q) is well-defined when P is discrete and Q is continuous, but not the other way around.
Consider the following notion of KL-divergence: where p and q denote probability mass functions (PMFs) or probability density functions (PDFs) of P and Q respectively (depending on whether each is discrete or continuous), νP and νQ denote the reference measures for P and Q, and FP and FQ denote the cumulative distribution functions (CDFs) of P and Q respectively. If P is continuous, the reference measure νP is the Lebesgue measure λ on R d ; if it is discrete, νP is the counting measure µ on a set D. We will write out the definition of p and q explicitly as Radon-Nikodym derivatives to emphasize the possibly different reference measures for P and Q. Note that the second integral is w.r.t. the Lebesgue-Stieltjes measure associated to the CDF of P . It is easy to check that when P and Q are both continuous or are both discrete, this definition is equivalent to the previous definition.
Now we consider the case where P is discrete and Q is continuous. We first evaluate the first term: So, the first term is clearly well-defined. We then evaluate the second term: Since log dQ dλ is continuous and FP is of bounded variation, the Lebesgue-Stieltjes integral is equivalent to the Riemann-Stieltjes integral. From the definition of the Riemann-Stieltjes integral, we can see that R d log dQ dλ (x) dFP (x) evaluates to x∈D dP dµ (x) log dQ dλ (x) = x∈D p(x) log q(x). Hence, when P is discrete and Q is continuous, Note that while this final expression appears similar to the expression for KL-divergence when both P and Q are discrete, q here denotes the PDF rather than the PMF (which doesn't exist because Q is continuous).
Therefore, under this definition of KL-divergence, DKL( p data p θ ) = n i=1 1 n log 1 n − n i=1 1 n log p θ (xi), where {xi} n i=1 are the training examples. This is why minimizing DKL( p data p θ ) is equivalent to maximizing likelihood.
On the other hand, when P is continuous and Q is discrete, the first term is: This is just differential entropy and is clearly well-defined. The second term is: This is not well-defined, because dQ dµ (x) is not defined for x / ∈ D. This implies that under this definition, even though DKL( p data p θ ) is well-defined, reverse KL-divergence, DKL(p θ p data ), is not.