#Most effective way to tell Chat Completion Model its rules?

14 messages · Page 1 of 1 (latest)

edgy goblet
#

Hello. I am using Open AIs Chat Completion API to allow users on my Discord chat with an AI that aims to be supportive for my Discord bot (e.g. recognizing an issue the user has, and linking the correct docs). I also want them to have nice conversations or have a supportive bot right in Discord.

As of yet, everything is fine, however the model keeps failing following the rules.
i have some rules and every time the user asks something, I will include the rules in the message history as system before the user sends it. unfortunately, the model fails to stick to the rules. is it smarter to split this one giant message into smaller messages and include each in the "history"?

current json i send (i want to include previous messages of the model as well in the future additionally to the rules and user message to provide more natural conversations)

// current request json to the api
{
    "model": "gpt-3.5-turbo",
    "temperature": 1,
    "messages": [
        {
            "role": "system", // the rules i include in every message.
            "content": "the large amount of rules (361 words, 2.3k characters)"
        },
        {
            "role": "user", // user input
            "content": "Hello. What is your name?"
        }
    ]
}

json that may work better? for example:

{
    "model": "gpt-3.5-turbo",
    "temperature": 1,
    "messages": [
        {
            "role": "system", // rules split no. 1
            "content": "first 120 words"
        },
        {
            "role": "system", // rules split no. 2
            "content": "second 120 words"
        },
        {
            "role": "system", // rules split no. 3
            "content": "last 121 words"
        },
        {
            "role": "user", // user input
            "content": "Hello. What is your name?"
        }
    ]
}
gaunt fable
#

Instruction following decoherency is a known thing with gpt3.5-turbo, it has a lot of trouble sticking to a character or following instructions across a long conversation

#

You will get better results with text-davinci-003

#

You can also try setting the context message as a user message instead of a system message, system messages are de-weighted on turbo-0301

#

You can also try re-sending the whole instruction set in the middle of the conversation history as "reminder"

#

and etc, it's basically just prompt engineering to get it to behave like you want it

edgy goblet
gaunt fable
#

I think you can probably get away with sending the instructions 1 time in a user message at the beginning

edgy goblet
#

when i tell it to remember, it sometimes just lists me what to remember and then says that it shouldn't have said it at the first place 🙃

gaunt fable
#

you can also try having ur entire conversation be in one user message

#

like the content would contain conversation history with the names and stuff manually added in

#
    "messages": [
        {
            "role": "user", // rules split no. 1
            "content": "Instructions go here
        },
        {
            "role": "user", // rules split no. 2
            "content": "Kaveen:Hi\nAssisstant:Hey there! How can I help?\nKaveen:What's your name?"
        },
    ]
#

as an example ^