Crafting Effective Prompts: Strategies for Better AI Results
This article can be considered a companion piece to our previous article, ChatGPT Prompt Training Tips Guide
AI language models like ChatGPT are incredibly useful tools for everyday personal and professional tasks. In order for them to provide the best possible response, however, you need to first craft an effective prompt. “Prompt engineering” advice can help you learn strategies and tactics that work to get better AI answers and results. In this blog post, we’ll share some of our own strategies and tactics as well as provide a summary of OpenAI’s own guide to better AI prompting.
Six Strategies (with Tactics) for Better AI Results: from OpenAI
Prompt engineering (according to OpenAI, the creators of ChatGPT) can be broken down into six main strategies:
- Write clear instructions
- Provide context or reference text
- Split complex tasks into simpler ones
- Give the model time to “think”
- Use external tools
- Test changes systematically
Learn more about how to accomplish each of these strategies below!
1. Write Clear Instructions
Clarity is key when crafting prompts for AI models. Clearly articulate what you want the AI to do or provide. Vague or ambiguous prompts can lead to irrelevant or confusing responses. Instead, provide specific instructions or questions to guide the AI in generating the desired output. If you’re asking the AI to generate content, provide sample sentences or paragraphs that capture the tone, style, and structure you’re aiming for. This can help steer the AI in the right direction.
Tactics:
- Include details to get more relevant answers
- Ask the model to adopt a persona
- Specify the steps required to complete a task
- Provide examples
- Specify the desired length of the response
ChatGPT Examples: Write Clear Instructions
- Specific Instructions for Content Creation: Suppose you want an article about renewable energy trends. Instead of saying, “Write about energy,” specify, “Write a detailed guide on the latest renewable energy trends, focusing on solar, wind, and hydroelectric power, for an audience of engineers and policymakers.”
- Adopting a Persona: If the content requires a playful tone, instruct the model, “Write this explanation as if you are a friendly science teacher explaining to high school students.”
- Structured Steps: For a process explanation, direct the AI, “List the steps needed to install solar panels on a residential rooftop, including required materials, estimated time, and safety precautions.”
- Length Specification: For concise communication, direct, “Provide a summary in no more than 150 words describing the economic benefits of switching to renewable energy.”
2. Provide Context or Reference Text
Contextual information helps the AI understand the intent behind your prompt and generate more relevant responses. Before posing a prompt, provide relevant background information or context to set the stage. This could include details about the topic, audience, or purpose of the interaction.
Tactics:
- Provide a specific reference text to refer to
- Request citations
ChatGPT Examples: Provide Context or Reference Text
- Background Information: When asking for a comparison of programming languages, include, “Considering the context of mobile app development, compare Python and Kotlin, highlighting their strengths and weaknesses.”
- Using Citations: Instruct the AI, “Provide a brief overview of Python’s features for data science and cite at least three recent academic papers that discuss its applications in machine learning.”
3. Split Complex Tasks into Simpler Ones
Giving the AI one simple task to work on at a time can result in much better responses than a more complicated, in-depth prompt with multiple subthreads. Think of prompting with AI as more of a dialogue, moving from one question to the next, versus a lengthy essay prompt that will likely lead to a worse (or error-ridden) result.
Tactics:
- Identify the most relevant instructions by breaking things down into classifications/categorizations
- For longer conversations, summarize previous dialogue to help AI stay on track
ChatGPT Examples: Split Complex Tasks into Simpler Ones
- Task Breakdown: Instead of asking, “How do you start a tech company?”, break it down to, “What are the first legal steps in starting a tech company?”, followed by, “What are the basic technological needs for a startup in fintech?”
- Summarizing Dialogue: In ongoing discussions, prompt, “Summarize the key points from our previous conversation about user interface design best practices.”
4. Give the Model Time to “Think”
Asking for the thought process behind the answer can help produce less errors and help the AI reason its way toward more correct responses.
Tactics:
- Ask the model to work out its own solution
- Use a sequence of queries to understand the reasoning process
- Ask the AI if it missed anything on previous passes
ChatGPT Examples: Give the Model Time to “Think”
- Reasoning Query: To explore marketing strategies, ask, “Can you explain step-by-step how a small business can increase its online visibility using SEO?”
- Iterative Queries: When solving problems, prompt, “First, describe the common challenges in supply chain management for e-commerce. Next, suggest practical solutions for each challenge.”
5. Use External Tools
Feeding AI outputs from other tools can help it understand relevant documents and complete your task more reliably and efficiently.
Tactics:
- Use embeddings-based search to implement efficient knowledge retrieval
- Use code execution to perform more accurate calculations or call external APIs
- Give the model access to specific functions
ChatGPT Examples: Use External Tools
- Embeddings-Based Search: “Use an embeddings-based search tool to find the most relevant scholarly articles on blockchain technology, then summarize their findings on its impact on financial services.”
- Code Execution: When needing precise calculations, instruct, “Calculate the potential return on investment for a $10,000 investment in solar panels with an average energy bill saving of $100 per month.”
6. Test Changes Systematically
Don’t be afraid to experiment with different prompts to see what works best. AI models like ChatGPT are versatile and can generate a wide range of responses based on varying inputs. Try tweaking the wording, tone, or structure of your prompts to see how it affects the AI’s output. Continuous iteration is key to improving the quality of AI prompt results. After receiving responses from the AI, evaluate them critically to identify strengths and areas for improvement. Use this feedback to refine your prompts and iterate on your approach until you achieve the desired results.
ChatGPT Examples: Test Changes Systematically
- Prompt Variations: Experiment by asking, “What are the future prospects of AI in healthcare?” and rephrase it as, “Discuss how AI could transform healthcare in the next decade.”
- Evaluative Feedback: After receiving responses, prompt, “Which aspects of this answer were most helpful in understanding AI’s impact on healthcare, and what could be improved?”
Additional Ways to Get Better AI Prompt Results
AI Technology is constantly evolving, with new capabilities being released seemingly every day. Stay informed about the latest developments in the field of AI and the various updates to AI models like ChatGPT. This knowledge will enable you to leverage the latest features and techniques to enhance your prompt results. You can also consider additional tools and resources to improve your AI prompting, such as:
- Joining online communities, forums, and social media groups dedicated to AI and natural language processing
- Exploring online workshops, training classes, and other guides to AI prompting
By implementing these strategies and tactics, you can maximize the effectiveness of your AI prompt results and unlock the full potential of language models like ChatGPT. With careful planning, experimentation, and continuous refinement, you can harness the power of AI to accomplish a wide range of tasks and achieve your goals.
See our ChatGPT Workshop post or our ChatGPT online course and demo collection for more training to innovate how you work with AI. We’ve also built a customized version of ChatGPT for a specific purpose called the GPT Prompt Trainer Coach that you can use to interactively learn how to build better prompts within ChatGPT itself.