Hacker News new | ask | show | jobs
by michaelt 784 days ago
Sometimes when you ask chatgpt 4 for a random number it... writes python code to choose a random number, runs it, then tells you the response: https://chat.openai.com/share/a72c2d8c-c44e-4c89-b6bc-b0673c...

One way of doing it, I suppose.

4 comments

If you asked a person to give you a random number between 1 and 6, would you accept if they just said a number they just came up with or would you rather they rolled a die for it?
If they didn't already have dice in their hand, I would certainly expect the former.
They should turn around and ask me instead for a random number between 1 and 6 and then reply with seven minus that number.
How is that more random?
I was being somewhat tongue in cheek (absurdist?), but I suppose if you don't know my algorithm (7 - n) then it does add layer of ... uncertainty?
Depending on who you ask, the answer would have been "oh, I have an app for that. Hold on..."

GPT wins for not having that delay.

What a time to be alive
It is 4. It's always 4.
Technically speaking, it's the right way to do it.
Exactly. Only trust random numbers and/or probability via processes that have been vetted to be either (somewhat) random or follow a probabilistic algorithm. Humans are generally terrible at randomness and probability except in cases where they have been well trained, and even then those people would rather run an algorithm.
Is it actually running the code it creates? Or does it generate code, and then just output some number it "thinks" is random, but that is not a product of executing any python code?
It's actually running the code. It doesn't run all code it generates. But if you specifically ask it to, then it does. It also has access to a bunch of data visualization libraries if you want it to calculate and plot stuff.
Yes, it runs the code.
Couldn't this open people up for remote code execution somehow? Say, someone sends you a message that they know will make you likely to ask an AI a certain question in a certain way... Maybe far-fetched, but I've seen even more far-fetched attacks in real life :D
the code is sandboxed on openai servers. it doesn’t run on your machine if you use chatgpt interface
I would assume it can only generate pure functions and/or run in a sandbox.
Isn't that a case where the interesting behavior is from a new piece someone programmed onto the side of the core LLM functionality?

In other words, it's still true that large language models can't do probability, so someone put in special logic to have the language model guess at a computer language to do the thing instead.