2 min read

Effective prompting tips from Anthropic

🤖 Tactical Thursday: The Art of AI Whispering!

I just dove into Anthropic's "Building towards Computer Use" tutorial on DeepLearning.AI, and boy, did I stumble upon a gold mine! While I went looking for computer use insights, I struck prompting perfection instead.

Let me share these prompting power moves for your enterprise AI game:

1. 🎭 Play Casting Director

Just like how you wouldn't send an accountant to do a chef's job, AIs need clear roles too! Example from Anthropic's playbook:

"You are an AI assistant specialized in analyzing customer reviews. Your task is to determine the overall sentiment of a given review and extract any specific complaints mentioned. Please follow these instructions carefully:"

2. 📝 Set Crystal Clear Boundaries

Think of it as putting training wheels on your AI bicycle - use opening and closing tags for long inputs, and give your AI a clear format to follow. No more "freestyle" responses that leave you scratching your head!

Here are some examples from Anthropic:

  • opening and closing tags:
Review the following customer feedback:
<customer_review>
{{CUSTOMER_REVIEW}}
</customer_review>
  • Detailed output instructions:
Based on your analysis,
generate a JSON output with the following structure:
<json
{
 "sentiment_score": "Positive|Negative|Neutral",
"sentiment_analysis": "Explanation of sentiment classification",
"complaints": [
   "Complaint 1",
"Complaint 2",
"..."
 ]
}
</json>
If no complaints are found, use an empty array for the "complaints" field.
Remember:
- Base your analysis solely on the content of the provided review.
- Do not make assumptions or include information not present in the review.
- Be objective and focus on the customer's expressed opinions and experiences.
- Ensure your JSON output is properly formatted and contains all required fields.

3. 🧠 Make Your AI Show Its Work

Remember those math teachers who always said "show your work"? They were onto something! When AIs think out loud, they're less likely to face-plant into wrong answers. While AI agents are getting smarter at figuring things out, there's still massive value in spelling out what you want them to evaluate.

Here is a detailed example from Anthropic:

Analyze the review using the following steps.
Show your work in <review_breakdown> tags:
a) Key Phrase Extraction:
- Extract and quote key phrases that indicate sentiment (positive, negative, or neutral).
  - Extract and quote key phrases that suggest complaints or issues.
b) Sentiment Analysis:
  - Consider arguments for positive, negative, and neutral sentiment based on the extracted phrases.
  - Determine the overall sentiment (positive, negative, or neutral) based on your analysis.
  - Explain your reasoning for the sentiment classification.

🤔 I'm curious - are you already using these prompting tricks in your enterprise workflow? Drop your experiences below!