Deterministic or probabilistic? The psychology of LLMs as random number generators
Javier Coronado-Blázquez
TL;DR
The paper investigates whether LLMs can generate true random numbers or merely reproduce biases from training data and linguistic cues. It uses a large-scale multilingual, multi-model setup spanning three number ranges, six temperatures, and seven languages, with 75,600 prompts to quantify randomness via a proposed randomness index $RI$ and statistical tests ($\chi^2$, $\phi_C$), benchmarked against Python's random.randint(). Key findings show pervasive nonuniformity and language/model-specific biases, with central-value tendencies in low and medium ranges, and strong constraints in high ranges for several API-based models; DeepSeek-R1's chain-of-thought logs illustrate internal reasoning patterns that do not yield true randomness. The results have practical implications for any application requiring unpredictable randomness and motivate future work on bias mitigation, prompt design, and broader multilingual evaluation.
Abstract
Large Language Models (LLMs) have transformed text generation through inherently probabilistic context-aware mechanisms, mimicking human natural language. In this paper, we systematically investigate the performance of various LLMs when generating random numbers, considering diverse configurations such as different model architectures, numerical ranges, temperature, and prompt languages. Our results reveal that, despite their stochastic transformers-based architecture, these models often exhibit deterministic responses when prompted for random numerical outputs. In particular, we find significant differences when changing the model, as well as the prompt language, attributing this phenomenon to biases deeply embedded within the training data. Models such as DeepSeek-R1 can shed some light on the internal reasoning process of LLMs, despite arriving to similar results. These biases induce predictable patterns that undermine genuine randomness, as LLMs are nothing but reproducing our own human cognitive biases.
