2
$\begingroup$

OpenAI has recently added something that it calls Function calling to its chatGPT models/API.

What is meant by function calling in the context of a large langage model? Does it allow us to invoke functions and feed them back immediately?

What limitations does it have? What sort of applications does it enable?

$\endgroup$
5
  • $\begingroup$ This question is about a specific API, so it's off-topic. $\endgroup$
    – nbro
    Jun 22, 2023 at 21:55
  • 1
    $\begingroup$ There are other questions about chatGPT on here. I'll try and rephrase though. $\endgroup$ Jun 22, 2023 at 22:55
  • $\begingroup$ Models and APIs are not the same thing. An API has nothing to do with AI, unless that API was e.g. created by an AI. Function calling seems to be just an API feature. If function calling is something that the model itself is able to do, then fine. If they created a new model that can produce JSON, then your question is more likely to be on-topic here. $\endgroup$
    – nbro
    Jun 23, 2023 at 10:38
  • $\begingroup$ According to this openai.com/blog/function-calling-and-other-api-updates, they fine-tuned the model, so it's not just an API feature. $\endgroup$
    – nbro
    Jun 23, 2023 at 10:46
  • $\begingroup$ Indeed before it could just output langauge now it is outputting parameter values. $\endgroup$ Jun 23, 2023 at 12:56

2 Answers 2

2
$\begingroup$

If you examine the announcement on https://openai.com/blog/function-calling-and-other-api-updates function calling does not actually give LLMs the power to invoke functions directly. Instead it gives them the power to populate JSON models of the arguments to functions. Hopefully ones for which it has a good model.

So there is a new output from such models. In addition to language they can output parameters. Though this is not such a stretch given that they can already output code which include functions and parameters.

These can be checked to see if they follow the rules of the function itself in the same way that written output must conform to the rules of the language. It is an obvious evolution as:

  1. It plays to the models strengths - creating seemingly sensible patterns
  2. Its what many applications of chatGPT are already doing.

The model itself will not invoke the functions but its easy to imagine invoking a function which will provide new prompts.

I think its very wise to break the feedback loop here as immediate invocation of arbitray functions could have undesirable consequences.

I expect we will see some consequences from people experimenting with that in the near future.

The limitations are less obvious but you can imagine it falling prey to its own hallucinations.

$\endgroup$
0
$\begingroup$

What sort of applications does it enable?

Here is an example of an application that function calling enabled: PDFTriage: Question Answering over Long, Structured Documents

We propose an approach called PDFTriage that enables models to retrieve the context based on either structure or content. Our experiments demonstrate the effectiveness of the proposed PDFTriage-augmented models across several classes of questions where existing retrieval-augmented LLMs fail.

$\endgroup$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .