Crafting specific user queries is crucial in prompt engineering. Well-crafted queries direct Amazon Nova text understanding models to generate accurate and pertinent responses. To craft such queries, it is essential to start by providing contextual information in the query. The context provided helps situate the model better by aligning to clear target-user scenarios, thereby enhancing the relevance and coherence of the output.
Topics
Providing contextual, specific information
Amazon Nova models work best if the instructions are clear, well structured, short, and specific.
Prompt Template:
// use this to clearly define the task and job needed by the model Task: {{Task summary}} // use this to provide contextual information related to the task Context information: - {{Context and content information 1}} - {{Context and content information 2}} ... // use this to provide any model instructions that you want model to adhere to Model Instructions: - {{ Other Model Instructions }} ... // use this to provide response style and formatting guidance Response style and format requirements: - {{Style and format requirement 1}} - {{Style and format requirement 2}} ...
Here is an example of a prompt that is rewritten with specific and contextual information. Adding more contextual information helps the model ground towards the desired behavior.
Role |
Unclear Prompt |
Clear Prompt |
---|---|---|
User |
Write me a meeting invite to the project team |
Write me a meeting invite to the project team. The meeting is about project planning, and should be held on October 16th, from 10 AM to 11 AM in Conference Room B. Please include an agenda that covers our progress on the project thus far, as well as any upcoming milestones and deadlines. |
Assistant |
Certainly! Here's a sample meeting invite for your project team: --- Subject: Project Team Meeting - [Project Name] Date: [Insert Date]Time: [Insert Time]Duration: [Insert Duration]Location: [Insert Location] / [Zoom/Teams Link if Online] Agenda:
Additional Notes:
Contact Information: For any questions or concerns before the meeting, please feel free to reach out to [Your Name] at [Your Email] or [Your Phone Number]. We look forward to a productive discussion and to kicking off our project with enthusiasm! Best regards, [Your Full Name][Your Position][Your Contact Information] --- Feel free to customize this template to better fit your specific project and team needs! |
Meeting Invitation: Project Planning Session Date: October 16thTime: 10:00 AM - 11:00 AMLocation: Conference Room B Agenda:
Please ensure your attendance to discuss and finalize our project planning for the next phase. Your insights and contributions are highly valued. Best regards, [Your Name][Your Position][Your Contact Information] |
-
Be clear: When prompting the model, try to keep instructions as clear as possible in a way a human would understand it versus a machine (for instance, a JSON-style list).
-
Be specific: Give the model specific instructions about what the task is, what the expected output is, and any additional context to help the model respond the way you want.
Specify the output format and style
If you want Amazon Nova to generate responses that are tailored to your specific needs, you can specify the format and style of the output. For example, if you want to generate responses only in JSON or constrain the response length to a maximum number of words, bullet points, or paragraphs. This enables Amazon Nova to better understand your requirements and produce output that is more relevant and easier to parse.
Use capitalization and strong wordings such as DO, DO NOT, MUST to emphasize the rules you want the model to strictly obey. For example, if you want only one JSON object in the response, you can instruct the model by saying "You MUST answer in JSON format only. DO NOT use any other format while answering the question."
Here are some example prompts that are rewritten with specific and contextual information. Adding more contextual information helps the model ground towards the desired behavior.
Adding extra details on the response formatting can help the model accomplish the desired result. Some of the other commonly used response format include CSV, Markdown, YAML, and XML
Role |
Prompt without any Style constraints |
Prompt with Style constraints |
---|---|---|
User |
Outline the different types of rooms available in a typical 4-star hotel, including their features. |
Outline the different types of rooms available in a typical 4-star hotel, including their features. All responses MUST be in YAML format. |
Assistant |
In a typical 4-star hotel, you'll find a range of room types, each designed to cater to different guest needs and preferences. Here's an outline of the different types of rooms available along with their features: 1. Standard Room
2. Deluxe Room
3. Suite
4. Family Room
5. Executive Room
6. Junior Suite
7. Premium Room
8. Connecting Rooms
9. Accessible Rooms
10. Business Room
Each room type in a 4-star hotel is designed to provide comfort, convenience, and luxury tailored to different guest needs, ensuring a pleasant stay for all types of travelers. |
|
In this case, the prompt with style constraints provides comprehensive information on the constraints to follow and the desired response format. As observed in the response, the optimized prompt aligns more closely with the requested brevity and bulleted list structure.
Role |
Prompt without any Style constraints |
Prompt with Style constraints |
---|---|---|
User |
Explain the process of checking in a guest at a luxury resort. |
Explain the process of checking in a guest at a luxury resort. Provide all answers in a numbered list format, with each point containing no more than 15 words, and no more than 6 bullet points. |
Assistant |
Checking in a guest at a luxury resort involves a meticulous and personalized process designed to ensure a seamless and memorable start to their stay. Here's a detailed overview of the steps involved: Pre-Arrival Preparation
Arrival and Initial Interaction
Documentation and Formalities
Room Assignment
Additional Services
Final Touches
By following these steps, a luxury resort aims to provide an exceptional check-in experience that sets the tone for an unforgettable stay. |
|
Here, the prompt with the response format forces the model to respond only with the category number and limit it to be between 1-10, instead of being highly verbose.
Role |
Prompt without any response format |
Prompt with response format |
---|---|---|
User |
In this task, you are given a text which is the body of a document. Your job is to classify the topic of the document into these categories: 1)Company, 2)Educational Institution, 3)Artist, 4)Athlete, 5)Office Holder, 6)Mean of transportation, 7)Building, 8)Natural place, 9)Village, 10)Animal. Text: Johangsan is a mountain of South Korea. It has an elevation of 954 metres. |
In this task, you are given a text which is the body of a document. Your job is to classify the topic of the document into these categories: 1)Company, 2)Educational Institution, 3)Artist, 4)Athlete, 5)Office Holder, 6)Mean of transportation, 7)Building, 8)Natural place, 9)Village, 10)Animal. Your output should be the category number. DO NOT generate anything apart from numbers 1-10. Text: Johangsan is a mountain of South Korea. It has an elevation of 954 metres. |
Assistant |
To classify the topic of the given text, let's analyze the content step-by-step:
Based on the information provided, the text describes a geographical feature, specifically a mountain. From the given categories, the most appropriate classification for this document is: 8) Natural place The text does not mention any company, educational institution, artist, athlete, office holder, means of transportation, building, village, or animal. Therefore, the classification as a "Natural place" is the most fitting choice. |
8 |
Provide clear prompt sections
Beyond the initial context, a structured query format plays a significant role in optimizing interactions with the language model. Separating distinct parts of the input with delimiters ensures clarity and enhances Amazon Nova models' ability to understand the query's structure. Another effective way is to use numbered lists or bullet points, which can help to break down the task into manageable steps and provide a clear outline of the actions that need to be taken. This structured approach aids in reducing ambiguity and improving the accuracy of the responses generated.
Notice how in the Sectioned Prompt column, the prompt is clearer and has delineated sections for different entities like Tasks, Context, Requirements, and the rest when compared to the instructions in the Unsectioned Prompt column.
Role |
Unsectioned Prompt |
Sectioned Prompt |
---|---|---|
User |
Write an article about climate change for high school students explaining basic concepts, current impacts, and individual actions to mitigate it. Make it informative and engaging with simple language, including statistics and real-world examples. |
Task: Write an article Context Section: Topic: Climate Change Target Audience: High School Students Purpose: Educational Article Content Requirements:
Tone and Style:
|
Assistant |
Understanding Climate Change: What It Is, What It's Doing, and What You Can Do About It Introduction Climate change might sound like a big, complicated topic, but it's really about the way our planet's weather is changing over time. This change is mostly happening because humans are doing things that are making our Earth warmer. Let's break it down so you can understand what's going on and what you can do to help. What Is Climate Change? Climate change refers to long-term shifts in temperatures and weather patterns. These shifts may be natural, but since the 1800s, human activities have been the main driver of rapid climate change. Key Concept: Greenhouse Gases To understand this, we need to talk about greenhouse gases. These gases, like carbon dioxide (CO2), methane (CH4), and nitrous oxide (N2O), trap heat in our atmosphere. Without these gases, Earth would be too cold for most life forms. But when we burn fossil fuels (like coal, oil, and natural gas) and cut down forests, we release too much CO2 and other greenhouse gases, trapping more heat and making the planet warmer. Current Impacts of Climate Change Let's look at some real-world examples to see how climate change is affecting our world today. 1. Rising Temperatures Since the late 19th century, Earth's average surface temperature has risen about 2 degrees Fahrenheit (1 degree Celsius). Scientists predict that if we don't change our ways, it could rise by 3.6 to 4.3 degrees Fahrenheit (2 to 2.4 degrees Celsius) by the end of this century. 2. More Extreme Weather Climate change is making extreme weather events more frequent and severe. For example:
3. Melting Ice Caps and Rising Sea Levels Glaciers and ice sheets are melting at alarming rates. This not only affects wildlife but also leads to rising sea levels. Since 1901, global sea levels have risen by about 8 inches (20 centimeters). By 2100, they could rise by another 1 to 4 feet (0.3 to 1.2 meters). 4. Ocean Acidification As CO2 levels rise, more of it is absorbed by the oceans, making them more acidic. This is particularly harmful to marine life, including coral reefs. Coral reefs are crucial for marine biodiversity but are now dying at an alarming rate. Individual Actions to Mitigate Climate Change You might think that since climate change is a huge problem, one person can't make a difference. But even small actions can add up to make a big impact. 1. Reduce, Reuse, Recycle Try to minimize waste by:
2. Conserve Energy Small changes can lead to big savings:
3. Use Less Meat Livestock farming is a major contributor to greenhouse gas emissions. By eating less meat, especially beef, you can reduce your carbon footprint. 4. Support Renewable Energy If possible, support or switch to renewable energy sources like solar or wind power. Even advocating for these options in your community can make a difference. 5. Educate Yourself and Others Knowledge is power. The more you know about climate change, the more you can help others understand it. Share facts and encourage your friends and family to take action too. Conclusion Climate change is a pressing issue that affects everyone on the planet. By understanding its basics, recognizing its current impacts, and taking individual actions, you can play a crucial role in mitigating its effects. Remember, every small step counts, and together, we can make a big difference for our planet. Let's start today and build a sustainable future! |
Understanding Climate Change: A Guide for High School Students Introduction Climate change is one of the most pressing issues of our time. It affects our planet, our ecosystems, and our daily lives. Understanding what climate change is and how it impacts us can help us take action to make a difference. This article will explain the basic concepts of climate change, provide examples of its current impacts, and suggest actions you can take to help mitigate it. What is Climate Change? Climate change refers to long-term changes in global temperatures and weather patterns. These changes are primarily caused by human activities, especially the burning of fossil fuels like coal, oil, and natural gas. When we burn these fuels, we release large amounts of greenhouse gases, such as carbon dioxide (CO2) and methane (CH4), into the atmosphere. These gases trap heat from the sun, causing the Earth's temperature to rise. This is often referred to as the greenhouse effect. Basic Concepts:
Current Impacts of Climate Change On Ecosystems:
On Human Populations:
Actions You Can Take Even though climate change is a massive issue, there are many actions you can take to help mitigate its effects. Here are some simple steps you can start with today:
Conclusion Climate change is a complex issue with far-reaching impacts. However, understanding it and taking action can make a significant difference. By learning about the basic concepts, recognizing the current impacts, and implementing simple changes in our daily lives, we can all contribute to mitigating climate change. Remember, every small action counts, and together, we can create a more sustainable future for our planet. |