Few shot learning with gpt-4 - is it needed and what is best practice?

I’m creating a tutorial on the OpenAI API/gpt-4. Back when the model of choice for text creation was text-davinci-003, it was common to use a “few shot” approach to improve results. This would involve adding one or more examples to the prompt.

Is “few shot” still considered good practice with gpt-4? And if so, should the examples go in the system object of messages array:

const messages = [{
role: 'system',
content: 'This is my instruction, and here are some examples of what I want.
###
Example 1, 
###
example 2'
}]

or should they be presented as a conversation:

const messages = [{
role: 'system',
content: 'My instruction.
},
{
role: 'user',
content: 'example question'
},
{
role: 'assistant',
content: 'example desired response'
}]

There doesn’t seem to be anything in the docs about this, and maybe few shot is considered unnecessary with gpt-4.

Personally I keep the system prompt for persona definitions and global preferences, use Celsius, you are a helpful assistant, etc. I put my shots in the user prompt, you could try experimenting with the system prompt and see how that works for you though.

Thanks Foxabilo!
Just to clarify, when you say you put your shots in the user prompt do you mean you hard-code the start of the conversation and in the system prompt instruct the model to continue the conversation in the same style?

Or is your user prompt something like

{ role: 'user',
content: 'Write me a covering letter for a job with these criteria ${job_criteria} and make the letter similar in style to these examples: 
###
example 1: ${example1}
###
example 2: ${example2}'
}

Many thanks!

I will define a section at the start of my user prompt “###{shot_examples}### Using the examples in ### markers, please {Task_to_be_performed}”

1 Like