News for hackers. Stuff that matters.
Re:GPT-4 API General Availability by gamegoblin on Thursday July 06, 2023 @03:33PM (#36621543)
Biggest news here from a capabilities POV is actually the gpt-3.5-turbo-instruct model.

gpt-3.5-turbo is the model behind ChatGPT. It's chat-fine-tuned which makes it very hard to use for use-cases where you really just want it to obey/complete without any "chatty" verbiage.

The "davinci-003" model was the last instruction tuned model, but is 10x more expensive than gpt-3.5-turbo, so it makes economical sense to hack gpt-3.5-turbo to your use case even if it is hugely wasteful from a tokens point of view.

Re:GPT-4 API General Availability by m3kw9 on Thursday July 06, 2023 @03:37PM (#36621619)
What’s the diff with 3.5turbo with instruct?
Re:GPT-4 API General Availability by gamegoblin on Thursday July 06, 2023 @03:41PM (#36621669)
One is tuned for chat. It has that annoying ChatGPT personality. Instruct is a little "lower level" but more powerful. It doesn't have the personality. It just obeys. But it is less structured, there are no messages from user to AI, it is just a single input prompt and a single output completion.
Re:GPT-4 API General Availability by thewataccount on Thursday July 06, 2023 @03:47PM (#36621755)
the existing 3.5turbo is what you would call a "chat" model.

The difference between them is that the chat models are much more... chatty - they're trained to act like they're in a conversation with you. The chat models generally say things "Sure, I can do that for you!", and "No problem! Here is". The conversation style is generally more inconsistent in it's style. It can be difficult to make it only return the result you want, and occasionally it'll keep talking anyway. It'll also talk in first person more, and a few things like that.

So if you're using it as an API for things like summarization, extracting the subject of a sentence, code editing, etc, then the chat model can be super annoying to work with.

Re:GPT-4 API General Availability by ClassicOrgin on Thursday July 06, 2023 @03:43PM (#36621707)
I'm interested in the cost of gpt-3.5-turbo-instruct. I've got a basic website using text-davinci-003 that I would like to launch but can't because text-davinci-003 is too expensive. I've tried using just gpt-3.5-turbo but it won't work because I'm expecting a formatted JSON to be returned and I can just never get consistency.
Re:GPT-4 API General Availability by merpnderp on Thursday July 06, 2023 @03:51PM (#36621821)
You need to use the new OpenAI Functions API. It is absolutely bonkers at returning formatted results. I can get it to return a perfectly formatted query-graph a few levels deep.
Re:GPT-4 API General Availability by jimmySixDOF on Thursday July 06, 2023 @07:55PM (#36625037)
There is also Code Interpreter now in plugin beta so should influence it's ability to output proper formats without hallucinations.
Re:GPT-4 API General Availability by gamegoblin on Thursday July 06, 2023 @03:50PM (#36621808)
I'm assuming they will price it the same as normal gpt-3.5-turbo. I won't use it if it's more than 2x the price of turbo, because I can usually get turbo to do what I want, it just takes more tokens sometimes.

Have you tried getting your formatted JSON out via the new Functions API? I does cure a lot of the deficiencies in 3.5-turbo.

Re:GPT-4 API General Availability by mrinterweb on Thursday July 06, 2023 @05:55PM (#36623650)
From what I can find, pricing of GPT-4 is roughly 25x that of 3.5 turbo.

https://openai.com/pricing

https://platform.openai.com/docs/deprecations/

Re:GPT-4 API General Availability by gamegoblin on Thursday July 06, 2023 @06:00PM (#36623722)
In this thread we’re talking about gpt-3.5-turbo-instruct, not GPT4
Re:GPT-4 API General Availability by mrinterweb on Thursday July 06, 2023 @07:03PM (#36624506)
Sorry about that. Got my thread context confused.
Re:GPT-4 API General Availability by senko on Thursday July 06, 2023 @04:04PM (#36621997)
With the latest 3.5-turbo, you can try forcing it to call your function with a well-defined schema for arguments. If the structure is not overly complex, this should work.
Re:GPT-4 API General Availability by stavros on Thursday July 06, 2023 @05:57PM (#36623679)
It's great at returning well-formatted JSON, but it can hallucinate arguments or values to arguments.
Re:GPT-4 API General Availability by sigstoat on Thursday July 06, 2023 @07:02PM (#36624497)
i’ve had it come up with new function names, or prepend some prefix to the names of functions. i had to put some cleverness in on my end to run whatever function was close enough.
Re:GPT-4 API General Availability by tagawa on Thursday July 06, 2023 @08:00PM (#36625081)
You can try to force JSON output using function calling (you have to use either the gpt-3.5-turbo-0613 or gpt-4-0613 model for now).

Think of the properties you want in the JSON object, then send those to ChatGPT as required parameters for a function (even if that function doesn't exist).

    # Definition of our local function(s).
    # This is effectively telling ChatGPT what we're going to use its JSON output for.
    # Send this alongside the "model" and "messages" properties in the API request.

    functions = [
        {
            "name": "write_post",
            "description": "Shows the title and summary of some text.",
            "parameters": {
                "type": "object",
                "properties": {
                    "title": {
                        "type": "string",
                        "description": "Title of the text output."
                    },
                    "summary": {
                        "type": "string",
                        "description": "Summary of the text output."
                    }
                }
            }
        }
    ]
I've found it's not perfect but still pretty reliable – good enough for me combined with error handling.

If you're interested, I wrote a blog post with more detail: https://puppycoding.com/2023/07/07/json-object-from-chatgpt-...

Re:GPT-4 API General Availability by vczf on Thursday July 06, 2023 @09:58PM (#36626031)
Re:GPT-4 API General Availability by Zpalmtree on Thursday July 06, 2023 @04:54PM (#36622859)
I'm hoping gpt-3.5-turbo-instruct isn't super neutered like chatgpt. davinci-003 can be a lot more fun and answer on a wide range of topics where ChatGPT will refuse to answer.
Re:GPT-4 API General Availability by rmorey on Thursday July 06, 2023 @05:58PM (#36623699)
such as?
Re:GPT-4 API General Availability by byt143 on Thursday July 06, 2023 @06:47PM (#36624326)
What's the difference between chat and instruction tuning?
Re:GPT-4 API General Availability by tudorw on Thursday July 06, 2023 @06:53PM (#36624394)
no expert, but from my messing around I gather the chat models are tuned for conversation, for example, if you just say 'Hi', it will spit out some 'witty' reply and invite you to respond, it's creative with it's responses. On the other hand, if you say 'Hi' to an instruct model, it might say something like, I need more information to complete the task. Instruct models are looking for something like 'Write me a twitter bot to make millions'... in this case, if you ask the same thing again, you are somewhat more like to get the same, or similar result, this does not appear so true with a chat model, perhaps a real expert could chime in :)
Re:GPT-4 API General Availability by msp26 on Thursday July 06, 2023 @07:10PM (#36624588)
System/assistant/user prompting