AI Prompting Tips: Insights from the Hunch Community

AI, prompts, models, tips
AI prompting ideas from the community.

Effective AI prompting is crucial for getting the most out of AI language models. In this post, we'll explore valuable tips from real users in our Discord community, offering practical advice to enhance your AI interactions. We've included actual snippets you can use in your prompting adventures.

Well-formatted outputs

  • Specify headings to guide the output.
    Use headings # Overview and # Examples.
  • Good formatting without being prescriptive about the structure.
    Use well-structured markdown incl. headings, bullets, and tables if appropriate.
  • For bullet points, particularly useful for OpenAI models.
    Output bullets.
  • To skip the shoe leather filler at the beginning of a response and cut straight to the output.
    No preamble. No explanation. or No yapping.
  • Important tip to increases density of info in the response.
    Be concise.
  • For ultra-concise outputs, even no full sentences.
    Use clipped language.

🤖 Contributed by Ross Douglas and David Wilson.

Input clarifications

Use XML and variables for upstream blocks to clarify different inputs. This is particularly useful for Claude models, which are designed to work well with XML tags.

Your task: make the following text better:
<text>
{Text to Improve}
</text>

You may draw from these brainstormed ideas, if helpful:
<brainstorm>
{Text Improvement Ideas}
</brainstorm>

🤖 Contributed by David Wilson.

Enhanced persona descriptions

Not only describe a simple persona, but be more clear about the action and perspective of the persona. For example, if you want the model to generate labels/tags that describe data, ask it to create a labeling strategy that can best teach a new student to understand the topic. Another example is to think as an expert music producer and describe the song in a way that a new music producer could learn from your expertise.

🤖 Contributed by John Lowell.

Dealing with large context

When generating a lot of code, AI models have a tendency to say // ... rest of code to save tokens. Here's a key tip:

Provide the fully updated code, without contractions.

The Input/Output ratio for current models is a bit skewed at the moment (hopefully not for long).

Encourage detailed responses, when needed.

I don't have hands, so please type out everything so I can simply copy and paste.

🤖 Contributed by Jeremiah Harvey and Derek Van Pelt.

Step-by-step reasoning

Here's a fast hack to list out steps of a thought or problem, particularly useful for Claude models. Then map out these steps in individual Hunch blocks for the final result.

First, use <thinking> tags to plan your answer.

Alternatively:

I want you to reason through the problem step by step before coming up with a finished solution by using <thinking></thinking> tags. If you need any information that you don't have, make sure to ask for it.

The block chaining in Hunch is key – incorporate multiple strategies and then have a block evaluate the strategy outputs, and then another block revises those outputs.

🤖 Contributed by Sam Zlotnick, Derek Van Pelt, and John Lowell.

Using examples and separators

Provide examples in your prompts as a shorter way to explain what you want rather than describing it in the prompt. For example, if there's context involved, use separators like --CONTEXT START-- and --CONTEXT END-- for clear segmentation.

Segment everything with those start and stop templates when there are lots of different things going on in the prompt.

🤖 Contributed by Bedros Pamboukian.

Using text expansion

Use TextExpander, where /xxx is a shortcut that expands into a commonly used prompt.

🤖 Contributed by Derek Van Pelt.

Structure data as JSON

For better structuring of data, consider adding this to your prompt.

Use clear, structured JSON format and not context or explanations.

This makes it easier for the models to work with, and it's generally readable by most people. The latter part of the prompt keeps only the necessary data without any filler, similar to No preamble. No explanation.

🤖 Contributed by Anders van Amerongen.

Code-specific tips

  1. If you can answer simply with code, simply answer with code.
  2. If an explanation of a modification is helpful, prefer inline code comments over lengthy textual replies.

🤖 Contributed by Julian Fleck.

Improving SQL queries

Use a structured approach with headings like # Desired outcome, # Plan, # Critique, and # Final SQL. This method ensures understanding of requirements and improves output quality.

write an sql query to calculate the number of users who have used the product 3 or more days out of the past 7 days. I want a number for every day, using the rolling previous 7 days.

Having it state the desired outcome gives me a chance to make sure it's on the same page and that I stated the requirement without ambiguity, which is super useful. Plan followed by Critique seems to generally improve the final output.

This also works for refactoring code, rewriting emails, etc.

🤖 Contributed by Ross Douglas.

Ask if any confusion

Some models do a good job in admitting confusion without explicit prompting them for that admission, such as: I apologize for the confusion, but there appears to be an error in your question. To be sure, ask the model if it encounters inconsistencies.

🤖 Contributed by Julian Fleck.

Politeness in prompting

Use please and thank you in prompts. You know what? This probably can't hurt, and it's a simple hedge against a potential future where some of us will be chosen to become batteries for machines. They'll remember the polite ones.

🤖 Contributed by Sam Zlotnick.

Final thoughts

These diverse prompting techniques demonstrate the creativity and ingenuity of AI users. Please experiment with these methods to find what works best for your specific needs and enhance your AI interactions. Let us know if there's anything on the list you'd like to add.