Large Language Models Are Bad Dice Players: LLMs Struggle to Generate Random Numbers from Statistical Distributions
This paper demonstrates that current large language models fundamentally lack the ability to generate random numbers from specified probability distributions, exhibiting severe statistical failures in both batch and independent sampling modes that propagate systematic biases into downstream applications.
Original paper licensed under CC BY 4.0 (http://creativecommons.org/licenses/by/4.0/). This is an AI-generated explanation of the paper below. It is not written or endorsed by the authors. For technical accuracy, refer to the original paper. Read full disclaimer
The Big Idea: The "Magic Dice" That Isn't Magic
Imagine you ask a super-smart robot to roll a die 1,000 times and write down the results. You expect the numbers 1 through 6 to appear roughly the same amount of time (about 166 times each). This is what statisticians call a uniform distribution.
This paper asks a simple but shocking question: Can modern AI models (LLMs) actually do this on their own?
The answer is a resounding no. The researchers found that while these models are amazing at writing stories, coding, and chatting, they are terrible at being random. They don't have a "randomness engine" inside them. Instead, they are just guessing based on patterns they've seen before, which leads to predictable, biased results.
The Two Ways to Ask for Randomness
The researchers tested the AI in two different ways, like asking a friend to roll dice in two different scenarios:
The "Batch" Request (The One-Shot):
- The Prompt: "Please roll a die 1,000 times and list all the numbers in one big list."
- The Result: The AI does okay. It gets about 7% of the distributions right.
- Why? When the AI writes a long list, it can "look back" at what it just wrote. If it rolled too many "6s" in the first 100 numbers, it might subconsciously try to roll more "1s" later to balance the list out. It's like a human trying to "fix" their mistake as they go.
The "Independent" Request (The One-by-One):
- The Prompt: "Roll a die once. Now, roll it again (in a new chat). Now again..." (Repeating this 1,000 times).
- The Result: Total failure. 10 out of 11 models failed completely.
- Why? Without the ability to look back at previous rolls, the AI's internal bias takes over. It has a "favorite number" (like always picking 7 or always picking the middle option) and it can't stop itself from picking it.
The Analogy: Think of the AI as a student taking a test.
- In the Batch mode, the student can see their previous answers and say, "Oh, I picked 'C' too many times, I'll pick 'A' now to balance it out."
- In the Independent mode, the student is in a different room for every question. They can't see their past mistakes, so they just keep picking their favorite answer, "C," over and over again.
The "Complexity" Problem
The researchers tested the AI with different types of "dice":
- Simple Dice: Just picking a number between 1 and 10 (Uniform).
- Tricky Dice: Numbers that follow a bell curve (Gaussian) or have weird shapes (Cauchy).
The Finding: The more complex the "dice" is, the worse the AI gets.
- Analogy: Imagine the AI is a chef who has cooked millions of simple omelets. If you ask for a simple omelet, they are great. But if you ask for a complex, multi-layered soufflé with a specific chemical structure, the chef panics and just serves you a burnt omelet. The AI can mimic simple randomness because it's seen it in its training data, but it doesn't understand the math behind complex randomness.
The "Longer is Worse" Paradox
Usually, in math, if you take more samples, your results get more accurate.
- Normal Expectation: "If I roll the die 10,000 times, the average will be perfect."
- AI Reality: "If I ask the AI to roll the die 10,000 times, the results get worse."
The Analogy: Imagine a drunk person trying to walk in a straight line.
- If they take 10 steps, they might look okay.
- If they take 1,000 steps, they will eventually wander miles off course.
The AI accumulates its tiny biases over time. The longer the list of numbers it has to generate, the more it drifts away from true randomness.
Why Should You Care? (The Real-World Mess)
You might think, "So the AI is bad at math. Who cares?" But this is dangerous because we are starting to use AI to make real-world decisions that need to be random.
1. The Biased Test Maker
- Scenario: Schools use AI to generate multiple-choice questions.
- The Rule: The correct answer (A, B, C, or D) should be random so students can't cheat by guessing "C" is always right.
- The AI Failure: The study found that even when told to be random, the AI heavily favored certain letters (like B or C).
- Result: Students could figure out the pattern and pass the test without knowing the material. The test is no longer fair.
2. The Unfair Image Generator
- Scenario: A company asks an AI to create 1,000 images of people for a diversity study. They want the images to match real-world demographics (e.g., 50% men, 50% women; specific percentages for different ethnicities).
- The AI Failure: The AI ignored the instructions. It generated 97% women, or 0% Hispanic people, or almost everyone wearing a green coat (even though they asked for all colors).
- Result: The data is biased. If a doctor or a policy maker uses this data, they will make decisions based on a fake reality that doesn't represent real people.
The Bottom Line
The paper concludes that LLMs do not have a functional "randomness switch" inside them. They are excellent at describing randomness, but terrible at doing it.
The Takeaway:
If you need true randomness for anything important (like cryptography, fair testing, or scientific simulations), do not ask the AI to do it. You must use a dedicated random number generator (like a computer chip or a physical dice roll) and let the AI just write the text around it. The AI is a great writer, but it is a terrible dice player.
Drowning in papers in your field?
Get daily digests of the most novel papers matching your research keywords — with technical summaries, in your language.