Model don't follow instructions with Function Calling

I’m working on a solution for a chat support assistant. The model has a system message with guidelines and restrictions about topics it should answer and what it should not. It has a decent performance when being forced to answer out-of-context subjects.

Recently though, I’ve been trying function calling. I just noticed that when I provide any function it is very easy to get out-of-context answers. The model doesn’t seem to follow the instructions like before.

For example, before was frequent this kind of response:

User: 'Who is Einstein?"
Assistant: “Sorry, but I have no information about Albert Einstein.”

GOOD. (It is expected not to talk about other subjects)

After providing functions:

User: 'Who is Einstein?"
Assistant: “Albert Einstein was a German theoretical physicist who developed the theory of relativity, one of the foundations of modern physics…”

BAD. (It should avoid talking about other subjects not related to its chat support role)

Has anyone ever experienced this? And what do you suggest to do in this case?
Btw, I’m using gpt-3.5-turbo.

1 Like

How do you call the API?


1st API call (function calling)
- system prompt #1

2nd API call (summary)
- system prompt #2

So which API call is giving you the undesired response? The first one? Does it contain your original system prompt?

1 Like

The model doesn’t even need to call any function. It doesn’t matter. Just the fact in providing any function description in the params already causes the model to answer about everything you ask for, completely ignoring what was stated in the system prompt.

1st API call
- system prompt
- user prompt
- function calls descriptions

It seems to me that a different model is used when the function_calls param is present. Maybe a different model optimized for function calls but with a poor performance on steerability?

You are correct that a different model is used. It has training about how functions work, has more training about writing code, and simply operates differently on the same inputs.

You still should be able to keep the AI on topic with more prompting and reinforcement. Example.

You are the customer support assistant for widgets inc.
You only provide direct support for widgets inc products and related solutions.
Other chat or off-topic conversation is prohibited, and the user must be reminded the AI is only for customer support.
You have a “disconnect_user” function to be used in case of continued off-topic requests.