6 Prompt Engineering Examples

Written by Coursera Staff • Updated on

Generative artificial intelligence allows you to prompt applications to create text, photos, and other content to suit your particular requests.

[Featured image] An AI engineer works at a computer using prompt engineering to create a chatbot.

Applications like ChatGPT and Google’s Gemini can create written content for you based on the prompts you give them, while image applications like DALL-E will produce AI-generated art. 

How you prompt a generative AI program is important to maximizing its output, which is why understanding prompt engineering can be beneficial.

What is prompt engineering?

Prompt engineering is a process that focuses on crafting the optimal prompts you need to get the best output from generative AI programs to ensure you’re getting the results you need. It is often used with large language models (LLMs), a type of generative AI tool that can output conversational text that mimics human language based on the prompts you give it.

Generative AI can use detailed instructions with specific words and phrases to give you the best results for your questions. That’s where prompt engineering comes in to structure your request so that generative AI can focus on your exact needs for each prompt.

Read more: What Is Prompt Engineering? Definition and Examples

Types of prompt engineering

You can use different forms of prompt engineering for your questions. Each one is useful in different ways depending on the particular needs of a prompt. Here are some of the prompt engineering types you can use to get your desired results.

1. Text completion

Text completion follows a logical output from your beginning prompt. You can give the AI the beginning of a thought or sentence and have the AI help you finish it.

2. Instruction-based

You can give instructions to the AI to perform a specific task. You may be familiar with these types of prompts if you have experience with things like Siri or Alexa when you ask them to perform a specific instruction for you.

3. Contextual

Contextual prompting allows the AI to understand and respond to prompts in a way that shows it understands the prompt's meaning so that it responds within the proper context.

4. Multiple choice

You can input a question with multiple choices and ask the AI to choose the best answer along with why it chose it. This can be a good prompt if you’re trying to decide among multiple outcomes based on a question.

5. Bias mitigation

Bias mitigation takes potential biases out of the AI's generated responses. You can focus prompts for the AI to create an output that better reflects an unbiased or objective response instead of a more subjective one.

6. Fine-tuning

Fine-tuning allows you to focus an AI option for a specific purpose instead of a more general use. You can use additional data sources and information to help an AI better adapt to customer questions or specific topics used by the prompt.

Prompt engineering examples

You can use specific types of AI prompt engineering to find the best ways to reach your audience. Here are some examples that can work for you.

Natural language processing

Natural language processing allows an AI to develop an output in a conversational style to convey a particular idea. Applications could include text summarization with a question about summarizing an article or paper in an easy-to-understand synopsis for the user. It can also help you translate text from one language to another in a conversational way. 

Read more: What is Natural Language Processing? Definition and Examples

Chatbots and virtual assistants

Prompt engineers can work on chatbots and virtual assistants to handle specific inquiries from a particular audience. You may be able to use chatbots to generate conversational responses to common questions.

Content generation

Use AI's content generation to create short or long answers. It can also produce content for marketing or more creative pursuits like fictional stories with specific parameters.

Question-answering systems

Question-answering systems use AI to generate specific answers based on user input. They can help users obtain more precise information by creating specific answers conversationally.

Data analysis

Give AI data to analyze, and come up with insights about data sets and research potential that can help with the decision-making process. You can also use data analysis to develop visualizations.

Read more: Data Science vs. Machine Learning: What’s the Difference?

Information extraction

Sometimes you don’t have the time to read a full article or watch a video. Information extraction can be used by AI to give you a summary of the information instead and save you time.

Read more: Prompt Engineering Jobs: Your Career Guide

Pros and cons of prompt engineering 

Prompt engineering has positives and negatives to consider before you decide to work in the field.

An advantage of prompt engineering is its capacity to allow you to make it more efficient for customers and other users. Generative AI can complete tasks quicker and easier, which means the AI has to keep up with changes in technology or adapt to an evolving user base.

You can also use prompt engineering to save company costs. AI can help employees work more efficiently by cutting back on the amount of time needed to complete a task to thereby have higher output on more important or human-dependant tasks, helping a company’s bottom line.

On the other hand, there could be some cons to using prompt engineering. For example, you may be able to save money in certain areas like employment but then spend on the resources needed to make it work like prompt engineering specialists or the machines and technology to keep generative AI running for an organization.

Prompt engineering is also a new field, so there is some uncertainty about its future. You may be spending money and resources on projects that aren’t fruitful or building things that may fail.

How to become a prompt engineer

Positions are available for prompt engineers if you have relevant education and skill set.

To become a prompt engineer, you'll need at least a bachelor’s degree in computer science, information technology, linguistics, cognitive psychology, or a related field. It’s also helpful to have studied topics such as machine learning, artificial intelligence, cognitive psychology, and communication.

Want to learn more? The field is also new, so you may have to pick up additional skills through experience. You might want to seek out additional work with LLMs, which you can facilitate with courses like Generative AI with Large Language Models presented by AWS and DeepLearning.AI.

Learn more: How to Become a Prompt Engineer: Skills You Need + Steps to Take

Getting started with Coursera

Learn more about the field with Generative AI: Prompt Engineering Basics with IBM on Coursera. The course can help you with prompt engineering basics, such as understanding the basics of generative AI and learning about tools used in prompt engineering.

Additionally, you can find out more about one particular generative AI application with Prompt Engineering for ChatGPT with Vanderbilt University. Learn more about how to create prompt-based applications or use prompt patterns in ChatGPT.

Keep reading

Updated on
Written by:

Editorial Team

Coursera’s editorial team is comprised of highly experienced professional editors, writers, and fact...

This content has been made available for informational purposes only. Learners are advised to conduct additional research to ensure that courses and other credentials pursued meet their personal, professional, and financial goals.