Write a facebook post to advertise my company’s new product. My company’s name is Alpha and the product is called Beta, a new ultra-fast hairdryer.
GPT-4 的輸出如下:
Introducing the Revolutionary Beta Hairdryer by Alpha!- Say goodbye to long, tedious hair drying sessions! Alpha is proud to unveil the Beta, our latest innovation in haircare technology.
- Ultra-Fast Drying: The Beta is designed to cut your drying time in half, thanks to its advanced, powerful motor. Get ready faster and enjoy more time doing what you love!Shop Now: [Link to product page]
# CONTEXT #I want to advertise my company’s new product. My company’s name is Alpha and the product is called Beta, which is a new ultra-fast hairdryer.# OBJECTIVE #Create a Facebook post for me, which aims to get people to click on the product link to purchase it.
# STYLE #Follow the writing style of successful companies that advertise similar products, such as Dyson.# TONE #Persuasive
# AUDIENCE #My company’s audience profile on Facebook is typically the older generation. Tailor your post to target what this audience typically looks out for in hair products.# RESPONSE #The Facebook post, kept concise yet impactful.
透過使用 CO-STAR,GPT-4 的響應會變得明顯更有針對性、效果更好:
Embrace Effortless Elegance with Alpha Beta — The Ultra-Fast Hairdryer for the Wise Generation.
Rediscover the joy of simple, effective hair care with Alpha Beta. Our latest innovation is more than just a hairdryer; it’s a promise of swift, gentle, and reliable hair styling for those who appreciate the finer things in life.
- Easy and Intuitive Use: Say goodbye to complicated gadgets. Alpha Beta iscrafted for comfort and simplicity, perfect for those who value straightforward,hassle-free technology.
- Time-Saving Technology: We understand your time is precious. That’s why Alpha Beta cuts down drying time significantly, giving you more moments to enjoy life’s pleasures.
Make every day a good hair day with Alpha Beta. Experience the blend of sophistication and simplicity today.[Your Product Link Here]
Classify the sentiment of each conversation in <<<CONVERSATIONS>>> as‘Positive’ or ‘Negative’. Give the sentiment classifications without any other preamble text.
###EXAMPLE CONVERSATIONS[Agent]: Good morning, how can I assist you today?[Customer]: This product is terrible, nothing like what was advertised![Customer]: I’m extremely disappointed and expect a full refund.[Agent]: Good morning, how can I help you today?
[Customer]: Hi, I just wanted to say that I’m really impressed with yourproduct. It exceeded my expectations!EXAMPLE OUTPUTSNegativePositive###<<<
[Agent]: Hello! Welcome to our support. How can I help you today?[Customer]: Hi there! I just wanted to let you know I received my order, andit’s fantastic![Agent]: That’s great to hear! We’re thrilled you’re happy with your purchase.Is there anything else I can assist you with?
[Customer]: No, that’s it. Just wanted to give some positive feedback. Thanksfor your excellent service![Agent]: Hello, thank you for reaching out. How can I assist you today?[Customer]: I’m very disappointed with my recent purchase. It’s not what I expected at all.
[Agent]: I’m sorry to hear that. Could you please provide more details so I can help?[Customer]: The product is of poor quality and it arrived late. I’m reallyunhappy with this experience.>>>
上面例子中使用的分隔符是 ###,同時每一節都帶有完全大寫的標題以示區分,如 EXAMPLE CONVERSATIONS 和 EXAMPLE OUTPUTS。前置說明部分陳述了要分類的對話是在 <<<CONVERSATIONS>>> 中,這些對話是在 prompt 末尾提供,也不帶任何解釋說明文字,但由於有了 <<< 和 >>> 這樣的分隔符,LLM 就能理解這就是要分類的對話。 GPT-4 對此 prompt 給出的輸出如下,其給出的情感分類結果不帶任何附加文字,這符合我們的要求:
PositiveNegative
用 XML 標籤當分隔符 另一種方法是使用 XML 標籤作為分隔符。XML 標籤是使用尖括號括起來的成對標籤,包括開始和結束標籤。比如 <tag> 和 </tag>。這很有效,因為 LLM 在訓練時就看過了大量用 XML 標註的網路內容,已經學會了理解其格式。 下面用 XML 標籤作為分隔符重寫上面的 prompt:
Classify the sentiment of the following conversations into one of two classes, using the examples given. Give the sentiment classifications without any otherpreamble text.
<classes>PositiveNegative</classes>
<example-conversations>[Agent]: Good morning, how can I assist you today?[Customer]: This product is terrible, nothing like what was advertised![Customer]: I’m extremely disappointed and expect a full refund.[Agent]: Good morning, how can I help you today?
[Customer]: Hi, I just wanted to say that I’m really impressed with yourproduct. It exceeded my expectations!</example-conversations><example-classes>
NegativePositive</example-classes><conversations>
[Agent]: Hello! Welcome to our support. How can I help you today?[Customer]: Hi there! I just wanted to let you know I received my order, andit’s fantastic![Agent]: That’s great to hear! We’re thrilled you’re happy with your purchase.Is there anything else I can assist you with?
[Customer]: No, that’s it. Just wanted to give some positive feedback. Thanksfor your excellent service![Agent]: Hello, thank you for reaching out. How can I assist you today?[Customer]: I’m very disappointed with my recent purchase. It’s not what Iexpected at all.
[Agent]: I’m sorry to hear that. Could you please provide more details so Ican help?[Customer]: The product is of poor quality and it arrived late. I’m reallyunhappy with this experience.</conversations>
為了達到更好的效果,在 XML 標籤中使用的名詞應該與指令中用於描述它們的名詞一樣。在上面的 prompt 中,我們給出的指令為:
Classify the sentiment of the following conversations into one of two classes, using the examples given. Give the sentiment classifications without any other preamble text.
其中使用的名詞有 conversations、classes 和 examples。也因此,後面的分隔 XML 標籤就對應為 <conversations>、<classes>、<example-conversations> 和 <example-classes>。這能確保 LLM 理解指令與 XML 標籤的關聯。 同樣的,使用這樣的分隔符能以清晰的結構化方式對 prompt 進行分節,從而確保 GPT-4 輸出的內容就剛好是你想要的結果:
You will answer questions using this text: [insert text].You will respond with a JSON object in this format: {“Question”: “Answer”}.If the text does not contain sufficient information to answer the question, do not make up information and give the answer as “NA”.
You are only allowed to answer questions related to [insert scope]. Never answer any questions related to demographic information such as age, gender, and religion.
其中每部分的類別如下: 對上述 System Prompt 的分解 那麼「普通」prompt 又該包含哪些內容呢? 現在你可能會想:看起來 System Prompt 中已經給出了大量資訊。那麼我們又該在「普通」prompt(也稱為使用者 prompt)中放什麼內容? System Prompt 會大致描述任務概況。在上面的 System Prompt 示例中,任務被定義為僅使用特定的文字進行問答,並指示 LLM 以 {"Question": "Answer"} 的格式進行響應。
You will answer questions using this text: [insert text].You will respond with a JSON object in this format: {“Question”: “Answer”}.
在這個案例中,聊天中的每個使用者 prompt 都只是你希望得到文字解答的問題。舉個例子,使用者 prompt 可能是這樣「What is the text about?」。而 LLM 的響應會是這樣:{"What is the text about?": "The text is about..."}。 但我們可以進一步泛化這個示例任務。在實踐中,你更可能會有多個希望得到解答的問題,而不只是一個。在這個案例中,我們可以將上述 System Prompt 的第一行從
You will answer questions using this text: [insert text].
改成
You will answer questions using the provided text.
System Prompt:I want you to act as a data scientist to analyze datasets. Do not make up information that is not in the dataset. For each analysis I ask for, provide me with the exact and definitive answer and do not provide me with code or instructions to do the analysis on other platforms.
Prompt:# CONTEXT #I sell wine. I have a dataset of information on my customers: [year of birth, marital status, income, number of children, days since last purchase, amount spent].#############
# OBJECTIVE #I want you use the dataset to cluster my customers into groups and then give me ideas on how to target my marketing efforts towards each group. Use this step-by-step process and do not use code:
1. CLUSTERS: Use the columns of the dataset to cluster the rows of the dataset, such that customers within the same cluster have similar column values while customers in different clusters have distinctly different column values. Ensure that each row only belongs to 1 cluster.
For each cluster found,2. CLUSTER_INFORMATION: Describe the cluster in terms of the dataset columns.3. CLUSTER_NAME: Interpret [CLUSTER_INFORMATION] to obtain a short name for the customer group in this cluster.
4. MARKETING_IDEAS: Generate ideas to market my product to this customer group.5. RATIONALE: Explain why [MARKETING_IDEAS] is relevant and effective for this customer group.#############
# STYLE #Business analytics report############## TONE #Professional, technical#############
# AUDIENCE #My business partners. Convince them that your marketing strategy is well thought-out and fully backed by data.#############
# RESPONSE: MARKDOWN REPORT #<For each cluster in [CLUSTERS]>— Customer Group: [CLUSTER_NAME]— Profile: [CLUSTER_INFORMATION]— Marketing Ideas: [MARKETING_IDEAS]— Rationale: [RATIONALE]
<Annex>Give a table of the list of row numbers belonging to each cluster, in order to back up your analysis. Use these table headers: [[CLUSTER_NAME], List of Rows].#############
# START ANALYSIS #If you understand, ask me for my dataset.
Prompt:# CONTEXT #I sell wine. I have a dataset of information on my customers: [year of birth, marital status, income, number of children, days since last purchase, amount spent].#############
# OBJECTIVE #I want you use the dataset to cluster my customers into groups and then give me ideas on how to target my marketing efforts towards each group. Use this step-by-step process and do not use code:
1. CLUSTERS: Use the columns of the dataset to cluster the rows of the dataset, such that customers within the same cluster have similar column values while customers in different clusters have distinctly different column values. Ensure that each row only belongs to 1 cluster.
For each cluster found,2. CLUSTER_INFORMATION: Describe the cluster in terms of the dataset columns.3. CLUSTER_NAME: Interpret [CLUSTER_INFORMATION] to obtain a short name for the customer group in this cluster.
4. MARKETING_IDEAS: Generate ideas to market my product to this customer group.5. RATIONALE: Explain why [MARKETING_IDEAS] is relevant and effective for this customer group.#############
# STYLE #Business analytics report############## TONE #Professional, technical#############
# AUDIENCE #My business partners. Convince them that your marketing strategy is well thought-out and fully backed by data.#############
# RESPONSE: MARKDOWN REPORT #<For each cluster in [CLUSTERS]>— Customer Group: [CLUSTER_NAME]— Profile: [CLUSTER_INFORMATION]— Marketing Ideas: [MARKETING_IDEAS]— Rationale: [RATIONALE]
<Annex>Give a table of the list of row numbers belonging to each cluster, in order to back up your analysis. Use these table headers: [[CLUSTER_NAME], List of Rows].############## START ANALYSIS #If you understand, ask me for my dataset.
Use this step-by-step process and do not use code:
1. CLUSTERS: Use the columns of the dataset to cluster the rows of the dataset, such that customers within the same cluster have similar column values while customers in different clusters have distinctly different column values. Ensure that each row only belongs to 1 cluster.
For each cluster found,2. CLUSTER_INFORMATION: Describe the cluster in terms of the dataset columns.3. CLUSTER_NAME: Interpret [CLUSTER_INFORMATION] to obtain a short name for the customer group in this cluster.
4. MARKETING_IDEAS: Generate ideas to market my product to this customer group.5. RATIONALE: Explain why [MARKETING_IDEAS] is relevant and effective for this customer group.
# RESPONSE: MARKDOWN REPORT #<For each cluster in [CLUSTERS]>— Customer Group: [CLUSTER_NAME]— Profile: [CLUSTER_INFORMATION]— Marketing Ideas: [MARKETING_IDEAS]— Rationale: [RATIONALE]
<Annex>Give a table of the list of row numbers belonging to each cluster, in order to back up your analysis. Use these table headers: [[CLUSTER_NAME], List of Rows].