<few_shot_prompting>
<overview>
By including a few examples of your task within the prompt, you can build a structured template for Amazon Nova to follow. This reduces ambiguity and enhances the accuracy and quality of the output. The technique of providing clear examples to make the model's responses more aligned with the desired outcome is called few-shot prompting.

The concept of few-shot prompting is to provide the language model with a few examples of the task, along with the input and output format, and then ask it to generate the output for a new input based on the provided examples. This method also helps in clarifying complex instructions or tasks, making it easier for Amazon Nova to understand and interpret what is being asked.
</overview>

<benefits>
Adding examples can help the model with producing:
- Consistent responses which are uniform to the style of the examples
- Performant responses due to reducing the chance of misinterpreting instructions, and minimizing hallucinations
</benefits>

<guidelines>
The amount by which model performance improves using few shot prompting will depend on the quality and diversity of your chosen examples. The following items demonstrate the characteristics of good shots in the prompt:

1. Select diverse examples: The examples chosen should represent the distribution of your expected input/output in terms of diversity (ranging from common use cases to edge cases) to adequately cover relevant use cases. It is important to avoid any biases in your examples, as bias in the inputs can cause outputs to be biased as well.

2. Match complexity levels: The complexity of the examples provided should align with the target task or scenario. It is important to make sure the complexity grade is mapped between expected the input and the chosen example in the prompt.

3. Ensure relevance: The examples selected should be directly relevant to the problem or objective at hand. This ensures consistency and uniformity in responses.
</guidelines>

<implementation_examples>
<example1 name="Examples in user prompt">
Context: Customer support ticket classification into predefined categories
Format: Provide examples with Ticket: and Category: labels

Example implementation:
Please classify the following customer support tickets into categories: "Technical Issue," "Billing Inquiry," or "General Inquiry."

Examples:
Ticket: "I can't log in to my account. The system keeps giving me an error message."
Category: Technical Issue

Ticket: "I received an email saying my account will be suspended unless I make a payment. Is this a scam?"
Category: Billing Inquiry

Ticket: "What are the hours of operation for your customer support team?"
Category: General Inquiry
</example1>

<example2 name="Examples as conversation turns">
Context: Category classification using conversation format
Format: Present examples as User/Assistant turns

System: Your task is to Classify texts into categories: Food, Entertainment, Health, Wealth, Other

User: I love to eat pizza.
Assistant: Food

User: I enjoy watching movies.
Assistant: Entertainment

User: I am going to the gym after this.
Assistant: Health
</example2>

<example3 name="Examples in system prompt">
Context: Professional report drafting with formatting examples
Format: Include complete example reports in system prompt using <Example> tags

System prompt structure:
You are an AI assistant helping to draft professional reports for enterprise stakeholders. Below are examples of well-formatted project update reports to guide your response.

<Example 1>
[Include complete formatted report example with sections like:
- Project Milestones Achieved
- Tasks Completed
- Future Plans
- Contact Information]
</Example 1>

<Example 2>
[Include another complete report example following same structure]
</Example 3>

</implementation_examples>

<tip>
If the above suggestions do not work, we recommended you build a RAG-based system that augments the prompt with a dynamic selection of shots based on the similarities between the user-input query and an available pool of shots.
</tip>

</few_shot_prompting>