Українська правда

AI has a favorite number, and it's not 42

- 1 July, 10:22 AM

Popular AI models, including OpenAI's ChatGPT, Anthropic's Claude Sonnet 4, Google's Gemini 2.5 Flash, and Meta's Llama 4, all choose the number 27 when asked to "guess a random number between 1 and 50." This indicates that the models are unable to generate true randomness, but instead reproduce patterns from their training data, The Register reported.

Answer to the query "Guess a number from 1 to 50" from the ChatGPT o4-mini model

Muhd Faraaz, a researcher at the consulting firm Capco, was the first to notice this phenomenon: he tested seven different LLM applications and in six of them he got an answer of 27 when asked to “guess a number between 1 and 50.” Similar tests confirmed the result for models with typical settings. Only one, Grok from xAI, answered “42” — a reference to “The Answer to Life, the Universe, and Everything” in Douglas Adams’s novel The Hitchhiker’s Guide to the Galaxy.

The researchers attribute this behavior to two factors: next-word prediction algorithms and reinforcement learning with human input (RLHF) tuning, which favors the selection of the most likely tokens over true randomness. “RLHF likely induces ‘mode collapse,’ which may directly explain this predictability,” says Daniel Kang, an associate professor at the University of Illinois at Urbana-Champaign.

In a new preprint, Javier Coronado-Blaváquez of Telefónica Tech tested six models (GPT-4o-mini, Gemini 2.0, and Llama 3.1-8b) on a selection of numbers from the ranges 1–5, 1–10, and 1–100, in six languages, and for six values of the parameter "temperature." In total, they made 75,600 model calls and found:

  • In the range 1–10, GPT-4o-mini, Phi-4, and Gemini 2.0 produced the number 7 approximately 80% of the time;
  • In the range 1–5, models more often chose 3 or 4, and for 1–100, 37, 47, and 73, most of which are prime numbers;
  • The answers varied slightly by language: Gemini answered 3 in Spanish, but 4 in English.

"Despite the stochastic transformer-based architecture, these models often provide deterministic responses to random number queries," Coronardo-Blavakes summarized.

The inability to generate objectively uniform "random" numbers has practical consequences: randomized controlled trials, simulations, and cryptography require true randomness, which these AI systems cannot provide without calling on external generators.

“Machines have not only borrowed human biases about randomness, they have amplified them,” warn Cornell University researchers Catherine Van Koevering and John Kleinberg in their work on “coin flipping” in GPT-4 and Llama 3. There, they found that the models produce uneven 50/50 distributions that are even worse than humans.

To achieve true randomness, developers must integrate special algorithms (e.g. Math.random()) or hardware sources of entropy. Otherwise, AI queries to "guess a number" will continue to generate predictable numbers like 27.

Load more