提示词优化RTGO 和 CO-STAR模版使用
背景和价值
RTGO框架 VS CO-STAR框架
| 维度 | RTGO框架 | CO-STAR框架 |
|---|---|---|
| 架构 | 四层递进式结构 | 六维网状结构 |
| 响应速度 | 0.8-1.2秒/任务 | 1.5-2秒/任务 |
| 适用场景 | 结构化任务 | 复杂创意任务 |
| 资源消耗 | 2 token/字 | 3 token/字 |
| 优势领域 | 数据分析/技术文档 | 市场营销/产品设计 |
| 追求效率选RTGO(如技术客服问答) | ||
| 需要创造力选CO-STAR(如营销方案策划) |
RTGO框架

CO-STAR框架
C) 上下文(Context):提供与任务有关的背景信息。这有助于 LLM 理解正在讨论的具体场景,从而确保其响应是相关的。
O) 目标(Objective):定义你希望 LLM 执行的任务。明晰目标有助于 LLM 将自己响应重点放在完成具体任务上。
S) 风格(Style):指定你希望 LLM 使用的写作风格。这可能是一位具体名人的写作风格,也可以是某种职业专家(比如商业分析师或 CEO)的风格。这能引导 LLM 使用符合你需求的方式和词语给出响应。
T) 语气(Tone):设定响应的态度。这能确保 LLM 的响应符合所需的情感或情绪上下文,比如正式、幽默、善解人意等。
A) 受众(Audience):确定响应的目标受众。针对具体受众(比如领域专家、初学者、孩童)定制 LLM 的响应,确保其在你所需的上下文中是适当的和可被理解的。
R) 响应(Response):提供响应的格式。这能确保 LLM 输出你的下游任务所需的格式,比如列表、JSON、专业报告等。对于大多数通过程序化方法将 LLM 响应用于下游任务的 LLM 应用而言,理想的输出格式是 JSON。
英文版
(C) Context: Provide background information on the task
This helps the LLM understand the specific scenario being discussed, ensuring its response is relevant.
(O) Objective: Define what the task is that you want the LLM to perform
Being clear about your objective helps the LLM to focus its response on meeting that specific goal.
(S) Style: Specify the writing style you want the LLM to use
This could be a particular famous person’s style of writing, or a particular expert in a profession, like a business analyst expert or CEO. This guides the LLM to respond with the manner and choice of words aligned with your needs.
(T) Tone: Set the attitude of the response
This ensures the LLM’s response resonates with the intended sentiment or emotional context required. Examples are formal, humorous, empathetic, among others.
(A) Audience: Identify who the response is intended for
Tailoring the LLM’s response to an audience, such as experts in a field, beginners, children, and so on, ensures that it is appropriate and understandable in your required context.
(R) Response: Provide the response format
This ensures that the LLM outputs in the exact format that you require for downstream tasks. Examples include a list, a JSON, a professional report, and so on. For most LLM applications which work on the LLM responses programmatically for downstream manipulations, a JSON output format would be ideal.
假设你是一位社交媒体管理者,你需要帮助草拟一篇 Facebook 帖文,其內容是宣传你公司的新产品。
CO-STAR 会提醒你将任务涉及的其它方面也整合进 prompt 之中,具体来说就是上面的简单 prompt 中缺失的 STYLE(风格)、TONE(语气)、AUDIENCE(受众) 方面:
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.
'''
#上下文#
我想为我公司的新产品做广告。我公司的名字叫阿尔法,产品叫贝塔,是一种新型的超快吹风机。
#目标#
为我创建一个Facebook帖子,旨在让人们点击产品链接进行购买。
#风格#
遵循成功公司为类似产品做广告的写作风格,比如戴森。
#语气#
有说服力的
#受众#
我公司在Facebook上的受众群通常是老一辈。定制你的帖子,以针对这些受众在头发产品中通常想要的东西。
#响应#
脸书上的帖子简洁而有影响力。
'''
流程化交互引导
分步提示实现复杂任务拆解:

实践案例:电商客服通过“漏斗式提问”引导用户提供肤质、预算等信息,推荐匹配商品
参考资料
https://www.infoai.com.tw/blog/co-star-framework-gpt4-prompt-design
https://blog.csdn.net/weixin_40959890/article/details/138851865

浙公网安备 33010602011771号