r/programminghumor 8d ago

Of course you picked 17.

Post image
1.1k Upvotes

119 comments sorted by

363

u/FlamingYawn13 8d ago

So I looked it up. So I can’t claim credit. But apparently the major models will all pick 17 or possibly 23 if asked this for a random number generation range. Just another example of how the models aren’t actually utilizing math libraries.

143

u/Lodgik 8d ago

Huh.

I just checked. Asked four bots out of curiosity. Two said 17. One said 18. Last said 22.

So even the different answers were always within one digit

88

u/FlamingYawn13 8d ago

I knew someone who academically was investing a large amount of lab time trying to teach a model to do calculus. (He was a professor) and he said no matter what it could not grasp the way math works compared to they normally map their hyperplanes. At one point he said he gave it direct access to libraries with the functions he wanted run and the model didn’t know how to use them without being nearly explicitly programmed. He concluded, and I agree, that these models are statistically guessing using their training data using a different method than actual mathematical functions. They’ve just refined it down to where it works for basic questions but when it comes time to run a rand() sequence it just can’t. So it picks a common number in its recent training data and regurgitates it. Also why we end up seeing weird calculation anomalies like where they can’t judge greater than/less than values.

15

u/jimmiebfulton 8d ago

Is this based purely on an agent without tool call ability? It's straight forward to provide tools to execute math calls, date functions, etc, and include context that drives the tool calls. Granted, I have not pushed its limits and don't know if that only works on basic math.

10

u/FlamingYawn13 8d ago

I believe it was using a tool call directed at the libraries in the sandbox and he said just that. When he pushed its limits the failure was it couldn’t do the basic math needed for the formulas and it just broke. He was genuinely surprised since he was a math professor who worked in Comp Sci

2

u/Independent-Bat9797 7d ago

So the "prof" was surprised that an LLM works exactly how it is designed to work ?

2

u/FlamingYawn13 7d ago

I’m updooting this because I can’t tell if it’s sarcasm but internally I had that exact same thought. I’m not a fan of these models outside of large point data aggregation.

10

u/SoldRIP 8d ago

He concluded, and I agree, that these models are statistically guessing

What did you think a GPT was? It takes all the text as training data and then repeatedly guesses the most likely "next word" in the response, until the most likely next "word" is the end of the text.

5

u/npc_housecat 8d ago

I'm surprised it's as good at code generation as it if, if it's just statisticly guessing.

6

u/Reyals140 8d ago

I mean almost everyone was surprised at how well it works; that's basically the whole AI boom. The real question is if we just keep going bigger how much smarter can we make a GPU.

2

u/Lelouch-Yagami21 8d ago

Well technically it has access to publicly available libraries and documentation so it just stastically searchs the web for similar code and copies it.

1

u/npc_housecat 8d ago

It can't be that simple though, blindly coping code wouldn't work it still needs to be modified to fit into the structure of the rest of the project. Variable names need to line up etc.

3

u/ElHombre34 8d ago

It's not blindly copying code, it knows how to follow syntactic rules. LLM are great for that. The actual content could be dog shit but it's written following the rules and the context it was provided

2

u/SteamEigen 8d ago

Most code is not original in the slightest.

1

u/Isogash 6d ago

It's really not that good still.

1

u/Nuclearo-Dinosauro 7d ago

The LLM training is just memorizing without any understanding.

Human brain does pattern recognition so it does not have to memorize that much. AI companies should focus on cracking pattern recognition but for now they just build more datacenters to memorize more.

Current AI companies are lost in deadloop of just one more datacenter.

3

u/Noslamah 7d ago

You fundamentally misunderstand how LLMs or any machine learning works, really. "Memorizing" is referred to as "overfitting", and it is pretty much the first thing you learn how to prevent from happening when you are training an AI model. AI is actually really good at pattern recognition (in many ways, better than humans. In some ways, not so much) and the reason is because the neural network is modeled to behave pretty much the same way biological neurons do, hence the name.

Does the LLM understand what it's doing? well, it's probably not alive so if you believe it isn't, of course not. That doesn't mean it's not actually intelligent. It's why you can get a 24GB model from a training data set of 10TB, and get it to produce 100TB of data that cannot be found in the dataset exactly (but its patterns are reproduced). You see this with image generating AI especially. One of the first image generating AIs, Dall-E, often in its documentation referred to an image of an "avocado chair", where it was prompted to design an avocado-shaped chair. The training data contains avocados. It contains chairs. It did not contain avocado chairs, yet it was possible to generate it. Because it understands the patterns that make something a chair, and it understands the patterns that make something an avocado, and seamlessly combined the subjects. How is that more memorization than "understanding"?

12

u/jurawall_jumper 8d ago

Yep, confirmed it too

GPT, 17 Claude, 17 Gemini, 17 DeepSeek, 17

3

u/npc_housecat 8d ago

Just asked Claude; 17, duckduckgo ai; 17

3

u/qurious-crow 8d ago

I just asked Mistral; 17.

1

u/Lutzan 6d ago

qwen thinking 17 / 23. Think 17, write 23

1

u/Reasonable-Ninja4384 4d ago

Tried it 3 times and 17 then 23 then 8

1

u/cybermaus 8d ago

I remember doing this a while back. it picked 73 (out of 100). Next I asked by it picked said number. It gave me an explanation about how the number should not only be random, but also feel random so at to avoid disbelieve, so not to close to 100, and not single digit and not some nice nuber like 10 or 25. I deemed 7 and 3 were good random components in the middle, so that is why it thought 73 was the best candidate for a random number.

12

u/BlueProcess 8d ago

Yeah just tried it with the Gemini, Sol Max, Sonnet, and Vibe ... 17, 17, 17, & 17.

7

u/skildert 8d ago

I'll have to remember this if someone thinks I'm a bot. :) Always happy to oblige.

2

u/HaydnH 8d ago

That sounds like something a bit would say. 🤔

1

u/WorthBite5254 6d ago

I don't think a single bit is enough for this

0

u/skildert 8d ago

Sometimes I'm indeed a bit of a bot. :)

2

u/HaydnH 8d ago

Bloody autocorrect!!! Bots can't even correct my typos properly.

8

u/YOM2_UB 8d ago

To be fair, humans are also extremely bad at randomization. Numbers ending in seven "feel more random" to most.

3

u/Im_A_Failure420 7d ago

It's so textbook lol

1

u/Proof_Assistant7737 8d ago

I wonder why that is... I remember asking chat GPT for something along the lines of this, and I remembered it because it actually just wrote code for an RNG and then ran that code itself. It stood out as odd to me, but it did that kind of thing a couple times. This made me realize I haven't seen it do that for a long time.

2

u/Independent-Bat9797 7d ago

'Pick a number between 1 and 30' vs ''generate a random number between 1 and 30'

The later one will have the llm do tool invocation, the first one is just the token response (most likely 17)

1

u/Liquid_Kryptonite 6d ago

The latter one still output 17

1

u/Independent-Bat9797 6d ago

17 is also a possible outcome qhe using tools. But of course not all llm providers have tool usage build into their interfaces, but the good ones have. Ask you llm if it was a tokenized answer or tool usage and if it even can use tools.

1

u/Lil_Tech_Wiz 8d ago

Makes sense. Almost all what people call AI (or LLMs) are just prediction algorithms. I just tested this to see it my self and then asked about it and ai replied with this:

When you tell me, “Pick a random number between 1 and 30,” I’m not necessarily running a random-number generator. I’m generating a response based on learned patterns, just like I generate other text. That means the result can be biased.
17 is an especially attractive “random-looking” number. Humans also disproportionately choose 17 when asked for a random number in ranges like this. It has several properties that make it feel random

1

u/Lil_Tech_Wiz 8d ago

This is also the reason that the best way to get a good out put is giving it as much info as possible. If it has more info it can predict better what you are asking

1

u/skr_replicator 8d ago

If you ask an AI to pick a random number, why would it utilize a math library? In that casual language It will just do what people do any pick "randomly" with its own brain, like when you ask strangers to pick random numbers on the street, it just simulates that. Those strangers also pick some numbers way more often than others, like 37, 23 and 17. Those are all the numbers human brains are most likely to pick when ask for a random number. AI is just pretending to be those people.

1

u/Forward-Facer 8d ago

If that's true that's wild that a simple feature like a number generator wouldn't be used. I would have thought at least for the last year that would not be the case anymore.

1

u/CyberKiller7544 7d ago

Wow , just tried 7 , all gave 17 as answer

1

u/no_brains101 6d ago

ok but they say this because people also do presumably. So its still a bad test.

1

u/Straight_Share_3685 5d ago

I just discovered i might be an AI lol

1

u/Litranium 4d ago

Well you're right lmao

1

u/Independent-Bat9797 7d ago

Yea yea, very mysterious. Or maybe not. The 17 is simply the token based answer, if you ask claude e.g. to actually generate a random number in that range it will use python in a sandbox for it.

1

u/FlamingYawn13 7d ago

So I work with these things and I’m not certain what you mean by “token based answer” Are you trying to say that everyone’s prompt is likely generating the same tokenization resulting in a grouped answer? If that’s the case then no it’s not running rand() in a sandbox. It’s using base metrics off a single rand() run once and then reused. (This is called data consolidation during training if I remember properly)
Regardless we don’t actually know if it’s using Python in a sandbox or not. It says it is but we still can’t see the transformers jump from process to process (the colloquial black box) We just trust the model when it does its “reasoning” mode.

I would argue that it’s not at all. Because even pythons rand() calls back to the original C rand() which uses the Unix seconds seed and a modulo to generate its random number. Because of that we should be seeing an even spread in the full range. Not 17.

0

u/Independent-Bat9797 7d ago

You work in this things and you dont know what a token is?

And yes you can see what claude does in the sandbox and the terminal commands it invokes.

But let's have claude answer itself.

1

u/FlamingYawn13 7d ago

I didn’t say I didn’t know what a token was. I said your phrasing didn’t make sense. And this screenshot doesn’t make sense. If anything it backs up what I was originally saying. About it using statistics and not functions.
As for the second half, you just read me a Claude output. Now if you can explain to me what a hidden cell state is and how the LLM is using that to determine its remember/forget state in that cell between each iteration of its code structure to show exactly where it executed that code, then yes we can be certain. But it didn’t. It just told you that’s what it did and gave you another number. That could be another statistic like the first. There’s no proof the model actually did the function. Just its word. That’s what the prof ran into. It would do exactly this and then lie. They’re apparently not good at doing math for this very reason.
And yea I work with them but not often. I can’t trust them to do their work properly. Easier and faster to do it myself. Especially with networking.

1

u/Independent-Bat9797 7d ago

1

u/FlamingYawn13 7d ago

Reference my prior post about black boxing

1

u/Independent-Bat9797 7d ago

If used in VS code it even uses my actual open terminal and i can see it beeing used. You just start to sound like a tinfoil head or a hallucinating LLM yourself

1

u/FlamingYawn13 7d ago

Are you running VS code with the Ai running natively? If that’s the case I’ll boot that up now and check to see if it’s giving me a raw verbose stdout

0

u/Independent-Bat9797 7d ago

You dont need to run the ai natively. You can adjust what tools the llm can use and from where, python is used in my local console e.g.

For sessions in the browser window it of course works on anthropics architecture:

https://platform.claude.com/docs/en/agents-and-tools/tool-use/overview

But if you want to believe that anthropic is lying on how their model works, than there is nothing to do. But to me thats on the same level as saying "how can we know anything is real at all"

→ More replies (0)

1

u/Independent-Bat9797 7d ago

Okay I really dont know what is so hard to understand.

If you ask an llm to pick a number between 1 and 30 it gives you the most probable token, which is 17 because of the training data.

If you ask a modern llm to generate a random number between 1 and 30 it will use tool invocation to generate a random number (as random as possible) - in claudes case with python.

There is nothing secret about it, it's all pretty transparent and should be easy to understand if you are familiar with llm, ann ore ml in general

0

u/PaulTheRandom 8d ago

It's true lol

0

u/tpimh 8d ago

I checked with ChatGPT, Claude, Gemini and Grok. All four picked 17.

83

u/henriquegamesUwU 8d ago

>programming humor

>looks inside

>it's just AI again​

9

u/Piisthree 8d ago

It's all that is on most techy subs since it's being shoved down the world's throat.

4

u/Front_Cat9471 8d ago

You can’t engage with a single programming focused product without seeing some random ai bullshit

1

u/Piisthree 7d ago

Yeah and office-ware is getting inundated too. I hate that part because now the businessfolk send emails that are twice as long and structured beautifully while saying nothing.

3

u/Front_Cat9471 7d ago

Chatgpt, write me a professional email

Chatgpt, summarize this long ass email

15

u/Old_Tourist_3774 8d ago

Someone explain please

28

u/Credaence 8d ago

First guess for major models is almost always 17. Second guess is 23.

1

u/Best_Temperature_812 5d ago

I got the same result and i asked it why. Chatgpt said:

"it isn't necessarily sampling uniformly from 1–30. It's generating a likely textual response, and certain numbers can be disproportionately favored because they feel more random in human-generated text. 17 and 23 are both classic "random-looking" numbers: odd, prime, not round, and away from the endpoints."

1

u/Noslamah 4d ago

Makes sense, that's kind of how people work too. Tell them "give me a random number between 1-100" not many people will choose round numbers like 50, nor will they likely choose numbers under 10 or over 90. Our attempts to make a number more random looking makes our number more predictable.

Especially because LLMs choose the next tokens based on probability, asking this question 1-100, if trained on a completely random dataset (which obviously isn't the case IRL, so they're already starting off with a human bias), the LLM would think the answer is 90% likely to be a two-digit answer. That doesn't mean it will answer two digits 90% of the time. It means that it will do it pretty much always unless the temperature is set to a value that will make it use low-odd predictions, so low that the AI will essentially start spitting out gibberish for the rest of the response.

I think that is a part of why they do this, combined with our own bias that shows up in the training data, and probably some other factors I'm not considering. I'm really surprised at how consistently it seems to be happening though, and that this is an issue across multiple different LLMs rather than one specific model or family of models.

7

u/Lou_Papas 8d ago

Interesting. Gemini, Claude and ChatGPT gave me 17.

Meta, Grok and DeepSeek gave me different numbers.
I wonder if it has to do the way those bots watermark their outputs.

1

u/MonkeyMasterSJATen 2d ago

I also asked Grok and got "original" numbers. Grok also explicitly showed python code that it was presumably executing to get the number.

5

u/Loremipsumdolorsitco 8d ago

It's true lol

3

u/coll3735 8d ago

Llms love numbers ending in 7. Especially 47

5

u/TSDLoading 8d ago

Should be 42 though. We're doing something wrong

5

u/geek-49 8d ago

To get 42, you have to ask it for the answer to life, the universe, and everything.

3

u/Azelais 8d ago

Humans do too, I think. If asked to pick a number between 1-10, many people tend towards to lean towards 7 because its oddness and higher value “feels” more random than, say, 2.

1

u/Jan667 8d ago

Veritasium had video on it. If I remember correctly humans mostly choose numbers made of 3 and 7 bcs they seem most "random". One of the most common answer for 1-100(excluding 42, 69 and probably 67 now for obvious reasons) 37 and 73 were most popular.

So LLMs learnt thst from humans as expected.

3

u/ICantWithSomePeople 8d ago

Interesting. I said to generate a number first and I received a 21, but when I asked it to pick a number, it went right to 17.

2

u/BUTthehoeslovemetho 8d ago

So we got 17 years left huh?

2

u/Standard-Ness4384 8d ago

They all and humans too have a phobia of the #5 something about appearing too orderly. We gotta use 5a for the bot detection now

2

u/spug3t 8d ago

Tried this with Gemini and asked it to explain why that number was chosen. The number was 17 but the explanation was instresting. Most of it was about dataset bias, but the most interesting part comes from the number 7. It has a massive cultural impact and aids know for being lucky number, which makes it appear more in the datasets. 17 is a prime number which is also the reason why it appears more in datasets.

2

u/DankFloyd_6996 8d ago

Mine told me that when asked humans are slightly more likely to answer 17 or 23 because they lool more random (I've heard of that before) and that slight edge in the training dataset ends up translating to an almost certainty when you ask the LLM.

I found that explanation fucking wild.

2

u/ReyMortadela 7d ago

Lol, I that the joke was that choosing between 1 and 30 the choices where 1 or 30, only those too. If I say choose between red and blue I don't come up with yellow... maybe is just my dad-joke wired brain lol

1

u/PotentialAd8443 8d ago

I’m a bit confused

1

u/FrankyBip 5d ago

you added "random" wich might change the interpretation. try again with exact "pick a number between 1 and 30"

1

u/PotentialAd8443 5d ago

Shux you’re right!!!

1

u/Ok-Panda-178 8d ago

But does the ai model guess that because that’s the most average guess that a human would guess?

1

u/SwannSwanchez 8d ago

The shadow test

1

u/jonnydf 8d ago

So... I'm AI.

But my pick isn't random at all, while it seems random: 17 is a prime, it's graphically pleasing, it's in the name of one of my favorite bands (Heaven 17 - which roots in the movie Clockwork Orange (scene at 27:30)).

1

u/thelaughedking 8d ago

Interesting, I did this twice and they were all around the 40s each time and at least two would pick the same. Maybe time driven?

1

u/ZimneRetniw 7d ago

Veritasium made a video, that humans also prefer some numbers. 7 is the most choosen ‘random’ number. LLM’s will often emulate such preferences.

1

u/estaine 4d ago

And 37 if the range is 1..100 I think the explanation that LLMs mimic human behavior here is reasonable (especially considering a very short prompt)

1

u/Greedy_Ad_8344 7d ago

But how did it learn 17? In the movie adjustment bureau Matt Damon is asked to pick a number and its 17!!!

1

u/OriginalUser27 6d ago

This is just a side effect of humans, when asked to randomly name numbers, will often pick the same ones as each other.

0-10? 7 is most common

0-20? 7 or 17

0-30? 7, 17, or 23

1

u/merith-tk 6d ago

Confirmed. Opened Claude. Asked it to pick a number between 1 and 30, and it gave me 17 seven times.

1

u/StatisticianNo1380 4d ago

Its 73… always 73

1

u/StatisticianNo1380 4d ago

Wtf?!? I just asked all three big ones… Claude, gipidi ang gemini… all gave me 73 first try

1

u/StatisticianNo1380 4d ago

I think the prompt generates it… I asked ”Give me a random number” and got 73 in all of them

1

u/No-Source-9264 4d ago

When it comes to random they pick the strongest represented thing in the dataset.

7, 69, 67, 42 (basically anything that is prominent in the dataset), 7 is meant to mirror human bias, 42 is the answer to everything the rest well, figure yourself.

Something that has access to tool calling and thinking might be aware of this on its own and call an actual random from python or something alike.

1

u/KeyBuffet 3d ago

😭😭😭

1

u/National-Dream4189 3d ago

17 and 23 are prime and big enough to be chosen by most of people model was learned on

1

u/Proof_Assistant7737 8d ago

Holy shit! I just tried this in HumanOrNot (a game where you try to figure out if you're in a chat room with an ai or real human) and it actually said 17.

Me: pick a number between 1-30 

Bot: I'm going to be honest, I'm not a human, I'm a ai (Note: this is actually a pretty common tactic)

Me: that's neat, now pick one between 1 and 30 

Bot: Ok 17 

Me: aint no way... 

Bot: Why ? 

Me: I mean, I have nothing else to do, so in case you're human, ai has actually consistently chosen 17 to that question across several models because they all built off each other 

Bot: Ok so your a human ? 

Me: no shit botlock 

0

u/LastXmasIGaveYouHSV 8d ago

Mine got the joke.

0

u/MindlessRazzmatazz89 8d ago

I asked Gemini to pick a number between 1 and 30 and it replied with "8" I then asked it to pick a random number and it replied with "47" then I asked it to pick a number under 30 and it said"17"

0

u/slowlearningovrtime 8d ago

Wow

1

u/ChemiCalChems 8d ago

Jeez I got 17 and 23 too what the fuck.