AI Content Hub
Your ultimate resource for AI wisdom: expert tips, thought-provoking quotes, practical tutorials, and mind-expanding challenges
Know a useful AI tip or trick? Submit it to the hub →
Popular Tags
Use Negative Prompting to Set Boundaries
Tell the model what NOT to do in addition to what you want. For example, 'Explain quantum computing without using analogies or metaphors.' Negative constraints often produce more focused and accurate outputs than positive instructions alone.
Provide Output Format Examples
When you need a specific output format, include a concrete example in your prompt rather than just describing it. Showing the model 'Output should look like: {name: string, score: number, summary: string}' with a filled example is far more effective than verbal descriptions alone.
Use Specific Prompts to Cut Costs
Use specific, detailed prompts to get more accurate responses from LLMs and reduce token costs.
Keep Prompts Concise but Informative
Keep your prompts concise but informative to maximize the value of each token.
Match Prompt Style to Model
Use model-specific prompting techniques: Claude likes XML, GPT likes markdown, Gemini handles multimodal well.
Use Negative Prompts
To guide the model away from undesired outputs, tell it what *not* to do. For example, add constraints like 'Do not use technical jargon,' 'Avoid mentioning price,' or 'The response should not be longer than two paragraphs.'
Specify the Output Format
To get structured data, explicitly ask the LLM to format its response as JSON, a markdown table, or a numbered list. For example: 'Compare the top 3 smartphones and provide the output in a markdown table with columns for Model, Price, and Key Feature.'
Experiment with Temperature Settings
The 'temperature' parameter controls randomness. Lower values (e.g., 0.2) make output more deterministic and focused. Higher values (e.g., 0.8) increase creativity and diversity. Adjust it based on your task.
Break Down Complex Tasks
If an LLM struggles with a complex task, break it into smaller, simpler sub-tasks. Solve each part sequentially, and then combine the results. This is often more effective than one large prompt.
Role-Playing Prompts
Instruct the LLM to adopt a specific persona or role (e.g., 'You are a helpful assistant specializing in physics.'). This can significantly shape the tone, style, and content of its responses.
Negative Prompts: Specify What NOT To Do
Sometimes it's effective to tell the LLM what to avoid. For example, 'Write a product description. Do not use clichés or overly technical jargon.'
Few-Shot Prompting
Provide a few examples (input/output pairs) in your prompt to guide the LLM's response. This is called few-shot prompting and can significantly improve performance on specific tasks.
Use Delimiters for Clarity
Use delimiters like triple backticks (```), XML tags (<tag></tag>), or quotes ("") to clearly separate different parts of your prompt, such as instructions, context, examples, and input data.
Specify the Target Audience
When generating content, tell the LLM who the target audience is (e.g., 'Explain this to a 5-year-old,' or 'Write this for an expert audience.'). This helps tailor the complexity and tone.
Use Output Priming
Start the desired output for the LLM. For instance, if you want a list, start your prompt with the beginning of the list: 'Here are the steps:
1.' This can guide the model effectively.
Grounding with Facts
If accuracy on specific facts is crucial, provide those facts within the prompt. This helps to ground the LLM and reduce the chance of hallucinations on those specific points.
Embrace Constraints
Adding constraints to your prompt (e.g., word count, specific keywords to include/exclude, format requirements) can often lead to more focused and useful outputs from the LLM.
Iterative Image Prompting
Similar to text, image generation benefits from iteration. Start with a basic prompt, then refine it by adding details, styles (e.g., 'photorealistic', 'impressionist'), or camera angles.
Use Analogies for Complex Explanations
If you need an LLM to explain a complex topic simply, ask it to use an analogy. For example, 'Explain quantum entanglement using an analogy involving a pair of gloves.'
Structured Prompts for Complex Tasks
For intricate tasks, consider a structured prompt with sections like: ROLE, CONTEXT, TASK, OUTPUT_FORMAT, EXAMPLES. This organization helps the LLM understand requirements better.
Reflection or Self-Critique Prompts
Ask the LLM to critique its own previous answer and then improve it. For example: 'Here is your previous response: [response]. Please identify any flaws and provide an improved version.'
Specify 'Don't Know' Option
To reduce hallucinations, explicitly instruct the LLM to say 'I don't know' or a similar phrase if it cannot answer a question confidently or accurately based on the provided context.
Use 'Let's think step by step' for Math Problems
For mathematical or logical reasoning problems, adding the phrase 'Let's think step by step' before the LLM generates its solution significantly improves accuracy.
Claude XML Tags
When using Claude, make use of its XML tags for better structure in your prompts.
Key Info Placement
When processing long documents, try to place key instructions or questions at the beginning or end of the input text. Models sometimes pay more attention to the start/end of context.
Instruction Priming
Start your prompt with a clear instruction like 'Translate the following text to French:' before providing the text itself. This primes the model for the task.
Version Control Prompts
Treat your prompts as code. Use version control (like Git) to track changes, iterate, and collaborate on prompt engineering.
Use Keywords for Style/Tone
Incorporate keywords that suggest the desired style or tone, e.g., 'formal', 'casual', 'humorous', 'academic', 'empathetic'.
Context Window Awareness
Understand the context window limit of the model you are using. Information outside this window will be ignored. For long interactions, summarization or RAG is key.
Isolate the Problematic Part of a Prompt
If a complex prompt isn't working, simplify it. Remove parts one by one to identify which section is causing the issue.
Chain of Density Prompting
To generate more detailed and nuanced content, first ask for a brief outline, then ask the LLM to expand on each point, and then ask it to add specific examples or data. This is a form of 'Chain of Density'.
Avoid Ambiguity
Review your prompts for ambiguous words or phrases that could be interpreted in multiple ways. Strive for explicitness.
Use 'Stop Sequences'
Use stop sequences to tell the model when to stop generating text. This is useful for preventing run-on sentences or irrelevant content after the desired output.
Structured Input for Complex Tasks
For complex tasks involving multiple pieces of information, provide the input in a structured format (e.g., using JSON within the prompt, or clear headings) to help the LLM parse it correctly.
A/B Test Prompts
In a production environment, A/B test different prompt variations to empirically determine which ones yield the best results for your key metrics.
Self-Correction Prompts
Ask the LLM to review its own previous output for errors or areas of improvement. 'Review your previous response. Are there any inaccuracies or ways to make it clearer?'
Provide a 'Glossary' for Specific Terms
If your prompt uses domain-specific jargon or acronyms the LLM might not know, provide a small glossary or definitions within the prompt.
No Matching Content Found
Try adjusting your filters or search query.
Join the AI Revolution
Subscribe to our newsletter for weekly AI insights, expert tips, and early access to new tools and features.