chatGPT prompt tips

Prompt formulas are Prompt-specific formats that typically consist of three main elements:

  1. Task: State clearly and concisely what the Prompt asks the model to generate.
  2. Instructions: Instructions that the model should follow when generating text.
  3. Role: The role the model should play when generating text.

Command Prompt Technology

Instruction Prompt technology is a method to guide the output of ChatGPT by providing specific instructions. This technique
is useful for ensuring relevant and high-quality output.

  • Prompt formula: "Generate [task] following instructions: [instructions]"

Example:

Generate customer service responses:
Task: Generate responses to customer inquiries
Directive: Responses should be professional and provide accurate information

Prompt formula : "Generate professional and accurate responses to customer inquiries as follows: Responses should be professional
and provide accurate information."

Generate legal documents:
Task: Generate legal documents
Directive: Documents should comply with relevant laws and regulations

Prompt formula : "Generate legal documents that comply with relevant laws and regulations as follows: Documents shall comply with
relevant laws and regulations."

Role Prompt Technology

The role prompt technique is a way to guide the output of ChatGPT by specifying a specific role to be played by the model
. This technique is very useful for generating text tailored to a specific context or audience.
To use the role prompt technique, you need to provide a model with an explicit and specific role. For example, if you
are generating customer service responses, you might provide a role such as "Customer Service Representative".

  • Prompt formula: "Spawn [task] as [role]"

Example:

Generating Customer Service Responses:
Task: Generate Responses to Customer Inquiries
Role: Customer Service Representative
Prompt Formula: "Generate responses to customer inquiries as a Customer Service Representative."

Generate Legal Documents:
Task: Generate Legal Documents
Role: Lawyer
Prompt Formula: "Generate Legal Documents as Lawyer."

The following is an example of how the command prompt technique, role prompt technique, and seed word prompt technique can be used together
:

Task: Generate a product description for a new smartphone
Directive: The description should be informative, persuasive, and highlight the unique features of the smartphone
Role: Marketing representative
Seed word: "Innovative"

  • Prompt formula : "As a marketing representative, generate an informative and persuasive product description that
    highlights the innovative features of a new smartphone. A smartphone has the following characteristics [insert your characteristic]"

Task: Write a review of a new smartphone
Prompt formula: "Generate a review of a new smartphone"
Furthermore, standard prompts can be combined with other techniques, such as character prompts and seed word prompts,
to enhance the output of ChatGPT. Here is an example of
how the standard prompt technique, the role prompt technique, and the seed word prompt technique work together : Task: Generate a product review for a new laptop Directive: Reviews should be objective, informative, and highlight unique features of the laptop Role : Technologist seed Word: "mighty"




  • Prompt formula: "As a tech expert, generate an objective and informative product review
    highlighting the great features of your new laptop."

In this example, standard prompt techniques are used to ensure that the model generates product reviews. The role Prompt Technique
is used to ensure that reviews are written from a technical expert's point of view. Seed word prompt technology is used to ensure that reviews focus on
the laptop's strong features.

Zero sample, one sample and few sample prompting

Zero-shot, one-shot, and few-shot Prompting is a technique for generating text using ChatGPT with
minimal or no examples.
These techniques are useful when there is limited data for a specific task or when the task is new and not well defined .

  • The zero-sample prompting technique is used when no samples are available for the task. A generic task is given to the model, and it
    generates text based on its understanding of the task.
  • The one-sample prompting technique is used for tasks where only one sample is available. Examples are provided to the model, and it
    generates text based on its understanding of the examples.
  • Prompt formula: "Generate text based on [number] samples"

Example:
Generate a product description for a new product for which no samples are available:
Task: Write a product description for a new smartwatch

  • Prompt formula: "For this new smartwatch, generate a product description from zero samples"

Compare a new smartphone with the latest iPhone using a working example:
Task: Compare a new smartphone with the latest iPhone

  • Prompt formula: "Do a product comparison of this new smartphone using a sample (latest iPhone)
    "

For the few samples available, generate a product review:
Task: Write a review of a new e-reader

  • Prompt formula: "For this new e-reader,
    generate reviews using a small sample (three other e-readers)"

Let GPT think

The "Let's think about it" prompt is a technique used to encourage ChatGPT to generate reflective and contemplative text.
This technique is useful for tasks such as writing essays, poetry, or creative writing.

The formula for the “Let's think about it” prompt is simply to say “ 让我们思考一下” followed
by a topic or question.

Generating a Reflective Essay:
Task: Write a reflective essay about personal growth

  • Prompt formula: "Let's Think About This: Personal Growth"

Generating a Poem:
Task: Write a poem about changing seasons

  • Prompt formula: "Let's think about this: seasonal changes"

To use the "Let's Think About This" prompting technique with ChatGPT for conversation or text generation, you can follow the
steps below:

  1. Identify topics or ideas to discuss.
    • Prompt: "Let's think about the impact of climate change on agriculture"
  2. Formulate a prompt that clearly states a topic or idea and starts a conversation or text generation.
    • Prompt: "Let's Discuss the State of AI"
  3. Preface the prompt with "Let's think" or "Let's discuss" to indicate that you are initiating a conversation or discussion.
    • Prompt: "Let's talk about the pros and cons of working remotely"

self-consistency hint

Self-consistent hinting is a trick used to ensure that the output of ChatGPT is consistent with the provided input.

This technique is useful for tasks such as fact checking, data validation, or consistency checking in text generation.

Example 1: Text Generation
Task: Generate a product review
Description: The review should match the product information provided in the input Prompt
formula: "Generate a 一致的product review with the following product information [insert product information]"

Example 2: Text Summary
Task: Summarize a news article
Instructions: The summary should be consistent with the information provided in the article Prompt formula: " Summary the following news article [insert news article]
with the information provided below "一致的方

Example 3: Text Completion
Task: Complete a sentence
Instructions: Completion should be consistent with the context provided in the input Prompt
formula: " 一致的Complete the following sentence [insert sentence] in the context provided"

Example 4: Fact Check:
Task: Check consistency in a given news article
Input text: "The article mentions that the city has a population of 5 million, but then it says the city has a population of 7 million." Prompt formula
: " Please make sure of the following text 自我一致: The article mentions the city's population as 5 million, but then it says the city's population is 7 million."

Data Validation:
Task: Check for consistency in a given dataset Input
text: "Data shows that the average temperature in July is 30 degrees, but the lowest recorded temperature is 20 degrees." Prompt
formula: "Please ensure that the following text is self-consistent: The data shows The average temperature in July was 30 degrees, but the lowest temperature recorded was 20 degrees."

seed word hints

Seed word hints can be combined with character hints and instruction hints to create more specific and targeted generated text. By providing a seed word or phrase, the model can generate text related to that seed word or phrase, and by providing information about the desired output and character, the model can generate text in a specific style or tone consistent with the character or instruction. This allows for greater control over the generated text and can be used in a variety of applications.

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

Knowledge Generation Tips

To use this hint in ChatGPT, a question or topic should be given as input to the model and a hint specifying the task or goal of generating text. The hint should include information about the desired output, such as the type of text to produce and any specific requirements or restrictions.

Knowledge Integration :
Task: Integrate new information with existing knowledge
Instructions: Integration should be accurate and topic-related
Prompt formula: "Integrate the following information with existing knowledge on [specific topic]: [insert new information]"

Connect information
Task: Connect disparate information
Instructions: Connections should be related and logical
Prompt formula: "Connect the following information in a related and logical way: [insert information 1] [insert information 2]"

Data Analysis:
Task: Generate insights about customer behavior from a given dataset Prompt
formula: "Please generate new and original information about customer behavior from this dataset"

Sentiment Analysis
Task: Classify text as positive, neutral, or negative
Description: Classification should be one of the predefined options Prompt
formula: "Classify the following text as positive, neutral, or negative by selecting one of the following options of:
[insert text] [positive] [neutral] [negative]”

Interpretability Soft Tips

Interpretability soft hinting is a technique that allows control over the text generated by a model while providing more flexibility. This is done by feeding the model a controlled set of inputs along with other information about the desired output.
This technique provides more interpretable and controllable generated text.

Example 1: Text Generation
Task: Generate a story
Instructions: The story should be based on a given character and a specific topic
Prompt formula: "Generate a story based on the following characters: [insert character] and topic: [insert topic]"

Example 2: Text Completion
Task: Complete a sentence
Description: Completion should be in the style of a specific author
Prompt formula: "Complete the following sentence in the style of [specific author]: [insert sentence]"

Example 3: Language Modeling
Task: Generate text in a specific style
Description: Text should conform to the style of a specific period
Prompt formula: "Generate text in the style of [specific period]: [insert context]"

control generation

Example 1: Text Generation
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]"

Example 2: Text Completion
Task: Complete a sentence
Description: Completion should use a specific vocabulary
Prompt formula: "Complete the following sentence using the following vocabulary: [insert vocabulary list]: [insert sentence]"

Example 3: Language Modeling
Task: Generate text in a specific style
Description: Text should follow specific grammatical rules
Prompt formula: "Generate text that follows the following grammatical rules: [insert rule]: [insert content]"

Reinforcing and Countering Tips

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

To use adversarial hints with ChatGPT, the model should be fed a hint designed to have difficulty generating
text consistent with the desired output. The hint should also include information about the desired output, such as
the type of text to produce and any specific requirements or restrictions.

Example 1: Adversarial Prompts for Text Classification
Task: Generate text that is classified as a specific label
Description: Generated text should be difficult to classify as a specific label
Prompt formula: "Generate text that is difficult to classify as [insert label]"

Example 2: Adversarial Prompts for Sentiment Analysis
Task: Generate text that is difficult to classify as a specific sentiment
Description: Generated text should be difficult to classify as a specific sentiment
Prompt formula: "Generate text that is difficult to classify as [insert sentiment]"

Example 3: Adversarial hints for language translation
Task: Generate hard-to-translate text
Description: The generated text should be hard-to-translate into the target language
Hint formula: "Generate hard-to-translate text into [insert target language]"

Reinforcement learning hinting is a technique that allows a model to learn from its past behavior and
improve its performance over time. To use ChatGPT's reinforcement learning cues, the model should be
given a set of inputs and rewards and allowed to adjust its behavior based on the rewards received. Prompts
should also include information about the desired output, such as the tasks to be accomplished and any specific requirements
or constraints.

Example 1: Reinforcement Learning for Text Generation
Task: Generate text consistent with a specific style
Description: The model should adjust its behavior based on the reward for generating text consistent with a specific style Prompt
formula: "Use reinforcement learning to generate text consistent with the following style [insert style]"

Example 2: Reinforcement Learning for Language Translation
Task: Translate text from one language to another
Description: The model should adjust its behavior based on the reward for producing an accurate translation Prompt formula
: "Use reinforcement learning to translate the following text [insert text] translated from [insert language]
to [insert language]”

Example 3: Reinforcement Learning for Question Answering
Task: Answer a question
Description: The model should adjust its behavior based on the reward for generating an accurate answer Prompt formula
: "Use reinforcement learning to generate an answer to the following question [insert question]"
Therefore, this technique is useful for Decision making, gameplay, natural language generation, and more

Guess you like

Origin blog.csdn.net/RandyHan/article/details/130511070