Prompt Examples
In the previous lesson we discussed prompt engineering —Â the way we interact with conversational AIs like ChatGPT, Microsoft, and Google. Let’s look at how prompts are used in natural speech, then examine some realistic prompt scenarios.
In this lesson:
- Natural speech
- Prompt examples
- Longer prompts
Natural speech
Conversational AI is designed to respond conversationally. Natural speech or written text is the best method of communication for conversational AI systems like ChatGPT. (Past methods: punch cards, keyboard, mouse.)
A prompt is similar to an instruction or command. Example: “Dim the lights.”
In this simple case, there’s an action word (verb) followed by a phrase (object).
Prompt = [action word] + [phrase]
Example: “Write a report.”
“Write” = verb, action word.
“A report” = object, modifier.
Your prompts will usually have this verb+object structure. But language is complex. So your prompt may have the following structure:
[Action word] + [phrase], or
[Action word] + [phrase], [phrase], [phrase], or
[Exclamation].
The action word is the instruction part of the prompt, and the phrases may relate to context, input data, and/or output format.
Simple prompts
Close and open-ended prompts
[User]: “What is 2+2?”
[User]: “What’s the capital of Montana?”
The AI system knows this is a computation with a single correct answer. This type of prompt is called close-ended (or “zero-shot”) because the computer understands the request and requires no further information.
[User]: “Tell me a joke.”
The system understands this is a request to say something that is funny. This type of prompt is called open-ended because it allows the system to be creative.
Asking open-ended questions is good practice
Sentiment
[User]: “Awesome!”
The AI understands sentiment (positive, negative, neutral). It interprets the statement as a positive, contextual reinforcement to its own response. The AI will continue the topic.
[User]: “The movie was terrible.”
The AI rates this as a negative review based on the sentiment.
Prompt examples
Earlier we described four likely parts to a prompt:
- Instruction
- Context
- Input data
- Output format
In these examples, we’ll work backwards from complex to simple. Consider the examples and experiment on your own.
Output format
[User]: “Compose a social media post promoting our new summer collection.”
[User]: “Write a blog post discussing the benefits of our services for small businesses.”
[User]: “Write a short story about…”
[User]: “Show me our sales results in a spreadsheet.”
In these examples, the user specified the desired output format, either a social media or blog post, short story, or table format.
Input data
[User]: “Compose a social media post promoting our new summer collection.”
[User]: “Using our customer demographics, recommend a targeted advertising strategy.”
[User]: “Create a personalized plan for my gym workout.”
In these examples, the user will provide additional input data like summer products, customer demographics, or fitness goals.
Context
[User]: “Provide a brief summary of the book.”
[User]: “Which of our products are selling best on the West Coast?”
In these examples, the user provides a simple contextual modifier to explain the task.
Instruction
[User]: “Write an essay about jazz music.”
[User]: “Find local events.”
[User]: “Help me with my homework.”
In these examples, the user provides an instruction and the system responds appropriately.
Longer prompts
We discussed prompts in terms of sentence structure, but your prompts aren’t limited to a single sentence! The AI understands and remembers normal conversation.
Examples:
[User]: “I’m studying American history. Help me with my homework.”
[User]: “I’m looking for guest speakers. Whom should I ask?”
Thanks to natural language processing, the AI is able to understand the specific request within the context.
Keep practicing!
Key to success
What are the three steps to mastering conversational AI?
- Practice
- Practice
- Practice
What’s next?
In this lesson, we looked at natural prompts and saw some examples. In actual use cases, you will follow up the AI’s responses with related questions. For example, “Tell me more about…” In the next lesson, we’ll look at advanced methods called “prompt tuning” that help you fine-tune your prompts based on the AI’s response.