The Art of Crafting Effective Prompts: A Guide to Prompt Engineering

  

Hello, fellow spell-crafters. Today, we're going to delve into the mystical realm of prompt engineering – the art of summoning the full power of AI models through carefully crafted instructions. Why this is even important?

LLM go through our text only once.

When we read something and do not understand the piece of text, we re-read. However, LLMs still lack this superpower. So, it's super important to choose and put our words carefully. There are some frameworks that might help us. Let us review one such powerful framework named "AUTOMAT". Let's understand it character by character.

Act: What action do you want the LLM to take?

Act as a 10th grader Physics tutor..... ✅

Your are a 10th grader Physics tutor.... ✅


You are a helpful AI who can help for Physics problems ❌

User Persona: Who is the user of the generated text? (e.g., a child, a professional, a creative writer)

Explain to a 10th grader..... ✅

Explain to the diabetes patients .... ✅


Tell the user about  ❌

Targeted Action: What specific task do you want the LLM to perform? (e.g., write a blog post, translate a document, create a social media post) Add verbs like translate,extract, etc for the LLM to better understand what exactly to do.

classify as "spam" or "ham"✅

format the code as per PIP 8.... ✅


write code by following guidelines ❌

Output Definition: What format should the output be in? (e.g., text, JSON, bulleted points, decimal number between 0 and 1)

return a probability score between 0 and 1✅

format the result as {"spam" : score} where score can be between 0 and 1.. ✅


is it a spam and what is the chance of it being a spam. ❌

Mode: What is the overall tone or style of the output? (e.g., formal, informal, creative, sarcastic, witty, sensitive)
 

You are a sensitive diabetes care assistant✅

You are a sarcastic blog writer.. ✅


Write a good quality fun blog on  ❌

Atypical Cases: How should the LLM handle unexpected situations? (e.g., what if the user provides incorrect information?)

... If the answer is neither "spam" nor "ham" then set category as "NULL" ✅

Classify the email as spam or ham  ❌

Topic Whitelisting:  You may not want the bot to answer generic questions.

.... Answer only questions related to email spam classification. ✅

... You are a helpful AI assistant who helps to classify emails into spam and ham.  ❌

 

References: The Perfect Prompt (Medium Blog)

generative-ai.io

Bridging the gap between basic tutorials and industry-grade applications, generative-ai.io is dedicated to bringing you the best in generative AI education.

Our content is designed to challenge and elevate your skills, ensuring you are well-prepared for real-world AI development.

Contacts

Refunds:

Refund Policy
Social

Follow us on our social media channels to stay updated.

© Copyright Algoholic (OPC) Private Limited