这个技巧是技巧2的变种,比较常用于生成文本场景。其实在场景7中,你也可以用到这个技巧。

假设你想让 AI 总结一篇非常非常长的文章,并且按照特定格式给你总结,那你可以在文章前面明确输出的格式(为了不占用太多显示空间,我省略了正文内容,你可以在 OpenAI 的 Playground 看到完整案例)。它的意思其实是让 ChatGPT 按 Topic 总结,每个 Topic 里按照无序列表(就是里面那个 -)将每个 Topic 的主要观点罗列出来。

Summarize the main points of the following speech
Use the following format:
Topic 1: <topic_name_1>
- <point_1>
..
Topic 2: <topic_name_2>
- <point_1>
..
Topic 10: ..

Text: """
Thank you so much, Fred, for that lovely introduction. And thanks to the Atlantic Council for hosting me today.

The course of the global economy over the past two years has been shaped by COVID-19 and our efforts to fight the pandemic. It’s now evident, though, that the war between Russia and Ukraine has redrawn the contours of the world economic outlook. Vladimir Putin’s unprovoked attack on Ukraine and its people is taking a devastating human toll, with lives tragically lost, families internally displaced or becoming refugees, and communities and cities destroyed.
...

"""

Output 是这样的:

Topic 1: The war in Ukraine
- The war is taking a human toll with lives lost, families displaced, and communities destroyed
- The Biden administration is committed to holding Russia accountable
- The war has violated international law and is a challenge to the international order

Topic 2: The global economy
- The war is having negative impacts on the global economy, including higher commodity prices and inflation
- The IMF and World Bank will be focused on helping developing countries weather the impacts of the war
- The ultimate outcome for the global economy depends on the path of the war

关于这个场景和技巧,我想再解释一下为什么潜力很大。

根据我使用各种 Summary 或者信息提取的产品,我发现 AI 并不知道什么是重点,所以在总结的过程中,会丢失很多内容。如何引导 AI 进行总结,就变得非常重要,且具有一定的可玩性。


感谢 AlexZhangji 的分享,TA 提到一个使用此技巧的场景:

使用此技巧可以使输出更结构化。 比如针对一篇文章进行问答, 你不仅想要得到一个答案, 也希望 ChatGPT 的答案符合特定的格式, 方便你下一步进行自动化。

比如问 "这里的债券duration是多少?". 正常 GPT 模型的答案可能是 "债券duration是4年" 或 "duration 4年"。 ChatGPT 的回答不稳定, 且不方便继续处理。

解法: 我们可以通过这个技巧,让模型理解我们预期的格式。并在此基础上, 为了方便自动化, 让模型输出特定的结构化答案(比如JSON/Markdown等)。 也可以方便集成更多的额外要求, 比如增加一个"confidence level", 并通过 prompt 的形式指定这些数值的格式。

比如:

{context}
Question: What is bond duration mentioned here. 
Answer template (Valid JSON format):
{{
"duration": $duration_numeric_value_in_year, 
"confidence_level": $answer_confidence_level_high_modrate_or_low, 
}}
Answer:

标签: ChatGPT, ChatGPT教程, ChatGPT社区, ChatGPT社群, ChatGPT中文社区, ChatGPT入口, ChatGPT注册, ChatGPT注册教程, ChatGPT共享账号, ChatGPT开源教程, ChatGPT基础教程, ChatGPT高级教程, ChatGPT核心教程, ChatGPT Plus, ChatGPT镜像, ChatGPT是什么, ChatGPT怎么用, ChatGPT使用, ChatGPT下载