Prompt Engineering: Efficiency in the Age of AI
Best Practices for Prompt Engineering
Regardless of the technique you choose to use, there are some best practices to remember when writing your prompts. These practices can help you get the most out of your interactions.
Use Action Verbs
Instead of posing open-ended questions, use action verbs to direct the model's response. Adopt a directive tone to prompt the model to generate specific content or perform a specific task.
Instead of Can you tell me about..., try Write a detailed explanation of.... Both prompts may lead to the same result, but the latter is more direct and actionable.
Can you tell me about...is more conversational and open-ended. It may suggest that you're looking for an overview or an introduction to a topic. This prompt implies a level of curiosity and openness to any relevant information the LLM can provide, which could include facts, summaries, or interesting tidbits.Write a detailed explanation of...signals that you're seeking a more comprehensive, in-depth analysis or description of a specific topic. It also suggests you're prepared for or interested in more complex details, technical information, or a thorough exploration of the subject matter.
You can always use "please" in your requests if you wish to be remembered by AI when it dominates the globe!
Provide a Clear Context
To obtain a more specific and relevant response, include detailed information about your request or problem. This includes any pertinent context, background information, or particular criteria that may be significant.
Instead of:
What is the best way to lose weight when you're busy? Create a detailed plan.
Try:
I have 20 minutes a day to exercise.
I don't have time to cook elaborate meals.
I'm a vegetarian.
I want to lose 10 pounds in 2 months.
What is the most effective way to lose weight given these constraints?
Provide a detailed plan with exercise and diet recommendations.
Use Role-Playing
Assign roles to the model and prompt it to respond as if it were a specific character or expert. This technique can help guide the model's responses and provide more focused and relevant information.
For example:
Act as a fitness trainer with an extensive background in diet and exercise expertise.
Provide a detailed plan with exercise and diet recommendations given my constraints.
..etc
Break Down Complex or Lengthy Tasks
Prompt the model to think through a problem or task step by step. Alternatively, divide your query into multiple parts and ask the model to address each part individually. This will result in more queries and more time spent on the task, but also more accurate and detailed responses.
Instead of:
Write a blog post about how stars are formed.
Generative AI For The Rest Of US
Your Future, DecodedEnroll now to unlock all content and receive all future updates for free.
Hurry! This limited time offer ends in:
To redeem this offer, copy the coupon code below and apply it at checkout:
