Tech & Startup

10 prompt engineering tips to get better AI responses

Google reveals the art of 'prompt engineering' in new paper  
ChatGPT reason button
Here are 10 essential prompt engineering tips to dramatically improve your AI interactions.

Ever wondered why some people get brilliant results from AI tools like Gemini, while others receive gibberish? The secret lies in prompt engineering, the craft of designing clear, practical instructions for AI systems. 

Google's latest whitepaper, Prompt Engineering, authored by senior developer advocate Lee Boonstra, breaks down the best ways to communicate with AI. Whether you're a developer, writer, or just curious, these techniques can help you get smarter, more accurate responses.  

Here are 10 essential prompt engineering tips to dramatically improve your AI interactions.  

1. Be specific – don't be vague  

Instead of "Write about climate change", try "Write a 300-word explainer on how rising ocean temperatures affect coral reefs, aimed at high school students".

Why it works: Specificity gives the AI clear boundaries and direction, reducing irrelevant tangents.  

2. Zero-shot vs. few-shot prompts  

Zero-shot prompts are simple, direct instructions (e.g. "Summarise this article in one sentence"), whereas few-shot prompts provide examples (e.g. "Here are three product descriptions—write one in the same style"). The paper says that few-shot prompts often yield better results.  

Example prompt:
"Here are two product descriptions:  
1. 'This ergonomic keyboard reduces wrist strain with a 15° tilt design'  
2. 'Our noise-cancelling headphones block 95% of ambient sound'  
Now write a similar description for a smartwatch."  

Why it works: Examples demonstrate exactly what you want, helping the AI mimic your preferred style.  

3. Assign a role to the AI

Example prompt: "You are a senior software engineer reviewing this Python code. Identify three potential security vulnerabilities."  

Why it works: Role-playing focuses on the AI's "expertise" and tailors responses to professional standards.  

4. Request step-by-step reasoning

For complex queries, an example prompt could be: "Think through this step by step before answering."  

Why it works: This 'Chain of Thought' approach reduces errors in logic/math by ~60%, according to Google research.  

5. Control creativity with temperature

Need facts? Use low temperature (0–0.3). Want ideas? Try higher (0.7–1).  

Example prompt: 
"Generate 5 realistic startup names [temperature=0.2]" vs "Generate 5 imaginative fantasy city names [temperature=0.8]"  

6. Structure your output

For data-heavy requests, an example prompt could be:
"List the top 5 cryptocurrencies by market cap in JSON format with fields for name, price, and 24-hour change."  

Why it works: Structured formats (JSON, XML, tables) prevent rambling and ease data extraction.  

7. Use positive instructions over restrictions 

Instead of "Don't mention competitors", try "Focus exclusively on our product's features".

Why it works: AI handles "do this" better than "don't do that"—negative instructions sometimes backfire.  

8. Implement the step-back technique

For abstract concepts, first ask "What are the key principles of good UI design?". Then, type in "Apply those principles to critique this website layout".  

Why it works: This two-step process activates the AI's deeper knowledge before tackling specifics.  

9. Verify with self-consistency

To get consistent results among a variety of outputs, run the same prompt 3–5 times. For factual queries, take the most common answer. For creative tasks, cherry-pick the best ideas.  

Why it works: Majority voting filters out random hallucinations.  

10. Treat prompting as a conversation

Start with a basic prompt, then analyse the response. You should then refine with more detail/constraints. Repeat until you get a satisfactory result.  

Pro tip: Google's Vertex AI Studio lets you save and compare prompt versions.  

Why this matters

As the paper explains, the difference between mediocre and exceptional AI outputs often comes down to spending an extra 30 seconds crafting your prompt. With AI becoming ubiquitous in workplaces, mastering these techniques could soon be as vital as Excel or PowerPoint skills.  

Before jumping into more advanced prompt engineering techniques, try these essential ones yourself. Apply just 2–3 of these methods to your next ChatGPT/Gemini session and you should notice a quality jump, states the paper. For advanced users, Google's full whitepaper dives into 'Tree of Thoughts' prompting and automated prompt optimisation.  

Remember, prompt engineering isn't about "tricking" AI—it's about clear communication. As with human conversations, the better you express your needs, the better the response you'll receive.

Comments

10 prompt engineering tips to get better AI responses

Google reveals the art of 'prompt engineering' in new paper  
ChatGPT reason button
Here are 10 essential prompt engineering tips to dramatically improve your AI interactions.

Ever wondered why some people get brilliant results from AI tools like Gemini, while others receive gibberish? The secret lies in prompt engineering, the craft of designing clear, practical instructions for AI systems. 

Google's latest whitepaper, Prompt Engineering, authored by senior developer advocate Lee Boonstra, breaks down the best ways to communicate with AI. Whether you're a developer, writer, or just curious, these techniques can help you get smarter, more accurate responses.  

Here are 10 essential prompt engineering tips to dramatically improve your AI interactions.  

1. Be specific – don't be vague  

Instead of "Write about climate change", try "Write a 300-word explainer on how rising ocean temperatures affect coral reefs, aimed at high school students".

Why it works: Specificity gives the AI clear boundaries and direction, reducing irrelevant tangents.  

2. Zero-shot vs. few-shot prompts  

Zero-shot prompts are simple, direct instructions (e.g. "Summarise this article in one sentence"), whereas few-shot prompts provide examples (e.g. "Here are three product descriptions—write one in the same style"). The paper says that few-shot prompts often yield better results.  

Example prompt:
"Here are two product descriptions:  
1. 'This ergonomic keyboard reduces wrist strain with a 15° tilt design'  
2. 'Our noise-cancelling headphones block 95% of ambient sound'  
Now write a similar description for a smartwatch."  

Why it works: Examples demonstrate exactly what you want, helping the AI mimic your preferred style.  

3. Assign a role to the AI

Example prompt: "You are a senior software engineer reviewing this Python code. Identify three potential security vulnerabilities."  

Why it works: Role-playing focuses on the AI's "expertise" and tailors responses to professional standards.  

4. Request step-by-step reasoning

For complex queries, an example prompt could be: "Think through this step by step before answering."  

Why it works: This 'Chain of Thought' approach reduces errors in logic/math by ~60%, according to Google research.  

5. Control creativity with temperature

Need facts? Use low temperature (0–0.3). Want ideas? Try higher (0.7–1).  

Example prompt: 
"Generate 5 realistic startup names [temperature=0.2]" vs "Generate 5 imaginative fantasy city names [temperature=0.8]"  

6. Structure your output

For data-heavy requests, an example prompt could be:
"List the top 5 cryptocurrencies by market cap in JSON format with fields for name, price, and 24-hour change."  

Why it works: Structured formats (JSON, XML, tables) prevent rambling and ease data extraction.  

7. Use positive instructions over restrictions 

Instead of "Don't mention competitors", try "Focus exclusively on our product's features".

Why it works: AI handles "do this" better than "don't do that"—negative instructions sometimes backfire.  

8. Implement the step-back technique

For abstract concepts, first ask "What are the key principles of good UI design?". Then, type in "Apply those principles to critique this website layout".  

Why it works: This two-step process activates the AI's deeper knowledge before tackling specifics.  

9. Verify with self-consistency

To get consistent results among a variety of outputs, run the same prompt 3–5 times. For factual queries, take the most common answer. For creative tasks, cherry-pick the best ideas.  

Why it works: Majority voting filters out random hallucinations.  

10. Treat prompting as a conversation

Start with a basic prompt, then analyse the response. You should then refine with more detail/constraints. Repeat until you get a satisfactory result.  

Pro tip: Google's Vertex AI Studio lets you save and compare prompt versions.  

Why this matters

As the paper explains, the difference between mediocre and exceptional AI outputs often comes down to spending an extra 30 seconds crafting your prompt. With AI becoming ubiquitous in workplaces, mastering these techniques could soon be as vital as Excel or PowerPoint skills.  

Before jumping into more advanced prompt engineering techniques, try these essential ones yourself. Apply just 2–3 of these methods to your next ChatGPT/Gemini session and you should notice a quality jump, states the paper. For advanced users, Google's full whitepaper dives into 'Tree of Thoughts' prompting and automated prompt optimisation.  

Remember, prompt engineering isn't about "tricking" AI—it's about clear communication. As with human conversations, the better you express your needs, the better the response you'll receive.

Comments

কাফনের কাপড় পরে পলিটেকনিক শিক্ষার্থীদের মিছিল

বিক্ষুব্ধ শিক্ষার্থীরা তাদের ছয় দফা দাবি অবিলম্বে মেনে নিতে সরকারের প্রতি আহ্বান জানিয়েছেন। অন্যথায় তারা আরও কঠোর আন্দোলনের হুঁশিয়ারি দিয়েছেন।

১ ঘণ্টা আগে