View a markdown version of this page

提供示例(少样本提示) - Amazon Nova

提供示例(少样本提示)

通过在提示中加入一些任务示例,您可以构建一个结构化模板供 Amazon Nova 2 遵循。这减少了模糊性,提高了输出的准确性和质量。提供清晰的示例,使模型的回复与所需结果更加一致的技巧称为少样本提示

少样本提示的概念是为语言模型提供一些任务示例以及输入和输出格式,然后要求它根据提供的示例为新的输入生成输出结果。这种方法还有助于澄清复杂的指令或任务,使 Amazon Nova 2 更容易理解和解释提出的问题。

在提示中添加示例有何帮助:

添加示例有助于模型生成

  • 与示例风格一致的回复

  • 由于减少了误解指令的几率并最大限度地减少了幻觉,从而提高了回复性能

使用少样本提示提高模型性能的程度将取决于所选示例的质量和多样性。以下项目演示了提示中良好样本的特征:

  • 选择不同的示例:所选示例应代表预期输入/输出在多样性(从常见应用场景到边缘情况)方面的分布情况,以充分涵盖相关应用场景。请务必避免示例中的任何偏差,因为输入中的偏差也会导致输出偏差。

  • 匹配复杂性级别:所提供示例的复杂性应与目标任务或场景保持一致。重要的是要确保在提示中预期的输入和选定的示例之间映射复杂性级别。

  • 确保相关性:所选示例应与手头的问题或目标直接相关。这确保了回复的一致性和均匀性。

提示

如果上述建议不起作用,建议您构建一个基于 RAG 的系统,根据用户输入查询和可用样本池之间的相似之处,通过动态选择样本来增强提示。

在这里,您的用户正在尝试将传入的客户支持工单分类为预定义类别。您可以为 Amazon Nova 2 模型提供一些正确分类的工单示例,以提高其对工单中使用的类别和语言的理解。样本示例应简明扼要,并代表应用程序中针对的所有任务。如果有对任务有意义的特定字段名称(例如本示例中的 TicketCategory),则您的用户可以直接使用这些字段,后跟冒号 ":"

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.

在此示例中,样本以回合形式提供,每个样本一回合,其中 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

在此示例中,您可以指定“示例”部分,然后在系统提示中列出一系列示例。如果您的样本长且复杂,则这种在提示中提供样本的方式特别有用,并且可以帮助模型找到示例样本。

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.