how to write a good llm prompt
- User
how to write a good llm prompt
Assistant
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.
how to write a good llm prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.
Writing a good prompt for a Large Language Model (LLM) like me is both an art and a science. A well-crafted prompt can significantly improve the quality and relevance of the response. Here’s a step-by-step guide to help you write effective prompts:
Vague prompts lead to vague responses. The more specific you are about what you want, the better.
Bad:
"Tell me something about dogs."
Good:
"Explain the history of dog domestication from wolves, including key evolutionary changes and the timeline based on archaeological evidence."
Organize your request in a way that makes it easy for the model to follow.
Example:
"You are a biology tutor. Explain photosynthesis in simple terms for a high school student. Use an analogy, and provide one real-world example."
This includes:
Tell the model how to act or who it is. This helps shape the tone and content of the response.
Examples:
Give background information so the model understands the situation or problem better.
Example:
"I'm starting a blog about personal finance for young professionals. I need a catchy title and three post ideas focused on budgeting and saving money."
Limit scope, style, format, or length to keep the response useful and focused.
Examples:
If you want detailed reasoning, ask the model to explain its thinking.
Example:
"Solve this math problem: 8 ÷ 2(2+2). Show your work and explain each step."
If the first response isn’t perfect, refine your prompt based on what you got.
Example refinement: Original: "Write something about AI." Refined: "Write a 300-word summary of artificial intelligence's impact on healthcare, focusing on diagnostics and personalized medicine."
Sometimes showing what you want leads to better results.
Example:
"Here’s an example of a haiku:
Autumn leaves fall slow,
Wind whispers through branches bare—
Winter waits nearby.Now write a haiku about spring rain."
Using templates can help structure your thinking.
Template Example:
"You are a [role] tasked with [goal].
You must [constraint/requirement].
Format your response as [format].
Include [elements]."
Filled In:
"You are a nutritionist tasked with creating a healthy meal plan for a week.
You must include breakfast, lunch, dinner, and snacks.
Format your response as a table with days of the week as columns.
Include calorie estimates and macronutrient balance."
Don’t assume the model knows what you mean unless you spell it out clearly.
Instead of:
"What’s the best way to do it?"
Say:
"What’s the most efficient way to learn Spanish as an English speaker over six months, including methods, resources, and daily practice tips?"
| Element | Included? |
|---|---|
| Clear goal | ✅ |
| Role or persona | ✅ |
| Audience or context | ✅ |
| Format or constraints | ✅ |
| Examples or instructions | ✅ |
### or " " to separate parts of your prompt.Would you like help crafting a specific prompt for your use case? Let me know what you're trying to achieve!