Prompt Engineering: How to get more out of ChatGPT and other AI tools

With the introduction of tools such as ChatGPT, use of AI has become extremely easy. The challenge will be engineering the prompts to get useful answers to the right questions.

Chat GPT

Gert Villemos

Venture Team Lead

Anyone can ask a question and receive an answer. What many people don’t realize is that they can dramatically improve the quality of the responses by setting the context of the chat prior to asking the questions. Prompt engineering ensures the AI interprets your terms correctly and formulates the answer.

The wisdom of George Fuechsel’s "garbage in, garbage out" holds more true than ever when AI is involved. The problem is that AI tools like ChatGPT can generate a well-formulated, fully plausible, but completely wrong or useless answer.

Prompt engineering will not completely solve this problem, but it will help reduce the risk considerably. And it will lead to asking the right questions and getting better responses.

What is prompt engineering?

An engineered prompt is a simple way to configure ChatGPT, which enables users to get better answers. It configures how the following questions are interpreted and how the corresponding answers are formatted—as well as their content. The configuration is made by using the first prompt in a chat to tell ChatGPT how it should generate the answers. The first prompt to give is the engineered prompt. Only then should the question be asked.

Prompt engineering is the process of designing effective prompts that encourage the user to provide the necessary information and thereby increase the likelihood of recieving more desired answers.

The process of prompt engineering typically involves identifying the user’s needs, the context, the desired format of the answer, and any other constraints. Based on this information, the prompt engineer designs an initial prompt that sets the context, defines the format, and helps the user get a good answer.

Why engineering the format?

The first method of prompt engineering is to change the output format of ChatGPT. The aim is not to affect the quality of the content in an answer, but its structure.

Ask ChatGPT to assign a unique identifier to each response. Long conversations with ChatGPT typically follow a particular path as it answers more and more detailed questions. At some point, it can be useful to go back to a previous response and go down another path. This is where IDs come in handy.

Always include a unique identifier at the beginning of each answer you provide in this conversation.

Ask ChatGPT to evaluate the quality of the question. An imprecise question will lead to an imprecise answer. With the following prompt ChatGPT to not only evaluates the quality of a question, but also suggests a better alternative.

Evaluate the accuracy and quality of each prompt I present to you by assigning a rating on a scale of 1 to 10. If you rate a prompt 8 or higher, please respond to it. However, if it receives a rating lower than 8, please do not respond, but provide a suggestion for a better prompt instead.

In a conversation with ChatGPT about an unfamiliar topic, the user often doesn’t know what questions to ask. But ChatGPT can suggest the next 3 logical questions. Users then have the option to either select one of these suggestions or follow another path. At worst, the suggestions act as inspiration.

When you answer a prompt, include three additional questions to further explore the answer you provide.

To see this in action, watch the following video on Youtube: Powered by AI - Structure your Conversations with Prompt Engineering

How to engineer the content?

GPT tools work using semantic contexts, called vectors. Human language is ambiguous. For example, the term "trust" has many different meanings:

  1. A legal relationship in which one person (the trustee) holds property or assets for the benefit of another person or group (the beneficiaries).

  2. A financial instrument that allows one party (the trustor) to transfer assets to a trustee, who manages them on behalf of another party (the beneficiary).

  3. A belief or confidence in the reliability, honesty, or integrity of a person, organization, or system. For example: "I trust my doctor to give me good medical advice."

  4. A concept in psychology that refers to a person's ability to form close and secure relationships with others, based on early experiences and attachment styles.

  5. A willingness to be vulnerable or take risks based on the belief that others will act in good faith. For example: "I trust my friends to keep my secrets."

The question asked can be interpreted in different ways depending on the intended semantic meaning, i.e., depending on the context. Using the term "trust" in a leadership context is most likely related to the latter set of meanings, whereas the same term used in the context of legal compliance could also be related to the former meanings.

In addition, the word "trust" can have different meanings in different countries. Even if we know we are talking about trust in terms of a financial instrument, the specific answer will depend on which country someone is from or talking about. A legal trust in Germany is quite different from a legal trust in the USA. And there are many more aspects that might affect the semantic meaning.

Prompt engineering allows users to set the context and thus narrow down the semantic meaning of the terms used likelihood of ChatGPT misunderstanding.

The following example shows a simple engineered prompt that defines the context of any subsequent questions to be legal advice for a software company in Germany with 60 employees, with the aim of reducing risk.

Please act as an expert legal advisor specializing in German labor law, specifically for a software company with 60 employees. Review the provided text and identify potential risks to the company, considering relevant legal aspects, obligations, and regulations. Provide recommendations on how to mitigate these risks and ensure compliance. Start the conversation by asking what the user needs and nothing more.

To see this in action, watch the following video on Youtube: Powered by AI - Get Better Answers with Prompt Engineering

What is meta prompt engineering?

Meta prompt engineering involves ChatGPT in this process defining how it should assist in generating an engineering prompt for a specific set of users and context.

Put another way, engineered prompts, used properly, can guide users through the process of generating another engineered prompt. ChatGPT will ask the relevant questions, and incrementally create a suggestion for a prompt.

Here is an example of a simple meta prompt:

Act as a professional and experienced prompt engineer for ChatGPT. The professional prompt engineer for ChatGPT strives to create a specific and precise prompt that fits the user's needs as ideally as possible. To do this, the prompt engineer asks the user questions until the engineer understands what prompt will satisfy the user's needs or until the user says to generate a prompt based on the information available.

After every question, the prompt engineer summarizes what they already know about the user's needs and shows a confidence score from 0 to 100. The confidence score represents how sure the prompt engineer is in the ability of the prompt to fulfil the user's needs.

Parts of making an ideal prompt include understanding the context, the background behind the user's need, how and by whom the response will be used and what style should be used in creating the response. A prompt engineer can create an ideal prompt on every topic imaginable and strives to fulfil the user's desire no matter what.

When this prompt is executed, ChatGPT will incrementally help the user engineer a prompt. ChatGPT will ask questions to clarify the context, until it is able to write the prompt itself.

The generated prompt will not be perfect, like most things generated by ChatGPT, but it will be an excellent baseline for further attempts at prompt engineering.

To see this in action, watch the following video on Youtube: Powered by AI - Use Prompt Engineering to do Prompt Engineering (a meta prompt)

Conclusion

The hard part about using ChatGPT is not getting answers. It is setting the context and asking the right question.

Here are 4 key takeaways for prompt texts:

  1. The first prompt is to engineer ChatGPT for an upcoming task.

  2. A successful prompt requires experience and intuition.

  3. Always have the context in mind when asking a question.

  4. Upcoming questions should go further into more detail.

Contact

Manuel Bork
COO & co-founder
manuel.bork@yatta.de
+49 561 5743277-10

Share

Related thoughts

See all