Best Practices
Tips & tricks
Write prompts that cannot be interpreted ambiguously. Avoid pronouns without clear references, ambiguous terms, and overly general formulations. If a prompt can be understood differently, the model will choose a random interpretation.
Balance between detail and brevity. Too long prompts waste tokens and may confuse the model. Too short ones don't provide enough information. Include only what's actually needed for the task.
A good prompt gives consistent results on repeated queries. Use examples (few-shot), clear instructions, and constraints to minimize output variability. Test on different inputs.
Request explanations and sources. Ask the model to show reasoning (chain of thought), quote parts of the input, or explain why it chose this answer. This helps identify errors.
Prompting Best Practices
Compare bad and good prompts
Be Specific
Quick Reference
- •Start with a clear task statement
- •Provide relevant context and examples
- •Specify the desired output format
- •Set constraints (length, style, scope)
- •Use delimiters for content separation
- •Test with edge cases
- •Iterate and refine based on results
- •Don't assume the model knows context
- •Don't use vague terms like "good" or "better"
- •Don't give contradicting instructions
- •Don't skip format specification
- •Don't ignore errors — analyze them
- •Don't trust outputs blindly — verify
- 💡 Use XML tags (<context>, <task>, <format>) to structure complex prompts
- 💡 For critical tasks use self-consistency: multiple queries + voting
- 💡 Save working prompts in a library for reuse
- 💡 Test prompts at temperature=0 to check consistency
- 💡 Use roles ("You are an expert in...") to improve response quality
Try it yourself
Interactive demo of this technique
Write a social media post about a new company product
Introducing our new innovative product! It will change your life for the better. Try it now and see for yourself! Don't miss this unique opportunity. Click the link! #new #innovation
Charged on Monday — forgot about charging until the next one.
FitBand X — a tracker that keeps up with your pace:
🏃 7 days on one charge — train all week 💓 Heart rate ±1 bpm accuracy — know your zones 🏊 50m water resistance — from the pool straight to your run
Sales start March 1. First 500 buyers get 3 months of premium analytics free.
Link in bio →
#FitBandX #runeveryday #fitnessgear
Best practices are a checklist: role, specifics, format, constraints, prohibitions. Skipping any item = quality gap. Baseline skips all 5 — result: generic spam.
Create a free account to solve challenges
3 AI-verified challenges for this lesson
This lesson is part of a structured LLM course.
My Learning Path