The other day, I found this paper with interesting findings for anyone who wants to write better prompts.
The researchers created a list of prompt principles and tested them to see how much they improve the quality of large language models (LLMs) responses.
However, if you read the abstract or conclusion, it’s not obvious which principles work and which don’t (spoiler: not all the principles significantly improved LLMs response)
I read the entire paper to find the best prompt principles. In this article, I’ll list the top 10 prompt principles you need to follow, show bad vs good prompts, and explain how I apply the best principles in my own AI workflows (copy-and-paste prompts included)
The researchers created a list of prompt principles and tested them to see how much they improve the quality of large language models (LLMs) responses.
However, if you read the abstract or conclusion, it’s not obvious which principles work and which don’t (spoiler: not all the principles significantly improved LLMs response)
I read the entire paper to find the best prompt principles. In this article, I’ll list the top 10 prompt principles you need to follow, show bad vs good prompts, and explain how I apply the best principles in my own AI workflows (copy-and-paste prompts included)
The 10 best principles (sorted by response improvement)
You shouldn’t follow all 26 prompt principles!
Principles #25 and #26 improve the response dramatically, but #1 has little to no positive impact on the response (being polite or not to LLMs appears to be irrelevant).
Here are the top 10 principles to follow (treat them as guidance, not strict rules).
Principle #14: Have the model ask clarifying questions
Use the prompt “From now on, I would like you to ask me questions to ...” to allow the model to ask you questions until it has enough information to provide the needed output.
Bad prompt: Create a workout plan for me.
Good prompt: I want to create a personalized workout plan. From now on, I would like you to ask me questions to gather the information you need to provide the best plan.
Use the prompt “From now on, I would like you to ask me questions to ...” to allow the model to ask you questions until it has enough information to provide the needed output.
Bad prompt: Create a workout plan for me.
Good prompt: I want to create a personalized workout plan. From now on, I would like you to ask me questions to gather the information you need to provide the best plan.
Principle #26: Copy the language and style of a provided example
This is also known as one-shot prompt. Here, we provide the AI model with a single example to guide its output.
Bad prompt: Write another product description for wireless earbuds.
Good prompt: Write a product description for wireless earbuds that is similar to the sample attached. Please use the same language, tone, and structure as the sample provided. Do not copy phrases.
This is also known as one-shot prompt. Here, we provide the AI model with a single example to guide its output.
Bad prompt: Write another product description for wireless earbuds.
Good prompt: Write a product description for wireless earbuds that is similar to the sample attached. Please use the same language, tone, and structure as the sample provided. Do not copy phrases.
Principle #5: Ask for simple explanations when you need clarity
You should include one of the instructions below in your 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.
Bad prompt: Explain blockchain.
Good prompt: Explain blockchain to me as if I’m a beginner in technology.
You should include one of the instructions below in your 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.
Bad prompt: Explain blockchain.
Good prompt: Explain blockchain to me as if I’m a beginner in technology.
Principle #2: Name the intended audience
Bad prompt: Explain quantum computing.
Good prompt: Explain quantum computing to a high school student with no physics background.
Bad prompt: Explain quantum computing.
Good prompt: Explain quantum computing to a high school student with no physics background.
Principle #24: Continue text with specific words or sentences
Bad prompt: Continue this story: John walked into the room
Good prompt: I’m providing you with the beginning of a story: John walked into the room. Continue it using these words: mysterious, shadow, whisper. Finish based on the words provided, keeping the flow consistent
Principle #15: Test your understanding
This principle is about using this prompt to test your understanding: Teach me the [any theorem/topic/rule name] and include a test at the end, but don’t give me the answers, and then tell me if I got the answer right when I respond.
Bad prompt: Teach me photosynthesis.
Good prompt: Teach me photosynthesis and include a test at the end, but don’t give me the answers. Then tell me if I got the answers right when I respond.
This principle is about using this prompt to test your understanding: Teach me the [any theorem/topic/rule name] and include a test at the end, but don’t give me the answers, and then tell me if I got the answer right when I respond.
Bad prompt: Teach me photosynthesis.
Good prompt: Teach me photosynthesis and include a test at the end, but don’t give me the answers. Then tell me if I got the answers right when I respond.
Principle #25: State clear requirements
The requirements can be in the form of keywords, regulations, hints, or instructions.
Bad prompt: Write a product review
Good prompt: Write a product review following these requirements: Keywords to include: durable, affordable, eco-friendly. Must mention: battery life, build quality. Tone: professional but approachable. Length: 150-200 words
The requirements can be in the form of keywords, regulations, hints, or instructions.
Bad prompt: Write a product review
Good prompt: Write a product review following these requirements: Keywords to include: durable, affordable, eco-friendly. Must mention: battery life, build quality. Tone: professional but approachable. Length: 150-200 words
Principle #4: Use affirmative “do“ (avoid negative language)
Bad prompt: Don’t give me a long explanation. Don’t use technical jargon. Don’t include unnecessary details.
Good prompt: Give me a brief explanation using simple language with only the essential details.
Principle #9: Use “Your task is” and “You MUST”
Bad prompt: Can you summarize this article?
Good prompt: Your task is to summarize this article in 3 sentences. You MUST include the main conclusion.
Principle #16: Assign a role
Bad prompt: Rewrite my resume.
Good prompt: You are a career coach with 15 years of experience. Help me improve my resume.
Principle #3: Break down complex tasks into simpler prompts
Bad prompt: Create a complete business plan for a coffee shop
Good prompt: Create a complete business plan for a coffee shop:
Step 1: Brainstorm coffee shop ideas
Step 2: Identify target customers and unique angle
Step 3: Research market and competitors
….
If I had to add some good principles to the top 10 based on my experience, I’d add #7 (use few-shot prompting), #12 (add “think step by step”), and #19 (use chain of thought). You can find more about these principles in this guide I wrote.
by PYCOACH, Artifical Corner | Read more:
Image: Sondos Mahmoud Bsharat, Aidar Myrzakhan, Zhiqiang Shen, Mohamed bin Zayed