Now, try feeding those examples into ChatGPT (include the fencing as part of the prompt) at the end of your prompt, in this form:
Here are some examples:
Q: <first example prompt goes here>
<first answer goes here>
Q: <second example prompt goes here>
<second answer goes here>
Q: <actual prompt>
Depending on the complexity of some of the questions and answers you may need to generate additional examples.
One thing which might help to speed things along, as you’re doing this whenever ChatGPT returns an ideal response, grab the prompt and response and add them to your examples.
This is called few-shot learning and it can be a very powerful tool—especially if you are meticulous with your examples.
Now, depending on how many of these you need to do and if you really need the capabilities of gpt-3.5-turbo or not, you might consider ultimately doing a fine-tuning instead.
You’d need at least 500 examples (though 2–3 times that would definitely be better) but then you wouldn’t need to include the learning examples every time.
Because, with such short prompts and long responses, doing even 3-shot learning will basically quadruple your API costs (which is why a fine-tuning might actually be more economical).
But, you should experiment with this.
Maybe just one perfect example will be enough to keep the model on rails?
To better help others, I’d ask that you experiment a little bit and, if it’s something you can do (no data/privacy concerns), please report back your findings with successful screenshots (or even better the full text of a prompt and response).
Also, describe anything you discovered which worked particularly well, anything which surprised you, or any examples which were especially difficult to coerce the model into behaving well with.
This way your topic here can become a more valuable resource for others struggling and learning.