the IM algorithm returns plausibility $\widetilde{\Pi}_{x}(\mathbb{F}_{0})=1$.
This conclusion agrees with what’s shown in Figure 8, where the empirical
distribution function almost exactly agrees with the best monotone
approximation.

##  10 Extensions and open problems

###  10.1 Restricting the class of assertions

The validity condition in Definition 2 puts constraints on the capacity
$\overline{\Pi}_{x}$ and/or on the collection $\mathcal{A}$ of assertions. My
approach here was to keep the collection $\mathcal{A}$ as rich as possible,
e.g., the entire power set, and see what requirements are needed on the
capacity to achieve validity. It turns out that consonance is an important
(maybe necessary—see below) condition for a capacity to achieve validity for
such a rich collection of assertions. A natural question is if more
flexibility can be achieved in the capacity’s structure by restricting the
collection $\mathcal{A}$ of assertions.

Consider a simple case with a scalar $\theta$. As I argued in Section 3.1, in
order for the capacity to be a probability measure, the class $\mathcal{A}$
would need to be restricted to half-lines in order to maintain validity. This
is unsatisfactory to me because it means, e.g., the effort to convert
confidence intervals into a confidence distribution was for nothing, since it
can only reliably be used to read off confidence intervals.

But there would be less extreme cases that deserve consideration. Speaking in
terms of the dual $\underline{\Pi}_{x}$ of $\overline{\Pi}_{x}$, since the
terminology is more familiar and standard, an interesting question is the
following: for what collection $\mathcal{A}$ of assertions might a
$k$-monotone capacity (e.g., Huber, 1973; Huber and Strassen, 1973; Sundberg
and Wagner, 1992), a belief function or $\infty$-monotone capacity (e.g.,
Shafer, 1976, 1979; Nguyen, 1978), or a more general lower prevision (e.g.,
Walley, 1991; Miranda, 2008; Troffaes and de Cooman, 2014) be valid?

Another seemingly innocuous restriction is the requirement that (4) hold for
all $\alpha\in[0,1]$. This implies that $(x,A)\mapsto\overline{\Pi}_{x}(A)$
can and will take values arbitrarily close to 1. It seems to me that this more
or less implies that $\overline{\Pi}_{x}$ must be a consonant plausibility
function. More flexibility can be achieved if validity was relaxed so that (4)
held for all $\alpha\in[0,\bar{\alpha}]$, with $\bar{\alpha}<1$. Walley,
(2002) showed that a carefully constructed generalized Bayes solution could
achieve this kind of relaxed validity condition. However, his “$\bar{\alpha}$”
is directly tied to the size of his prior credal set, so achieving even this
relaxed validity property from a generalized Bayes approach loses a lot of
efficiency compared to solutions I’m advocating for based on consonant
plausibility measures. The generalized Bayes solution has other nice
properties that the plausibility measures don’t, e.g., the strong coherence
property in Walley, (1991, Theorem 7.8.1), so it remains to better understand
the balance between the various properties.

###  10.2 Fused plausibility

Section 4.2 introduced the notion of a fused plausibility measure, but only
when the condition (16) holds, can the resulting capacity $\overline{\Pi}_{x}$
really be called a plausibility measure with the consonance property.
Interestingly, Miranda et al., (2004, Theorem 4.4) shows that, in all
practical cases, plausibility measures are equivalent to the distribution of a
random set. This means that, in addition to the representation in terms of a
family of parameter-dependent random set distributions on the
$\mathbb{U}$-space, there is another representation of the output
$\overline{\Pi}_{x}$ in terms of a data-dependent random set on $\Theta$. This
latter random set can be pulled back, through the association, to a random set
on $\mathbb{U}$, but it would generally still depend on data. This suggests a
potentially interesting duality between the parameter-dependent random sets
and the fusion operation in Section 4.2 and the data-dependent random sets
that have appeared in, e.g., Ermini Leaf and Liu, (2012) and Cella and Martin,
(2019). The question is: how can this duality be leveraged for improved
understanding and for use in new and challenging problems?

###  10.3 Approximate validity

My focus here has been on situations where a test or confidence region is
available that exactly achieves the error rate control properties in (1) or
(2), respectively. Thanks to the recent developments in Wasserman et al.,
(2020) discussed in Section 8, my starting point covers virtually every
problem. However, it’s still worth asking what happens if the procedure used
as input the IM algorithm was only “approximately valid” in some specific
sense, e.g., as the sample size $n$ approaches infinity. For example, will
using an only approximately valid input to the IM algorithm return a procedure
that’s still approximately valid and potentially more efficient?

###  10.4 Beyond inference

My focus in this paper has been exclusively on statistical inference, but this
is not the only problem that statisticians and data scientists are interested
in. One of those important problems is prediction, the use of observed data
and any other relevant information to predict the next observation. A first IM
approach to prediction, based on a well-specified statistical model with
parameter $\theta$, along the lines presented in Section 4.1, was given by
Martin and Lingham, (2016). More recently, Cella and Martin, (2020, 2021)
showed that conformal prediction (e.g., Vovk et al., 2005; Shafer and Vovk,
2008) is naturally understood as an imprecise probability and, moreover, that
it can be similarly characterized using random sets as I did in this paper for
p-values and confidence regions. These results showcase the flexibility and
potential of IMs and, furthermore, they help to position conformal prediction
as part of an (imprecise) probabilistic inference framework.

Another relevant problem is decision-making, and there is a close connection
between probability and formal decision theory. Indeed, it’s very natural to
encode ones preferences in terms of a utility or loss function and define the
optimal decision as that which suitably optimizes the expected utility or
loss. Since a framework that deals with probabilities has an immediate
connection to decision theory, this is often seen as a win for the Bayesian
side. However, having a formal connection between the frequentist framework
and imprecise probabilities changes this perspective, because there is a well-
developed theory of optimal decisions in the imprecise probability literature;
see, e.g., Denœux, (2019) for a recent survey. So, it would be interesting to
investigate the valid IMs developed here in the context of a formal imprecise-
probabilistic decision theory framework.

A related matter is coherence in the sense of de Finetti, (1937). Of course,
de Finetti’s theory suggests that coherence can only be achieved via (finitely
additive) probabilities, but there is now an extensive literature (e.g.,
Walley, 1991; Williams, 2007) showing that de Finetti’s theory is a special
case of a more general notion of coherence that holds for imprecise
probabilities. So if the frequentist output can be understood as an imprecise
probability, as I showed here, then there ought to be a parallel frequentist
theory of coherence, one that balances the statistical considerations of
validity as in Definition 2 with those logical considerations of avoiding sure
loss, etc. Some first developments on this are given in Cella and Martin,
(2020) but in the context of prediction; see, also, Gong and Meng, (2021) and
the related discussion in Liu and Martin, 2021a . New results along these
lines are in development and will be reported elsewhere.

##  11 Conclusion

Motivated by a desire to understand what is required to achieve valid
probabilistic inference, and a recognition that ordinary additive
probabilities are limited unless genuine prior information is available, this
paper had the ambitious goal to characterize the so-called “frequentist
approach” via imprecise probabilities. To achieve this goal, I showed that for
every suitable frequentist procedure with error rate control guarantees, there
exists a valid plausibility measure such that the corresponding procedure
derived from it is at least as efficient as the given procedure. Moreover,
these valid plausibility measures have the additional structure of those
derived from the framework of Martin and Liu, 2015b . This puts the Bayesian
and frequentist schools on a common ground in terms of having a mathematically
rigorous underpinning, namely, precise and imprecise probability theory,
respectively. As discussed in Section 1, this common ground provides an
opportunity to clearly explain the interpretation of p-values and confidence,
which would strengthen our reputation in the eyes of other scientists and
improve the quality of scientific communication. A further consequence of this
common ground is that, with a slight generalization of the validity condition
(4) taken here, the nature, form, and strength of prior information determine
where on the spectrum between precise and imprecise probability one needs to
be for validity. These details will be reported elsewhere.

I argued in Section 1 that this imprecise probabilistic perspective can have a
positive impact on education and scientific communication. An additional
benefit is that it wouldn’t require a complete education reform. For advanced
courses, the instructor may opt to present details about imprecise
probability, but this isn’t necessary. Theorems 6–7 show that all the p-values
and confidence intervals presented in introductory courses (e.g., based on
Student’s t-test, analysis of variance, and linear regression) correspond to
plausibility measures, so the instructor can simply give students the
intuitive plausibility-based interpretations as I explained in Section 1. This
is precisely what I do in the courses I teach. Based on the feedback I’ve
received, students are able to understand my interpretation of p-values and
confidence even if they don’t know anything about the mathematics of imprecise
probability.666For example, a masters student who took my course wrote this to
me after her job interview: “I wanted to let you know that your discussion of
plausibility in ST503 made it easier for me to explain what a p-value is when
I was interviewing. Thank you for the new perspective on the subject!”

At the BFF4 meeting at Harvard in 2017,777BFF stands for both “Bayes,
fiducial, and frequentist” and “best friends forever.” See Meng, (2017) for
details about the group and its mission, and for more explanation about the
name. Nancy Reid’s invited talk summarized each of the different approaches
discussed at the meeting, with a one-liner from the respective advocates of
those approaches. Professor Reid’s one-liner for me was “IMs are the only
answer.” It took me a few years to finish this paper and justify that claim,
but better late than never. The point is that everyone wants procedures with
good properties and, as the results of Section 5 show, whatever approach one
takes to find a good procedure, it’s ultimately a valid IM based on the
developments in Martin and Liu, 2015b .

## Acknowledgments

The author is grateful to Duncan Ermini Leaf and Chuanhai Liu for valuable
feedback on a previous version of this manuscript, and to Michael Balch and
Leonardo Cella for discussions that helped to shape the arguments presented in
this revised version. This work is partially supported by the U.S. National
Science Foundation, under grants DMS–1811802 and SES–2051225.

## References

  * Arnold, (1984) Arnold, S. F. (1984).  Pivotal quantities and invariant confidence regions.  Statist. Decisions, 2(3-4):257–280.
  * Balabdaoui et al., (2009) Balabdaoui, F., Rufibach, K., and Wellner, J. A. (2009).  Limit distribution theory for maximum likelihood estimation of a log-concave density.  Ann. Statist., 37(3):1299–1331.
  * Balabdaoui and Wellner, (2007) Balabdaoui, F. and Wellner, J. A. (2007).  Estimation of a $k$-monotone density: limit distribution theory and the spline connection.  Ann. Statist., 35(6):2536–2564.
  * Balch, (2012) Balch, M. S. (2012).  Mathematical foundations for a theory of confidence structures.  Internat. J. Approx. Reason., 53(7):1003–1019.
  * Balch, (2020) Balch, M. S. (2020).  New two-sided confidence intervals for binomial inference derived using Walley’s imprecise posterior likelihood as a test statistic.  Internat. J. Approx. Reason., 123:77–98.
  * Balch et al., (2019) Balch, M. S., Martin, R., and Ferson, S. (2019).  Satellite conjunction analysis and the false confidence theorem.  Proc. Royal Soc. A, 475(2227):2018.0565.
  * Banerjee and Wellner, (2001) Banerjee, M. and Wellner, J. A. (2001).  Likelihood ratio tests for monotone functions.  Ann. Statist., 29(6):1699–1731.
  * Berger, (1985) Berger, J. O. (1985).  Statistical Decision Theory and Bayesian Analysis.  Springer-Verlag, New York, second edition.
  * Berger and Boos, (1994) Berger, R. L. and Boos, D. D. (1994).  $P$ values maximized over a confidence set for the nuisance parameter.  J. Amer. Statist. Assoc., 89(427):1012–1016.
  * Birnbaum, (1961) Birnbaum, A. (1961).  Confidence curves: an omnibus technique for estimation and testing statistical hypotheses.  J. Amer. Statist. Assoc., 56:246–249.
  * Blaker, (2000) Blaker, H. (2000).  Confidence curves and improved exact confidence intervals for discrete distributions.  Canad. J. Statist., 28(4):783–798.
  * Blaker and Spjøtvoll, (2000) Blaker, H. and Spjøtvoll, E. (2000).  Paradoxes and improvements in interval estimation.  Amer. Statist., 54(4):242–247.
  * Bowman et al., (1998) Bowman, A. W., Jones, M. C., and Gijbels, I. (1998).  Testing monotonicity of regression.  J. Comput. Graph. Statist., 7:489–500.
  * Brown et al., (2001) Brown, L. D., Cai, T. T., and DasGupta, A. (2001).  Interval estimation for a binomial proportion.  Statist. Sci., 16(2):101–133.  With comments and a rejoinder by the authors.
  * Cai et al., (2013) Cai, T. T., Low, M. G., and Xia, Y. (2013).  Adaptive confidence intervals for regression functions under shape constraints.  Ann. Statist., 41(2):722–750.
  * Cella and Martin, (2019) Cella, L. and Martin, R. (2019).  Incorporating expert opinion in an inferential model while maintaining validity.  In De Bock, J., de Campos, C. P., de Cooman, G., Quaeghebeur, E., and Wheeler, G., editors, Proceedings of the Eleventh International Symposium on Imprecise Probabilities: Theories and Applications, volume 103 of Proceedings of Machine Learning Research, pages 68–77, Thagaste, Ghent, Belgium. PMLR.
  * Cella and Martin, (2020) Cella, L. and Martin, R. (2020).  Validity, consonant plausibility measures, and conformal prediction.  Internat. J. Approx. Reason., to appear.
  * Cella and Martin, (2021) Cella, L. and Martin, R. (2021).  Valid inferential models for prediction in supervised learning problems.  In Cano, A., De Bock, J., Miranda, E., and Moral, S., editors, Proceedings of the Twelveth International Symposium on Imprecise Probability: Theories and Applications, volume 147 of Proceedings of Machine Learning Research, pages 72–82. PMLR.
  * Chakraborty and Ghosal, (2020) Chakraborty, M. and Ghosal, S. (2020).  Rates and coverage in Bayesian inference for monotone densities.  Unpublished manuscript.
  * (20) Chakraborty, M. and Ghosal, S. (2021a).  Convergence rates for Bayesian estimation and testing in monotone regression.  Electron. J. Stat., 15(1):3478–3503.
  * (21) Chakraborty, M. and Ghosal, S. (2021b).  Coverage of credible intervals in nonparametric monotone regression.  Ann. Statist., 49(2):1011–1028.
  * Cheng et al., (2014) Cheng, Q., Gao, X., and Martin, R. (2014).  Exact prior-free probabilistic inference on the heritability coefficient in a linear mixed model.  Electron. J. Stat., 8(2):3062–3076.
  * Choquet, (1954) Choquet, G. (1953–1954).  Theory of capacities.  Ann. Inst. Fourier, Grenoble, 5:131–295 (1955).
  * Cox and Lewis, (1966) Cox, D. R. and Lewis, P. A. W. (1966).  The Statistical Analysis of Series of Events.  Methuen & Co., Ltd., London; John Wiley & Sons, Inc., New York.
  * Creasy, (1954) Creasy, M. A. (1954).  Symposium on interval estimation: Limits for the ratio of means.  J. Roy. Statist. Soc. Ser. B., 16:186–194.
  * (26) De Cooman, G. (1997a).  Possibility theory. I. The measure- and integral-theoretic groundwork.  Internat. J. Gen. Systems, 25(4):291–323.
  * (27) De Cooman, G. (1997b).  Possibility theory. II. Conditional possibility.  Internat. J. Gen. Systems, 25(4):325–351.
  * (28) De Cooman, G. (1997c).  Possibility theory. III. Possibilistic independence.  Internat. J. Gen. Systems, 25(4):353–371.
  * de Finetti, (1937) de Finetti, B. (1937).  La prévision : ses lois logiques, ses sources subjectives.  Ann. Inst. H. Poincaré, 7(1):1–68.
  * Dempster, (1966) Dempster, A. P. (1966).  New methods for reasoning towards posterior distributions based on sample data.  Ann. Math. Statist., 37:355–374.
  * Dempster, (1967) Dempster, A. P. (1967).  Upper and lower probabilities induced by a multivalued mapping.  Ann. Math. Statist., 38:325–339.
  * (32) Dempster, A. P. (1968a).  A generalization of Bayesian inference. (With discussion).  J. Roy. Statist. Soc. Ser. B, 30:205–247.
  * (33) Dempster, A. P. (1968b).  Upper and lower probabilities generated by a random closed interval.  Ann. Math. Statist., 39:957–966.
  * Dempster, (2014) Dempster, A. P. (2014).  Statistical inference from a Dempster–Shafer perspective.  In Lin, X., Genest, C., Banks, D. L., Molenberghs, G., Scott, D. W., and Wang, J.-L., editors, Past, Present, and Future of Statistical Science, chapter 24. Chapman & Hall/CRC Press.
  * Denœux, (2019) Denœux, T. (2019).  Decision-making with belief functions: a review.  Internat. J. Approx. Reason., 109:87–110.
  * Denœux and Li, (2018) Denœux, T. and Li, S. (2018).  Frequency-calibrated belief functions: review and new insights.  Internat. J. Approx. Reason., 92:232–254.
  * Destercke and Dubois, (2014) Destercke, S. and Dubois, D. (2014).  Special cases.  In Introduction to Imprecise Probabilities, Wiley Ser. Probab. Stat., pages 79–92. Wiley, Chichester.
  * Drton, (2009) Drton, M. (2009).  Likelihood ratio tests and singularities.  Ann. Statist., 37(2):979–1012.
  * Dubois, (2006) Dubois, D. (2006).  Possibility theory and statistical reasoning.  Comput. Statist. Data Anal., 51(1):47–69.
  * Dubois and Prade, (1987) Dubois, D. and Prade, H. (1987).  Properties of measures of information in evidence and possibility theories.  Fuzzy Sets and Systems, 24(2):161–182.  Measures of Uncertainty.
  * Dubois and Prade, (1988) Dubois, D. and Prade, H. (1988).  Possibility Theory.  Plenum Press, New York.
  * Dufour, (1997) Dufour, J.-M. (1997).  Some impossibility theorems in econometrics with applications to structural and dynamic models.  Econometrica, 65(6):1365–1387.
  * Dvoretzky et al., (1956) Dvoretzky, A., Kiefer, J., and Wolfowitz, J. (1956).  Asymptotic minimax character of the sample distribution function and of the classical multinomial estimator.  Ann. Math. Statist., 27:642–669.
  * Efron, (1998) Efron, B. (1998).  R. A. Fisher in the 21st century.  Statist. Sci., 13(2):95–122.
  * Ermini Leaf and Liu, (2012) Ermini Leaf, D. and Liu, C. (2012).  Inference about constrained parameters using the elastic belief method.  Internat. J. Approx. Reason., 53(5):709–727.
  * Fieller, (1954) Fieller, E. C. (1954).  Symposium on interval estimation: Some problems in interval estimation.  J. Roy. Statist. Soc. Ser. B., 16:175–185.
  * Fisher, (1935) Fisher, R. A. (1935).  The fiducial argument in statistical inference.  Ann. Eugenics, 6:391–398.
  * (48) Fisher, R. A. (1973a).  Statistical Methods and Scientific Inference.  Hafner Press, New York, 3rd edition.
  * (49) Fisher, R. A. (1973b).  Statistical Methods for Research Workers.  Hafner Publishing Co., New York.  Fourteenth edition—revised and enlarged.
  * Fraser, (1968) Fraser, D. A. S. (1968).  The Structure of Inference.  John Wiley & Sons Inc., New York.
  * Fraser, (1990) Fraser, D. A. S. (1990).  Tail probabilities from observed likelihoods.  Biometrika, 77(1):65–76.
  * Fraser, (1991) Fraser, D. A. S. (1991).  Statistical inference: likelihood to significance.  J. Amer. Statist. Assoc., 86(414):258–265.
  * (53) Fraser, D. A. S. (2011a).  Is Bayes posterior just quick and dirty confidence?  Statist. Sci., 26(3):299–316.
  * (54) Fraser, D. A. S. (2011b).  Rejoinder: “Is Bayes posterior just quick and dirty confidence?”.  Statist. Sci., 26(3):329–331.
  * Fraser, (2013) Fraser, D. A. S. (2013).  Discussion: “Confidence distribution, the frequentist distribution estimator of a parameter: a review” [mr3047496].  Int. Stat. Rev., 81(1):42–48.
  * Fraser, (2014) Fraser, D. A. S. (2014).  Why does statistics have two theories?  In Lin, X., Genest, C., Banks, D. L., Molenberghs, G., Scott, D. W., and Wang, J.-L., editors, Past, Present, and Future of Statistical Science, chapter 22. Chapman & Hall/CRC Press.
  * Fraser, (2018) Fraser, D. A. S. (2018).  On evolution of statistical inference.  J. Stat. Theory Appl., 17(2):193–205.
  * Fraser et al., (2016) Fraser, D. A. S., Bédard, M., Wong, A., Lin, W., and Fraser, A. M. (2016).  Bayes, reproducibility and the quest for truth.  Statist. Sci., 31(4):578–590.
  * Ghosh et al., (2006) Ghosh, J. K., Delampady, M., and Samanta, T. (2006).  An Introduction to Bayesian Analysis.  Springer, New York.
  * Gleser and Hwang, (1987) Gleser, L. J. and Hwang, J. T. (1987).  The nonexistence of $100(1-\alpha)\%$ confidence sets of finite expected diameter in errors-in-variables and related models.  Ann. Statist., 15(4):1351–1362.
  * Goldman, (1979) Goldman, A. I. (1979).  Reliabilism: What is justified belief?  In Pappas, G. S., editor, Justification and Knowledge, page 11. Reidel, Dordrecht, Holland.
  * Gong and Meng, (2021) Gong, R. and Meng, X.-L. (2021).  Judicious judgment meets unsettling updating: dilation, sure loss and Simpson’s paradox.  Statist. Sci., 36(2):169–190.
  * Grenander, (1956) Grenander, U. (1956).  On the theory of mortality measurement. II.  Skand. Aktuarietidskr., 39:125–153 (1957).
  * Groeneboom, (1985) Groeneboom, P. (1985).  Estimating a monotone density.  In Proceedings of the Berkeley Conference in Honor of Jerzy Neyman and Jack Kiefer, Vol. II (Berkeley, Calif., 1983), Wadsworth Statist./Probab. Ser., pages 539–555, Belmont, CA. Wadsworth.
  * Hannig et al., (2016) Hannig, J., Iyer, H., Lai, R. C. S., and Lee, T. C. M. (2016).  Generalized fiducial inference: a review and new results.  J. Amer. Statist. Assoc., 111(515):1346–1361.
  * Hinkley, (1969) Hinkley, D. V. (1969).  On the ratio of two correlated normal random variables.  Biometrika, 56:635–639.
  * Hsu, (1938) Hsu, P. L. (1938).  Contributions to the theory of “Student’s” $t$-test as applied to the problem of two samples.  In Statistical Research Memoirs, pages 1–24. University College, London.
  * Huber, (1973) Huber, P. J. (1973).  The use of Choquet capacities in statistics.  Bull. Inst. Internat. Statist., 45(book 4):181–191.  With discussion by P. Gänssler, W. S. Hall, L. Schmetterer, Charles Stein, and G. N. Wilkinson and with reply by the author.
  * Huber and Strassen, (1973) Huber, P. J. and Strassen, V. (1973).  Minimax tests and the Neyman-Pearson lemma for capacities.  Ann. Statist., 1:251–263.
  * Klaschka, (2015) Klaschka, J. (2015).  BlakerCI: Blaker’s binomial confidence limits.  R package version 1.0-5.
  * Klaus and Strimmer, (2015) Klaus, B. and Strimmer, K. (2015).  fdrtool: Estimation of (Local) False Discovery Rates and Higher Criticism.  R package version 1.2.15.
  * Lehmann, (1975) Lehmann, E. L. (1975).  Nonparametrics: Statistical Methods Based on Ranks.  Holden-Day Inc., San Francisco, Calif.
  * (73) Liu, C. and Martin, R. (2021a).  Comment: Settle the unsettling—an inferential models perspective [mr4255191].  Statist. Sci., 36(2):196–200.
  * (74) Liu, C. and Martin, R. (2021b).  Inferential models and possibility measures.  Handbook of Bayesian, Fiducial, and Frequentist Inference, to appear; arXiv:2008.06874.
  * Mandelkern, (2002) Mandelkern, M. (2002).  Setting confidence intervals for bounded parameters.  Statist. Sci., 17(2):149–172.  With comments.
  * Martin, (2017) Martin, R. (2017).  A statistical inference course based on $p$-values.  Amer. Statist., 71(2):128–136.
  * Martin, (2019) Martin, R. (2019).  False confidence, non-additive beliefs, and valid statistical inference.  Internat. J. Approx. Reason., 113:39–73.
  * Martin and Lin, (2016) Martin, R. and Lin, Y. (2016).  Exact prior-free probabilistic inference in a class of non-regular models.  Stat, 5:312–321.
  * Martin and Lingham, (2016) Martin, R. and Lingham, R. T. (2016).  Prior-free probabilistic prediction of future observations.  Technometrics, 58(2):225–235.
  * Martin and Liu, (2013) Martin, R. and Liu, C. (2013).  Inferential models: a framework for prior-free posterior probabilistic inference.  J. Amer. Statist. Assoc., 108(501):301–313.
  * Martin and Liu, (2014) Martin, R. and Liu, C. (2014).  A note on p-values interpreted as plausibilities.  Statist. Sinica, 24(4):1703–1716.
  * (82) Martin, R. and Liu, C. (2015a).  Conditional inferential models: combining information for prior-free probabilistic inference.  J. R. Stat. Soc. Ser. B. Stat. Methodol., 77(1):195–217.
  * (83) Martin, R. and Liu, C. (2015b).  Inferential Models: Reasoning with Uncertainty, volume 147 of Monographs on Statistics and Applied Probability.  CRC Press, Boca Raton, FL.
  * (84) Martin, R. and Liu, C. (2015c).  Marginal inferential models: prior-free probabilistic inference on interest parameters.  J. Amer. Statist. Assoc., 110(512):1621–1631.
  * Martin and Syring, (2019) Martin, R. and Syring, N. (2019).  Validity-preservation properties of rules for combining inferential models.  In De Bock, J., de Campos, C. P., de Cooman, G., Quaeghebeur, E., and Wheeler, G., editors, Proceedings of the Eleventh International Symposium on Imprecise Probabilities: Theories and Applications, volume 103 of Proceedings of Machine Learning Research, pages 286–294, Thagaste, Ghent, Belgium. PMLR.
  * McLachlan, (1987) McLachlan, G. J. (1987).  On bootstrapping the likelihood ratio test stastistic for the number of ccmponents in a normal mixture.  J. Roy. Statist. Soc. Ser. C, 36(3):318–324.
  * McShane et al., (2019) McShane, B. B., Gal, D., Gelman, A., Robert, C., and Tackett, J. L. (2019).  Abandon statistical significance.  Amer. Statist., 73(suppl. 1):235–245.
  * Meng, (2017) Meng, X.-L. (2017).  X-L Files: Bayesian, Fiducial and Frequentist: BFF4EVER.  IMS Bulletin, 46(4):17.
  * Mickey and Brown, (1966) Mickey, M. R. and Brown, M. B. (1966).  Bounds on the distribution functions of the Behrens-Fisher statistic.  Ann. Math. Statist., 37:639–642.
  * Miranda, (2008) Miranda, E. (2008).  A survey of the theory of coherent lower previsions.  Internat. J. Approx. Reason., 48(2):628–658.
  * Miranda et al., (2004) Miranda, E., Couso, I., and Gil, P. (2004).  A random set characterization of possibility measures.  Inform. Sci., 168(1-4):51–75.
  * Molchanov, (2005) Molchanov, I. (2005).  Theory of Random Sets.  Probability and Its Applications (New York). Springer-Verlag London Ltd., London.
  * Nadarajah et al., (2015) Nadarajah, S., Bityukov, S., and Krasnikov, N. (2015).  Confidence distributions: a review.  Stat. Methodol., 22:23–46.
  * Neyman, (1941) Neyman, J. (1941).  Fiducial argument and the theory of confidence intervals.  Biometrika, 32:128–150.
  * Nguyen, (1978) Nguyen, H. T. (1978).  On random sets and belief functions.  J. Math. Anal. Appl., 65(3):531–542.
  * Nguyen, (2006) Nguyen, H. T. (2006).  An Introduction to Random Sets.  Chapman & Hall/CRC, Boca Raton, FL.
  * Prakasa Rao, (1969) Prakasa Rao, B. L. S. (1969).  Estimation of a unimodal density.  Sankhyā Ser. A, 31:23–36.
  * Reid and Cox, (2015) Reid, N. and Cox, D. R. (2015).  On some principles of statistical inference.  Int. Stat. Rev., 83(2):293–308.
  * Scheffé, (1970) Scheffé, H. (1970).  Practical solutions of the Behrens–Fisher problem.  J. Amer. Statist. Assoc., 65:1501–1508.
  * Schweder and Hjort, (2002) Schweder, T. and Hjort, N. L. (2002).  Confidence and likelihood.  Scand. J. Statist., 29(2):309–332.
  * Schweder and Hjort, (2013) Schweder, T. and Hjort, N. L. (2013).  Discussion: “Confidence distribution, the frequentist distribution estimator of a parameter: a review” [mr3047496].  Int. Stat. Rev., 81(1):56–68.
  * Schweder and Hjort, (2016) Schweder, T. and Hjort, N. L. (2016).  Confidence, Likelihood, Probability, volume 41 of Cambridge Series in Statistical and Probabilistic Mathematics.  Cambridge University Press, New York.
  * Shafer, (1976) Shafer, G. (1976).  A Mathematical Theory of Evidence.  Princeton University Press, Princeton, N.J.
  * Shafer, (1979) Shafer, G. (1979).  Allocations of probability.  Ann. Probab., 7(5):827–839.
  * Shafer, (1987) Shafer, G. (1987).  Belief functions and possibility measures.  In Bezdek, J. C., editor, The Analysis of Fuzzy Information, Vol. 1: Mathematics and Logic, pages 51–84. CRC.
  * Shafer and Vovk, (2008) Shafer, G. and Vovk, V. (2008).  A tutorial on conformal prediction.  J. Mach. Learn. Res., 9:371–421.
  * Spjøtvoll, (1983) Spjøtvoll, E. (1983).  Preference functions.  In A Festschrift for Erich L. Lehmann, Wadsworth Statist./Probab. Ser., pages 409–432. Wadsworth, Belmont, Calif.
  * Sundberg and Wagner, (1992) Sundberg, C. and Wagner, C. (1992).  Characterizations of monotone and $2$-monotone capacities.  J. Theoret. Probab., 5(1):159–167.
  * Trafimow and Marks, (2015) Trafimow, D. and Marks, M. (2015).  Editorial.  Basic Appl. Soc. Psych., 37(1):1–2.
  * Troffaes and de Cooman, (2014) Troffaes, M. C. M. and de Cooman, G. (2014).  Lower Previsions.  Wiley Series in Probability and Statistics. John Wiley & Sons, Ltd., Chichester.
  * Vovk et al., (2005) Vovk, V., Gammerman, A., and Shafer, G. (2005).  Algorithmic Learning in a Random World.  Springer, New York.
  * Walley, (1991) Walley, P. (1991).  Statistical Reasoning with Imprecise Probabilities, volume 42 of Monographs on Statistics and Applied Probability.  Chapman & Hall Ltd., London.
  * Walley, (2002) Walley, P. (2002).  Reconciling frequentist properties with the likelihood principle.  J. Statist. Plann. Inference, 105(1):35–65.
  * Wasserman, (2006) Wasserman, L. (2006).  All of Nonparametric Statistics.  Springer Texts in Statistics. Springer, New York.
  * Wasserman et al., (2020) Wasserman, L., Ramdas, A., and Balakrishnan, S. (2020).  Universal inference.  Proceedings of the National Academy of Sciences, 117(29):16880–16890.
  * Wasserstein and Lazar, (2016) Wasserstein, R. L. and Lazar, N. A. (2016).  The ASA’s statement on $p$-values: context, process, and purpose [Editorial].  Amer. Statist., 70(2):129–133.
  * Wasserstein et al., (2019) Wasserstein, R. L., Schirm, A. L., and Lazar, N. A. (2019).  Moving to a world beyond “$p<0.05$” [Editorial].  Amer. Statist., 73(suppl. 1):1–19.
  * Wilks, (1938) Wilks, S. S. (1938).  The large-sample distribution of the likelihood ratio for testing composite hypotheses.  Ann. Math. Statist, 9:60–62.
  * Williams, (2007) Williams, P. M. (2007).  Notes on conditional previsions.  Internat. J. Approx. Reason., 44(3):366–383.
  * Xie and Singh, (2013) Xie, M. and Singh, K. (2013).  Confidence distribution, the frequentist distribution estimator of a parameter: a review.  Int. Stat. Rev., 81(1):3–39.
  * Zabell, (1992) Zabell, S. L. (1992).  R. A. Fisher and the fiducial argument.  Statist. Sci., 7(3):369–387.
  * Zadeh, (1978) Zadeh, L. A. (1978).  Fuzzy sets as a basis for a theory of possibility.  Fuzzy Sets and Systems, 1(1):3–28.


ATL-PHYS-PROC-2021-004 August 29, 2024

Measurement of the inclusive and differential cross section of a top quark
pair in association with a $Z$ boson at $13\,\text{TeV}$ with the ATLAS
detector

Florian Fischer111Work supported by BMBF, Germany (FSP-103), on behalf of the
ATLAS Collaboration††Copyright 2024 CERN for the benefit of the ATLAS
Collaboration. CC-BY-4.0 license.

Fakultät für Physik
Ludwig-Maximilians-Universität München, 85748 Garching, Germany

> The inclusive as well as differential cross section of the associated
> production of top-antitop quark pairs and a $Z$ boson ($t\overline{t}Z$) is
> measured in final states with exactly three or four isolated leptons
> (electrons or muons). For this purpose, the full LHC Run 2 dataset of
> proton-proton collisions recorded by the ATLAS detector from $2015$ to
> $2018$, which corresponds to an integrated luminosity of
> $139\text{\,}{\mathrm{fb}}^{-1}$, is used. The inclusive production cross
> section is measured to be $\sigma_{t\overline{t}Z}=1.05\pm
> 0.05\,(\text{stat.})\,\pm 0.09\,(\text{syst.})\,\text{pb}$, which is in
> agreement with the most precise Standard Model theoretical prediction.
> Absolute and normalised differential cross section measurements are
> performed as a function of various kinematic variables in order to probe the
> kinematics of the $t\overline{t}Z$ system within both parton- and particle-
> level phase spaces.

> PRESENTED AT
>
>
>
>
> $13^{\mathrm{th}}$ International Workshop on Top Quark Physics
> Durham, UK (videoconference), 14–18 September, 2020

##  1 Introduction

The coupling of the top quark to the $Z$ boson is precisely predicted within
the Standard Model (SM) of particle physics by the theory of the electroweak
interaction. However, experimentally it is not yet well constrained and its
value can significantly vary in many models including physics beyond the
Standard Model (BSM). A process that is particularly sensitive to this
coupling is the associated production of a top-antitop quark pair with a $Z$
boson ($t\overline{t}Z$). The large centre-of-mass energy of the Large Hadron
Collider (LHC) [1] at CERN and the tremendous amount of data collected in
recent years have opened up the possibility to study this rare process which
was previously inaccessible due to its small production cross section. As
$t\overline{t}Z$ production contributes to the background processes in many
searches at the LHC for both SM and BSM physics, a better understanding of the
$t\overline{t}Z$ process can further enhance the experimental reach in such
analyses.

The results of previous inclusive measurements by the ATLAS [2] and CMS [3]
collaborations agree very well with the SM prediction [4, 5, 6]. A first
measurement of differential $t\overline{t}Z$ cross sections was conducted by
CMS only recently [7]. The first analysis using the full LHC Run 2 dataset was
performed by ATLAS using $139\text{\,}{\mathrm{fb}}^{-1}$ of proton-proton
($pp$) collision data [8] which is presented in the following.

##  2 Analysis channels

The most sensitive decay channels in which to perform measurements of the
$t\overline{t}Z$ process feature a multi-lepton final state with exactly three
or four isolated electrons or muons.Based on these signatures, different
signal regions are defined and optimised, referred to as trilepton ($3\ell$)
and tetralepton ($4\ell$) signal regions, depending on the respective lepton
multiplicity.

Three signal regions are defined for the trilepton decay channel, and four
signal regions are defined for the tetralepton decay channel. Of all lepton
pairs with opposite sign of the charge and of the same flavour (OSSF), the one
with the value of its invariant mass closest to the $Z$ boson mass is
considered to originate from the $Z$ boson decay. Furthermore, the difference
between its invariant mass and the $Z$ boson mass must not be greater than
$10\text{\,}\mathrm{GeV}$. Contributions from events featuring low-mass
resonances are suppressed by requiring all OSSF lepton combinations to have a
mass greater than $10\text{\,}\mathrm{GeV}$. Additionally, the sum of the
lepton charges is required to equal to $\pm 1$ and $0$ in the $3\ell$ and in
the $4\ell$ case, respectively. The trilepton signal regions differ from each
other by the number of selected jets and $b$-jets, where the latter are tagged
with different efficiency working points depending on the required $b$-jet
multiplicity. Similarly, the tetralepton signal regions are categorised into
same-flavour and different-flavour regimes of the two non-$Z$ leptons, and
each case is again subdivided into a regime with either exactly one or at
least two $b$-jets. In addition, depending on the flavour composition of the
non-$Z$ lepton pair and $b$-jet multiplicity, different thresholds on the
missing transverse energy are required.

##  3 Background estimation

Background processes – physics processes described by the Standard Model other
than $t\overline{t}Z$ – are subdivided into prompt and non-prompt
contributions.

The dominant prompt background processes are $WZ/ZZ\text{\,+\,jets}$
production which feature either three or four isolated leptons in the final
state, respectively. Dedicated control regions are used to estimate the light-
flavour components of these backgrounds during the fit employed for the
inclusive cross-section measurement. These regions are defined such that they
are orthogonal to the respective signal regions and are predominantly
populated with events featuring $WZ/ZZ\text{\,+\,jets}$ light-flavour
components. In contrast, the charm- and bottom-flavour components are
constrained in the fit with the corresponding uncertainties assigned which are
related to the simulation of heavy-flavour components. Further SM background
processes considered such as the associated production of single top quarks or
top-antitop quark pairs with heavy vector bosons are estimated directly from
simulated Monte Carlo (MC) samples.

Background contributions from leptons from secondary decays (“non-prompt”) or
so-called fake leptons (objects misidentified as leptons), however, are
estimated employing a data-driven method, referred to as matrix method.
Details about this method can be found in the reference documents [9] and
[10].

##  4 Results

The inclusive $t\overline{t}Z$ production cross section is extracted by
performing a simultaneous maximum-likelihood fit to the number of events in
the trilepton and tetralepton signal regions, as well as the
$WZ/ZZ\text{\,+\,jets}$ control regions. A total of three free parameters are
given to the fit: the ratio between the measured value of in the inclusive
$t\overline{t}Z$ production cross section and its corresponding Standard Model
prediction, referred to as signal strength, as well as the normalisation
factors of the $WZ/ZZ\text{\,+\,jets}$ backgrounds used to extrapolate the
corresponding event yields into the signal regions. The inclusive
$3\ell+4\ell$ cross section of $t\overline{t}Z$ production in $pp$-collision
data at a centre-of-mass energy of $13\text{\,}\mathrm{TeV}$ is measured to
be:

$\sigma(pp\to t\overline{t}Z)=1.05\pm 0.05\,(\text{stat.})\,\pm
0.09\,(\text{syst.})\,\text{pb}=\left(1.05\pm 0.10\right)\,\text{pb}$ (1)

This result agrees with the dedicated theoretical prediction [11] of

$\sigma_{t\overline{t}Z}^{\mathrm{NLO+NNLL}}=0.863^{+0.07}_{-0.09}\,(\mathrm{scale})\pm
0.03\,(\mathrm{PDF+\alpha_{s}})\,\mathrm{pb}\quad.$ (2)

The uncertainties on this result are dominated by the systematic uncertainties
of which the most important ones are related to the modelling of the parton
shower in the signal Monte Carlo, the modelling of various background
processes, and the $b$-tagging procedure.

In addition to the inclusive result, the $t\overline{t}Z$ cross section is
measured as a function of different variables sensitive to the kinematics and
the production of the $t\overline{t}Z$ system. For this purpose, a total of
nine such variables are unfolded to parton and particle level, employing the
Iterative Bayesian Unfolding method [12]. On parton level, the (anti-)top
quark and the $Z$ boson can be directly accessed before the decay within Monte
Carlo simulation, whereas on particle level these have to be reconstructed
from simulated stable particles without any modelling of their interaction
with the detector material or pile-up. In this way, events are corrected for
detector effects and results can be directly compared to theoretical
calculations.

(a)

(b)

Figure 1: Absolute (left) and normalised (right) cross section measured at
parton (left) and particle (right) level as a function of the transverse
momentum (left) and of the absolute rapidity (right) of the $Z$ boson. The
predictions of various MC generators are represented by dashed and dotted
coloured lines whereas the data are depicted as black dots. In addition,
custom differential [15] predictions are shown by a black solid line within a
grey-shaded area. In the ratio panels, the relative contributions from both
the statistical and systematic uncertainties are shown. A branching fraction
of $\mathcal{B}(t\overline{t}Z_{3\ell+4\ell})=0.0223$ is applied for the
parton-level result [8].

This analysis determined both the absolute and normalised differential cross
section for the $3\ell$ and $4\ell$ scenarios separately as well as for the
combination. In Figure 1, two examples for the differential cross section
measurements in the combined $3\ell+4\ell$ channel are depicted. Different
simulated samples generated with different sets of MC generators, including
the nominal MG5_aMC@NLO+Pythia 8 [13, 14], as well as a set of additional
differential predictions, calculated at parton level as described in [15], are
compared to the unfolded data. In general, a good agreement between the
unfolded data and the various predictions can be observed.

ACKNOWLEDGEMENTS

The author would like to thank for the support of his work by BMBF, Germany
(FSP-103).

## References

  * [1] L. Evans and P. Bryant (editors), JINST 3, S08001 (2008).
  * [2] ATLAS Collaboration, JINST 3, S08003 (2008).
  * [3] CMS Collaboration, JINST 3, S08004 (2008).
  * [4] ATLAS Collaboration, Eur. Phys. J. C 77, no. 1, 40 (2017).
  * [5] ATLAS Collaboration, Phys. Rev. D 99, no. 7, 072009 (2019).
  * [6] CMS Collaboration, JHEP 1808, 011 (2018).
  * [7] CMS Collaboration, JHEP 2003, 056 (2020).
  * [8] ATLAS Collaboration, ATLAS-CONF-2020-028,
https://cds.cern.ch/record/2725734.

  * [9] ATLAS Collaboration, Eur. Phys. J. C 71, 1577 (2011).
  * [10] ATLAS Collaboration, JHEP 1406, 035 (2014).
  * [11] A. Kulesza et al., Eur. Phys. J. C 79, no. 3, 249 (2019)
  * [12] G. D’Agostini, Nucl. Instrum. Meth. A 362, 487 (1995).
  * [13] J. Alwall et al., JHEP 1407, 079 (2014)
  * [14] T. Sjöstrand et al., Comput. Phys. Commun. 191, 159 (2015)
  * [15] A. Broggio et al., JHEP 1908, 039 (2019)


# Diffusion Models for Generative Artificial Intelligence: An Introduction for
Applied Mathematicians

Catherine F. Higham School of Computing Science, University of Glasgow, Sir
Alwyn Williams Building, Glasgow, G12 8QQ. Supported by EPSRC grant
EP/T00097X/1<EMAIL_ADDRESS> Desmond J. Higham School of
Mathematics, University of Edinburgh, EH9 3FD, UK. Supported by EPSRC grant
EP/V046527/1<EMAIL_ADDRESS> Peter Grindrod CBE Mathematical
Institute, University of Oxford, Oxford, United Kingdom. Supported by EPSRC
grant EP/R018472/1<EMAIL_ADDRESS>
###### Abstract

Generative artificial intelligence (AI) refers to algorithms that create
synthetic but realistic output. Diffusion models currently offer state of the
art performance in generative AI for images. They also form a key component in
more general tools, including text-to-image generators and large language
models. Diffusion models work by adding noise to the available training data
and then learning how to reverse the process. The reverse operation may then
be applied to new random data in order to produce new outputs. We provide a
brief introduction to diffusion models for applied mathematicians and
statisticians. Our key aims are (a) to present illustrative computational
examples, (b) to give a careful derivation of the underlying mathematical
formulas involved, and (c) to draw a connection with partial differential
equation (PDE) diffusion models. We provide code for the computational
experiments. We hope that this topic will be of interest to advanced
undergraduate students and postgraduate students. Portions of the material may
also provide useful motivational examples for those who teach courses in
stochastic processes, inference, machine learning, PDEs or scientific
computing.

##  1 Motivation

Generative artificial intelligence (AI) models are designed to create new
outputs that are similar to the examples on which they were trained. Over the
past decade or so, advancements in generative AI have included the development
of variational autoencoders [9, 22], generative adversarial networks [19] and
transformers [38]. In this work we focus on denoising diffusion probabilistic
models [15]; for simplicity we use the term diffusion models. They currently
represent the state of the art in image generation [7], and form a key part of
more sophisticated tools such as DALL-E 2 and 3 [31]. We refer to [4, 6, 8,
29], and the references therein, for details of the historical developments
that have led to the current state-of-the art in generative AI.

The somewhat counterintuitive, but deceptively powerful, idea behind diffusion
models is to destroy the training data by adding noise. While doing so, the
model learns how to reverse the process. In this way, the final model is able
to start with new, easily generated, random samples and denoise them, thereby
generating new, synthetic examples. The task of building and applying a
simple, yet impressive, model can be described very succinctly—see Algorithms
1 and 2 in section 5. However, deriving the expressions that go into these
algorithms is not so straightforward, and we believe that there is a niche for
a careful and accessible mathematically-oriented treatment.

Our intended readership is advanced undergraduate students and postgraduate
students in mathematics or relate disciplines. The material should be suitable
for independent study, and there are many directions in which this material
can be followed up—the literature is rapidly expanding, and new extensions and
connections are being discovered at a pace. We also hope that portions of this
material will provide higher education professionals with topical and engaging
examples that can be slipped into courses on stochastics, numerics, PDEs or
data science.

We aimed to keep the prerequisites to a minimum; these are

  * •

for sections 2–5 ideas from statistics: mean, variance, Gaussian distribution,
Markov chains, conditional probability,

  * •

for sections 4 and 5 ideas from deep learning: the stochastic gradient method,
artificial neural networks,

  * •

for section 7 ideas from PDEs: multivariate calculus, the divergence theorem,
spectral analysis.

We focus here on the task of image generation. We describe a bare bones form
of diffusion model, explain carefully how the key mathematical expressions
arise, and illustrate the concept via computational examples. The key
reference for this article is [15], which built on [35] and received more than
ten citations per day during the year 2023. We also found [25] to be a very
useful resource.

In section 2 we present some pictures that give a feel for the idea of
diffusion models in generative AI. We then provide details of the relevant
forward and backward processes in sections 3 and 4, respectively, which leads
to the algorithms presented in section 5.

We emphasize that this is a very active and fast-moving research topic with
connections to many related areas. In section 6 we provide some links to the
relevant literature. That section also highlights wider issues around
performance evaluation, computational expense, copyright, privacy, ethics,
bias, explainability and robustness.

We finish in section 7 with more speculative material that suggests a
connection between stable diffusion models and deterministic PDEs, providing a
link to more traditional applied mathematics.

##  2 Illustration

A diffusion model [15] aims to generate realistic-looking images. It works by

(i)

taking an existing image and iteratively adding noise until the original
information is lost,

(ii)

learning how to reconstruct the original image by iteratively removing the
noise.

After training, we can then use the reverse diffusion process to generate a
realistic image from a new, random, starting point—remove the noise and see
what emerges.

One way to conceptualize this method is to imagine an (unknown) probability
distribution over the collection of all natural images. We hope to sample from
this distribution; more likely images should be chosen with higher
probability. We don’t have access to this magic probability distribution.
Instead, we have training data; that is, examples of natural images. We also
have a pseudorandom number generator that allows us to sample from a standard
Gaussian distribution. In item (i) above, we are doing the easy part, mapping
from the image distribution to the Gaussian distribution. In item (ii) we
learn the inverse operator, mapping from the Gaussian distribution to the
image distribution. This allows us to convert Gaussian samples into images.

We illustrate the idea of a diffusion model trained on images from the widely
studied MNIST data set [23]. Here, each image represents a handwritten digit
from the set $\\{0,1,2,\ldots,9\\}$. These low resolution images are black-
and-white with $28\times 28$ pixels, resized by the model to $32\times 32$.
Figure 1 shows a representative collection of $64$ images.

Figures 2–4 were produced with a diffusion model based on a Mathworks tutorial
at

    https://uk.mathworks.com/help/deeplearning/ug/generate-images-using-diffusion.html

Figure 2 illustrates the forward process that is used in the training phase.
At time $t=0$ we have an MNIST image. At each integer time
$t=0,1,2,\ldots,499$ Gaussian noise is added. At $t=500$ there is no visible
evidence of the original image.

Figure 1: Representative set of $64$ images from the MNIST data set [23].
Figure 2: Result of forward map noising over time.

Figure 3 shows the effect of the backward process that is available after
training. The top left panel displays nine randomly chosen final time $t=500$
images—pure noise matrices consisting of independent Gaussian samples. We show
the effect of applying the backward, denoising process as time is reversed. At
$t=0$ the model has produced new, synthetic examples that, in at least eight
of the nine cases, correspond to handwritten digits. We emphasize that labels
were not used in the training process. In this simple, unconditional model
there is no way to control which (if any) of the $t=0$ images will resemble
any particular category of digit.

Figure 3: Result of backward map denoising over time, for $9$ different random
choices at $t=500$.

In Figure 4 we show the results from a larger experiment. Here we used the
trained diffusion model to generate images from 500 independent time $t=500$
choices. For this figure, we separated the images into categories using an
independent convolutional neural network classifier that was trained
separately on real MNIST data. Since we have no control over how many of the
500 images will appear in each class, the number of synthetic outputs in each
category varies considerably.

Figure 4: $500$ synthetic images generated by the diffusion model from
different time $t=500$ noise samples. These have been sorted into classes by a
convolutional neural network classifier that was trained separately on real
MNIST data.

We finish with two experiments which illustrate that the backward, denoising
process is both stochastic and unpredictable. In Figure 5 we show the images
generated after applying nine independent denoising runs to the same Gaussian
at $t=500$. We see that the denoising process can produce considerably
different results from a single source of randomness. In Figure 6 we perform a
similar experiment where the $t=500$ data emerges from the training set. On
the left we show a training image undergoing the forward, noising process up
to time $t=500$. On the right we show the results from nine independent
denoising runs on this time $t=500$ data. We see that none of the
synthetically generated images resemble the original.

Figure 5: Nine images (right) created from the same Gaussian noise at $t=500$
(left).

Figure 6: Nine images (right) created from the noisy version (left $t=500$) of
one original image (left $t=0$).

##  3 Forwards

We begin this section with some background on Gaussian random variables; see a
standard text such as [3, 27] for more details. When dealing with Gaussians,
we will always consider the multivariate, isotropic case. We denote the
probability density at a point $\mathbf{x}\in\mathbb{R}^{d}$ by
$\mathcal{N}(\mathbf{x};\boldsymbol{\mu},\sigma\mathbf{I})$, where

$\mathcal{N}(\mathbf{x};\boldsymbol{\mu},\sigma\mathbf{I}):=\frac{1}{\sigma(2\pi)^{1/d}}\exp\left(-{\textstyle{{\frac{1}{2\sigma^{2}}}}}(\mathbf{x}-\boldsymbol{\mu})^{T}(\mathbf{x}-\boldsymbol{\mu})\right).$
(1)

Here, $\boldsymbol{\mu}\in\mathbb{R}^{d}$ is the mean, and we will refer to
$\sigma^{2}$ as the variance, since the corresponding covariance matrix has
the form $\sigma^{2}\mathbf{I}$, with $\mathbf{I}\in\mathbb{R}^{d\times d}$
denoting the identity matrix. Such Gaussian random variables have the
important property that their sums remain Gaussian, with means and variances
combining additively: the sum of two independent Gaussians with means
$\boldsymbol{\mu}_{1}$ and $\boldsymbol{\mu}_{2}$ and variances
$\sigma_{1}^{2}$ and $\sigma_{2}^{2}$ is a Gaussian random variable with mean
$\boldsymbol{\mu}_{1}+\boldsymbol{\mu}_{2}$ and variance
$\sigma_{1}^{2}+\sigma_{2}^{2}$. The term standard Gaussian refers to the case
where the mean is $\mathbf{0}\in\mathbb{R}^{d}$ and the variance is $1$.
Multiplying a standard Gaussian by the scalar $\sigma$ and shifting by
$\boldsymbol{\mu}\in\mathbb{R}^{d}$ produces a Gaussian with mean
$\boldsymbol{\mu}$ and variance $\sigma^{2}$. It follows that if $\mathbf{y}$
and $\mathbf{z}$ are independent standard Gaussians, and $a$ and $b$ are
scalars, then $a\mathbf{y}+b\mathbf{z}$ is Gaussian with mean zero and
variance $a^{2}+b^{2}$; so $a\mathbf{y}+b\mathbf{z}$ can be sampled as
$\sqrt{a^{2}+b^{2}}\,\boldsymbol{\epsilon}$, where $\boldsymbol{\epsilon}$ is
a standard Gaussian.

We consider images that can be described by $d$ real numbers, typically pixel
values, and we collect these into a vector in $\mathbb{R}^{d}$. In practice
pixel values might be constrained—for example only integers between $0$ and
$255$ might be allowed—but we ignore this issue here for simplicity.

Given an image $\mathbf{x}_{0}\in\mathbb{R}^{d}$, the _forward process_
iteratively adds noise to create a sequence
$\mathbf{x}_{1},\mathbf{x}_{2},\ldots,\mathbf{x}_{T}$ according to the rule

$\mathbf{x}_{t}=\sqrt{1-\beta_{t}}\,\mathbf{x}_{t-1}+\sqrt{\beta_{t}}\,\boldsymbol{\epsilon}_{t}.$
(2)

Here, each $\boldsymbol{\epsilon}_{t}$ is an independent standard Gaussian and
the scalar parameter $\beta_{t}$ is between zero and one. The sequence
$\beta_{1},\beta_{2},\ldots,\beta_{T}$, known as the _variance schedule_ , is
predetermined. For example, in [15], linearly increasing values from
$\beta_{1}={10}^{-4}$ to $\beta_{T}=0.02$ are used. Since $\beta_{t}$ here is
increasing, more noise is added as the forward process evolves. It is useful
to think of $t$ as a time-like variable. At time zero we have an image and at
time $T$ we effectively have pure Gaussian noise.

The process (2) defines a discrete time Markov process, and the associated
transition density may be written

$q(\mathbf{x}_{t}\,|\,\mathbf{x}_{t-1})=\mathcal{N}(\mathbf{x}_{t};\sqrt{1-\beta_{t}}\,\mathbf{x}_{t-1},\beta_{t}\mathbf{I}).$
(3)

This quantifies the probability of observing $\mathbf{x}_{t}$ at time $t$,
given $\mathbf{x}_{t-1}$ at time $t-1$.

Updating over one time step in the forward process (2) is straightforward;
just scale the current value and add Gaussian noise. For later use, it is
helpful to know that stepping from time zero to a general time $t$ is possible
with a single leap. To see this, we introduce $\alpha_{t}=1-\beta_{t}$ so that

$\mathbf{x}_{t}=\sqrt{\alpha_{t}}\,\mathbf{x}_{t-1}+\sqrt{1-\alpha_{t}}\,\boldsymbol{\epsilon}_{t}.$
(4)

Then, applying (4) again, we have

$\displaystyle\mathbf{x}_{t}$ $\displaystyle=$
$\displaystyle\sqrt{\alpha_{t}}\left(\sqrt{\alpha_{t-1}}\,\mathbf{x}_{t-2}+\sqrt{1-\alpha_{t-1}}\,\boldsymbol{\epsilon}_{t-1}\right)+\sqrt{1-\alpha_{t}}\,\boldsymbol{\epsilon}_{t}$
(5) $\displaystyle=$
$\displaystyle\sqrt{\alpha_{t}\alpha_{t-1}}\,\mathbf{x}_{t-2}+\sqrt{\alpha_{t}}\sqrt{1-\alpha_{t-1}}\,\boldsymbol{\epsilon}_{t-1}+\sqrt{1-\alpha_{t}}\,\boldsymbol{\epsilon}_{t}.$

Using the properties of Gaussians mentioned at the start of this section, we
see that
$\sqrt{\alpha_{t}}\sqrt{1-\alpha_{t-1}}\,\boldsymbol{\epsilon}_{t-1}+\sqrt{1-\alpha_{t}}\,\boldsymbol{\epsilon}_{t}$
can be combined into a single Gaussian. In this way, (5) may be written

$\mathbf{x}_{t}=\sqrt{\alpha_{t}\alpha_{t-1}}\,\mathbf{x}_{t-2}+\sqrt{1-\alpha_{t}\alpha_{t-1}}\,\boldsymbol{\epsilon}_{t,t-2},$

where $\boldsymbol{\epsilon}_{t,t-2}$ is a standard Gaussian.

Proceeding inductively, suppose that for some $k$ between $t-2$ and $1$

$\mathbf{x}_{t}=\sqrt{\alpha_{t}\alpha_{t-1}\ldots\alpha_{k+1}}\,\mathbf{x}_{k}+\sqrt{1-\alpha_{t}\alpha_{t-1}\ldots\alpha_{k+1}}\,\epsilon_{t,k},$
(6)

where $\epsilon_{t,k}$ is a standard Gaussian. Then replacing $\mathbf{x}_{k}$
using (4)

$\mathbf{x}_{t}=\sqrt{\alpha_{t}\alpha_{t-1}\ldots\alpha_{k+1}}\,\left(\sqrt{\alpha_{k}}\,\mathbf{x}_{k-1}+\sqrt{1-\alpha_{k}}\,\boldsymbol{\epsilon}_{k}\right)+\sqrt{1-\alpha_{t}\alpha_{t-1}\ldots\alpha_{k+1}}\,\epsilon_{t,k}.$

Again replacing the sum of two independent Gaussians by a single, appropriate
Gaussian, we have

$\displaystyle\mathbf{x}_{t}$ $\displaystyle=$
$\displaystyle\sqrt{\alpha_{t}\alpha_{t-1}\ldots\alpha_{k}}\,\mathbf{x}_{k-1}+\sqrt{\alpha_{t}\alpha_{t-1}\ldots\alpha_{k+1}(1-\alpha_{k})+1-\alpha_{t}\alpha_{t-1}\ldots\alpha_{k+1}}\,\epsilon_{t,k-1},$
$\displaystyle=$
$\displaystyle\sqrt{\alpha_{t}\alpha_{t-1}\ldots\alpha_{k}}\,\mathbf{x}_{k-1}+\sqrt{1-\alpha_{t}\alpha_{t-1}\ldots\alpha_{k}}\,\epsilon_{t,k-1},$

where $\epsilon_{t,k-1}$ is a standard Gaussian. Hence, the form (6) is valid
all the way down to $k=0$. So, letting

$\overline{\alpha}_{t}=\prod_{i=1}^{t}\alpha_{i},$ (7)

we may write

$\mathbf{x}_{t}=\sqrt{\overline{\alpha}_{t}}\,\mathbf{x}_{0}+\sqrt{1-\overline{\alpha}_{t}}\,\bar{\boldsymbol{\epsilon}}_{t},$
(8)

where $\bar{\boldsymbol{\epsilon}}_{t}$ is a standard Gaussian. We may
therefore step directly from time $0$ to any later time $t$ using a single
Gaussian. This proves convenient for the analysis in section 4 and also for
the training algorithm discussed in section 5.

In terms of a transition density, (8) shows that

$q(\mathbf{x}_{t}\,|\,\mathbf{x}_{0}):=\mathcal{N}(\mathbf{x}_{t};\sqrt{\overline{\alpha}_{t}}\,\mathbf{x}_{0},(1-\overline{\alpha}_{t})\mathbf{I}).$
(9)

##  4 Backwards

We now consider the reverse process. We are interested in the probability of
$\mathbf{x}_{t-1}$ given $\mathbf{x}_{t}$ and $\mathbf{x}_{0}$; that is,
$q(\mathbf{x}_{t-1}\,|\,\mathbf{x}_{t},\mathbf{x}_{0})$. To proceed we will
make use of a result in conditional probability theory known as the product
rule, [3, 27], which for our purposes may be written

$P(A,B,C)=P(A\,|\,B,C)\,P(B,C)=P(A\,|\,B,C)\,P(B\,|\,C)\,P(C).$

By symmetry, we also have

$P(A,B,C)=P(B,A,C)=P(B\,|\,A,C)\,P(A,C)=P(B\,|\,A,C)\,P(A\,|\,C)\,P(C).$

Hence,

$P(A\,|\,B,C)=\frac{P(B\,|\,A,C)\,P(A\,|\,C)}{P(B\,|\,C)}.$

We will use this in the form

$\displaystyle q(\mathbf{x}_{t-1}\,|\,\mathbf{x}_{t},\mathbf{x}_{0})$
$\displaystyle=$
$\displaystyle\frac{q(\mathbf{x}_{t}\,|\,\mathbf{x}_{t-1},\mathbf{x}_{0})\,q(\mathbf{x}_{t-1}\,|\,\mathbf{x}_{0})}{q(\mathbf{x}_{t}\,|\,\mathbf{x}_{0})}.$
(10)

So now we focus on the quantities appearing on the right hand side of (10).

By the Markovian nature of the forward process, from (3),

$q(\mathbf{x}_{t}\,|\,\mathbf{x}_{t-1},\mathbf{x}_{0})=q(\mathbf{x}_{t}\,|\,\mathbf{x}_{t-1})=\mathcal{N}(\mathbf{x}_{t};\sqrt{\alpha_{t}}\,\mathbf{x}_{t-1},(1-\alpha_{t})\mathbf{I}).$
(11)

Making use of (9) for $\mathbf{x}_{t}$ and $\mathbf{x}_{t-1}$, we then see
that

$q(\mathbf{x}_{t-1}\,|\,\mathbf{x}_{t},\mathbf{x}_{0})=\frac{\mathcal{N}(\mathbf{x}_{t};\sqrt{\alpha_{t}}\,\mathbf{x}_{t-1},(1-\alpha_{t})\mathbf{I})\,\mathcal{N}(\mathbf{x}_{t-1};\sqrt{\overline{\alpha}_{t-1}}\,\mathbf{x}_{0},(1-\overline{\alpha}_{t-1})\mathbf{I})}{\mathcal{N}(\mathbf{x}_{t};\sqrt{\overline{\alpha}_{t}}\,\mathbf{x}_{0},(1-\overline{\alpha}_{t})\mathbf{I})}.$
(12)

From the definition (1), and ignoring the normalizing constants, we see that
this expression has the form

$\displaystyle\exp\left(-{\textstyle{{\frac{1}{2}}}}\frac{(\mathbf{x}_{t}-\sqrt{\alpha_{t}}\,\mathbf{x}_{t-1})^{T}(\mathbf{x}_{t}-\sqrt{\alpha_{t}}\,\mathbf{x}_{t-1})}{1-\alpha_{t}}-{\textstyle{{\frac{1}{2}}}}\frac{(\mathbf{x}_{t-1}-\sqrt{\overline{\alpha}_{t-1}}\,\mathbf{x}_{0})^{T}(\mathbf{x}_{t-1}-\sqrt{\overline{\alpha}_{t-1}}\,\mathbf{x}_{0})}{1-\overline{\alpha}_{t-1}}\right.$
$\displaystyle\left.\mbox{}+{\textstyle{{\frac{1}{2}}}}\frac{(\mathbf{x}_{t}-\sqrt{\overline{\alpha}_{t}}\mathbf{x}_{0})^{T}(\mathbf{x}_{t}-\sqrt{\overline{\alpha}_{t}}\,\mathbf{x}_{0})}{1-\overline{\alpha}_{t}}\right).$
(13)

We will show that this expression matches

$\mathcal{N}\left(\mathbf{x}_{t-1};\mu_{q}(\mathbf{x}_{t},\mathbf{x}_{0}),\sigma^{2}_{q}(t)\mathbf{I}\right),$
(14)

for appropriate $\mu_{q}(\mathbf{x}_{t},\mathbf{x}_{0})$ and
$\sigma^{2}_{q}(t)$. From (1), we can find $\sigma^{2}_{q}(t)$ by considering
the coefficient of $\mbox{}-\mathbf{x}_{t-1}^{T}\mathbf{x}_{t-1}$ in the
exponent of (13). This coefficient is given by

${\textstyle{{\frac{1}{2}}}}\frac{\alpha_{t}}{1-\alpha_{t}}+{\textstyle{{\frac{1}{2}}}}\frac{1}{1-\overline{\alpha}_{t-1}}={\textstyle{{\frac{1}{2}}}}\frac{\alpha_{t}(1-\overline{\alpha}_{t-1})+1-\alpha_{t}}{(1-\alpha_{t})(1-\overline{\alpha}_{t-1})}={\textstyle{{\frac{1}{2}}}}\left(\frac{1-\overline{\alpha}_{t}}{(1-\alpha_{t})(1-\overline{\alpha}_{t-1})}\right),$

where we used $\alpha_{t}\,\overline{\alpha}_{t-1}=\overline{\alpha}_{t}$ from
(7). Hence,

$\sigma^{2}_{q}(t)=\frac{(1-\alpha_{t})(1-\overline{\alpha}_{t-1})}{1-\overline{\alpha}_{t}}.$
(15)

Using the functional form (1) again, we can find
$\mu_{q}(\mathbf{x}_{t},\mathbf{x}_{0})$ by considering the vector, say
$\mathbf{v}$, such that $\mathbf{x}_{t-1}^{T}\mathbf{v}$ is the cross-product
in the exponent of (13). We see that

$\frac{\mu_{q}(\mathbf{x}_{t},\mathbf{x}_{0})}{\sigma^{2}_{q}(t)}=\mathbf{v}=\frac{\sqrt{\alpha_{t}}\,\mathbf{x}_{t}}{1-\alpha_{t}}+\frac{\sqrt{\overline{\alpha}_{t-1}}\,\mathbf{x}_{0}}{1-\overline{\alpha}_{t-1}}.$

Hence, using (15),

$\mu_{q}(\mathbf{x}_{t},\mathbf{x}_{0})=\frac{\sqrt{\alpha_{t}}\,(1-\overline{\alpha}_{t-1})\mathbf{x}_{t}+\sqrt{\overline{\alpha}_{t-1}}(1-\alpha_{t})\mathbf{x}_{0}}{1-\overline{\alpha}_{t}}.$
(16)

We wish to compute a sample from the distribution in (14). This will allow us
to perform the required transition along the backwards process. Our approach
is to estimate the mean in (14) and then shift with an appropriate Gaussian in
order to match the required variance.

If we know $\mathbf{x}_{t}$ and $\bar{\boldsymbol{\epsilon}}_{t}$ in (8) then
we may write

$\mathbf{x}_{0}=\frac{\mathbf{x}_{t}-\sqrt{1-\overline{\alpha}_{t}}\,\bar{\boldsymbol{\epsilon}}_{t}}{\sqrt{\overline{\alpha}_{t}}}.$

Substituting this expression for $\mathbf{x}_{0}$ into (16) we see that the
mean of $\mathbf{x}_{t-1}$, given $\mathbf{x}_{t}$ and $\mathbf{x}_{0}$, takes
the form

$\mu_{q}(\mathbf{x}_{t},\mathbf{x}_{0})=\frac{\sqrt{\alpha_{t}}(1-\overline{\alpha}_{t-1})}{1-\overline{\alpha}_{t}}\mathbf{x}_{t}+\frac{\sqrt{\overline{\alpha}_{t-1}}(1-\alpha_{t})}{(1-\overline{\alpha}_{t})\sqrt{\overline{\alpha}_{t}}}\mathbf{x}_{t}-\frac{\sqrt{\overline{\alpha}_{t-1}}(1-\alpha_{t})\sqrt{1-\overline{\alpha}_{t}}}{(1-\overline{\alpha}_{t})\sqrt{\overline{\alpha}_{t}}}\,\bar{\boldsymbol{\epsilon}}_{t}.$
(17)

Noting from (7) that
$\overline{\alpha}_{t-1}/\overline{\alpha}_{t}=1/\alpha_{t}$ and
$\alpha_{t}\times\overline{\alpha}_{t-1}=\overline{\alpha}_{t}$, we find that
in (17) the coefficient of $\mathbf{x}_{t}$ simplifies as follows:

$\frac{\sqrt{\alpha_{t}}(1-\overline{\alpha}_{t-1})}{1-\overline{\alpha}_{t}}+\frac{\sqrt{\overline{\alpha}_{t-1}}(1-\alpha_{t})}{(1-\overline{\alpha}_{t})\sqrt{\overline{\alpha}_{t}}}=\frac{1}{\sqrt{\alpha_{t}}(1-\overline{\alpha}_{t})}\left(\alpha_{t}(1-\overline{\alpha}_{t-1})+1-\alpha_{t}\right)=\frac{1}{\sqrt{\alpha_{t}}}.$

Similarly, the coefficient of $\bar{\boldsymbol{\epsilon}}_{t}$ in (17)
simplifies to

$\mbox{}-\frac{\sqrt{\overline{\alpha}_{t-1}}(1-\alpha_{t})\sqrt{1-\overline{\alpha}_{t}}}{(1-\overline{\alpha}_{t})\sqrt{\overline{\alpha}_{t}}}=\mbox{}-\frac{1-\alpha_{t}}{\sqrt{\alpha_{t}}\sqrt{1-\overline{\alpha}_{t}}}.$

Hence, (17) may be written

$\mu_{q}(\mathbf{x}_{t},\mathbf{x}_{0})=\frac{1}{\sqrt{\alpha_{t}}}\left(\mathbf{x}_{t}-\frac{1-\alpha_{t}}{\sqrt{1-\overline{\alpha}_{t}}}\bar{\boldsymbol{\epsilon}}_{t}\right).$
(18)

The missing ingredient here is $\bar{\boldsymbol{\epsilon}}_{t}$—the noise
that drove the transition from $\mathbf{x}_{0}$ to $\mathbf{x}_{t}$. To deal
with this we will train a neural network to predict
$\bar{\boldsymbol{\epsilon}}_{t}$. After training, the network will be a black
box which takes as input

  * •

a value of $t$ and a noisy image $\mathbf{x}_{t}$

and returns

  * •

a prediction of $\bar{\boldsymbol{\epsilon}}_{t}$.

We will denote the prediction by the function
$\boldsymbol{\epsilon}_{\theta}$, where $\theta$ represents the parameters in
the neural network—these will be learned during the training phase. In each
training step, we select an image $\mathbf{x}_{0}$ from the training set, take
a Gaussian $\bar{\boldsymbol{\epsilon}}_{t}$ and form a sample of
$\mathbf{x}_{t}$ using (8). The job of the network is to make the output
$\boldsymbol{\epsilon}_{\theta}$ as close as possible to
$\bar{\boldsymbol{\epsilon}}_{t}$.

Recalling the expression (14) for the required transition density, using the
neural network prediction $\boldsymbol{\epsilon}_{\theta}$ in the expression
(18) for the mean, and adjusting the variance using (15), we will obtain
$\mathbf{x}_{t-1}$ from

$\mathbf{x}_{t-1}=\frac{1}{\sqrt{\alpha_{t}}}\left(\mathbf{x}_{t}-\frac{1-\alpha_{t}}{\sqrt{1-\overline{\alpha}_{t}}}\,\boldsymbol{\epsilon}_{\theta}\right)+\sigma_{q}(t)\,\mathbf{z},$
(19)

where $\mathbf{z}$ is a standard Gaussian. This allows us to run the denoising
process from $t=T$ to $t=0$.

Having set up the required expressions, in the next section we outline the
resulting training and sampling algorithms.

##  5 Algorithms

The training process is summarized in Algorithm 1. Here we are applying a
basic stochastic gradient method [13]; in step 5 the network parameters are
updated using a least-squares loss function applied to a single, randomly
chosen training image. This simple least-squares formulation can be justified
from a likelihood perspective [4, 15, 16, 34]. The network architecture used
for the experiments in section 2 combines residual and attention blocks in a
U-Net [33] type structure, motivated by the choice in [15]. Overall, that
network has 12.9 Million parameters across 205 layers.

Algorithm 1 Training with the forward process [15]

1:repeat

2: $\mathbf{x}_{0}\sim q(\mathbf{x}_{0})$ $\triangleright$ choose an image
from training set

3: $t\sim\mathrm{Uniform}(\\{1,2,\ldots,T\\})$

4: $\boldsymbol{\epsilon}\sim\mathrm{N}(\mathbf{0},\mathbf{I})$
$\triangleright$ standard Gaussian sample

5: Take gradient step w.r.t. $\theta$ on
$\|\boldsymbol{\epsilon}-\boldsymbol{\epsilon}_{\theta}(\sqrt{\overline{\alpha}_{t}}\,\mathbf{x}_{0}+\sqrt{1-\overline{\alpha}_{t}}\,\boldsymbol{\epsilon},t)\|_{2}^{2}$

6:until converged

Algorithm 2 summarizes the sampling process. Here we define $\sigma_{q}(1)=0$,
so that only the mean estimate based on (18) is used at $t=1$.

Algorithm 2 Sampling with the backward process [15]

1:$\mathbf{x}_{T}\sim\mathrm{N}(\mathbf{0},\mathbf{I})$ $\triangleright$
standard Gaussian sample

2:for $t=T,T-1,\ldots,1$ do

3: $\mathbf{z}\sim\mathrm{N}(\mathbf{0},\mathbf{I})$ $\triangleright$ standard
Gaussian sample

4:
$\mathbf{x}_{t-1}=\frac{1}{\sqrt{\alpha_{t}}}\left(\mathbf{x}_{t}-\frac{1-\alpha_{t}}{\sqrt{1-\overline{\alpha}_{t}}}\,\boldsymbol{\epsilon}_{\theta}\right)+\sigma_{q}(t)\,\mathbf{z}$

5:end for

6:return $\mathbf{x}_{0}$

##  6 Furthermore

In this section we touch upon some issues that may have occurred to the
reader, and provide references where further information may be found.

How do we judge the performance of generative AI? A generative model must
balance the contradictory aims of producing outputs that are plausible (like
the training data) and novel (not like the training data). Any attempt to
quantify performance must involve somewhat arbitrary choices that allow this
circle to be squared. A popular quantitative measure, which focuses on the
plausibility aspect, is Fréchet Inception Distance [12]. This measure
approximates and compares the probability distributions of the real and
synthetic image spaces, under a Gaussian assumption. Some studies also make
use of subjective human opinions, which raises new issues, including
reproducibility and representativeness.

What are useful applications of diffusion models? Given that the internet
already stores a bewildering array of real images, it is reasonable to ask
whether the world needs synthetic examples, however realistic. However, in
some domains representative artificial data is valuable. In medical imaging,
for example, synthetically generated data may help address scarcity, class
imbalance and privacy concerns in educational settings [21]. Perhaps the
biggest attraction of diffusion models lies in their use within larger
systems. A diffusion model for image generation may be viewed as a
representation of the hidden, or latent, distribution of real-world images. By
conditioning or guiding the image generation according to user-specified
requirements, it is then possible to tailor the output to meet certain goals
[2, 10, 17, 45]. For example, diffusion forms part of several systems with
text-to-image capabilities, including Open AI’s DALL-E 2 [31], Stability.ai’s
Dreamstudio [32] and Google’s Imagen [34]. In-painting and overwriting
unwanted pixels is also possible [44, 29].

Stable diffusion may also be exploited within ChatGPT-style large language
models; an example is Stability.ai’s StableLM-3B-4E1T [39].

How computationally expensive is it to train and employ a diffusion model? For
the simple low-resolution examples in section 2, using a pretrained network to
produce new images is feasible on a standard desktop machine. However, high
resolution image generation with a state-of-the-art pretrained diffusion model
is a “high resource intensive and slow task that prohibits interactive
experience for the users and results in huge computational cost on expensive
GPUs” [1]. The size of many diffusion based models also raises storage issues:
“generating high-resolution images with diffusion models is often infeasible
on consumer-grade GPUs due to the the excessive memory requirements” [29].

Training is greater challenge. For the examples in section 2 we trained the
network for 500 epochs in under 35 minutes on a single NVIDIA GeForce RTX 3090
GPU. It is reported in [40] that training the model in [7] consumes 150-1000
days of NVIDIA V100 GPU time. StableLM-3B-4E1T [39] is a 3 Billion parameter
language model trained on 1 Trillion tokens of diverse English and code
datasets; a 7 Billion parameter version was later released. Developing
smaller-scale versions of such models, or applying the models to compressed
latent spaces, is therefore an active area [32, 43].

In terms of power usage when a trained model is deployed, Luccioni et al. [24]
estimated that “the most carbon-intensive image generation model (stable-
diffusion-xl-base-1.0) generates 1,594 grams of CO2 for 1,000 inferences,
which is roughly the equivalent to 4.1 miles driven by an average gasoline-
powered passenger vehicle.”

Is it a coincidence that (4) and (19) look similar to a numerical
discretization of a stochastic differential equation? It is natural to compare
(4) and (19) with the Euler–Maruyama method [14], and indeed there are
variations of the forward diffusion model that have a direct correspondence
with stochastic differential equations [15, 25, 29, 37]. The reverse process
may also be associated with backward stochastic differential equations [40].

What about the dark side: ethics, privacy, bias and related concerns? Carlini
et al. [5] showed that diffusion models have a tendency to memorize and
reproduce training images. For tests on Stable AI [32] and Imagen [34] they
were able to “extract over a hundred near-identical replicas of training
images that range from personally identifiable photos to trademarked logos.”
Somepalli et al. [36] also found examples where a diffusion model “blatantly
copies” from training data. The resulting harms to professional artists are
considered in [20]; these include “reputational damage, economic loss,
plagiarism and copyright infringement.” When we move into the realm of text-
to-image algorithms there are many further issues to consider, including
fairness, toxicity and trust [11].

The figures in section 2 indicate that the output from a simple diffusion
model is difficult to predict and hence to interpret. In particular, very
different results can be generated from the same input. Explainable AI is a
serious challenge in this setting.

On a more general note, any machine learning algorithm is likely to reflect
the biases, omissions and errors in the training set [28]. See [18] for a
proposed framework for data transparency.

We also mention that discussions around ethics in this field often assume that
AI is, or will become, all-powerful, thereby overlooking empirical
observations that these systems may fail to operate as intended—the so-called
_fallacy of AI functionality_ [30]. So, as well as the important question of
what tasks _should_ AI be used for, we must also ask what tasks _can_ AI
reliably perform. This latter issue is ripe for mathematical and statistical
contributions.

Using generative AI to create content (text, images, music, videos, and so on)
that is difficult or impossible to discriminate from human generated content
may allow fakery and conspiracy theories to undermine societal safety and
benefits. This begets novel risks that are already upon us, identified in part
by the inaugural AI Safety Summit which met at Bletchley Park in November
2023.111 https://www.gov.uk/government/publications/ai-safety-
summit-2023-chairs-statement-2-november/chairs-summary-of-the-ai-safety-
summit-2023-bletchley-park Arguably, some of the decadal data science focus on
ethics and privacy should have been redirected towards the societal risk of
fake truths and the widespread inability to discriminate between content; and
the introduction of bias. These risks now require an in-depth consideration,
as we seek to uncover and tackle the full range of possibilities. An
understanding of the mathematical foundations of generative AI methods will be
a key to ensuring transparency.

##  7 PDEs

For many applied mathematicians, diffusion is synonymous with certain
parabolic PDEs. Here we present some speculative material that aims to draw a
PDE connection with the process described in section 3. The notion of
continuously re-normalizing a diffusion process takes us outside the realm of
standard textbook analysis, and opens up some issues that may be of
independent interest. Depending on our choice of basic PDE there are several
ways to ensure that the norm of some derivative of the solution remains
unchanged over time. Here we illustrate this general idea by continuously re-
scaling to preserve the norm of the gradient of the solution, that is, the
total variation, over the domain.

Consider a real valued field $u(x,t)$, where $x\in\Omega$, a bounded domain in
$\mathbb{R}^{d}$ with a piecewise smooth boundary, $\partial\Omega$, and time
$t\geq 0$, satisfying

$u_{t}=\Delta u+r(t)u,\quad x\in\Omega,\quad\nabla u.{\bf n}=0,\quad
x\in\partial\Omega,$ (20)

for a suitable given initial condition $u(x,0)=u_{0}(x)$. Here $r(t)>0$ is a
shadow time-dependent variable (akin to a Lagrange multiplier), which
continuously rescales $u$ so that the $L^{2}$ norm of the gradient of $u$ is
preserved. More explicitly, $r(t)$ must be such that

$\int_{\Omega}||\nabla u||^{2}\,dx:{=}\int_{\Omega}\nabla u.\nabla u\,dx\equiv
R\quad\mathrm{(constant)},\ \ t\geq 0.$ (21)

Here $R>0$ is determined from the initial condition.

Taking the gradient of (20), and then forming the scalar product with $\nabla
u$, and integrating over $\Omega$, we obtain

$\frac{1}{2}\,\frac{d\ }{dt}\int_{\Omega}\nabla u.\nabla
u\,dx=\int_{\Omega}{\nabla u.\nabla(\Delta u)}\,dx+r(t)\int_{\Omega}{\nabla
u.\nabla u}\,dx.$

But, by direct calculation,

$\nabla.(\nabla u\Delta u)=(\Delta u)^{2}+\nabla u.\nabla(\Delta u).$

So, using the divergence theorem [26] together with the no-flux boundary
condition, in order to ensure that $R$ is constant we must set

$R\,r(t)=\int_{\Omega}{(\Delta u)^{2}}\,dx\geq 0.$

Thus we may write (20) and (21) as the nonlinear integro-differential equation

$u_{t}=\Delta u+\frac{u}{R}\int_{\Omega}{(\Delta u)^{2}}\,dx,\quad
x\in\Omega,\quad\nabla u.{\bf n}=0,\quad x\in\partial\Omega.$ (22)

Here, as before, $R$ in (22) is set by the initial condition:
$R=\int_{\Omega}||\nabla u_{0}(x)||^{2}\,dx.$

For any $R>0$, the constrained equation, (20) and (21), has infinitely many
possible steady states, each of which is of the form

$u=\mu_{k}\phi_{k}(x)\quad{\rm and}\quad r=\lambda_{k},$

where $(\phi_{k}(x),\lambda_{k})$ is the $k$th ($k=0,1,2,...$) eigenfunction-
eigenvalue pair for the Laplacian on $\Omega$ with no-flux boundary
conditions. However, $\mu_{k}$ must satisfy

$\mu_{k}^{2}=\frac{R}{\int_{\Omega}||\nabla\phi_{k}||^{2}\,dx},$

and so $k\geq 1$, since the simplest eigenfunction satisfies
$||\nabla\phi_{0}||\equiv 0$.

Now consider small perturbations around the $k$th steady state. We set

$\displaystyle u$ $\displaystyle=$
$\displaystyle\mu_{k}\left(\phi_{k}(x)+\epsilon e^{\sigma
t}v(x)\right)+O(\epsilon^{2}),$ $\displaystyle r(t)$ $\displaystyle=$
$\displaystyle\lambda_{k}+\epsilon\beta e^{\sigma t}+O(\epsilon^{2}),$

for some $v(x)$ and constants $(\sigma,\beta)$ to be determined. Substituting
these expressions into (20), to $O(\epsilon)$ we obtain

$0=\Delta v+(\lambda_{k}-\sigma)v+\beta\phi_{k},\quad x\in\Omega,\quad\nabla
v.{\bf n}=0,\quad x\in\partial\Omega.$ (23)

Now setting $v=\phi_{\tilde{k}}$, for $k\neq\tilde{k}$ (since the
eigenfunctions form an orthonormal basis for the solution space), (23) yields

$0=(\lambda_{k}-\lambda_{\tilde{k}}-\sigma)\phi_{\tilde{k}}+\beta\phi_{k},\quad
x\in\Omega,$

so that

$\sigma=\lambda_{k}-\lambda_{\tilde{k}}\ {\rm and}\ \beta=0.$

The condition on $\sigma$ implies that each steady state is stable with
respect to perturbations in all higher eigenmodes, where $k<\tilde{k}$, yet is
unstable with respect to any perturbations in lower eigenmodes, $k>\tilde{k}$.
Thus over a long time the solution must decay to the the first eigenmode,
$\mu_{1}\phi_{1}(x)$.

This is borne out in the numerical experiment shown in Figure 7. Here, for a
one dimensional domain $\Omega=[0,1]$, we have $\phi_{k}(x)=\sqrt{2}\cos k\pi
x$ and $\lambda_{k}=k^{2}\pi^{2}$.

Figure 7: Numerical solution profiles of (20) and (21) where $d=1$ and
$\Omega=[0,1]$, shown at successive times on a $\log$ timescale ($t=$ 1.5
(blue), 15 (yellow), 150 (green), and 1500 (red)), where any $\phi_{0}$
component has been set to zero. In this case each profile has
$\int_{\Omega}||\nabla u||^{2}\,dx\equiv R\approx 11.15$. The $\phi_{1}$ mode
dominates at larger times.

This framework and others in physics (see for example [41, 42]) suggests a
number of ways that generative AI might exploit, or be explained by, PDE
theory. The central challenge is being able to run the processes in reverse in
order to generate plausible content from randomness.

Of course in the example above the parabolicity of the forward dynamic
evolution, (20) and (21), means that, formally, the backward equation is ill-
posed, there being no global solution guaranteed, with both discontinuities
and point masses possibly occurring as time moves backwards. Hence any
backward approximation should require some mollification, perhaps via a
numerical solution that leverages finite resolution and norm preserving
properties.

In general one should also wish to consider (i) how these norm-preserving (re-
scaling) diffusion systems work when they are subject to stochastic forcing
over a finite time, and (ii) how such processes might be run backwards in
seeking to recover or approximate the initial conditions under various
Markovian assumptions.

## Data Statement

Code for the experiments presented here will be made available upon
publication.

## References

  * [1] S. Agarwal, S. Mitra, S. Chakraborty, S. Karanam, K. Mukherjee, and S. Saini, Approximate caching for efficiently serving diffusion models, arXiv:2312.04429, (2023).
  * [2] A. Bansal, H.-M. Chu, A. Schwarzschild, S. Sengupta, M. Goldblum, J. Geiping, and T. Goldstein, Universal guidance for diffusion models, in 2023 IEEE/CVF Conference on Computer Vision and Pattern Recognition Workshops (CVPRW), 2023, pp. 843–852.
  * [3] C. M. Bishop, Pattern Recognition and Machine Learning (Information Science and Statistics), Springer, Berlin, 2007.
  * [4] Y. Cao, S. Li, Y. Liu, Z. Yan, Y. Dai, P. S. Yu, and L. Sun, A comprehensive survey of AI-generated content (AIGC): A history of generative AI from GAN to ChatGPT, arXiv:2303.04226, (2023).
  * [5] N. Carlini, J. Hayes, M. Nasr, M. Jagielski, V. Sehwag, F. Tramèr, B. Balle, D. Ippolito, and E. Wallace, Extracting training data from diffusion models, in Proceedings of the 32nd USENIX Conference on Security Symposium, SEC ’23, USA, 2023, USENIX Association.
  * [6] F.-A. Croitoru, V. Hondru, R. T. Ionescu, and M. Shah, Diffusion models in vision: A survey, IEEE Transactions on Pattern Analysis and Machine Intelligence, 45 (2023), pp. 10850–10869.
  * [7] P. Dhariwal and A. Nichol, Diffusion models beat GANs on image synthesis, in Advances in Neural Information Processing Systems, M. Ranzato, A. Beygelzimer, Y. Dauphin, P. Liang, and J. W. Vaughan, eds., vol. 34, Curran Associates, Inc., 2021, pp. 8780–8794.
  * [8] S. Feuerriegel, J. Hartmann, C. Janiesch, and P. Zschech, Generative AI, Business and Information Systems Engineering, (2023).
  * [9] L. Girin, S. Leglaive, X. Bie, J. Diard, T. Hueber, and X. Alameda-Pineda, Dynamical variational autoencoders: A comprehensive review, Foundations and Trends in Machine Learning, 15 (2021), p. 1–175.
  * [10] R. Gozalo-Brizuela and E. C. Garrido-Merchán, A survey of generative AI applications, arXiv:2306.02781, (2023).
  * [11] S. Hao, P. Kumar, S. Laszlo, S. Poddar, B. Radharapu, and R. Shelby, Safety and fairness for content moderation in generative models, in CVPR Workshop on Ethical Considerations in Creative applications of Computer Vision, 2023.
  * [12] M. Heusel, H. Ramsauer, T. Unterthiner, B. Nessler, and S. Hochreiter, GANs trained by a two time-scale update rule converge to a local Nash equilibrium, in Advances in Neural Information Processing Systems, I. Guyon, U. von Luxburg, S. Bengio, H. M. Wallach, R. Fergus, S. V. N. Vishwanathan, and R. Garnett, eds., Long Beach, CA, USA, 2017, pp. 6626–6637.
  * [13] C. F. Higham and D. J. Higham, Deep learning: An introduction for applied mathematicians, SIAM Review, 61 (2019), pp. 860–891.
  * [14] D. J. Higham and P. E. Kloeden, An introduction to the numerical simulation of stochastic differential equations, SIAM, Philadelphia, 2021.
  * [15] J. Ho, A. Jain, and P. Abbeel, Denoising diffusion probabilistic models, in Proceedings of the 34th International Conference on Neural Information Processing Systems, Red Hook, NY, USA, 2020, Curran Associates Inc.
  * [16] J. Ho, C. Saharia, W. Chan, D. J. Fleet, M. Norouzi, and T. Salimans, Cascaded diffusion models for high fidelity image generation, J. Mach. Learn. Res., 23 (2022).
  * [17] J. Ho and T. Salimans, Classifier-free diffusion guidance, in NeurIPS 2021 Workshop on Deep Generative Models and Downstream Applications.
  * [18] B. Hutchinson, A. Smart, A. Hanna, E. Denton, C. Greer, O. Kjartansson, P. Barnes, and M. Mitchell, Towards accountability for machine learning datasets: Practices from software engineering and infrastructure, in Proceedings of the 2021 ACM Conference on Fairness, Accountability, and Transparency, FAccT ’21, New York, NY, USA, 2021, Association for Computing Machinery, pp. 560–575.
  * [19] G. Iglesias, E. Talavera, and A. Díaz-Álvarez, A survey on GANs for computer vision: Recent research, analysis and taxonomy, Computer Science Review, 48 (2023), p. 100553.
  * [20] H. H. Jiang, L. Brown, J. Cheng, M. Khan, A. Gupta, D. Workman, A. Hanna, J. Flowers, and T. Gebru, AI art and its impact on artists, in Proceedings of the 2023 AAAI/ACM Conference on AI, Ethics, and Society, AIES ’23, New York, NY, USA, 2023, Association for Computing Machinery, pp. 363–374.
  * [21] A. Kazerouni, E. K. Aghdam, M. Heidari, R. Azad, M. Fayyaz, I. Hacihaliloglu, and D. Merhof, Diffusion models in medical imaging: A comprehensive survey, Medical Image Analysis, 88 (2023), p. 102846.
  * [22] D. P. Kingma and M. Welling, Auto-encoding variational Bayes, in 2nd International Conference on Learning Representations, 2014, Banff, AB, Canada, April 14-16, 2014, Conference Track Proceedings, 2014.
  * [23] Y. LeCun, C. Cortes, and C. J. C. Burges, The MNIST database of handwritten digits.
  * [24] A. S. Luccioni, Y. Jernite, and E. Strubell, Power hungry processing: Watts driving the cost of AI deployment?, arXiv:2311.16863, (2023).
  * [25] C. Luo, Understanding diffusion models: A unified perspective, arXiv:2208.11970, (2022).
  * [26] P. C. Matthews, Vector Calculus, Springer, Berlin, 1998.
  * [27] K. P. Murphy, Probabilistic Machine Learning: An introduction, MIT Press, Boston, 2022.
  * [28] A. Paullada, I. D. Raji, E. M. Bender, E. Denton, and A. Hanna, Data and its (dis) contents: A survey of dataset development and use in machine learning research, Patterns, 2 (2021).
  * [29] R. Po, W. Yifan, V. Golyanik, K. Aberman, J. T. Barron, A. H. Bermano, E. R. Chan, T. Dekel, A. Holynski, A. Kanazawa, C. K. Liu, L. Liu, B. Mildenhall, M. Nießner, B. Ommer, C. Theobalt, P. Wonka, and G. Wetzstein, State of the art on diffusion models for visual computing, arXiv:2310.07204, (2023).
  * [30] I. D. Raji, I. E. Kumar, A. Horowitz, and A. Selbst, The fallacy of AI functionality, in Proceedings of the 2022 ACM Conference on Fairness, Accountability, and Transparency, FAccT ’22, New York, NY, USA, 2022, Association for Computing Machinery, pp. 959–972.
  * [31] A. Ramesh, P. Dhariwal, A. Nichol, C. Chu, and M. Chen, Hierarchical text-conditional image generation with CLIP latents, arXiv:2204.06125, (2022).
  * [32] R. Rombach, A. Blattmann, D. Lorenz, P. Esser, and B. Ommer, High-resolution image synthesis with latent diffusion models, in Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, 2022, pp. 10684–10695.
  * [33] O. Ronneberger, P. Fischer, and T. Brox, U-Net: Convolutional networks for biomedical image segmentation, in Medical Image Computing and Computer-Assisted Intervention – MICCAI 2015, N. Navab, J. Hornegger, W. M. Wells, and A. F. Frangi, eds., Cham, 2015, Springer International Publishing, pp. 234–241.
  * [34] C. Saharia, W. Chan, S. Saxena, L. Li, J. Whang, E. L. Denton, K. Ghasemipour, R. Gontijo Lopes, B. Karagol Ayan, T. Salimans, J. Ho, D. J. Fleet, and M. Norouzi, Photorealistic text-to-image diffusion models with deep language understanding, in Advances in Neural Information Processing Systems, S. Koyejo, S. Mohamed, A. Agarwal, D. Belgrave, K. Cho, and A. Oh, eds., vol. 35, Curran Associates, Inc., 2022, pp. 36479–36494.
  * [35] J. Sohl-Dickstein, E. Weiss, N. Maheswaranathan, and S. Ganguli, Deep unsupervised learning using nonequilibrium thermodynamics, in Proceedings of the 32nd International Conference on Machine Learning, F. Bach and D. Blei, eds., vol. 37 of Proceedings of Machine Learning Research, Lille, France, 2015, PMLR, pp. 2256–2265.
  * [36] G. Somepalli, V. Singla, M. Goldblum, J. Geiping, and T. Goldstein, Diffusion art or digital forgery? Investigating data replication in diffusion models, in Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), June 2023, pp. 6048–6058.
  * [37] Y. Song, J. Sohl-Dickstein, D. P. Kingma, A. Kumar, S. Ermon, and B. Poole, Score-based generative modeling through stochastic differential equations, in International Conference on Learning Representations, 2021.
  * [38] Y. Tay, M. Dehghani, D. Bahri, and D. Metzler, Efficient transformers: A survey, ACM Comput. Surv., 55 (2022).
  * [39] J. Tow, M. Bellagente, D. Mahan, and C. R. Ruiz, StableLM-3B-4E1T, tech. rep., Stability-AI, 2023.
  * [40] Z. Wang, Score-based generative modeling through backward stochastic differential equations: Inversion and generation, arXiv:2311.16863, (2023).
  * [41] Y. Xu, Z. Liu, M. Tegmark, and T. Jaakkola, Poisson flow generative models, in Advances in Neural Information Processing Systems, S. Koyejo, S. Mohamed, A. Agarwal, D. Belgrave, K. Cho, and A. Oh, eds., vol. 35, Curran Associates, Inc., 2022, pp. 16782–16795.
  * [42] Y. Xu, Z. Liu, Y. Tian, S. Tong, M. Tegmark, and T. Jaakkola, PFGM++: Unlocking the potential of physics-inspired generative models, in Proceedings of the 40th International Conference on Machine Learning, A. Krause, E. Brunskill, K. Cho, B. Engelhardt, S. Sabato, and J. Scarlett, eds., vol. 202 of Proceedings of Machine Learning Research, 2023, pp. 38566–38591.
  * [43] X. Yang, D. Zhou, J. Feng, and X. Wang, Diffusion probabilistic model made slim, in 2023 IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), 2023, pp. 22552–22562.
  * [44] A. B. Yildirim, V. Baday, E. Erdem, A. Erdem, and A. Dundar, Inst-Inpaint: Instructing to remove objects with diffusion models, arXiv:2304.03246, (2023).
  * [45] L. Zhang, A. Rao, and M. Agrawala, Adding conditional control to text-to-image diffusion models, in Proceedings of the IEEE/CVF International Conference on Computer Vision, 2023, pp. 3836–3847.