0% found this document useful (0 votes)
44 views4 pages

Understanding Prompt Types for LLMs

Uploaded by

Starry Knight
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
44 views4 pages

Understanding Prompt Types for LLMs

Uploaded by

Starry Knight
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Types of Prompts

1
Introduction to Prompt Engineering

Module 002 – Types of Prompts

At the end of this module you are expected to:


1. Understand the different types of prompts that can be used with large
language models.
2. Identify the most appropriate type of prompt for a given task.

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.

Examples of prompts for people with non-technical backgrounds:


 Write a poem about a cat.
 Write a story about a robot who falls in love with a human.
 Generate a list of 10 things that I should do to improve my writing skills.

Examples of prompts for people with technical backgrounds:


 Write a prompt that will generate a poem about a cat using the Bard API.
 Write a prompt that will generate a story about a robot who falls in love with a human, but make
sure the story is different from any other stories you have written.
 Write a prompt that will generate a list of 10 things that I should do to improve my writing skills,
and make sure the list is specific and actionable.

Course Module
Types of Prompts
4
Introduction to Prompt Engineering

References and Supplementary Materials


Books and Journals
1. [Link]
t-Based_Generative_Art
2. [Link]
3. Oppenlaender, Jonas. (2022). Prompt Engineering for Text-Based Generative Art.
Online Supplementary Reading Materials
1. [Link]
2. [Link]
3. [Link]
4. [Link]
ions/[Link]
Online Instructional Videos
1. [Link]
2. [Link]
3. [Link]

Course Module

Common questions

Powered by AI

When selecting a prompt type, one must consider the specific task requirements, desired output creativity level, computational resources, and platform capabilities. Input/output prompts are selected for efficiency and straightforward tasks, while zero-shot prompts suit tasks demanding high creativity from a rich dataset. Few-shot prompts are chosen for tasks requiring specific style imitations. Adversarial prompts require powerful computing capacities, making them apt for generating highly unique content. The task's complexity and computational burden will dictate the choice .

Zero-shot prompts leverage large text datasets to generate creative and unexpected content without any specific prior instruction. Platforms like OpenAI's Jurassic-1 Jumbo, which have access to extensive text corpora, can use zero-shot prompts to explore vast thematic possibilities, resulting in highly original outputs such as poems, stories, or dialogues. This makes them suitable for creative writing tasks where novelty and variety are desired .

Input/output prompts play an essential role in translation tasks within LLMs by providing structured text input in one language and requesting translation into another. This approach leverages the model's language understanding capabilities to generate accurate translations efficiently. By specifying precise inputs, these prompts help streamline the translation process, making them highly effective for platforms focused on practical language applications .

Few-shot prompts assist in generating text in specific styles or genres by providing a few examples that illustrate the desired textual pattern. This guided approach enables the LLM to recognize and mimic stylistic nuances, allowing for the generation of new content that adheres closely to the established style or genre while incorporating novel elements. Such prompts are employed effectively to replicate known literary styles or generate genre-consistent content .

Designing adversarial prompts can be challenging due to their requirement for creativity and their computational expense. Such prompts necessitate precise wording to guide the LLM in generating text that significantly differs from a specified input. In powerful computing environments, these challenges can be mitigated by leveraging resources that handle the additional computational load, allowing for the iterative refinement of prompts until the desired outcomes are achieved .

Adversarial prompts require more computational resources than few-shot prompts due to their need for generating text that deviates significantly from the input. They push the LLM to produce highly creative and unexpected outputs, which can be computationally intensive. Few-shot prompts, while still creative, operate within the constraints of provided examples, requiring less computational power as they guide the LLM towards familiar stylistic outputs without extensive deviation. The demands of adversarial prompts make them suitable for powerful computing platforms .

To ensure effective use of few-shot prompts in creating content similar to established literary styles, one should provide well-chosen examples that closely reflect the desired stylistic elements. These examples should highlight key thematic, syntactic, and lexical features of the target style. Additionally, iterative refinement and testing of prompts can further align generated content with stylistic expectations. Employing a comprehensive understanding of literary nuances will guide the LLM effectively, ensuring the output aligns with the envisioned style .

Adversarial prompts are effectively used in scenarios requiring creative and unexpected text generation. In computationally powerful environments, they can be employed to generate texts that deviates significantly from a given input or are creatively challenging, such as humorous content or thought-provoking poetry. This type of prompt takes advantage of the platform's computational capabilities to explore uncharted territories in creative writing .

Zero-shot prompts instruct the LLM to generate text about a topic without any prior knowledge provided in the prompt, making them suitable for generating creative or unexpected content such as poems or stories. Few-shot prompts, on the other hand, provide a few examples to guide the LLM, making them useful for generating text that follows a specific style or genre while still allowing for some creativity. This makes zero-shot prompts ideal for novel content creation and few-shot prompts for imitating specific styles .

Input/output prompts are beneficial for limited-resource platforms because they are the most efficient type of prompt for generating text. These prompts use specific inputs to direct the LLM's output, making them suitable for tasks like text generation, translation, and question answering without requiring excessive computational resources .

You might also like