Prompt Engineering

Review

  1. 2023-04-08 15:54
  2. 2023-08-21

#Prompting #PromptEngineering

一、Introduction #

[!Info] 简介 Using a prompt to instruct an AI to do a task is called prompting. The process of refining our prompt over time is known as prompt engineering. You will never write the perfect prompt on your first try, so it is important to get good at refining your prompt. Being good at prompt engineering mostly comes from lots of practice (trial and error).

[!Tip] 结构化提示词

  1. Role
  2. Goals
  3. Constrains
  4. Skills
  5. Workflow

Role Prompting #

Role prompting is a technique used in prompt engineering to encourage the AI to approach a question or problem by assuming a specific role, character, or viewpoint. This strategy can lead to a more focused, creative, or empathetic response depending on the given role.

How to use Role Prompting #

  1. Identify a role or character: Determine a character or role that will be compelling and relevant to the problem or question you’re posing. This could be a real or fictional character or a general professional role.
  2. Provide context: Set a scene or introduce the role so the AI knows the context in which it should respond. This can help to encourage responses that align closely with the character’s attributes or profession.
  3. Pose the question or task: Now, with the context and role present, ask the question or set the task you want the AI or user to respond to. Make sure it’s explicitly related to the chosen role.

Example of Role Prompting #

Imagine you want to explore solutions to an environmental problem. You can use role prompting to elicit diverse perspectives and insights. Here’s an example prompt with role prompting:

As a climate scientist, how would you approach the problem of deforestation to minimize its impact on the environment?

Goals #

Constrains #

Skills #

Workflow #

Reference #

  1. https://github.com/f/awesome-chatgpt-prompts
  2. Learn Prompting
  3. Learn Prompting Github