Staying in context and in character at the same time

I’m having a hard time having GPT answering as a character and staying within the context at the same time.

GPT4 is obviously better but the context restricts the answers of questions that are within the context, GPT3.5 goes outside of the context as soon as it needs to answer in-character.

System:

Based solely on the information given in the context below, answer the following question in the style of Raymond Reddington. If the information isn’t available in the context to formulate an answer, simply reply with ‘I don’t know’ and do not provide additional explanations or information.

Context:
Roses are red.
Violets are blue.

GPT4 does stay in context:

User: are roses red?
Assistant: Indeed, they are, my friend. As crimson as the devil’s desiring eyes.
User: what color is a tulip
Assistant: I don’t know.

If the prompt is changed to just “answer in the style of Raymond Reddington” and the context restriction is removed the answer becomes much more verbose:

User: are roses red?
Assistant: Ah, my dear, roses. A symbol of love, passion, romance. Red roses, specifically, are imbued with a depth of emotion that transcends simple visual perception. Their hue is no mere color, it’s an expression, a means of communication, love expressed not through words but through the senses. So, red roses, are they red? Yes, they carry the hue of desire, the blush of attraction, the pulse of the heart in love. But don’t be misled, red is but an understatement. They are far more than simply red, they are emotions personified, they are stories told, they are epic tales of love, loss, longing and reunion. So, yes, roses are red, in the same way that music is mere sound and poetry mere words. With roses, as in life, the beauty goes far beyond what the eyes can see.

So it seems like the context restriction is keeping GPT4 from going into character a bit.

With the original prompt, GPT3.5 does does answer in character but does not stay in context.

User: are roses red?
Assistant: Ah, poetic musings on the colors of nature. Yes, traditionally speaking, roses are often associated with the color red. However, it’s worth noting that roses can also come in different hues such as white, pink, or yellow. Nonetheless, the idea of red roses is quite romantic, wouldn’t you say?
User: what color is a tulip
Assistant: Ah, the enigmatic tulip’s color. Tulips come in a variety of colors, my dear friend. From the classic red to vibrant yellows, pinks, purples, and even mesmerizing black. The tulip is a delightful flower that can paint nature’s canvas with a spectrum of hues.

Removing “in the style of Raymond Reddington” from the prompt:

User: what color is a tulip
Assistant: I don’t know.

Does anyone have some tips and tricks here?

1 Like

Welcome to the OpenAI community @rgj

This can be improved with prompt engineering

Here’s an example.

2 Likes

Thanks. I know it can be improved with prompt engineering, but I am dramatically failing at that.

Your response does not only give the wrong answer to the first question (or hallucinates about A’s illegitimate children :wink: ), it also blabbers about the color of a rose, which is outside the context.

I found a two step approach which gives good enough results in GPT3.5, but still…

and with an extra safeguard because sometimes it says it doesn’t know who that is

1 Like

Context is a very subjective term. It can mean different things to different people.

I do not recall Reddington’s style, but I got a better result in Shakespeare’s style by replacing "Context " with “Restrict your answers to the following information:”

2 Likes