News for hackers. Stuff that matters.
Re:How many legs do ten elephants have, if two of them are l... by insanitybit on Monday December 25, 2023 @05:08PM (#38766609)
I just tried ChatGPT and it ran this code.

    from datetime import datetime, timedelta

    # Current date
    current_date = datetime(2023, 11, 1)
    
    # Calculate the date 140 days from now
    future_date = current_date + timedelta(days=140)
    future_date.strftime("%Y-%m-%d")
Result: '2024-03-20'

The ability to execute code is kinda insane for these models.

Re:How many legs do ten elephants have, if two of them are l... by block_dagger on Monday December 25, 2023 @05:13PM (#38766666)
Here’s the python ChatGPT-4 produced and ran with the title prompt:

# Number of elephants total_elephants = 10

# Elephants with legs elephants_with_legs = total_elephants - 2

# Number of legs for an elephant legs_per_elephant = 4

# Total legs total_legs = elephants_with_legs * legs_per_elephant total_legs

Its actual response was correct.

Re:How many legs do ten elephants have, if two of them are l... by insanitybit on Monday December 25, 2023 @05:15PM (#38766689)
Yeah, ChatGPT gave me the correct answer without even needing Python in the case of the title.
Re:How many legs do ten elephants have, if two of them are l... by edanm on Tuesday December 26, 2023 @01:54AM (#38769459)
Interesting, I copied the text into gpt 4 and it did run python as well.
Re:How many legs do ten elephants have, if two of them are l... by londons_explore on Monday December 25, 2023 @06:20PM (#38767291)
Remembering that the correct answer is 40 because 'legless' is slang for 'drunk'?
Re:How many legs do ten elephants have, if two of them are l... by TheCleric on Monday December 25, 2023 @06:57PM (#38767518)
Is that regional? I’ve never heard that euphemism.
Re:How many legs do ten elephants have, if two of them are l... by pvorb on Monday December 25, 2023 @07:58PM (#38767922)
Calling a drunk person legless is hardly an euphemism.
Re:How many legs do ten elephants have, if two of them are l... by londons_explore on Tuesday December 26, 2023 @05:37AM (#38770549)
It is commonly used in British English. In fact, there is a famous comedy sketch about it that also uses the word 'caravaned'
Re:How many legs do ten elephants have, if two of them are l... by runarberg on Monday December 25, 2023 @05:12PM (#38766655)
Doesn’t that just mean it was trained with inputs and outputs from simple programs?
Re:How many legs do ten elephants have, if two of them are l... by insanitybit on Monday December 25, 2023 @05:16PM (#38766701)
No, it's actually executing that Python code. This is what allows an LLM (or an 'llm based system', I guess) to do something like "reverse <some uuid that has never been observed before>" - it can't just memorize the output and map it to the input because the output has literally never been observed. Instead, if it knows the algorithm for reversing a string, it can just use that and offload the execution to Python.
Re:How many legs do ten elephants have, if two of them are l... by runarberg on Monday December 25, 2023 @06:12PM (#38767231)
That is even less impressive. I was thinking—like normal linear models—it would be capable of interpolation.
Re:How many legs do ten elephants have, if two of them are l... by throwup238 on Monday December 25, 2023 @06:21PM (#38767302)
It is. It doesn’t even need an existing language. You can define your own psuedo language in the prompt and have ChatGPT “execute” it (works best with 4 nonturbo).

You can even combine your pseudo language with natural language. See the OP’s custom GPT and the comments here: https://news.ycombinator.com/item?id=38594521

Re:How many legs do ten elephants have, if two of them are l... by insanitybit on Monday December 25, 2023 @07:50PM (#38767882)
That looks totally different. In the case of the Python code it is literally executing it by calling out to CPython.
Re:How many legs do ten elephants have, if two of them are l... by no_identd on Monday December 25, 2023 @10:52PM (#38768772)
…got a source for that claim?
Re:How many legs do ten elephants have, if two of them are l... by throwup238 on Monday December 25, 2023 @11:03PM (#38768816)
Re:How many legs do ten elephants have, if two of them are l... by labaron on Tuesday December 26, 2023 @07:53AM (#38771351)
I checked those links and didn’t see it mentioned that python code is actually executed. Could you quote the relevant part?
Re:How many legs do ten elephants have, if two of them are l... by insanitybit on Tuesday December 26, 2023 @12:28PM (#38773771)
https://openai.com/blog/chatgpt-plugins#code-interpreter

>We provide our models with a working Python interpreter in a sandboxed, firewalled execution environment, along with some ephemeral disk space. Code run by our interpreter plugin is evaluated in a persistent session that is alive for the duration of a chat conversation (with an upper-bound timeout) and subsequent calls can build on top of each other. We support uploading files to the current conversation workspace and downloading the results of your work.

It really feels like I'm just googling for you, you had the feature name.

Re:How many legs do ten elephants have, if two of them are l... by insanitybit on Monday December 25, 2023 @07:43PM (#38767836)
Why is it less impressive?
Re:How many legs do ten elephants have, if two of them are l... by runarberg on Monday December 25, 2023 @08:08PM (#38767970)
I would say creating a model which is able to interpolate from training data in a way which produces an accurate output of a new input is a little impressive (if only as a neat party trick), however anybody can run a python interpreter on a server somewhere.

I’m sure there are use cases for this. But in the end it is only a simple feature added onto a—sometimes—marginally related service.

Re:How many legs do ten elephants have, if two of them are l... by insanitybit on Monday December 25, 2023 @08:16PM (#38768029)
Hm, I don't think of it that way I guess. What the LLM is doing is generalizing a problem based on previous problems it has seen and then offloading the execution of that problem to a machine with some defined, specific semantics.

This is a lot more than a party trick. The model is able to describe the program it wants to execute and now it can accurately execute that - that it 'offloads' the work to a specialized program seems fine to me.

It's way more than a simple feature, this is enabling it to overcome one of the biggest limitations and criticisms of LLMs - it can answer questions it has never seen before.

Re:How many legs do ten elephants have, if two of them are l... by nomel on Monday December 25, 2023 @05:24PM (#38766769)
Re:How many legs do ten elephants have, if two of them are l... by amelius on Monday December 25, 2023 @05:46PM (#38767009)
So it only works if the code is 100% correct. Which according to my experience doesn't happen often.
Re:How many legs do ten elephants have, if two of them are l... by insanitybit on Monday December 25, 2023 @07:43PM (#38767838)
Most of the time it's just doing really simple stuff like this.
Re:How many legs do ten elephants have, if two of them are l... by nomel on Monday December 25, 2023 @06:32PM (#38767364)
Sure, don’t expect perfection, but it still works great.
Re:How many legs do ten elephants have, if two of them are l... by karateka on Monday December 25, 2023 @09:58PM (#38768576)
It’s kind of funny that they can more reliably spit out code that will give an answer than actually output the answer as text. I guess it’s a workaround that works well for many cases
Re:How many legs do ten elephants have, if two of them are l... by bmicraft on Tuesday December 26, 2023 @06:37AM (#38770887)
Humans can also more reliably use a calculator (which is basically what python is) for big numbers than doing it in their heads. I think it makes sense.

This reminds me, I've had an alias for calc='python -ic "from math import *' for a long time now. It comes handy more often than you'd think.

Re:How many legs do ten elephants have, if two of them are l... by fragmede on Tuesday December 26, 2023 @07:19AM (#38771154)
bc

or octave if you need some real power

Re:How many legs do ten elephants have, if two of them are l... by nurettin on Tuesday December 26, 2023 @12:27AM (#38769145)
Still not worth $20/mo
Re:How many legs do ten elephants have, if two of them are l... by leereeves on Tuesday December 26, 2023 @01:58AM (#38769469)
It even correctly adjusted for the leap year.

But is that actually output from a LLM, or is ChatGPT just running the Python code through a Python interpreter?

Re:How many legs do ten elephants have, if two of them are l... by tim333 on Tuesday December 26, 2023 @02:09PM (#38774884)
Interpreter.