提示词使用技巧:指定步骤及提供示例

这是《ChatGPT官方提示词教程》的第1章第4节、第5节学习笔记。

官方文档(英文)链接: https://platform.openai.com/docs/guides/gpt-best-practices/six-strategies-for-getting-better-results

第4节: 指定完成任务所需的步骤

有些任务最好指定为一系列步骤。明确地写出步骤可以使模型更容易遵循它们。

参考提示词模板:

使用以下分步说明响应用户输入。

第 1 步 – 用户将用三重引号为您提供文本。在一个句子中总结这段文字,并加上一个前缀“Summary:”。

第 2 步 – 将第 1 步中的摘要翻译成西班牙语,并加上前缀“Translation:”。 “””在此插入文本”””

示例

使用以下分步说明响应用户输入。

第 1 步 – 用户将用三重引号为您提供文本。在一个句子中总结这段文字,并加上一个前缀“Summary:”。

第 2 步 – 将第 1 步中的摘要翻译成简体中文,并加上前缀“Translation:”。

“””A well-known Chinese journalist stated that Russia would not be able to return to what it was before the armed mutiny, the Telegraph reported.

Hu Xijin, the former editor in chief of the Chinese-government-affiliated Global Times, had been commentating on Prigozhin’s insurrection and Russia’s political situation. In the now-deleted tweet, Hu wrote: “[Prigozhin’s] armed rebellion has made the Russian political situation cross the tipping point. Regardless of his outcome, Russia cannot return to the country it was before the rebellion anymore.”

Hu’s comments were a stark contrast to the Chinese government’s neutral stance on Russian politics. In what appeared to be a backtrack, Hu later posted: “Prigozhin quickly stopped and the rebellion was stopped without bloodshed, which obviously narrowed the impact on Putin’s authority, although not to zero.””””

第5节: 提供示例

这个方法,是通过提供示例,来让模型理解你需求。 又称作“小样本提示(few-shot Prompt)”。

通常应用在风格特殊、任务难以用语言描述的场景下。

用来模仿爆文、爆款标题等,效果应该不错。

例如,假设你是一个科技博主,你希望模型能以专业的方式描述各种科技产品。你可以这样写提示词:

你是一个科技博主,我会在三重括号内给你提供示例。你模仿示例,写出5个回答。

提示词:告诉我关于华为Mate系列的事。

“”” 提示词:告诉我关于iPhone的事。

回答:iPhone,就像一首充满创新与激情的科技交响曲,每一次更新都引领着智能手机的潮流与趋势; 精湛的工艺,优雅的设计,和人性化的操作系统,都让这部手机成为了人们生活中的重要一部分。 “””

假设你是一个旅行博主,你希望模型能以引人入胜的方式描述各种旅游地点。你可以这样写提示词:

你是一个旅行博主,我会在三重括号内给你提供示例。你模仿示例,写出5个回答。

提示词:告诉我关于上海的事。

“”” 提示词:告诉我关于巴黎的事。 回答:巴黎,犹如一首经久不衰的交响乐,每个角落都充满了艺术与浪漫的气息; 埃菲尔铁塔,卢浮宫,塞纳河都如同乐章,述说着这座城市的历史与未来。 “””

广告

一个集美剧、音乐和AI工具为一体的服务商:

网址: https://nf.video/yqyfZ

输入优惠码: ysw 可以享受九折优惠。

全站侧栏

近期文章

发表评论