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
Specify Output Format for Data
When asking an LLM to analyze or extract data, clearly specify the desired output format (e.g., JSON, CSV, markdown table). This makes the output easier to parse and use programmatically.
Regenerate for Different Results
If you're not satisfied with an LLM's response, simply try regenerating it. Due to the probabilistic nature of LLMs, you might get a better answer on a subsequent attempt, especially with higher temperature settings.
Use LLMs for Brainstorming
Stuck for ideas? LLMs are excellent brainstorming partners. Ask for blog post ideas, marketing slogans, plot twists, or research directions. Use their suggestions as a starting point.
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.'
Implement Content Filtering
If your application involves user-generated content that is then processed by an LLM, or if the LLM generates content for users, implement content filtering for harmful or inappropriate material.
Ask for Multiple Code Solutions
If there are several ways to implement a feature, ask the LLM to provide a few different code solutions along with their pros and cons. This can help you choose the best approach.
Attribute AI-Generated Content
When using LLM-generated content publicly, consider attributing it as AI-assisted or AI-generated, especially in contexts where transparency is important (e.g., news, academic writing).
Understand Token Boundaries
Use a tokenizer tool (like the one on TokenCalculator.com!) to see how your text is split into tokens. This helps you understand why certain phrasing might consume more tokens and how to optimize it.
Use LLMs as Tutors
LLMs can be great for learning. Ask them to explain complex concepts in simple terms, quiz you on topics, or provide examples. Specify your current understanding level for tailored explanations.
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.
Draft Emails and Reports Quickly
Use LLMs to generate first drafts of emails, reports, or other documents. Provide key points and desired tone, then refine the output. This can save significant time.
Request Code Comments
When asking an LLM to generate code, also ask it to include comments explaining the code. This improves readability and maintainability.
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.
Be Wary of Long Conversations
In conversational AI, the entire chat history is often sent with each new message, increasing token count. Summarize or truncate past history for long conversations to manage costs.
Explore Different Creative Styles
Ask the LLM to write in the style of a specific author, genre, or era. For example, 'Write a poem about a cat in the style of Edgar Allan Poe.' This can lead to fun and surprising results.
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.
Implement Exponential Backoff for Retries
When making API calls to LLMs, implement exponential backoff for retries. This helps manage rate limits and temporary server issues gracefully without overwhelming the API.
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.'
High-Quality Data for Fine-tuning
If you plan to fine-tune an LLM, the quality of your training data is paramount. Even a small dataset of high-quality, relevant examples can be more effective than a large, noisy one.
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.
Test for Cultural Nuances
When building multilingual AI applications, test responses not just for linguistic accuracy but also for cultural appropriateness and nuances in each target language and region.
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.
Cost-Effective GPT-3.5-Turbo
For the most cost-effective solution, GPT-3.5-Turbo often provides 80% of GPT-4's quality at 10% of the cost.
Claude XML Tags
When using Claude, make use of its XML tags for better structure in your prompts.
GPT-4o Strengths
GPT-4o excels at multi-modal tasks combining text, image, and code understanding.
Implement Caching
Implement caching strategies for repeated queries to reduce API calls and costs.
Use TokenCalculator.com
Use TokenCalculator.com to estimate costs before running expensive operations.
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.
Batch Small Requests
If you have many small, independent tasks for an LLM, batch them into a single API call if the model and API support it, rather than many separate calls. This can reduce overhead.
Specify Language and Version
When asking for code, specify the programming language and, if relevant, the version (e.g., 'Python 3.9', 'JavaScript ES6'). This helps avoid ambiguity and deprecated features.
Ask for Different Perspectives
When trying to understand a topic, ask the LLM to explain it from different perspectives or viewpoints. This can deepen your comprehension.
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.
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.