Prompt Engr - Module 2
Prompt Engr - Module 2
1
Introduction to Prompt Engineering
Types of Prompts
A prompt is a piece of text that guides the output of a large language model (LLM). Prompts can be as
simple as a few words or as complex as a paragraph. They can be written in natural language or in a more
technical format.
There are many different types of prompts, but some of the most common ones include:
Input/output prompts: These prompts tell the LLM to generate text that matches a specific input.
o For example, an input/output prompt might say "Write a poem about a cat."
o Input/output prompts are often used for tasks such as generating text, translating
languages, and answering questions.
o For example, an input/output prompt for generating text might say "Write a poem about a
cat."
o An input/output prompt for translating languages might say "Translate this sentence from
English to French."
o An input/output prompt for answering questions might say "What is the capital of France?"
o Input/output prompts can be used on any platform that can generate text, such as Google
AI's Bard or OpenAI's GPT-3.
o These prompts are the most efficient type of prompt, so they are a good choice for
platforms that have limited resources.
Zero-shot prompts: These prompts tell the LLM to generate text about a topic without any prior
knowledge.
o For example, a zero-shot prompt might say "Write a poem about something beautiful."
o Zero-shot prompts are often used for tasks such as generating creative content, such as
poems, stories, and scripts.
o For example, a zero-shot prompt for generating a poem might say "Write a poem about
something beautiful."
Course Module
Types of Prompts
2
Introduction to Prompt Engineering
o A zero-shot prompt for generating a story might say "Write a story about a robot who falls
in love with a human."
o A zero-shot prompt for generating a script might say "Write a script for a movie about a cat
who solves a mystery."
o Zero-shot prompts can be used on platforms that have a large dataset of text, such as
Google AI's LaMDA or OpenAI's Jurassic-1 Jumbo.
o These prompts can be used to generate creative or unexpected text, so they are a good
choice for platforms that are used for creative writing or generating ideas.
Few-shot prompts: These prompts tell the LLM to generate text about a topic based on a few
examples.
o For example, a few-shot prompt might say "Write a poem about a cat, but make sure it is
different from the other poems you have written."
o Few-shot prompts are often used for tasks such as generating text that is similar to a
specific style or genre.
o For example, a few-shot prompt for generating text in the style of Shakespeare might say
"Write a poem about a cat in the style of Shakespeare."
o A few-shot prompt for generating text in the genre of science fiction might say "Write a
story about a robot who falls in love with a human in the genre of science fiction."
o A few-shot prompt for generating text that is different from a specific input might say
"Write a poem about a cat that is different from any other poem you have written."
o Few-shot prompts can be used on platforms that have a smaller dataset of text, such as
Google AI's Meena or OpenAI's WuDao 2.0.
o These prompts can be used to generate creative or unexpected text, but they may not be as
creative or unexpected as zero-shot prompts.
Adversarial prompts: These prompts tell the LLM to generate text that is different from a specific
input.
o For example, an adversarial prompt might say "Write a poem about a cat that is not like any
other poem you have written."
o Adversarial prompts are often used for tasks such as generating text that is creative and
unexpected.
o For example, an adversarial prompt for generating text might say "Write a poem about a
cat that is not like any other poem you have written."
o An adversarial prompt for generating text that is funny might say "Write a joke about a cat."
o An adversarial prompt for generating text that is thought-provoking might say "Write a
poem about a cat that explores the meaning of life."
Course Module
Types of Prompts
3
Introduction to Prompt Engineering
o Adversarial prompts can be used on platforms that are computationally powerful, such as
Google AI's Pathways or OpenAI's Megatron-Turing NLG.
o These prompts can be used to generate creative or unexpected text, but they may be
difficult to write and they can be computationally expensive.
The type of prompt that you use will depend on the task you are trying to achieve. For example, if you are
trying to generate text that is similar to a specific input, you would use an input/output prompt. If you are
trying to generate text about a topic that the LLM has never seen before, you would use a zero-shot
prompt.
Course Module
Types of Prompts
4
Introduction to Prompt Engineering
Course Module