Prompt Engineering Guides 2023, Tips for Designing Prompts

Prompt Engineering Guides 2023.

Designing Prompts have been one of the important for the Prompt Engineers. Therefore, we have come up with few things to remember and the General tips for Designing Prompts under the heading Prompt Engineering Guides 2023.

The Beginning

When beginning the process of designing prompts, it is important to remember that it is an iterative journey that necessitates extensive experimentation to achieve optimal outcomes. A good starting point is to utilize a straightforward playground such as OpenAI’s or Cohere’s.

You can commence with uncomplicated prompts and gradually incorporate additional elements and context as you strive for improved outcomes. It is crucial to version your prompt along the way for this purpose. Throughout the guide, you will encounter numerous examples illustrating how specificity, simplicity, and conciseness frequently yield superior results.

See Examples: Examples of Prompt Engineering

When faced with a substantial task involving multiple subtasks, it is advisable to break down the task into simpler components and gradually build upon them as you attain better outcomes. This approach prevents overwhelming the prompt design process with excessive complexity at the outset.

Prompt Engineering Guides 2023

Instruction

To generate effective prompts for various straightforward tasks, employ commands to instruct the model regarding the desired objective, such as “Write,” “Classify,” “Summarize,” “Translate,” “Order,” and so on.

Remember that extensive experimentation is necessary to determine the most effective approach. Attempt different instructions with varied keywords, contexts, and data to identify the optimal strategy for your specific use case and task. Typically, the task’s performance improves when the context provided is specific and relevant. In the upcoming guides, we will delve into the significance of sampling and incorporating more context.

Some experts recommend placing instructions at the beginning of the prompt. It is also advised to use a clear separator like “###” to demarcate the instruction and the context.

For instance:

Prompt:

### Instruction ###
Translate the text below to Spanish:

Text: "hello!"

Output:

¡Hola!

Specificity

Ensure that your instructions and task descriptions are highly specific. The prompt’s effectiveness improves with greater descriptive and detailed information, particularly when aiming for a desired outcome or generation style. There are no specific tokens or keywords that guarantee better results; instead, focus on maintaining a well-structured and descriptive prompt. Including examples within the prompt proves to be highly effective in achieving desired outputs in specific formats.

When designing prompts, consider the length limitations imposed. Balancing specificity and detail is crucial. Excessive unnecessary details are not recommended. The details provided should be relevant and contribute to the task at hand. Experimentation plays a vital role in finding the right balance. We strongly encourage ample experimentation and iteration to optimize prompts for your specific applications.

As an example, let’s construct a simple prompt for extracting specific information from a given text.

Prompt:

Extract the name of places in the following text. 

Desired format:
Place: <comma_separated_list_of_company_names>

Input: "Although these developments are encouraging to researchers, much is still a mystery. “We often have a black box between the brain and the effect we see in the periphery,” says Henrique Veiga-Fernandes, a neuroimmunologist at the Champalimaud Centre for the Unknown in Lisbon. “If we want to use it in the therapeutic context, we need to understand the mechanism."

Output:

Place: Champalimaud Centre for the Unknown, Lisbon

The input text is obtained from this Nature article.

Prompt Engineering Guides 2023
Image: Business Solution

Avoid Impreciseness

Given the tips above about being detailed and improving format, it’s easy to fall into the trap of wanting to be too clever about prompts and potentially creating imprecise descriptions. It’s often better to be specific and direct. The analogy here is very similar to effective communication — the more direct, the more effective the message gets across.

For example, you might be interested in learning the concept of prompt engineering. You might try something like:

Explain the concept of prompt engineering. Keep the explanation short, only a few sentences, and don't be too descriptive.

It’s not clear from the prompt above how many sentences to use and what style. You might still somewhat get good responses with the above prompts but the better prompt would be one that is very specific, concise, and to the point. Something like:

Use 2-3 sentences to explain the concept of prompt engineering to a high school student.

To do or not to do?

Another common tip when designing prompts is to avoid saying what not to do but say what to do instead. This encourages more specificity and focuses on the details that lead to good responses from the model.

Here is an example of a movie recommendation chatbot failing at exactly what I don’t want it to do because of how I wrote the instruction — focusing on what not to do.

Prompt:

The following is an agent that recommends movies to a customer. DO NOT ASK FOR INTERESTS. DO NOT ASK FOR PERSONAL INFORMATION.

Customer: Please recommend a movie based on my interests.
Agent: 

Output:

Sure, I can recommend a movie based on your interests. What kind of movie would you like to watch? Do you prefer action, comedy, romance, or something else?

Here is a better prompt:

Prompt:

The following is an agent that recommends movies to a customer. The agent is responsible to recommend a movie from the top global trending movies. It should refrain from asking users for their preferences and avoid asking for personal information. If the agent doesn't have a movie to recommend, it should respond "Sorry, couldn't find a movie to recommend today.".

Customer: Please recommend a movie based on my interests.
Agent:

Output:

Sorry, I don't have any information about your interests. However, here's a list of the top global trending movies right now: [list of movies]. I hope you find something you like!

Some of the examples above were adopted from the “Best practices for prompt engineering with OpenAI API” article.

At Last,

We have tried to make it as simple as possible for you to understand the basic Prompt Engineering Guides 2023. Stay with Prompt Engineering Guides for further more tips and guides in future.

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top