Orchestra AIBlog

How I Work: One-shot and few-shot prompts for generating marketing copy with ChatGPT

Jim Wrubel

Jim Wrubel

CEO, Orchestra AI · June 5, 2023

This article covers a topic that I actually don't see a lot of folks talking about; one-shot and few-shot prompts. Just like people, Large Language Models (LLM) like GPT perform better on tasks when you give them examples of the output you are expecting.

How I Work: One-shot and few-shot prompts for generating marketing copy with ChatGPT

This article covers a topic that I actually don't see a lot of folks talking about; one-shot and few-shot prompts. Just like people, Large Language Models (LLM) like GPT perform better on tasks when you give them examples of the output you are expecting. Most of the ChatGPT thinkpieces I see advise the user to give the LLM context in the prompt. For example, to start with "I want you to act like an expert marketer...". I'm not convinced this makes a big difference, and now with GPT-4 it might not make a difference at all.

Instead you should include examples of input and output in your prompt to guide the LLM towards your goal. In this article I'm generating candidate taglines for a hypothetical company that makes custom-built canoes. In my first prompt I'm giving the model two examples from related companies, REI and The North Face:

Beginning prompt to generate taglines for a custom-built canoe company
Beginning prompt to generate taglines for a custom-built canoe company

The first thing I notice is that these taglines are all much longer than the examples. So let's try to fix that.

Revising the prompt to adjust for length and tone.
Revising the prompt to adjust for length and tone.

Now we're starting to get some that work. Crafted with care, designed for exploration isn't bad! We can put it on our list. But these are still longer than the prompts, because most of the taglines include the word canoe or custom. The LLM doesn't understand that these will be displayed in context and the audience doesn't need that part. So let's ask ChatGPT to remove them.

Asking the ChatGPT prompt to avoid useless words in its output
Asking the ChatGPT prompt to avoid useless words in its output

Now we're getting closer. Where adventure meets the water is pretty good, and the others are getting better. They're still long though, and boat is used in a few of these and that doesn't make sense as a replacement word for canoe. So let's nudge the output even closer to our goal.

Asking ChatGPT to avoid boat and limit character length.
Asking ChatGPT to avoid boat and limit character length.

These look a lot closer to our original examples. The output is now using the word sail which also doesn't make sense for a canoe.

The ChatGPT output, now excluding the word sail
The ChatGPT output, now excluding the word sail

These are looking a lot more like what we were expecting going in. It took a combination of giving ChatGPT examples (which is the un-fancy way to say few-shot prompting), giving it a length limit, and also the subject of next week's article, negative keywords. With these three techniques we got some pretty strong candidate taglines for our hypothetical canoe company. Next time we can combine all of these in the first prompt and save ourselves some steps.

More articles