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
Version Control Prompts
Treat your prompts as code. Use version control (like Git) to track changes, iterate, and collaborate on prompt engineering.
Request Error Handling
When asking an LLM to write code, specifically request that it include error handling (e.g., try-catch blocks, input validation).
Use Keywords for Style/Tone
Incorporate keywords that suggest the desired style or tone, e.g., 'formal', 'casual', 'humorous', 'academic', 'empathetic'.
Fine-Tuning for Common Tasks
If you perform a specific task repeatedly with long prompts, consider fine-tuning a smaller model. This can significantly reduce token count and improve performance for that task.
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.
Request Unit Tests
When an LLM generates code, ask it to also generate unit tests for that code. This helps ensure correctness and makes future refactoring safer.
Simulate Dialogues
Use an LLM to simulate dialogues for practicing conversations, interviews, or customer service interactions. Define the roles and scenario.
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.
Generate Multiple Drafts
Ask the LLM to generate several different versions or drafts of a creative piece. You can then pick the best one or combine elements from different drafts.
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.
Iteratively Debug Code
If LLM-generated code has errors, provide the error message back to the LLM and ask it to debug and fix the code. Iterate until it works.
Analyze Token Overlap in Conversations
In chat applications, analyze how much of the conversation history is repeated tokens. Strategies like summarization can reduce this significantly.
Translate Code Between Languages
LLMs can be surprisingly good at translating code snippets from one programming language to another. Useful for learning new languages or migrating projects.
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.
Guard Against Prompt Injection
If incorporating user input into prompts, be aware of prompt injection vulnerabilities. Sanitize user inputs or use techniques to separate instructions from user data.
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?'
World-Building Assistance
Use LLMs to help build fictional worlds by generating names, cultures, histories, or even maps based on your descriptions and requirements.
Ask for Code Optimization Suggestions
Provide a working piece of code to an LLM and ask for suggestions on how to optimize it for performance or readability.
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.
Chain Prompts for Multi-Step Tasks
For complex tasks, chain multiple prompts together. The output of one LLM call becomes the input (or part of the input) for the next. This allows for sophisticated workflows.
Use for Boilerplate Code
LLMs are excellent at generating boilerplate code for common patterns (e.g., setting up a new class, a basic API endpoint, HTML structure).
Debate with an LLM
To explore different sides of an argument, ask an LLM to take a specific stance on a topic and then debate it. Instruct it to provide evidence or reasoning for its points.
Golden Rule: Garbage In, Garbage Out
The quality of your LLM's output is highly dependent on the quality of your input prompt. Clear, well-structured, and relevant prompts lead to better results.
Personalized Content Generation
Use LLMs to generate personalized content for users, such as tailored recommendations, custom learning plans, or individualized messages.
Semantic Caching
Beyond exact-match caching, consider semantic caching. If a new prompt is semantically similar to a previously cached one, you might be able to reuse the old response, potentially saving an API call.
Overcome Writer's Block
If you have writer's block, describe your general idea or last sentence to an LLM and ask for suggestions on what could happen next or different ways to phrase something.
Template Prompts
For recurring tasks, create prompt templates with placeholders for variable inputs. This ensures consistency and makes it easier to automate prompt generation.
Refactor Legacy Code
LLMs can assist in refactoring legacy code by suggesting modernizations, improving readability, or even translating to a new language (with careful review).
The 'Assume Role' Technique
Start your prompt with 'Assume the role of a [expert/character].' This helps the LLM adopt the desired persona and knowledge base more effectively.
Generate Practice Problems
Ask an LLM to generate practice problems or quiz questions for a topic you're learning, along with answers and explanations.
Fallback Strategies for LLM Failure
Implement fallback strategies in your application for when the LLM fails, returns an error, or provides an unsatisfactory response. Don't let it be a single point of failure.
Sentiment Analysis with Nuance
When performing sentiment analysis, ask the LLM to not just classify as positive/negative/neutral, but also to identify specific emotions or nuances in the text.
Paraphrasing and Rephrasing
Use LLMs to paraphrase text to avoid plagiarism, simplify complex language, or adapt content for different audiences. Always review for accuracy.
Constraint Satisfaction Prompts
Clearly list all constraints the output must satisfy. For example, 'Write a poem about a cat that is exactly 10 lines long and mentions the moon.'
Generate Documentation from Code
Provide code to an LLM and ask it to generate documentation (e.g., docstrings, comments, or a README section) for that code.
Explain 'ELI5' (Explain Like I'm 5)
A classic prompt technique: ask the LLM to 'Explain [complex topic] like I'm 5 years old.' This forces very simple, clear explanations.
ReAct Prompting (Reason + Act)
A more advanced technique where the LLM is prompted to generate both reasoning traces and actions to take to solve a problem, often interacting with external tools.
Synthetic Data Generation
Use LLMs to generate synthetic data for training other machine learning models, especially when real-world data is scarce or sensitive. Validate quality carefully.
Dialogue Generation
Provide context about characters and a situation, and ask the LLM to write dialogue between them. Specify tone and subtext if needed.
The 'What, Why, How' Framework
Structure prompts by defining: WHAT you want the LLM to do, WHY it's important (context), and HOW it should do it (format, style, constraints).
Generate Regex Patterns
Describe the pattern you want to match in natural language, and ask an LLM to generate the corresponding regular expression. Test it thoroughly.
The 'Pretend To Be' Prompt
Example: 'I am a software developer. Pretend to be a senior architect and review my proposed design [design details].' Helps frame interaction.
Content Moderation Assistance
Use LLMs to help moderate user-generated content by flagging potentially harmful, inappropriate, or off-topic posts for human review.
Progressive Disclosure
For complex tasks, reveal information progressively. Start with basic requirements, get initial output, then add more specific constraints or details.
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.