skip to content
Posts · August 2023

Building ChatGPT Prompts: Guide with Examples


Creating system prompts for models like ChatGPT is both an art and a science. Proper prompts allow users to interact with the model more effectively and receive more relevant responses. This article aims to shed light on the intricacies of crafting prompts for GPT models and provides examples for a better understanding.

Understanding ChatGPT and the Role of Prompts

Before diving into the construction of prompts, it’s essential to understand what ChatGPT is and how prompts influence its outputs.

A models from the GPT series, designed for conversation. It’s trained on vast amounts of text and is capable of generating human-like text based on the input it receives.

Prompts are the inputs given to ChatGPT. The model doesn’t truly “understand” in the human sense, but it generates outputs based on patterns it has learned. The more clear and specific your prompt, the better the model’s response.

Basic Prompt Construction

Prompts can range from a single word to full sentences or even paragraphs. Here are the basic guidelines:

Clarity

Ensure the prompt clearly conveys what you want from the model. Example:

Instead of “Hemingway,” you could say, “Write a summary of Ernest Hemingway’s influence on literature.”

Specificity

Being more specific can guide the model towards a more accurate response. Example:

“Write about the history of Golden Retrievers.”

Advanced Prompt Techniques

Leading Questions

You can often get more detailed or nuanced responses by framing your prompts as questions. Example:

“How did Renaissance art differ from the art of the Middle Ages?”

Providing Context

In cases where you need a particular type of answer, providing more context helps. Example:

“Translate this English text into French considering the nuances of business terminology.”

Setting a Format or Structure

If you have a specific format in mind, include that in your prompt. Example:

“List five fascinating facts about black holes.”

Role Play

ChatGPT can assume various roles, making interactions more engaging or tailored to specific needs. Example:

“Pretend you’re a fitness coach. What exercises should I do for a full-body workout?”

Handling Biases and Controversies

All models, including ChatGPT, can sometimes produce outputs that might be deemed controversial or biased, given they are trained on vast and diverse datasets. When crafting prompts around sensitive topics:

  • Be explicit about neutrality: “Provide a neutral overview of [Topic].”
  • Ask for multiple perspectives: “Detail both sides of the debate on [Topic].”

Continuous Feedback Loop

It’s often beneficial to iterate over prompts based on the model’s responses. If you don’t get the desired output:

  • Rephrase: Sometimes, slight tweaks in phrasing can lead to better answers.
  • Break it down: Split complex queries into simpler, related questions.

Examples for Better Understanding

Let’s look at various ways to prompt the model for a topic, say, “climate change”:

Basic: “Climate change.”

Potential Response: A general overview of climate change.

Leading Question: “What are the main causes of climate change?”

Potential Response: A detailed explanation of greenhouse gases, deforestation, and other significant causes.

Context: “Explain climate change from the perspective of its impact on polar bears.”

Potential Response: Details on how rising temperatures affect ice melting and its consequences on polar bear habitats.

Format: “List ten consequences of climate change on global weather patterns.”

Potential Response: A structured list detailing various impacts, like increased hurricanes, erratic rainfall, and prolonged droughts.

Role Play: “Imagine you’re a historian from the year 2200. How would you describe the climate change events of the 21st century?”

Potential Response: A speculative, historical recount of our current era’s climate change challenges.

Finally

Crafting effective prompts for ChatGPT or any GPT model requires a mix of clarity, specificity, and creativity. As you interact with the model and iterate over prompts, you’ll get a better feel for extracting the kind of response you’re aiming for.


Originally published on Medium.