15 Prompt Engineering Best Practices for Better AI Results
15 Prompt Engineering Best Practices for Better AI Results
Mastering prompt engineering is one of the most critical skills for anyone looking to leverage AI effectively. Whether you are a developer, marketer, educator, or business leader, the difference between a generic, unreliable output and an insightful, actionable result often comes down to the quality of your prompt . This article synthesizes academic research, insights from leading institutions like the University of Pennsylvania's Wharton School and the Project Management Institute, and best practices from AI developers to provide a definitive guide for getting better results from any large language model (LLM) .
What You'll Learn
You'll understand the core principles of prompt engineering best practices, from clear instruction and role-playing to advanced techniques like chain-of-thought and self-reflection. By the end, you will have a practical framework to craft, refine, and optimize prompts, enabling you to transform AI from a mere text generator into a powerful collaborative partner that consistently delivers high-quality, relevant, and reliable outputs for your specific needs .
1. Be Explicit and Clear in Your Instructions
Be Direct
Modern AI models excel at following clear, direct instructions. Don't assume the AI will infer what you want; state it directly. It is better to lead with action verbs like "Write," "Analyze," "Generate," or "Create" and skip extraneous preambles to get straight to the request .
Vague vs. Explicit Prompt Comparison
| Vague Prompt | Explicit Prompt | Why It Works |
|---|---|---|
| "Create an analytics dashboard." | "Create an analytics dashboard. Include as many relevant features and interactions as possible. Go beyond the basics to create a fully-featured implementation." | Directly requests comprehensive features, signaling a high-quality, detailed output is expected . |
| "Explain climate change." | "Write a 3-paragraph summary of climate change for high school students, using bullet points and a neutral tone." | Specifies the audience, format, and tone, reducing ambiguity and guesswork for the model . |
2. Provide Rich Context and Motivation
The Power of Context
Explaining why something matters helps the AI better understand your goals. This is particularly effective with advanced models that can reason about underlying objectives. You should explain the purpose, audience, constraints, and the problem you're trying to solve. As Wharton research highlights, context and constraints guide AI to produce more relevant and responsible output .
Why This Works
Instead of giving a simple rule like "NEVER use bullet points," explain your reasoning: "I prefer responses in natural paragraph form rather than bullet points because I find flowing prose easier to read and more conversational. Bullet points feel too formal and list-like for my casual learning style." This allows the AI to make better decisions about related formatting choices .
3. Use Role-Playing to Surface Tailored Insights
Assign a Specific Role
Assigning a role to the AI—such as Editor, Innovator, Mentor, Coach, or Project Manager—tells it what kind of thinker or expert to emulate. This narrows the scope, reduces generic answers, and aligns responses with specific stakeholder priorities. This tactic is grounded in research on human-AI collaboration .
Example
Instead of "Identify areas of the criminal justice system suitable for an investigation," try: "You are an investigative journalist for The Guardian aimed at an audience of legal professionals. Identify areas of the criminal justice system in the UK that may be suitable for an investigation." The contextual information enhances how the model interacts with the task, yielding more specific and professional output .
4. Provide Examples (Few-Shot Prompting)
Show, Don't Just Tell
Instead of abstractly describing what you want, showing the AI actual examples of the desired output is far more powerful. This is known as few-shot prompting. It helps the AI "see" your exact tone, structure, and style. It is widely considered one of the most important basic techniques .
Example
Here are examples of how I write emails:
- Q: How do I reschedule a meeting?
- A: Hi Sarah, I need to reschedule our Tuesday meeting due to a conflict. Would Thursday at the same time work? Thanks!
Now, write a professional email declining a budget review meeting on Friday.
The AI will follow the pattern in the examples rather than guessing what "professional" and "brief" mean .
5. Decompose Complex Tasks
Break It Down
Instead of asking the AI to solve a complex problem all at once, first ask it to break the problem into smaller sub-problems. This prevents the AI from trying to do everything simultaneously and failing. The magic phrase is: "Before answering this, tell me what sub-problems need to be solved first?" This technique is also known as prompt chaining .
Example
Task: "I need to plan a product launch."
- Prompt: "Before answering this, tell me what sub-problems need to be solved first for a product launch?"
- AI Response: Lists: target audience definition, competitive analysis, pricing strategy, etc.
- You: "Great, now let's solve each of these one by one, starting with target audience definition..."
6. Ask the AI to Self-Reflect and Critique
Iterative Improvement
Get the AI to check and improve its own work. This is a "free performance boost" that works well in many situations. The simple 3-step process is: 1) AI provides an initial response, 2) You ask, "Can you go back and check your response? Offer yourself some criticism," 3) You say, "Great job, now implement that feedback." Use this 1-3 times maximum .
Example
- You: "Write a brief for a new marketing campaign."
- AI: [Provides initial brief]
- You: "Can you go back and check your response? Offer yourself some criticism."
- AI: "Looking back, I notice I didn't include specific metrics for success, the target audience is too broad, and I didn't consider budget constraints..."
- You: "Great. Now implement that feedback."
7. Specify the Desired Output Format
Control the Structure
To avoid lengthy editing, explicitly tell the AI exactly what format you want. Be precise about the structure, such as a concise paragraph, a numbered list, a table with specific columns, or JSON. For detailed control, tell the AI what to do instead of what not to do to avoid unintended behavior .
Example
| For Structure | Try This Prompt |
|---|---|
| For a Table | "Consolidate findings into a table with 3 columns: 1) A, 2) B, 3) C." |
| For JSON | "Output only valid JSON with no preamble. Begin your response with an opening brace." |
8. Set Constraints and Conditions
Create Boundaries
Help focus the model's attention and prevent it from wandering by establishing clear boundaries. This includes specifying who the audience is, what tone to use, the desired length, or what to exclude .
Example
- "Exclude technical jargon."
- "Only use facts from the provided document."
- "Make it understandable to non-technical personnel."
- "No more than 350 words."
9. Encourage Chain-of-Thought Reasoning
Think Step-by-Step
Chain-of-Thought (CoT) prompting encourages the AI to break down its "reasoning" into logical steps before arriving at a final answer. This is especially useful for math, logic, multi-step decision-making, and tasks where transparency is needed. In some cases, you can simply add "Think step-by-step" to your instructions .
Guided Chain-of-Thought
A more structured approach guides the model through specific reasoning stages. For example: "Think before you write the email. First, think through what messaging might appeal to this donor given their donation history. Then, consider which aspects of the program would resonate with them. Finally, write the personalized donor email using your analysis."
10. Use Ensemble Methods for High-Stakes Tasks
Ask Multiple Approaches
For critical decisions, ask the same question using 3-5 different approaches (e.g., role-based, data-focused, case-study based) and pick the answer that comes up most frequently. This technique, known as "ensembling," is based on the principle that the answer that emerges regardless of the approach is usually the most reliable .
Example
- Expert 1 (Role-based): "You are a financial advisor. What's the best investment strategy for someone in their 30s?"
- Expert 2 (Data-focused): "Based on historical market data, what investment strategy works best for people in their 30s?"
- Expert 3 (Case-study): "Looking at successful investment cases, what strategy should someone in their 30s follow?"
- Analysis: Compare the 5 answers and choose the recommendations that appear most often .
11. Leverage an Interview Process
Let the AI Clarify
When you're not sure how to frame your request, ask the AI to interview you. It can ask one question at a time to gather context systematically and adapt follow-up questions based on your responses. This is particularly useful for planning articles, clarifying complex input, or collaboratively shaping a plan .
Implementation
- Prompt: "Before writing, ask me up to 5 clarifying questions if anything is missing or ambiguous. Do not start the task until you've confirmed."
12. Understand and Use the CLEAR Framework
A Mnemonic for Better Prompts
The CLEAR framework provides a simple, easy-to-remember guide for creating effective prompts .
- C - Concise: Keep the prompt as clear as possible.
- L - Logical: Ensure the prompt has a logical and natural progression.
- E - Explicit: If you want a certain format or style, explicitly say so.
- A - Adaptive: Try different versions of the same prompt to see various outputs.
- R - Reflection: Check that the output is accurate and relevant .
13. Prefill the AI's Response for Control
Guide the Beginning
Prefilling lets you start the AI's response for it, which is a powerful way to enforce output formats or skip conversational preambles. This is typically done in an API setting but can be approximated in chat interfaces by being explicit .
Example (API Usage)
- User Prompt: "Extract the name and price from this product description into JSON."
- Assistant (Prefill): "{"
The AI will then continue from the opening brace, outputting only valid JSON .
14. Document and Reuse High-Performing Prompts
Build a Prompt Library
Create a library of prompts that consistently yield good results. Tag them by function (e.g., marketing, financial planning, hiring) for easy access. Research on workplace AI adoption shows that productivity gains often stem from standardizing successful practices, and prompt templates are a core part of that .
15. Give Permission to Express Uncertainty
Reduce Hallucinations
Give the AI explicit permission to say "I don't know" rather than guessing. This is a simple but vital addition to increase reliability and trustworthiness, especially when dealing with facts or data. By telling the AI to acknowledge limitations, you reduce the risk of "hallucinations" (plausible but factually incorrect information) .
Example
"Analyze this financial data and identify trends. If the data is insufficient to draw conclusions, say so rather than speculating."
Sources
- Notion. "Complete LLM Prompting Mastery Guide."
- Project Management Institute. "Building Blocks for Better Prompts: A Modular Prompt Engineering Framework."
- ScienceDirect. "AIPO: Automatic Instruction Prompt Optimization by model itself with 'Gradient Ascent'."
- Wharton Executive Education. "PROMPT POWER: SIX TACTICS TO GET BETTER RESULTS FROM AI."
- Claude by Anthropic. "Best practices for prompt engineering."
- Cranfield University Library. "AI and Generative AI: Prompt engineering."
- arXiv. "Prompt Design and Engineering: Introduction and Advanced Methods."
- DreamHost. "Prompt Engineering: How To Prompt AI for Real-World Results."
- CodeSignal. "Prompt engineering best practices 2025: Top features to focus on now."
- Birkbeck, University of London. "Artificial Intelligence (AI): Prompt Engineering."
— Editorial Team
No comments yet.