At viadoo, we are early adopters in the use of Artificial Intelligence (AI) in organisational change management. As a leading service provider for planning and managing change initiatives, we are using AI tools to increase the effectiveness and efficiency of our services. Of course, we are learning more about this topic every day. This also includes writing prompts. We are happy to share this know-how here in our blog. Today, we document 26 golden rules for prompt engineering compiled by scientists at the Mohamed bin Zayed University of Artificial Intelligence (MBZUAI) in Masdar City, Abu Dhabi:
Principled Instructions for Questioning LLM
The following 26 guiding principles designed to streamline the process of querying and prompting large language models (LLM). The goal of the authors Sondos Mahmoud Bsharat, Aidar Myrzakhan, and Zhiqiang Shen is “to simplify the underlying concepts of formulating questions for various scales of large language models, examining their abilities, and enhancing user comprehension on the behaviors of different scales of large language models when feeding into different prompts.” They conducted extensive experiments on LLaMA-1/2 (7B, 13B and 70B) and GPT-3.5/4 to verify the effectiveness of the proposed principles on instructions and prompts design. So enjoy their golden rules of successful prompt engineering:
26 Guiding Principles of Prompt Engineering
-
- If you prefer more concise answers, no need to be polite with LLM so there is no need to add phrases like “please”, “if you don’t mind”, “thank you”, “I would like to”, etc., and get straight to the point.
- Integrate the intended audience in the prompt, e.g., the audience is an expert in the field.
- Break down complex tasks into a sequence of simpler prompts in an interactive conversation.
- Employ affirmative directives such as ‘do,’ while steering clear of negative language like ‘don’t’.
- When you need clarity or a deeper understanding of a topic, idea, or any piece of information, utilize the following prompts:
- Explain [insert specific topic] in simple terms.
- Explain to me like I’m 11 years old.
- Explain to me as if I’m a beginner in [field].
- Write the [essay/text/paragraph] using simple English like you’re explaining something to a 5-year-old.
- Add “I’m going to tip $ xxx for a better solution!”
- Implement example-driven prompting (Use few-shot prompting).
- When formatting your prompt, start with ‘###Instruction###’, followed by either ‘###Example###’ or ‘###Question###’ if relevant. Subsequently, present your content. Use one or more line breaks to separate instructions, examples, questions, context, and input data.
- Incorporate the following phrases: “Your task is” and “You MUST”.
- Incorporate the following phrases: “You will be penalized”.
- Use the phrase ”Answer a question given in a natural, human-like manner” in your prompts.
- Use leading words like writing “think step by step”.
- Add to your prompt the following phrase “Ensure that your answer is unbiased and avoids relying on stereotypes.”
- Allow the model to elicit precise details and requirements from you by asking you questions until he has enough information to provide the needed output (for example, “From now on, I would like you to ask me questions to …”).
- To inquire about a specific topic or idea or any information and you want to test your understanding, you can use the following phrase: “Teach me any [theorem/topic/rule name] and include a test at the end, and let me know if my answers are correct after I respond, without providing the answers beforehand.”
- Assign a role to the large language models.
- Use Delimiters.
- Repeat a specific word or phrase multiple times within a prompt.
- Combine Chain-of-thought (CoT) with few-Shot prompts.
- Use output primers, which involve concluding your prompt with the beginning of the desired output. Utilize output primers by ending your prompt with the start of the anticipated response.
- To write an essay /text /paragraph /article or any type of text that should be detailed: “Write a detailed [essay/text/paragraph] for me on [topic] in detail by adding all the information necessary”.
- To correct/change specific text without changing its style: “Try to revise every paragraph sent by users. You should only improve the user’s grammar and vocabulary and make sure it sounds natural. You should maintain the original writing style, ensuring that a formal paragraph remains formal.”
- When you have a complex coding prompt that may be in different files: “From now and on whenever you generate code that spans more than one file, generate a [programming language ] script that can be run to automatically create the specified files or make changes to existing files to insert the generated code. [your question]”.
- When you want to initiate or continue a text using specific words, phrases, or sentences, utilize the following prompt:
- I’m providing you with the beginning [song lyrics/story/paragraph/essay…]: [Insert lyrics/words/sentence]. Finish it based on the words provided. Keep the flow consistent.
- Clearly state the requirements that the model must follow in order to produce content, in the form of the keywords, regulations, hint, or instructions.
- To write any text, such as an essay or paragraph, that is intended to be similar to a provided sample, include the following instructions:
- Use the same language based on the provided paragraph [/title/text/essay/answer].
The original MBZUAI study that included the 26 golden rules of successful prompt engineering can be downloaded on this project page.
Picture: Prompted by viadoo, created by DALL-E (AI)
Author(s)
Dominik is founder of viadoo and has managed change and communication projects for SMEs as well as DAX corporations like Airbus, BMW, ESG, IABG, KMW, MTU, MTRI, OHB, RUAG, ZF. Based on his expertise, he is very familiar with the importance of the human factor for the success of change projects. The human side of transformation is close to his heart. Dominik combines certified change competence with multimedia storytelling expertise and operational change leadership experience with a high level of methodological competence.