1. 使用最新的模型
2.?將指令放在提示詞的開頭,并使用 ### 或 """ 來分隔指令和上下文,例如
錯誤示范?
將下面的文本總結為一個要點列表,列出最重要的內容。
Summarize the text below as a bullet point list of the most important points.{text input here}正確示范?
Summarize the text below as a bullet point list of the most important points.Text: """
{text input here}
"""
3.?明確說明上下文、結果、長度、格式、風格等
錯誤示范?
Write a poem about OpenAI. 正確示范?
寫一首簡短的鼓舞人心的詩,主題是 OpenAI 最近推出的 DALL-E 產品(DALL-E 是一個文本轉圖像的機器學習模型),以 {著名詩人} 的風格進行創作。
Write a short inspiring poem about OpenAI, focusing on the recent DALL-E product launch (DALL-E is a text to image ML model) in the style of a {famous poet}
4. 通過示例明確說明所需的輸出格式
錯誤示范?
提取下面文本中提到的實體。提取以下四種實體類型:公司名稱、人物名稱、特定話題和主題。
Extract the entities mentioned in the text below. Extract the following 4 entity types: company names, people names, specific topics and themes.Text: {text}正確示范?
提取下面文本中提到的重要實體。首先提取所有公司名稱,然后提取所有人物名稱,再提取符合內容的特定話題,最后提取一般性的主題。所需格式:
公司名稱:<以逗號分隔的公司名稱列表>
人物名稱:-||-
特定話題:-||-
一般主題:-||-文本:{text}
Extract the important entities mentioned in the text below. First extract all company names, then extract all people names, then extract specific topics which fit the content and finally extract general overarching themesDesired format:
Company names: <comma_separated_list_of_company_names>
People names: -||-
Specific topics: -||-
General themes: -||-Text: {text}
5.?先嘗試零樣本(Zero-shot),然后嘗試少樣本(Few-shot),如果都不起作用,再進行微調(Fine-tune)
Zero-shot
Extract keywords from the below text.Text: {text}Keywords:Few-shot
從以下對應的文本中提取關鍵詞。
Extract keywords from the corresponding texts below.文本 1: Stripe 提供 API,Web 開發人員可以使用這些 API 將支付處理集成到其網站和移動應用程序中。
關鍵詞 1: Stripe、支付處理、API、Web 開發人員、網站、移動應用程序
Text 1: Stripe provides APIs that web developers can use to integrate payment processing into their websites and mobile applications.
Keywords 1: Stripe, payment processing, APIs, web developers, websites, mobile applications
##文本 2: OpenAI 訓練了最前沿的語言模型,這些模型非常擅長理解和生成文本。我們的 API 提供了對這些模型的訪問,并可用于幾乎所有涉及語言處理的任務。
關鍵詞 2: OpenAI、語言模型、文本處理、API
Text 2: OpenAI has trained cutting-edge language models that are very good at understanding and generating text. Our API provides access to these models and can be used to solve virtually any task that involves processing language.
Keywords 2: OpenAI, language models, text processing, API.
##
Text 3: {text}
Keywords 3:
6.?減少“華而不實”和不精確的描述
錯誤示范?
此產品的描述應盡量簡短,僅需幾句話,不宜過多。
The description for this product should be fairly short, a few sentences only, and not too much more.正確示范?
使用一個包含 3 到 5 句話的段落來描述此產品。
Use a 3 to 5 sentence paragraph to describe this product.
7. 直接說明該做什么,而不是不該做什么
錯誤示范?
以下是代理(Agent)與客戶(Customer)之間的對話。不要詢問用戶名或密碼。不要重復內容。客戶: 我無法登錄我的賬戶。
代理:
The following is a conversation between an Agent and a Customer. DO NOT ASK USERNAME OR PASSWORD. DO NOT REPEAT.Customer: I can’t log in to my account.
Agent:正確示范?
以下是代理(Agent)與客戶(Customer)之間的對話。代理應嘗試診斷問題并提供解決方案,同時避免詢問任何與個人身份信息(PII)相關的問題。
不要詢問 PII(如用戶名或密碼),而應引導用戶訪問幫助文章:www.samplewebsite.com/help/faq客戶: 我無法登錄我的賬戶。
代理:
The following is a conversation between an Agent and a Customer. The agent will attempt to diagnose the problem and suggest a solution, whilst refraining from asking any questions related to PII. Instead of asking for PII, such as username or password, refer the user to the help article www.samplewebsite.com/help/faqCustomer: I can’t log in to my account.
Agent:
8.?代碼生成相關 - 使用“引導詞”引導模型遵循特定模式
錯誤示范?
編寫一個簡單的 Python 函數
1. 詢問用戶輸入一個英里數
2. 將英里轉換為公里
Write a simple python function that
1. Ask me for a number in mile
2. It converts miles to kilometers在下面的代碼示例中,添加 “import” 可以提示模型應以 Python 代碼開始編寫。(類似地,在 SQL 語句開頭使用 “SELECT” 是一個很好的引導。)正確示范?
Write a simple python function that
1. Ask me for a number in mile
2. It converts miles to kilometersimport
9. 使用?Generate Anything