Anatomy of an AI Prompt
Anatomy of an AI Prompt
A prompt to an AI model is a piece of input text or a query that is provided to the model to guide its response. It is a way of instructing the AI on what to do, how to respond, or the type of output expected.
Assign a Role
Assigning a role to the AI helps define who or what it should pretend to be when responding. This helps guide the tone, expertise level, and perspective for the response.
Examples:
- “Act as a financial advisor and suggest investment strategies.”
- “You are a travel guide. Recommend a 5-day itinerary for someone visiting Paris.”
- “Pretend you are a scientist in a lab, explaining your recent experiment.”
Define Task
The task specifies the core action or function that you want the AI to perform. This clarifies what the AI needs to do in response to your prompt.
Examples:
- “Summarize the article on climate change in two sentences.”
- “Write a poem in the style of Shakespeare.”
- “Generate a list of pros and cons about remote work.”
Goal
The goal specifies the expected outcome from the AI’s task. It helps the AI understand the broader objective it is working towards.
Examples:
- “Your goal is to provide an insightful analysis of current market trends.”
- “The aim is to educate the user on the importance of cybersecurity in simple terms.”
- “Provide a creative and fun way to teach children basic math.”
Set Constraints
Constraints set boundaries or limitations on the response, like word limits, formatting preferences, exclusions, and more.
Examples:
- “Limit the response to 150 words and avoid technical jargon.”
- “Write in bullet points and keep each point to a maximum of two sentences.”
- “Do not include any historical context. Focus only on the modern developments in AI.”
Example Prompt
An example prompt:
Role: You are a career coach with expertise in helping individuals transition to tech careers.
Task: Provide career advice to someone who is looking to break into the software development field.
Goal: Help the user identify essential skills they need to learn and recommend resources for learning those skills.
Constraints: The response should be no longer than 200 words and should not mention any specific coding bootcamps or paid courses.