

# 예제 제공(퓨샷 프롬프팅)
<a name="prompting-provide-examples"></a>

프롬프트에 태스크의 몇 가지 예제를 포함하면 Amazon Nova 2가 따를 수 있는 구조화된 템플릿을 만들 수 있습니다. 이렇게 하면 모호성이 줄어들고 출력의 정확도와 품질이 향상됩니다. 모델의 응답이 원하는 결과에 더 잘 부합하도록 명확한 예제를 제공하는 기술을 *퓨샷 프롬프팅*이라고 합니다.

퓨샷 프롬프팅의 개념은 입력 및 출력 형식과 함께 태스크의 몇 가지 예제를 언어 모델에 제공한 다음 제공된 예제를 기반으로 새 입력에 대한 출력을 생성하도록 요청하는 것입니다. 또한 이 방법은 복잡한 지침이나 태스크를 명확히 하여 Amazon Nova 2가 요청 내용을 더 쉽게 이해하고 해석할 수 있도록 합니다.

**프롬프트에 예제를 추가하는 방법:**

예제를 추가하면 모델이 다음을 수행하는 데 도움이 될 수 있습니다.
+ 예제의 스타일과 일치하는 일관된 응답 생성 
+ 지침을 잘못 해석할 가능성을 줄이고 할루시네이션을 최소화하여 효과적인 응답 제공

퓨샷 프롬프팅을 사용하여 모델 성능이 얼마나 향상되는지는 선택한 예제의 품질과 다양성에 따라 달라집니다. 다음 항목은 프롬프트에서 좋은 샷의 특징을 보여줍니다.
+ **다양한 예제 선택**: 선택한 예제는 관련 사용 사례를 적절히 포괄할 수 있도록 다양성(일반적인 사용 사례부터 엣지 사례까지) 측면에서 예상되는 입력/출력 분포를 나타내야 합니다. 입력의 편향으로 인해 출력도 편향될 수 있으므로 예제에서 편향을 방지하는 것이 중요합니다.
+ **복잡성 수준 일치**: 제공된 예제의 복잡성은 대상 태스크 또는 시나리오와 일치해야 합니다. 프롬프트에서 예상 입력과 선택한 예제 사이에 복잡성 등급이 매핑되었는지 확인하는 것이 중요합니다.
+ **관련성 확인**: 선택한 예제는 현재 문제 또는 목표와 직접 관련이 있어야 합니다. 이렇게 하면 응답의 일관성과 균일성이 보장됩니다.

**작은 정보**  
위의 제안이 효과가 없다면 사용자 입력 쿼리와 사용 가능한 샷 풀 간의 유사성을 기반으로 동적 샷 선택으로 프롬프트를 보강하는 RAG 기반 시스템을 구축하는 것이 좋습니다.

## 예제 1: 사용자 프롬프트에 예제 제공
<a name="example-collapsible1"></a>

여기에서는 사용자가 들어오는 고객 지원 티켓을 미리 정의된 카테고리로 분류하려고 합니다. Amazon Nova 2 모델에 올바르게 분류된 티켓의 몇 가지 예제를 제공하여 티켓에 사용되는 카테고리와 언어에 대한 이해를 높일 수 있습니다. 예시 예제는 간결해야 하며 애플리케이션에서 목표로 하는 모든 태스크를 표현해야 합니다. 이 예의 `Ticket`이나 `Category`와 같이 태스크에 의미 있는 특정 필드 이름이 있는 경우에는 콜론 `":"`을 바로 뒤에 붙여 해당 필드를 사용할 수 있습니다.

------
#### [ 0-shot prompt ]

사용자:

```
Please classify the following customer support tickets into one of the categories: "Technical Issue," "Billing Inquiry," or "General Inquiry." 

Ticket: "Can you explain why my latest bill is higher than usual? I haven't changed my plan."
```

어시스턴트:

```
The customer support ticket should be classified as a "Billing Inquiry."

 Here’s the reasoning:
 - The customer is asking about the reason for a change in their latest bill amount.
 - The context revolves around billing and payment, which falls under the category of "Billing Inquiry."
```

------
#### [ 3-shot prompt ]

사용자:

```
Please classify the following customer support tickets into one of the categories: "Technical Issue," "Billing Inquiry," or "General Inquiry." 
Use these examples to guide your classification:

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

Now, classify the following ticket:
Ticket: "Can you explain why my latest bill is higher than usual? I haven't changed my plan."
```

어시스턴트:

```
Category: Billing Inquiry

Explanation: The ticket is asking for an explanation regarding a change in the billing amount, which falls under the billing category as it pertains to questions about charges or payments.
```

------

## 예제 2: 턴 프롬프트로 예제 제공
<a name="example-collapsible2"></a>

이 예제에서는 예시가 예시당 한 차례씩 턴으로 제공되며, `User` 역할에는 입력이, `Assistant` 역할에는 해당 예제에 대한 예상 출력이 포함되어 있습니다.

------
#### [ 0-shot Prompt ]

시스템:

```
Your task is to Classify the following texts into the appropriate categories. The categories to classify are: 

Categories: 
- Food 
- Entertainment 
- Health 
- Wealth 
- Other
```

사용자:

```
I have 20$ in my pocket.
```

어시스턴트:

```
Category: Wealth

Explanation: The text mentions a specific amount of money, which falls under the category of wealth. The presence of a monetary value directly relates to financial status or economic aspect.
```

------
#### [ 3-shot Prompt (as turns) ]

시스템:

```
Your task is to Classify the following texts into the appropriate categories. The categories to classify are: 

Categories: 
- Food 
- Entertainment 
- Health 
- Wealth 
- Other
```

사용자:

```
I love to eat pizza.
```

어시스턴트:

```
Food
```

사용자:

```
I enjoy watching movies.
```

어시스턴트:

```
Entertainment
```

사용자:

```
I am going to the gym after this.
```

어시스턴트:

```
Health
```

사용자:

```
I have 20$ in my pocket.
```

어시스턴트:

```
Wealth
```

------

## 예제 3: 시스템 프롬프트에 예제 제공
<a name="example-collapsible3"></a>

이 예에서는 '예제' 섹션을 지정한 다음 시스템 프롬프트에 일련의 예제를 나열할 수 있습니다. 프롬프트에 예시를 제공하는 이 방법은 예시가 길고 복잡한 경우 특히 유용하며 모델이 예제 샷을 찾는 데 도움이 됩니다.

------
#### [ 0-shot Prompt ]

시스템:

```
You are an AI assistant helping to draft professional reports for enterprise stakeholders. Ensure the report is formatted in rich text, with headings, bullet points, and highlighted important tasks.
```

사용자:

```
Draft a detailed project update report for our stakeholders, summarizing the project milestones achieved, tasks completed, and future plans.
```

어시스턴트:

```
# Project Update Report

## Executive Summary
This report provides a comprehensive update on the project milestones achieved, tasks completed, and future plans. Our team has made significant progress, and we are on track to meet the project goals. The following sections outline the details of our accomplishments and upcoming activities.

---

## Project Milestones Achieved

### **1. Project Initiation**
- **Milestone Date:** July 15, 2023
- **Description:** Completed initial project planning and secured stakeholder approval.

### **2. System Design Completion**
- **Milestone Date:** September 30, 2023
- **Description:** Finished the detailed system design and received positive feedback from technical review meetings.

### **3. Prototype Development**
- **Milestone Date:** November 15, 2023
- **Description:** Developed and tested a working prototype of the system.

---

## Tasks Completed

### **1. Requirement Gathering**
- **Description:** Conducted comprehensive stakeholder interviews and collected detailed requirements.
- **Highlighted Important Tasks:**
  - **User Story Mapping:** Mapped out user stories to ensure all user needs are addressed.
  - **Requirement Documentation:** Created detailed requirement specifications.

### **2. System Architecture Design**
- **Description:** Designed the system architecture, focusing on scalability and maintainability.
- **Highlighted Important Tasks:**
  - **Technology Stack Selection:** Chose the appropriate technology stack based on project requirements.
  - **Architecture Diagrams:** Developed detailed architecture diagrams for easy understanding.

### **3. Prototype Development and Testing**
- **Description:** Developed and rigorously tested the prototype.
- **Highlighted Important Tasks:**
  - **Coding:** Implemented core functionalities of the prototype.
  - **Testing:** Conducted unit and integration testing to ensure prototype reliability.

---

## Future Plans

### **1. Full System Development**
- **Description:** Begin the full-scale development of the system based on the approved design and prototype.
- **Highlighted Important Tasks:**
  - **Module Development:** Develop each module as per the design specifications.
  - **Code Reviews:** Implement regular code reviews to maintain code quality.

### **2. User Acceptance Testing (UAT)**
- **Description:** Conduct UAT to ensure the system meets user requirements and is ready for deployment.
- **Highlighted Important Tasks:**
  - **Test Plan Development:** Create detailed UAT plans and test cases.
  - **UAT Execution:** Execute UAT and gather feedback for final adjustments.

### **3. Deployment and Training**
- **Description:** Deploy the system and provide necessary training to end-users.
- **Highlighted Important Tasks:**
  - **Deployment:** Roll out the system to the production environment.
  - **Training Sessions:** Organize training sessions for users to familiarize them with the new system.

---

## Conclusion
Our project has successfully achieved key milestones and completed significant tasks. With the current momentum, we are well-positioned to meet our future objectives. We remain committed to delivering a high-quality system that meets all stakeholder expectations.

---

**Prepared by:**
[Your Name]
[Your Position]
[Date]

**Contact Information:**
[Your Email]
[Your Phone Number]

---

This detailed update aims to keep stakeholders informed and reassured about the project's progress and future direction. For any queries or further information, please do not hesitate to contact me directly.
```

------
#### [ 2-shot Prompt ]

시스템:

```
You are an AI assistant helping to draft professional reports for enterprise stakeholders. Below are a few examples of well-formatted project update reports to guide your response. 

<Example 1>

<b>Project Update Report</b><br>
<i>Date:</i> January 15, 2023<br>
<hr>


<b>Project Milestones Achieved:</b><br>
- Successfully launched the new CRM system.<br>
- Integrated the marketing automation tool.<br>
- Completed the employee training sessions.

<b>Tasks Completed:</b><br>
- Developed the user manual.<br>
- Conducted system testing.<br>
- Prepared the training materials.

<b>Future Plans:</b><br>
- Roll out the CRM system to all departments.<br>
- Schedule follow-up training sessions.<br>
- Monitor system performance and make necessary adjustments.

<hr>
<b>Prepared by:</b><br>
[Your Name]<br>
[Your Position]<br>
[Your Contact Information]

<Example 2>

<b>Project Update Report</b><br>
<i>Date:</i> February 20, 2023<br>
<hr>

<b>Project Milestones Achieved:</b><br>
- Launched the new website.<br>
- Completed the SEO optimization.<br>
- Organized the stakeholder meeting.

<b>Tasks Completed:</b><br>
- Designed the website layout.<br>
- Wrote the content for the website.<br>
- Tested the website functionality

<b>Future Plans:</b><br>
- Implement the analytics tracking.<br>
- Launch the social media campaign.<br>
- Gather feedback from stakeholders.

<hr>
<b>Prepared by:</b><br>
[Your Name]<br>
[Your Position]<br>
[Your Contact Information]
```

사용자:

```
Draft a detailed project update report for our stakeholders, summarizing the project milestones achieved, tasks completed, and future plans.
```

어시스턴트:

```
<b>Project Update Report</b><br>
<i>Date:</i> October 5, 2023<br>
<hr>

<b>Project Milestones Achieved:</b><br>
- Successfully completed the implementation of the new enterprise resource planning (ERP) system.<br>
- Conducted and completed the first phase of the data migration process.<br>
- Successfully launched the new inventory management module.

<b>Tasks Completed:</b><br>
- Developed and finalized the comprehensive user training program, including detailed user manuals and video tutorials.<br>
- Conducted extensive system integration testing with all existing systems and ensured seamless interoperability.<br>
- Executed the initial data migration from the legacy system to the new ERP system, resulting in a 95% accuracy rate.

<b>Future Plans:</b><br>
- Roll out the new ERP system to all departments in the next two phases.<br>
- Schedule and conduct follow-up training sessions for all employees.<br>
- Implement the remaining modules of the ERP system, including financial management and human resources.<br>
- Establish a robust monitoring and support framework to ensure smooth system operation and address any issues promptly.

<hr>
<b>Prepared by:</b><br>
[Your Name]<br>
[Your Position]<br>
[Your Contact Information]

---

This detailed report provides a clear and concise overview of the project's progress, highlighting the milestones achieved, tasks completed, and future plans. It ensures stakeholders are well-informed and can make strategic decisions based on the current status of the project.
```

------