Introduction to Prompt Engineering

Prompt Engineering

Prompt engineering is a fascinating way to communicate with a machine learning model like ChatGPT. It’s like giving specific instructions to a super-smart robot that can understand and respond to your queries in a human-like way. Let’s explore this concept with some easy and exciting examples!

What is Prompt Engineering?

Prompt engineering is the process of giving a machine learning model a prompt to generate a response. The prompt is a short text that describes what you want the model to do. The model then generates a response based on the prompt.

How does Prompt Engineering work?

Prompt engineering works by giving a machine learning model a prompt to generate a response. The prompt is a short text that describes what you want the model to do. The model then generates a response based on the prompt.

How to write a prompt?

  • What are some key terms I should know about [topic]?
  • What are some important concepts in [subject]?
  • Provide me with some reliable sources to learn about [topic].
  • I want you to act as a research assistant and provide me with 5 reliable sources to learn about [topic].
  • Can you explain the concept of [topic] in simple terms?
  • I want you to act as a teacher and give me a definition of [term].
  • What are some common mistakes to avoid when [activity]?
  • Generate a bullet-point list of key takeaways from [presentation].

General Rules for Prompt Writing

Here are some general rules for writing prompts for ChatGPT-4:

  • Start simple - start with a simple prompt and build on it
  • Call to Action - start the prompt with an action word like “Write”, “Create”, or “Summarize” instead of “Can you”
  • Add Context - add specific and relevant context to the task you want to perform
  • Add Expectations - add clear and direct expectations for the content, like how long it should be and what to include

With the following prompt:

Create a list of 10 fun and inexpensive toy gifts to programmers based on the following criteria:

  • It should be useful
  • It should be silly
  • It should spark creativity

ChatGPT Role Prompting

A simple way to add context to a prompt is to assign a role to ChatGPT. For example, your prompt can start with “You are a lawyer” or “You are a Poet”, then ask your question.