This page covers effective prompt writing techniques to help AI generate more accurate and useful responses.
6. Step-by-step Instructions
When asking AI to perform complex tasks, it's often more effective to break down the overall task into multiple steps and instruct the AI sequentially. Clearly separate each step to prevent the AI from getting confused.
Examples:
"Write an article following these steps: 1. Write an introduction (100 words) about 'The Impacts of Climate Change'. 2. Explain the effects of climate change on sea level rise (200 words). 3. Summarize three solutions to climate change (150 words). 4. Write a conclusion (50 words)."
7. Providing Examples (Few-shot Prompting)
Providing examples (input-output pairs) to the AI helps it better understand and replicate the desired output format. This is particularly useful when requesting a specific style or complex structure.
Examples:
"Summarize as follows: Original: 'Cats are small, furry mammals. They are primarily nocturnal and skilled hunters.' Summary: 'Cats are small, furry nocturnal hunters.' Original: 'Artificial intelligence is a field of computer science that aims to create machines mimicking human intelligence.' Summary: "
8. Positive Instructions vs. Negative Instructions
It is generally more effective to use positive instructions ('do this') rather than negative instructions ('do not do this') when guiding an AI. AI models typically process positive instructions more clearly.
Examples:
Bad Prompt: "Don't include an unnecessary introduction, just get to the main point." (Negative) Improved Prompt: "Please get straight to the main point in your explanation." (Positive)
9. Specifying Output Format
You can request a specific output format for the AI's response (e.g., list, table, JSON, code, specific word count). This makes the AI's output easier to use for subsequent tasks.
Examples:
"Output the following information in JSON format: Name: John Doe, Age: 30, Occupation: Developer" "List the following words as a bullet point list: Apple, Banana, Cherry" "Organize the following data into a table: (Provide data)"
10. Persona Setting
By instructing the AI to respond from the perspective of a specific person or target audience, you can make the tone and content of the response more appropriate for that audience. (Similar to 'Role Assignment' on Page 1, but here focusing on the 'audience' persona).
Examples:
"Explain global warming as if you are talking to a 5-year-old child." "Predict the future of AI as a Silicon Valley engineer who is well-versed in the latest technology trends."