跳到主要内容

Optimizing Your Prompt

What is Basic Prompt?

A prompt is used to initiate a Large Language Model and guide it to generate text of a specific type or style. These prompts can be a word, a sentence, or even a dialogue. In the case of conversational robots, the prompts are usually the user's questions or requests.

When we provide a prompt to the robot, it generates a response based on this prompt. This response is based on the patterns the robot learned during the training process and its understanding of the prompt.

Therefore, prompts are a key part of the robot's understanding and responding to user requests. It helps the robot understand the user's needs and generate appropriate responses.

How to create a good prompt?

Different Large Language Models may have different tricks for creating prompts, and it is recommended that you test different prompts with the model you choose to find the best way to create prompts.

Basic Guidelines for Creating Prompts

Here are some basic guidelines for creating prompts:

1. Define your Goal

Clearly articulate what you want from the model's response. This helps in shaping your prompt.

2. Be Specific

Large language models respond to the specifics of a prompt. If you are vague or ambiguous, the model may not return the desired results.

3. Contextual Clues

Provide as much relevant context as possible within your prompt. The context helps the model generate more accurate and relevant responses.

4. Directness

You may need to be more direct than you would with a human. For example, instead of asking "Can you tell me...?", you might say, "Describe in detail...".

5. Experiment

Different prompts can lead to different outputs, so experimentation is key. Try rewriting the prompt in different ways if the output is not what you expected.

6. Review and Refine

Based on the responses you receive, you can refine your prompts to better achieve the desired outcomes.

Less Effective Prompt VS Better Prompt

For the above seven guidelines, examples of less effective prompts and better prompts are provided here.

ConsiderationLess Effective PromptBetter Prompt
Define your GoalTell me something.Provide a summary of the book "1984" by George Orwell.
Be SpecificWhat's the weather?What's the weather like in New York City right now?
Contextual CluesTranslate this.Translate the phrase "I love you" from English to French.
DirectnessCan you tell me about photosynthesis?Describe the process of photosynthesis in plants.
ExperimentWrite a poem.Write a poem in the style of Robert Frost about winter.
Review and RefineTell me about World War II.Provide a detailed timeline of major events during World War II.

Tips for Applying Guidelines

Remember, these suggestions indeed share some overlap, but they each emphasize a particular aspect of designing effective prompts to guide and optimize the model's output. When creating prompts for your AI application, you can check for yourself whether these seven guidelines have been met.

SuggestionKey Aspect
Define your GoalTell the model what you want.
Be SpecificEmphasizes the need for detail and precision in the prompt.
Contextual CluesGive more background information.
DirectnessMake the request clear and straightforward.
ExperimentTry different ways of asking.
Review and RefineImprove prompts based on the model's responses.

In practice, these considerations often work together to help you craft better prompts.

Online learning resources for creating prompts

With the rapid development and application of Large Language Models, people from all over the world are exploring how to use AI better.

Therefore, we have collected some websites that currently provide high-quality content for learning prompts, as shown below: