ChatGPT-Prompts使用指南

发布时间 2023-05-07 16:36:05作者: 煽风想要点火

1. Standard Prompts

Standard prompts can be combined with other techniques like role prompting and seed-word prompting to enhance the output of ChatGPT.

? Example

- Task: Generate a product review for a new laptop
- Instructions: The review should be objective, informative and highlight the unique features of the laptop
- Role: Tech expert
- Seed-word: "powerful"
- Prompt formula: "As a tech expert, generate an objective and informative product review that highlights the powerful features of the new laptop."

2. "Let’s think about this” prompt

The "Let's think about this" prompt is a technique used toencourage ChatGPT to generate text that is reflective and contemplative. This technique is useful for tasks such as writing essays, poetry, or creative writing.The prompt formula for the "Let's think about this" prompt is simply the phrase "Let's think about this" followed by a topic or question.

? Steps

  1. Identify the topic or idea you want to discuss.
  2. Formulate a prompt that clearly states the topic or idea, and starts the conversation or text generation.
  3. Preface the prompt with "Let's think about" or "Let's discuss" to indicate that you're initiating a conversation or discussion.

? Example

Prompt: "Let's think about the impact of climate change on agriculture"
Prompt: "Let's discuss the current state of artificial intelligence"
Prompt: "Let's talk about the benefits and drawbacks of remote work"

3. Self-Consistency Prompt

The Self-Consistency prompt is a technique used to ensure that the output of ChatGPT is consistent with the input provided. This technique is useful for tasks such as fact-checking, data validation, or consistency checking in text generation.

? Example

Task: Generate a product review
Instructions: The review should be consistent with the
product information provided in the input
Prompt formula: "Generate a product review that is
consistent with the following product information [insert
product information]"

4. Seed-word Prompt

The Seed-word prompt is a technique used to control the output of ChatGPT by providing it with a specific seed-word or phrase. The prompt formula for the Seed-word prompt is the seed-word or phrase followed by the instruction "Please generate text based on the following seed-word"

? Example

Task: Generate a poem
Instructions: The poem should be related to the seed word
"love" and should be written in the style of a sonnet.
Role: Poet
Prompt formula: "Generate a sonnet related to the seed word 'love' as a poet"

5. Knowledge Generation prompt

The Knowledge Generation prompt is a technique used to elicit new and original information from ChatGPT. The prompt formula for the Knowledge Generation prompt is "Please generate new and original information about X" where X is the topic of interest.

? Example

Task: Generate new information about a specific topic
Instructions: The generated information should be accurate and relevant to the topic
Prompt formula: "Generate new and accurate information about [specific topic] "

6. Multiple Choice prompts

This technique is useful for generating text that is limited to a specific set of options and can be used for question-answering, text
completion and other tasks.
The model can generate text that is limited to the predefined options.

? Example

Task: Answer a multiple-choice question
Instructions: The answer should be one of the predefined options
Prompt formula: "Answer the following question by selecting one of the following options: [insert question] [insert option 1] [insert option 2] [insert option 3]"

7. Interpretable Soft Prompts

Interpretable soft prompts is a technique that allows to control the model's generated text while providing some flexibility to the model. It is done by providing the model with a set of controlled inputs and some additional information about the desired output. This technique allows for more interpretable and controllable generated text.

? Example

Task: Generate text in a specific style
Instructions: The text should be in the style of a specific period 
Prompt formula: "Generate text in the style of [specific period]:[insert context]"

8. Controlled Generation prompts

Controlled generation prompts are techniques that allows to
generate text with a high level of control over the output.
This is achieved by providing the model with a specific set ofinputs, such as a template, a specific vocabulary, or a set of constraints, that can be used to guide the generation process.

? Example

Task: Generate a story
Instructions: The story should be based on a specific template
Prompt formula: "Generate a story based on the following template: [insert template]"

9. Question-answering prompts

Question-answering prompts is a technique that allows a model to generate text that answers a specific question or task. This is achieved by providing the model with a question or task as input,along with any additional information that may be relevant to the question or task.This can be useful for tasks such as question-answering and information retrieval.

? Example

Task: Retrieve information from a specific source
Instructions: The retrieved information should be relevant
Prompt formula: "Retrieve information about [specific topic] from the following source: [insert source]"

10. Summarization prompts

Summarization prompts is a technique that allows a model to
generate a shorter version of a given text while retaining its main ideas and information.This is achieved by providing the model with a longer text as input and asking it to generate a summary of that text. This technique is useful for tasks such as text summarization and information compression.

? Example

Task: Summarize a book
Instructions: The summary should be a brief overview of the main points of the book
Prompt formula: "Summarize the following book in one short paragraph: [insert book title]"

11. Dialogue prompts

Dialogue prompts is a technique that allows a model to generate text that simulates a conversation between two or more entities. By providing the model with a context and a set of characters or entities, along with their roles and backgrounds, and asking the model to generate dialogue between them.

? Example

Task: Generate a conversation between two characters
Instructions: The conversation should be natural and relevant to the given context
Prompt formula: "Generate a conversation between the following characters [insert characters] in the following context [insert context]"

12. Adversarial prompts

Adversarial prompts is a technique that allows a model to generate text that is resistant to certain types of attacks or biases. This technique can be used to train models that are more robust and resistant to certain types of attacks or biases.

? Example

Task: Generate text that is difficult to translate
Instructions: The generated text should be difficult to translate to the target language
Prompt formula: "Generate text that is difficult to translate to [insert target language]"

13. Adversarial prompts

Adversarial prompts is a technique that allows a model to generate text that is resistant to certain types of attacks or biases. This technique can be used to train models that are more robust and resistant to certain types of attacks or biases.

? Example

Task: Generate text that is difficult to translate
Instructions: The generated text should be difficult to translate to the target language
Prompt formula: "Generate text that is difficult to translate to [insert target language]"

14. Clustering prompts

Clustering prompts is a technique that allows a model to group similar data points together based on certain characteristics or features.This is achieved by providing the model with a set of data points and asking it to group them into clusters based on certain characteristics or features.This technique is useful for tasks such as data analysis, machine learning, and natural language processing.

? Example

Task: Group similar customer reviews together
Instructions: The reviews should be grouped based on sentiment
Prompt formula: "Group the following customer reviews into clusters based on sentiment: [insert reviews]"

15. Reinforcement learning prompts

Reinforcement learning prompts is a technique that allows a model to learn from its past actions and improve its performance over time. To use reinforcement learning prompts with ChatGPT, the model should be provided with a set of inputs and rewards, and allowed to adjust its behavior based on the rewards it receives. The prompt
should also include information about the desired output, such as the task to be accomplished and any specific requirements or constraints.This technique is useful for tasks such as decision making, game playing, and natural language generation

? Example

Task: Generate text that is consistent with a specific style
Instructions: The model should adjust its behavior based on the rewards it receives for generating text that is consistent with the specific style
Prompt formula: "Use reinforcement learning to generate text that is consistent with the following style [insert style]"

16. Curriculum learning prompts

Curriculum learning is a technique that allows a model to learn a complex task by first training on simpler tasks and gradually increasing the difficulty.This technique is useful for tasks such as natural language processing, image recognition, and machine learning.

? Example

Task: Generate text that is consistent with a specific style
Instructions: The model should be trained on simpler styles before moving on to more complex styles
Prompt formula: "Use curriculum learning to generate text that is consistent with the following styles [insert styles] in the following order [insert order]

17. Sentiment analysis prompts

Sentiment analysis is a technique that allows a model to determine the emotional tone or attitude of a piece of text, such as whether it is positive, negative, or neutral.

? Example

Task: Determine the sentiment of customer reviews
Instructions: The model should classify the reviews as positive, negative, or neutral
Prompt formula: "Perform sentiment analysis on the following customer reviews [insert reviews] and classify them as positive, negative, or neutral."

18. Named entity recognition prompts

Named entity recognition (NER) is a technique that allows a model to identify and classify named entities in text, such as people, organizations, locations, and dates.

? Example

Task: Identify and classify named entities in a news article
Instructions: The model should identify and classify people, organizations, locations, and dates
Prompt formula: "Perform named entity recognition on the following news article [insert article] and identify and classify people, organizations, locations, and dates."

19. Text classification prompts

Text classification is a technique that allows a model to categorize text into different classes or categories. This technique is useful for tasks such as natural language processing, text analytics, and sentiment analysis.

? Example

Task: Classify customer reviews into different categories such as electronics, clothing and furniture
Instructions: The model should classify the reviews based on their content
Prompt formula: "Perform text classification on the following customer reviews [insert reviews] and classify them into different categories such as electronics, clothing and furniture based on their content."

20. Text generation prompts

Text generation prompts can be used to fine-tune a pre-trained model or to train a new model for specific tasks.

? Example

Task: Generate a story based on a given prompt
Instructions: The story should be at least 1000 words and include a specific set of characters and a plot
Prompt formula: "Generate a story of at least 1000 words, including characters [insert characters] and a plot [insert plot] based on the following prompt [insert prompt].

21. 总结

这是一本关于如何使用 Prompt 来更好使用自然语言模式的教程,对大部分 Prompt 做了分类和样例,是一本非常不错的 Prompt 工具书。

笔记来源:The Art of Asking ChatGPT for High-Quality Answers A Complete Guide to Prompt Engineering Techni