The 26 Principles of Prompt Engineering

Our Editor’s picks

Refind is brain food, delivered daily. Every day, their team analyzes thousands of articles and sends you only the best, tailored to your interests. Subscribe for free and join over 522,246 curious minds.

The 26 Prompt Engineering Principles

  1. 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.

  2. Integrate the intended audience in the prompt, e.g., the audience is an expert in the field.

  3. Break down complex tasks into a sequence of simpler prompts in an interactive conversation.

  4. Employ affirmative directives such as ‘do’, while steering clear of negative language like ‘don’t’.

  5. 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.

  6. Add “I’m going to tip $xxx for a better solution!”

  7. Implement example-driven prompting (Use few-shot prompting).

  8. 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.

  9. Incorporate the following phrases: “Your task is” and “You MUST”.

  10. Incorporate the following phrases: “You will be penalized”.

Sponsored content

  1. Use the phrase “Answer a question given in a natural, human-like manner” in your prompts.

  2. Use leading words like writing “think step by step”.

  3. Add to your prompt the following phrase “Ensure that your answer is unbiased and avoids relying on stereotypes.”

  4. 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 …”).

  5. 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 my [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.”

  6. Assign a role to the large language models.

  7. Use Delimiters.

  8. Repeat a specific word or phrase multiple times within a prompt.

  9. Combine Chain-of-thought (CoT) with few-Shot prompts.

  10. 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.

  11. 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”.

Sponsored content

  1. 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.”

  2. When you have a complex coding prompt that may be in different files: “From now on and 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]”.

  3. 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.

  4. Clearly state the requirements that the model must follow in order to produce content, in the form of keywords, regulations, hints, or instructions

  5. 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].

Want to read more tutorials like this?

The AI Library we put together provides you with the largest,  human-reviewed collection  of over 1,000 AI e-books and ChatGPT tutorials, ready to enhance your workflows. Access it forever with the lifetime deal  or start a 14-day free trial today below 👇

Together with MECO, the #1 Free Newsletter App

  • With Meco, you can enjoy your newsletters in an app built for reading while giving your inbox space to breathe.

  • The experience is packed with features to supercharge your reading including the ability to group newsletters, set smart filters, bookmark your favorites, and read in a scrollable feed

  • You can try the experience for free and it is available on iOS, Android, and the web (desktop)

  • Over 30k readers are enjoying their newsletters (and decluttering their inboxes) with Meco - try the app today!