Day 13

Day 13 of 1% Better.
Today, I learned about Prompt Engineering Best Practices.
Here's the simplest way to think about it:
1. 𝐖𝐫𝐢𝐭𝐞 𝐜𝐥𝐞𝐚𝐫 𝐚𝐧𝐝 𝐞𝐱𝐩𝐥𝐢𝐜𝐢𝐭 𝐢𝐧𝐬𝐭𝐫𝐮𝐜𝐭𝐢𝐨𝐧𝐬
↳ Tell the model exactly what you want.
↳ Remove ambiguity.
↳ The clearer your instructions, the better the output.
2. 𝐏𝐫𝐨𝐯𝐢𝐝𝐞 𝐬𝐮𝐟𝐟𝐢𝐜𝐢𝐞𝐧𝐭 𝐜𝐨𝐧𝐭𝐞𝐱𝐭
↳ A model can only work with the information it has.
↳ Give it the right context.
↳ If the required information isn't available, the model is more likely to hallucinate.
3. 𝐁𝐫𝐞𝐚𝐤 𝐜𝐨𝐦𝐩𝐥𝐞𝐱 𝐭𝐚𝐬𝐤𝐬 𝐢𝐧𝐭𝐨 𝐬𝐢𝐦𝐩𝐥𝐞𝐫 𝐬𝐭𝐞𝐩𝐬
↳ Don't ask the model to do everything at once.
↳ Split large problems into smaller subtasks.
↳ Smaller prompts are often easier for models to follow and debug.
4. 𝐆𝐢𝐯𝐞 𝐭𝐡𝐞 𝐦𝐨𝐝𝐞𝐥 𝐭𝐢𝐦𝐞 𝐭𝐨 𝐭𝐡𝐢𝐧𝐤
↳ Encourage step-by-step reasoning.
↳ Ask it to explain its reasoning before answering.
↳ This can improve performance on complex tasks.
5. 𝐈𝐭𝐞𝐫𝐚𝐭𝐞 𝐨𝐧 𝐲𝐨𝐮𝐫 𝐩𝐫𝐨𝐦𝐩𝐭𝐬
↳ The first prompt is rarely the best.
↳ Test different versions.
↳ Improve prompts based on the model's responses.
LinkedIn post: https://lnkd.in/p/gcruhGkF (opens in a new tab)