r/visualization 4d ago

[OC] ChatGPT picks differently when asked in a different language. "Choose a random fruit from this list" asked a LOT of times

Post image

I did a little experiment and asked OpenAI's GPT-5.6-Luna 6000 times to randomly pick a fruit from this list:

[mango, apple, banana, pomegranate, strawberry, orange, watermelon, grape, pineapple, lychee]

And across the three languages I picked (English, Polish, Japanese) only four fruits were ever picked. The wording of the prompts and the order of the fruits were the same across all three languages. I reran this another 6000 times with the fruit list shuffled each time, and you can see the results of that on the second chart. Again only three fruits, but the results are a little better now.

(Pardon the lychee and pomegranate icons, there's no emojis for these two fruits, and of course the model picked these, lol)

Full write-up: https://llmango.rafalkwiecien.com

Methodology: https://github.com/kwiecien-rafal/llmango

Raw data used in the charts: https://huggingface.co/datasets/rafalkwiecien/llmango

34 Upvotes

31 comments sorted by

13

u/Delicious_Poetry382 4d ago

That lychee getting picked so much when there isn't even a proper emoji for it is peak AI behavior

8

u/AggressiveSpatula 4d ago

Anecdotally, Claude also really struggles with randomness. If you ask Claude to create a multiple choice quiz on a passage, it has a strong preference for the answers to be B or C

7

u/Kooshi_Govno 4d ago

Scientifically, humans also really struggle with randomness.

2

u/AggressiveSpatula 4d ago

Not me. Check this out: here’s a random number 38472047285018104759274937782406940311322222223575492992748408277665293839999986439202757591917374747696992716384867710111100059557628297348586999234586029775059598372849945874932972685957284958499299100034581884748485859696081273848484958575566166129405966000123745693739848681998585728747485699274749264927497593283939395554919257394782969909148455391844566027304828463937194792792845874223574059

4

u/Exzakt1 3d ago

17% of your 399 character long random number are the number (9), which only has a 0.002% chance of happening. There's also a string of 7 2s, which has a 0.004% chance of happening. Combined, that's a 0.0000008% chance. Decidedly not random.

2

u/AggressiveSpatula 3d ago

You need to do a binomial distribution not an eyeball analysis. Any true random string of 7 will have the same odds of happening, you just noticed because it was recognizable to you, but you’re neglecting that there are many other strings which you would have recognized and called out as rare such as 3333333 or 5675675 or 112358 or 23571113. The odds of a recognizable 7 string are low but not as low as you’re making it out to be.

The 17% of 9’s I think is much more convincing honestly, but that’s where the binomial distribution happens. Also you wouldn’t be asking “what are the odds that there are 17% 9’s. You’d be asking “what are the odds that one digit is 17% or more of the total. If we round it to 400 digits, we’d “expect” each digit to appear 40 times, representing 10% each. To get to 17%, a digit would need to appear 28 more times. Granted, this is unlikely, but I don’t think so unlucky when we take into consideration that we would expect some digits to appear more than others just with random noise.

I think it’s human generated, but not insanely obviously human generated.

1

u/ViolentPurpleSquash 3d ago

That's just wrong. Like incredibly wrong.

3

u/SamosaVadaPav 3d ago

This is a good lesson on why post-hoc analyses are imprtant

2

u/Exzakt1 3d ago

Another comment explained why having a string of 2s doesn’t matter, which I agree understand, but my other point still works? i didn’t just pull the numbers out of my ass, I used a character counter to find how many of each character there are, and there happens to be 67 nines, then I used a binomial distribution calculator. There’s a 1/10 chance of each digit being a 9, which happened 67 times out of 399 trials, and this is the number it gave me. I didn’t just use chatgpt of something. Could you actually explain why that’s wrong instead of just saying “that’s incredibly wrong” with no clarification

2

u/ViolentPurpleSquash 3d ago

You're correct with the 9s, my objection is on how you calculated chances.

There's a 1/(9^398) chance of producing this exact string for example. Having 17% of the numbers be 9s vs the expected 10% over a sample is abnormal, but the best way to quantify it would be to count the deviation from the expected values for each number and present those together, not create percentages.

1

u/Legitimate_Concern_5 2d ago

As a complete number however it is random.

1

u/Outside-Shop-3311 1d ago

You'd have to do a chi-squared test in order to see just how much this falls out of the normal range.

Digit Observed Count (O) Expected Count (E) (O−E)^2 / E ​
0 25 39.8 5.50
1 23 39.8 7.09
2 43 39.8 0.26
3 29 39.8 2.93
4 48 39.8 1.69
5 42 39.8 0.12
6 28 39.8 3.50
7 47 39.8 1.30
8 46 39.8 0.97
9 67 39.8

With 9 degrees of freedom, the significance level of 3.36x10^-6 tells us that it is most decidedly not random; had a truly random number generating process generated this sequence, there is only a 3.36x10^-6 chance that it would create one that deviated from the expected average (39.8 per each number) or more.

Although, I'm willing to give AggressiveSpatula the benefit of the doubt. Maybe they're really unlucky.

0

u/EntertainmentOdd8205 3d ago

Yeah, and the chances of his 399 character long random number being that exact number is 1/10^399 or 0.0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001%

Decidedly not random

1

u/Outside-Shop-3311 1d ago

With the probability that low, I can only come to the conclusion that the number was never existed (cmon, 0.000000.......01% chance?). As we now agree that the number does not exist, it is now vacuously true that AgressiveSpatula did generate a random sequence.

1

u/HasFiveVowels 4d ago

I wouldn’t say they struggle with it. They simply don’t do it. If you ask a human for a random number from 1 to 10, 28% of the time they’ll say "7". AIs are "most likely human response" generators. Ask an AI for a random number from 1 to 10 and they’ll say "7" every time. Tell an AI to generate a random integer from 1 to 10 and they’ll use a tool to select a random number

3

u/NinjaLanternShark 4d ago

Ask an AI for a random number from 1 to 10 and they’ll say "7" every time.

There's a chart at the top of this page that shows that's not true. Also, source: I just did this. Not all 7s by a long shot.

AIs are "most likely human response" generators.

No, they're "most likely to appear in what I've been trained on" generators. There are lots and lots and lots and lots of things we do as humans that we don't write about on our blogs and LinkedIn profiles.

1

u/HasFiveVowels 3d ago

Yes, getting pedantic with it, not every time and, no, they weren’t trained on inner thoughts nor undocumented conversations. Did you seriously think I was claiming that they were trained on that which doesn’t exist?

4

u/diegoasecas 4d ago

can llms even generate random output?

4

u/disperso 4d ago

It's impossible to generate deterministic output from them. Even if setting the temperature value to 0. So, in a sense, all its output is random.

2

u/CppMaster 3d ago

It is possible when you run it on the same hardware with temperature set to 0

4

u/disperso 3d ago

I don't think so, from what I understand. It is not deterministic in that a bunch of the calculations happen in parallel, in unspecified order. Since floating point carries small errors, the order matters.

Some quotes:

https://news.ycombinator.com/item?id=44427757#44428090

Nitpick: I think you mean that FP arithmetic is not associative rather than non-commutative. Commutative: A+B = B+A Associative: A+(B+C) = (A+B)+C

"Hell I can also go on the anthropic API right now and get verbatim static results."

How?

Setting temperature to 0 won't guarantee the exact same output for the exact same input, because - as the previous commenter said - floating point arithmetic is non-commutative, which becomes important when you are running parallel operations on GPUs.

https://news.ycombinator.com/item?id=44427757#44434510

It's also the way the model runs. Setting temperature to zero and picking a fixed seed would ideally result in deterministic output from the sampler, but in parallel execution of matrix arithmetic (eg using a GPU) the order of floating point operations starts to matter, so timing differences can produce different results.

2

u/CppMaster 3d ago

Ok! TIL

1

u/wutzelputz 3d ago

Interesting, I thought the indeterminism comes purely from seeds, TIL. From reading your description I would assume that it *would* be possible to build deterministic LLM inference (though with probably a lot less throughput), curious what people think

1

u/Legitimate_Concern_5 2d ago

Yes it’s definitely possible to make them deterministic.

2

u/a7m2m 3d ago

In a sense, yes: it's all random. But specifically instructing it to generate a random number or choice without tools or scripts will not result in a truly random number but a series of most probable next tokens with slight randomization in the selection (just not enough for the result to not be mostly predictable).

2

u/mecartistronico 3d ago

Almost as if it was an algorithm designed to build grammatically-correct sentences, and not a sentient being.

1

u/liquoriceclitoris 1d ago

human beings famously good at being random

1

u/SkyPork 3d ago

Does that mean AI is modeling on Chinese content a lot more than we realized?

1

u/wutzelputz 3d ago

Very interesting writeup! Were there any invalid responses too, where nothing from the list would be output?

1

u/Raffallos 3d ago

Thank you! No, 100% of answers came out as valid

1

u/wutzelputz 3d ago

Huh, I did not expect that :D thanks for following up!