AI prompt engineering means writing, testing, and refining instructions for a model. A prompt states the task, relevant background, and desired output. The principles below apply to language models, including those from OpenAI. Test the response against your goal and refine the instructions. A clearer prompt can help, but it does not guarantee accuracy.

Understanding the Basics
A useful prompt states what the model should do, what information it may use, and what a satisfactory result looks like. Model capabilities and the task also affect the result. Test instructions on representative examples rather than assuming that a well-written prompt will work reliably in every case.
Best Practices for AI Prompt Engineering
- Be Specific: Give the model the details it needs to address your task. Instead of asking, "How do I make a cake?" specify the type of cake, the occasion, dietary restrictions, and so on.
- Provide Context: Context is king in prompt engineering. Providing background information helps the AI understand the scope and relevance of your request. For example, if you're asking for a document summary, mention the key points you're interested in.
- Use Clear and Concise Language: While it's important to be specific, it's equally important to be clear and concise. Avoid using jargon, slang, or overly complex sentences that could confuse the AI. Remember, the goal is to communicate your request as straightforwardly as possible.
- Iterate and Refine: Prompt engineering is an iterative process. Your first prompt might not yield the perfect response, but it can serve as a starting point for refinement. Analyze the AI's response, identify areas of misunderstanding, and adjust your prompt accordingly.
- Leverage Examples: When appropriate, provide examples to guide the AI's output. If you're looking for a particular writing style or a specific format, including an example in your prompt can be incredibly helpful.
- Understand the Model's Limitations: No AI model is perfect, and understanding the limitations of LLMs will help you set realistic expectations for the responses you receive. Familiarize yourself with the types of tasks the model excels at and those it struggles with.
- Maintain Ethical Considerations: Always craft prompts with ethical considerations in mind. Avoid inputs that could lead to biased, harmful, or inappropriate content. OpenAI has guidelines and safeguards in place, but prompt engineers should also be mindful of the potential impact of their prompts.
- Experiment: Try different versions of a prompt and compare the results. Change one element at a time, such as the context, an example, or the requested format, so you can see which instruction helped. Keep a few useful prompts and adapt them to the next task.
- Stay Informed: AI technology is rapidly evolving, and so are the capabilities of platforms like OpenAI. Stay informed about updates, improvements, and new techniques in prompt engineering to continuously enhance your skills. Sign up below to receive emails with updates about AI.
Practice these principles on a task you know how to check. Clear instructions make the assignment easier to assess; factual claims, calculations, and consequential conclusions still need verification.
Test these principles on a task you already know how to do. Compare the answer with your expectations, identify what is missing, and revise the instructions. Experimenting with a familiar task makes the differences easier to see.
OpenAI’s prompt-engineering guide: instructions, examples, and evaluation