Exploding variance of means of exponentials: least-squares to the rescue Francis Bach's blog post analyzes why Monte Carlo estimates of log-sum-exp functions suffer exploding variance, showing that for independent normal variables with mean μ and variance σ², the relative squared error of estimating E[e^z] equals (e^{σ²}−1)/n and grows exponentially with σ. The post proposes least-squares regression as an alternative that keeps the optimization advantages of log-sum-exp while avoiding its computational and statistical disadvantages, noting least-squares offers closed-form estimation for linear models and moments with fixed controlled variance. A common task in machine learning is to estimate or optimize “log-sum-exp” https://fr.wikipedia.org/wiki/LogSumExp functions with potentially continuously many terms such as $$ \log \Big \int {\mathcal{X}} e^{v x } dq x \Big ,$$ where $v: \mathcal{X} \to \mathbb{R}$ is some potential function, and $q$ is a probability distribution on the set $\mathcal{X}$. This has many applications throughout data science, often through the normalization of probabilistic models https://en.wikipedia.org/wiki/Exponential family log-partition function , but also as a smooth approximation to the maximum https://en.wikipedia.org/wiki/Smooth maximum , in transformers