9 ms·
GPT-4 Can Use Tools Now–That’s a Big Deal
- Bostonian 3y agoPeople use GPT to write computer code. Now that it has "function calling", does that mean it can run a compiler on code and try to fix it based on error messages before showing the code to the user?
- mlyle 3y agoYes.
- srgpqt 3y agoI suppose Rust can finally become a mainstream language, just let the AI deal with massaging our code to appease the compiler.
- drdaeman 3y agoCurrent LLMs are notoriously bad at design. They can produce code snippets that may even work, but they can't stay focused to make it all fit nicely into a consistent architecture. If you ask it to write you some larger and reasonably complex codebase, you'll end up with a weird junior-grade patchwork. And even if you talk architecture first, they behave as if they have super-short attention spans, so they mostly disregard it and get carried away. (Of course that's not what really happens, I'm kind of anthropomorphising it, but that how it feels like).
- vidarh 3y agoYou need to iterate. I've had decent luck having it "fill in the blanks" of a spec, then produce outlines of code with placeholders, then fill in placeholders. Granted, each time with me in the loop to go "hold on, do this slightly differently". So basically treating it as a junior doing the typing and gruntwork, while providing regular feedback on the direction. But you need to effectively constantly refine and narrow down a harness it can be told to work within. But that's often how I work on my own as well, so that's fine.
- moonchrome 3y agoMy problem with this is that the interface sucks and the iteration is slow. Supposedly copilot x will have a deeper IDE integration and voice commands.
- vidarh 3y agoThe iteration is faster than asking a person to do the same tasks. I've started toying with the API to address the interface bit, though.
- drdaeman 3y agoThat’s exactly what I did when I’ve experimented with it teaching me how to make a watchOS app (with me having zero iOS and Swift experience), but the issue us that it started to “forget” what we have talked about. It helped me to bootstrap the project and pointed out at some APIs I needed, but then it was a constant fight for code quality. I wanted proper actor abstraction (because I was dealing with Bluetooth, even if I don’t know the language I can see the patterns) and it just loved to write code in style of some cheapest-grade “how to use CoreBluetooth in Swift for dummies” blog articles.
- mlyle 3y agoWere you using vanilla ChatGPT or GPT4? Vanilla ChatGPT uses a GPT-3.5turbo version with a context window of 4096 tokens. GPT-4 has twice the context window by default, and has a variant with a context window 8x as big. It's not "8x better" with regards to forgetting what it's doing, but it's substantially better.
- drdaeman 3y agoYes, that was GPT-3.5. GPT-4's 25 messages/3 hours ratelimit wouldn't have led us anywhere, even with me doing my own research and compiling larger lists of change requests would've exhausted that very quickly.
- 3y ago
- dluc 3y agoThe model doesn't run code, it generates text that happens to be code. It's up to the client calling the model API to use this text, e.g. compiling and executing (if that's your scenario) and calling the model again to fix the original code if needed.
- ilaksh 3y agoYou could always take the output and write it to a file, run a compiler on it, and feed the results back into the AI, automatically. This just makes it easier to build systems like that or the system to be more efficient. For example, you can give it a function to call to replace some text in a file. Whereas before you needed to come up with some custom scheme with a diff format or sed call or something which was prone to breaking due to things like minor AI "typos" or newlines etc. This also makes it easy to implement an interface to things like a compiler or other command line tools so the AI can call them itself if necessary. Such as for installing packages or initializing a project. Before you had to keep begging GPT to follow some protocol with file outputs or something. Although GPT-4 was much better (but cost 10X more).
- derN3rd 3y agohttps://archive.is/Hhsxa https://archive.is/Hhsxa
- famouswaffles 3y agoGPT-4 using a browser and wanting to switch from Bing lol - https://imgur.com/a/WrY40X2 https://imgur.com/a/WrY40X2
- majjam 3y agoIsn't that showing wanting to switch browser, not search engine?
- famouswaffles 3y agoYou're right. Mistake.
- dwaltrip 3y agoIs that real? Hilarious if so.
- famouswaffles 3y agoIt's real
- DebtDeflation 3y agoWhen people used to talk about the danger of runaway AI, I would laugh. "They're just models that learn patterns from data and then make predictions when they see new data." Now that these systems can 1) write code, 2) compile the code they wrote, and 3) connect to the internet, I'm not laughing so much any more. I mean, all the ingredients are there now.
- TheDudeMan 3y agoFYI, those people were talking about the future of AI.
- saurik 3y agoI used to be under the misimpression that the AI would have to trick or threaten a human--which, to be clear, I am not saying would have been super hard, but at least would have had to be a step--to be able to take actual action... and then I saw that as soon as we started getting close to AI developers started for fun haphazardly wiring up unpredictable early AI not even merely as autocomplete (where the AI might be able to slip something fun in you don't notice) but as critical components in fully-automated workflow that can directly take action sometimes with interfaces as powerful as full terminal access and I realized we are all doomed.
- rimeice 3y agoAre you an AI?
- civilitty 3y agoAt work we’re already using ChatGPT to help decide whether to replace specific parts during jet engine rebuilds. We ask it for each part whether we need to do any testing given the serial number. It’s been saving a lot of time! The weird thing is it keeps telling us to place some weird plastic molding called SEMTEX hooked up to a Starlink receiver in between the turbine insulation blankets when we put the engine back in. None of us can figure out why there’s a high voltage wire going from the radio to the plastic - it makes no sense. But hey who are we to argue with AI?
- courseofaction 3y agoThese features aren't available to plus subscribers? Only corporate entities can access more powerful GPT-4 functionality, either through Microsoft Azure or OpenAI directly. This goes through an entirely opaque application process. "Open" AI? These incredibly powerful tools are already entirely co-opted and opaquely gatekept by the standard bearers of capitalism, who control access with no oversight. Terrifying.
- minimaxir 3y agogpt-3.5-turbo-0613 can access these features via the API.
- inciampati 3y agoSo if you have API access, you can use these tools?
- minimaxir 3y agoYep, it's just a parameter. https://platform.openai.com/docs/guides/gpt/function-calling https://platform.openai.com/docs/guides/gpt/function-calling
- courseofaction 3y agoSo, you need GPT-4 API access to use these tools with the competitive model, which is behind the opaque application process. I stand by my statements.
- TeMPOraL 3y agoNo, GPT-3.5 API access is sufficient. But yes, you need API access.
- deleted 3y ago[deleted]
- 3y ago
- deleted 3y ago[deleted]
- deleted 3y ago[deleted]
- minimaxir 3y agoParaphrasing my response from a previous thread (https://news.ycombinator.com/item?id=36331206 https://news.ycombinator.com/item?id=36331206) and having done some actual testing of the function calling feature, there's two things ChatGPT can now do: 1. You can input and/or output structured data from ChatGPT. 2. ChatGPT can select from a list of functions and their schema and use one (with "use" being telling the user to use said function and providing input parameters), or use none at all if not applicable. #1 is the more interesting use case I suspect people will use and in my testing it's incredibly effective and stable. #2 is an extention of modern tooling, but nothing new and it's up in the air whether it's more robust; the demos OpenAI have aren't great in that aspect. This article brushes it off but the actual user implementation of function selection is a pain in the ass (and also passing structured input data) that can't easily be explained in a tutorial, and like using LangChain it increases the information asymmetry for people getting into modern AI. The actual process of having ChatGPT select from a discrete set of outputs is very simple in practice and it's incredibly annoying that people consider it to the the "killer app" of LangChain. I might have to accelerate my blog post on how to do it efficiently, but in practice it's just a simple, small prompt: https://github.com/minimaxir/simpleaichat/blob/main/PROMPTS.md#tools https://github.com/minimaxir/simpleaichat/blob/main/PROMPTS....
- TeMPOraL 3y ago> This article brushes it off but the actual user implementation of function selection is a pain in the ass (and also passing structured input data) that can't easily be explained in a tutorial, and like using LangChain it increases the information asymmetry for people getting into modern AI. Stupid question, but... can't you just feed the relevant bit of API docs to GPT-4 and kindly ask it to write you the user-side call dispatcher, complete with error handling? :).
- minimaxir 3y agoUnfortunately, ChatGPT's cutoff date is still October 2021.
- 3y ago
- yeahwhatever10 3y agoI guess I'm an idiot because I thought that was what it was supposed to be doing in the first place. All these examples such as making itineraries were just from stored data? That seems not very useful.
- TeMPOraL 3y agoThere is nothing new here in principle. The difference is that before, you had to convince GPT-4, with cleverly crafted prompts and/or parameter tricks, to ask you to do something for it. What we have now is in principle the same, except OpenAI picked a specific format for GPT-4 (and GPT-3.5) to make requests to you, and fine-tuned the hell out of the model so it's much more eager to use it, and much better at incorporating it into its "reasoning".
- BaculumMeumEst 3y agoThis morning I asked GPT-4 to solve a simple problem and it hallucinated a function in its solution. I told it that it hallucinated the function, and it apologized and admitted the function didn’t exist. Then it gave me a new solution that used the same hallucinated function, but wrapped it in another hallucinated function.
- deleted 3y ago[deleted]
- nextworddev 3y agoGPT Function Calls is the new standard for building agents. Tool selection, task planning, and termination condition determination in one single LLM call. https://nextword.dev/blog/gpt-function-calls-are-task-planners https://nextword.dev/blog/gpt-function-calls-are-task-planne...
- manmal 3y agoI haven’t tried that yet, but I guess one could make a function directory (maybe in a vector database) that the LLM can browse via a function interface. The model would pick from potentially thousands of functions by drilling down into categories. Maybe that’s how their own plug-in system works.