# Why AI is (or not) a good option for the generation of random numbers?

Why AI is (or not) a good option for the generation of random numbers? Would GANs be suited for this purpose?

Why AI is (or not) a good option for the generation of random numbers?

AI approaches are generally not good for generating random numbers, for these reasons:

• Similar to why they are not good for adding numbers, there already exist many strong pseudo-random and "true" random sources, possible without using any AI approach, and demonstrably good enough for purposes such as simulations and cryptography. These existing algorithms and devices perform much more efficiently at the task than any AI could.

• Generating random numbers with good statistical properties is a very precise task, that the approximations typically used in machine learning cannot cope with (a pseudo-random function is inherently noisy and difficult to learn). AI search techniques are not helpful either, because the amount of output that needs to be generated in order to validate a random data source is very large, making things like tree searches for solutions intractable.

One possible relationship between AI and random number generation that could be explored is in code generation and code analysis for random number generators. In other words, an AI that is sophisticated enough to understand the complexity of code used in a typical random number generator (RNG) might help with making random number generation more efficient, or less easy to hack, or expose flaws in existing implementations. This is beyond the capabilities of AI techniques at the moment - or put another way, human intelligence has taken RNG technology quite far already, so there is very little practical that current AIs can do to improve on it.

Would GANs be suited for this purpose?

No. The input to a GAN is typically a vector of random numbers that have been generated, by an already-existing RNG. The purpose the the GAN is convert this simply-distributed random vector input $$\mathbf{x}$$ - which might be suitable for many other purposes, such as running simulations of stochastic processes - into a $$\mathbf{y}$$ sampled from a distribution of some target population $$\mathbb{Y}$$, which is typically being expressed as a subset of a large space $$\mathbb{R}^d$$. The values that $$\mathbf{y}$$ will take are biased to a subspace (or manifold) of all possible space within the representations possible in that vector space. For instance, you might input a random vector with 100 variables and the GAN will generate a picture of a dog. It cannot generate anything other than attempts at pictures of dogs, whilst the space of all possible images that it might create if completely random is far larger (and usually not interesting to look at).

So a GAN would take an already-good random source and turn it into a biased set of numbers that would be generally unusable as a RNG without further processing. The kind of processing you would do (e.g. "noise whitening") is something that some current "secure" random generators do - meaning to use the GAN to generate quality random numbers you would literally put existing RNG code on its input and output layers. The GAN would add nothing but wasted computation.

You cannot even train a GAN to do this task, since a truly random space contains all possible outputs, there will be no negative examples for the discriminator. Although a random picture most often looks like static noise, and a picture of the Mona Lisa is clearly considered "not random" by most people, in fact it is just as likely to be seen as any other image.

• any article that proves it? Could you have any me? – Santos Nov 21 '19 at 15:33
• @Santos: There might be a blog or something by someone stating the same things, but I don't expect any academic article. This is not an area of speculation or missing knowledge where academic research is necessary. If you can express your question in a way that makes it mathematical in nature, I could probably match that with a suitable proof. – Neil Slater Nov 21 '19 at 18:42