首页
学习
活动
专区
圈层
工具
发布
清单首页AI文章详情

LLM 效果不好?可能是 Prompt 写错了!Prompt Engineering 技术的最全综述

{"type":"doc","content":[{"type":"heading","attrs":{"id":"362e33fd-0d4a-4e45-9626-0b550a045750","textAlign":"inherit","indent":0,"level":1,"isHoverDragHandle":false},"content":[{"type":"text","text":"一、绪论"}]},{"type":"paragraph","attrs":{"id":"c508108f-9bca-42fc-bb7f-6399a05aa5ff","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","text":"生成式人工智能(GenAI)系统,特别是基于Transformer架构的大型语言模型(LLM),正在迅速崛起并被广泛应用于各个行业和研究领域。这些模型能够通过文本、图像、音频或视频等多种形式的“提示”(prompt)进行交互,并根据提示生成相应的文本、图像、音频或视频输出。 LLM 从撰写营销邮件到解决数学问题,其应用范围不断拓展。 但是,想要有效地利用LLM需要掌握提示工程(prompt engineering)技术,即设计和优化提示以获得最佳结果。 这门新兴领域正快速发展,新的提示技术层出不穷,但同时也面临着术语混乱和缺乏系统性理解等挑战。"}]},{"type":"paragraph","attrs":{"id":"2dec6c8b-56da-4f8f-938f-efe97960be3e","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","text":"Prompt Engineering 并非简单的“随便问问”,而是精心设计、优化提示词的过程,旨在引导 LLM 产生目标明确、质量优异的结果。"}]},{"type":"paragraph","attrs":{"id":"62e05a0c-d349-4802-aebf-68d6889073bb","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","marks":[{"type":"textStyle","attrs":{"color":"","background":""}},{"type":"bold"}],"text":"为什么 Prompt Engineering 如此重要?"}]},{"type":"bulletList","attrs":{"id":"9532c3bc-684b-42a4-9629-9acd1135d231","isHoverDragHandle":false},"content":[{"type":"listItem","attrs":{"id":"d439f83f-fab5-4707-b1d0-90251119a94c"},"content":[{"type":"paragraph","attrs":{"id":"d9072dc0-3f86-4221-adcc-d4482b606460","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","text":"LLM 的输出质量高度依赖于输入提示词的质量。一个模糊、不明确的提示词往往会得到泛泛而谈、不准确甚至无意义的答案。而精心设计的提示词则能引导 LLM 聚焦关键信息,产出更精确、相关、有用的结果。"}]}]},{"type":"listItem","attrs":{"id":"73739d13-1a53-44b9-a817-e479817c4c92"},"content":[{"type":"paragraph","attrs":{"id":"6d260334-f86c-47e8-90fb-4658eb9207ef","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","text":"通过 Prompt Engineering,可以引导 LLM 扮演不同的角色,采用不同的写作风格,甚至遵循特定的格式。"}]}]},{"type":"listItem","attrs":{"id":"87bcd003-b4df-47e5-9ddf-bb128e7f8a1a"},"content":[{"type":"paragraph","attrs":{"id":"39667833-cc7b-4933-bab4-4aca3cd29663","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","text":"LLM 可能会产生虚假信息,即“幻觉”。通过在提示词中提供明确的背景信息、限制条件或要求引用来源,可以显著降低模型幻觉的风险,提高输出的可信度。"}]}]},{"type":"listItem","attrs":{"id":"d8f11af2-c3f8-46a9-9eb9-647250055ca1"},"content":[{"type":"paragraph","attrs":{"id":"255d5db4-32a2-4b7a-bd37-da5a29e180a8","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","text":"良好的提示词可以更有效地利用 LLM 的资源,节省时间和成本。"}]}]}]},{"type":"paragraph","attrs":{"id":"5db39201-b6cc-4629-aa0b-5ecfef93f794","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","marks":[{"type":"link","attrs":{"href":"https://arxiv.org/pdf/2406.06608","target":"_blank","rel":"noopener noreferrer nofollow","class":null}}],"text":"《The Prompt Report: A Systematic Survey of Prompt Engineering"},{"type":"hardBreak","attrs":{"id":"2f13d661-1fcd-4326-8925-eae351e9ccfe"},"marks":[{"type":"link","attrs":{"href":"https://arxiv.org/pdf/2406.06608","target":"_blank","rel":"noopener noreferrer nofollow","class":null}}]},{"type":"text","marks":[{"type":"link","attrs":{"href":"https://arxiv.org/pdf/2406.06608","target":"_blank","rel":"noopener noreferrer nofollow","class":null}}],"text":"Techniques》"},{"type":"text","text":"论文对提示工程技术进行了系统的调查,是"},{"type":"text","marks":[{"type":"textStyle","attrs":{"color":"","background":""}},{"type":"bold"}],"text":"迄今为止对该领域最全面的综述"},{"type":"text","text":"。"}]},{"type":"image","attrs":{"id":"7b57c24e-4cf1-4aa5-9ae8-54d165c5141c","src":"https://developer.qcloudimg.com/editor/image/11218869/20250404-990ffd25.png","extension":"png","align":"center","alt":"","showAlt":false,"href":"","boxShadow":"","width":1100,"aspectRatio":"1.624711","status":"success","showText":true,"isPercentage":false,"percentage":0,"isHoverDragHandle":false}},{"type":"paragraph","attrs":{"id":"05742f5b-6c09-44d6-a25f-5a7e95a64e71","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false}},{"type":"paragraph","attrs":{"id":"e8505fac-926b-4261-b27a-1a461ea324a3","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","marks":[{"type":"textStyle","attrs":{"color":"","background":""}},{"type":"bold"}],"text":"论文的主要发现:"}]},{"type":"bulletList","attrs":{"id":"2d7717da-40e7-4d41-9604-46161bb46aa8","isHoverDragHandle":false},"content":[{"type":"listItem","attrs":{"id":"e6ea89b4-d860-4f57-a522-6511c6dce919"},"content":[{"type":"paragraph","attrs":{"id":"e4e58354-8552-4aaf-8d9f-2e8c1740229d","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","marks":[{"type":"textStyle","attrs":{"color":"","background":""}},{"type":"bold"}],"text":"提示工程现状:"},{"type":"text","text":" 提示工程虽然被广泛采用并得到广泛研究,但由于其出现时间较短,术语存在冲突,对有效提示的本体论理解也支离破碎。"}]}]},{"type":"listItem","attrs":{"id":"c2b74c39-e430-49a0-817e-45cb06dae602"},"content":[{"type":"paragraph","attrs":{"id":"31c382ea-1b02-4fc5-bbe1-8bfa372134ec","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","text":"该论文确定了 58 种基于文本的 LLM 提示技术和 40 种其他模态(图像、音频、视频等)的技术。"}]}]},{"type":"listItem","attrs":{"id":"851316b6-8708-4250-808e-6dbfeb01187f"},"content":[{"type":"paragraph","attrs":{"id":"8482dd7a-d264-4989-b0fe-95deded34702","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","text":"研究表明,更好的提示会在各种任务中带来更好的结果。"}]}]},{"type":"listItem","attrs":{"id":"045e6c2d-65b0-4399-b281-a2a52ce8a5af"},"content":[{"type":"paragraph","attrs":{"id":"3bc31784-d8c8-43d1-a2ab-87840ac1acb0","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","text":"提示工程中存在安全和一致性问题,例如提示注入攻击、模型输出中的偏差和不确定性。"}]}]},{"type":"listItem","attrs":{"id":"7314a8c4-ceae-4135-8f58-9f7352d0bd19"},"content":[{"type":"paragraph","attrs":{"id":"7bca28ae-41d4-45ec-bcaa-b26ae7a57b20","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","text":"通过对 MMLU 基准的评估,论文对几种提示工程技术进行了比较,发现复杂的技术通常会提高准确性,但也不是绝对的。"}]}]},{"type":"listItem","attrs":{"id":"a40060a8-e844-4f5a-9a3e-edd3ebcddeab"},"content":[{"type":"paragraph","attrs":{"id":"450bf575-edea-48a2-811b-adb89cbf0c86","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","text":"论文中一个关于识别文本中自杀危机的案例研究说明了提示工程是一个复杂的过程,需要提示工程师和领域专家的合作。"}]}]}]},{"type":"paragraph","attrs":{"id":"41ce98a7-c9f2-43ca-afc5-51fa9d099c91","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","text":"论文系统地组织了提示工程的各个方面:"}]},{"type":"orderedList","attrs":{"id":"a568dd77-bc7a-4ee6-8705-1739495e05a4","start":1,"isHoverDragHandle":false},"content":[{"type":"listItem","attrs":{"id":"ec0b6deb-3ee3-4b54-9997-4e1ac28ca5aa"},"content":[{"type":"paragraph","attrs":{"id":"6c1c23aa-0e32-494f-b218-963b460c04e0","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","text":"定义了提示的概念,讨论了术语,并简要回顾了提示工程的历史。"}]}]},{"type":"listItem","attrs":{"id":"8ab28021-23a4-4d8e-9c0b-3b1cdce17d93"},"content":[{"type":"paragraph","attrs":{"id":"dc6b9745-ed22-4bc0-9328-0ccaa61d1ce4","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","text":"对现有文献进行了系统的回顾,总结并分类了 58 种基于文本的提示技术(包括少样本提示、零样本提示、思维链提示、分解技术、集成技术和自我批评技术),并分析了这些技术的应用和使用频率。"}]}]},{"type":"listItem","attrs":{"id":"b1f11f0f-46e9-450a-b9db-ebc6f02acdd5"},"content":[{"type":"paragraph","attrs":{"id":"8483b756-b7ee-41c4-9dcc-0d23b188ffb3","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","text":"探讨了多语言和多模态提示技术,指出多语言和多模态提示技术通常是基于英语文本提示技术的扩展。"},{"type":"hardBreak","attrs":{"id":"d8709551-1c50-4bf5-adcd-2b9a1bc4294a"}},{"type":"text","text":"4.讨论了代理(Agent)技术,这些技术允许 LLM 使用外部工具(如计算器、互联网搜索和代码解释器),以及用于评估代理和提示技术输出的各种方法。"}]}]},{"type":"listItem","attrs":{"id":"1f902d55-7682-4288-8dbb-42f21a45c16f"},"content":[{"type":"paragraph","attrs":{"id":"ecf5aad6-5100-4558-9e83-356fde5f5ada","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","text":"讨论了提示工程中的安全问题(如提示注入和越狱攻击)以及一致性问题:偏差、刻板印象、文化差异、歧义和过度自信等。"}]}]},{"type":"listItem","attrs":{"id":"0445b4eb-b612-4ab4-a5d8-f434912eff7e"},"content":[{"type":"paragraph","attrs":{"id":"e217487a-6952-4e3f-a884-7d1fe407758b","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","text":"对选定的提示技术在 MMLU 基准上的性能进行了基准测试,并对一个现实世界的案例研究(识别文本中的自杀危机信号)进行了详细的提示工程过程的描述。"}]}]}]},{"type":"heading","attrs":{"id":"7dc840af-1286-4c10-b126-de37c4c5a132","textAlign":"inherit","indent":0,"level":1,"isHoverDragHandle":false},"content":[{"type":"text","text":"二、Prompt Engineering 基础知识"}]},{"type":"heading","attrs":{"id":"f6b4f60e-3033-4d1c-9abe-355852b041a9","textAlign":"inherit","indent":0,"level":2,"isHoverDragHandle":false},"content":[{"type":"text","text":"2.1、什么是 Prompt?"}]},{"type":"paragraph","attrs":{"id":"cdc5a52e-3975-4e56-8285-a5343f99c621","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","text":"论文中将 Prompt 定义为输入生成式AI模型的输入,用于引导其输出。Prompt可以包含文本、图像、声音或其他媒体。"}]},{"type":"paragraph","attrs":{"id":"349e4515-e425-46b9-a6f6-becf1457bfe1","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","marks":[{"type":"textStyle","attrs":{"color":"","background":""}},{"type":"bold"}],"text":"更广泛的讲,它是指向大型语言模型 (LLM) 提供的指令或输入,旨在引导模型生成特定的输出。"},{"type":"text","text":" 它可以是一个问题、一个命令、一段描述,甚至是一组示例,用于触发模型进行文本生成、代码编写、图像创作等任务。"}]},{"type":"paragraph","attrs":{"id":"5c1195d5-1800-468e-93f6-6dc7f21d3e29","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","text":"更通俗地说,Prompt 是与 LLM 交流的语言,通过 Prompt 告诉模型我们想要什么。"}]},{"type":"paragraph","attrs":{"id":"4004a38c-5d26-402f-8a29-9f3e48d41a52","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","text":"Prompt 不仅仅局限于文本形式。随着多模态 LLM 的发展,Prompt 也可以是图像、音频、视频等多种模态的输入。"}]},{"type":"paragraph","attrs":{"id":"aea90608-dbbe-40a1-9e9d-265aebb8ecc5","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","marks":[{"type":"textStyle","attrs":{"color":"","background":""}},{"type":"bold"}],"text":"不同模态的 Prompt :"}]},{"type":"paragraph","attrs":{"id":"f1ac3072-96a1-41d9-94a3-d11466675f16","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","marks":[{"type":"textStyle","attrs":{"color":"","background":""}},{"type":"bold"}],"text":"文本 Prompt:"},{"type":"text","text":" 以文字形式呈现的指令。这是最常见和最容易理解的 Prompt 类型。"}]},{"type":"paragraph","attrs":{"id":"825d6020-beb0-4b66-a062-383792a375dc","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","marks":[{"type":"textStyle","attrs":{"color":"","background":""}},{"type":"bold"}],"text":"示例:"}]},{"type":"bulletList","attrs":{"id":"7c0c54bc-b9ac-4eb6-8351-54d106a73776","isHoverDragHandle":false},"content":[{"type":"listItem","attrs":{"id":"ce268561-dcd0-4092-bc01-b25b9743bdde"},"content":[{"type":"paragraph","attrs":{"id":"0b9010fb-34ba-4407-9b05-027457049a6c","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","marks":[{"type":"textStyle","attrs":{"color":"","background":""}},{"type":"bold"}],"text":"简单问题:"},{"type":"text","text":" “中国的首都是哪里?”"}]}]},{"type":"listItem","attrs":{"id":"64b93924-3993-40e6-937b-83f43cd59f24"},"content":[{"type":"paragraph","attrs":{"id":"b371855c-40b7-479a-baa2-c714ed6094fd","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","marks":[{"type":"textStyle","attrs":{"color":"","background":""}},{"type":"bold"}],"text":"代码生成:"},{"type":"text","text":" “用 Python 编写一个函数来计算斐波那契数列。”"}]}]},{"type":"listItem","attrs":{"id":"984af818-0e48-4238-be77-7a08bf578617"},"content":[{"type":"paragraph","attrs":{"id":"04b7e709-2a59-45ac-9cc7-b59ba67030e0","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","marks":[{"type":"textStyle","attrs":{"color":"","background":""}},{"type":"bold"}],"text":"内容创作:"},{"type":"text","text":" “写一篇关于人工智能未来发展的 500 字文章。”"}]}]},{"type":"listItem","attrs":{"id":"e9cc00da-7026-4272-9b5f-0c39c92f28e4"},"content":[{"type":"paragraph","attrs":{"id":"fecab1f8-703a-4205-a00d-63f1d3abcf48","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","marks":[{"type":"textStyle","attrs":{"color":"","background":""}},{"type":"bold"}],"text":"翻译:"},{"type":"text","text":" “将这句话翻译成中文:‘Hello, world!’”"}]}]},{"type":"listItem","attrs":{"id":"94572ede-1547-4225-bfa1-1905a5f12866"},"content":[{"type":"paragraph","attrs":{"id":"8e0675de-bf05-4243-9820-f4adc8baa616","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","marks":[{"type":"textStyle","attrs":{"color":"","background":""}},{"type":"bold"}],"text":"更复杂的 prompt,包括角色扮演和风格要求:"},{"type":"text","text":" “你是一位专业的科幻小说作家。请以第一人称视角,用充满悬念的文笔,描写一个宇航员在探索未知星球时发现了一个神秘信号的情景,字数 300 字左右。”"}]}]}]},{"type":"paragraph","attrs":{"id":"a3cd4531-66cb-44d8-9bc8-deca0d9d6f2a","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","marks":[{"type":"textStyle","attrs":{"color":"","background":""}},{"type":"bold"}],"text":"图像 Prompt:"},{"type":"text","text":" 利用图像作为指令,引导 LLM 生成新的图像或对图像进行编辑。"}]},{"type":"paragraph","attrs":{"id":"06ec59d9-397a-4a70-b9f1-562aaf0ad3b7","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","marks":[{"type":"textStyle","attrs":{"color":"","background":""}},{"type":"bold"}],"text":"音频 Prompt:"},{"type":"text","text":" 使用音频作为指令,引导 LLM 进行语音识别、语音合成、音乐创作等任务。"}]},{"type":"paragraph","attrs":{"id":"ae4a1779-ff47-496c-a4ca-569455d79716","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","marks":[{"type":"textStyle","attrs":{"color":"","background":""}},{"type":"bold"}],"text":"视频 Prompt (目前相对较新,但潜力巨大) :"},{"type":"text","text":" 利用视频作为指令,引导 LLM 进行视频生成、视频编辑、动作识别等任务。"}]},{"type":"heading","attrs":{"id":"1e379892-ec19-4eca-8919-958b8e10d5ec","textAlign":"inherit","indent":0,"level":2,"isHoverDragHandle":false},"content":[{"type":"text","text":"2.2、Prompt 的组成部分"}]},{"type":"orderedList","attrs":{"id":"a7757978-44db-4864-8347-3d83fb1a4f96","start":1,"isHoverDragHandle":false},"content":[{"type":"listItem","attrs":{"id":"86b9f497-a30b-4dd4-bbdd-50316c7acf28"},"content":[{"type":"paragraph","attrs":{"id":"ddad1b02-a741-412d-b35d-d6b42512f434","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","marks":[{"type":"textStyle","attrs":{"color":"","background":""}},{"type":"bold"}],"text":"指令 (Directive):"},{"type":"text","text":" 指令是prompt的核心,以指令或问题的形式出现,表明prompt的目的或意图。它可以是显式的,例如“写一首关于树的诗”;也可以是隐式的,例如在翻译任务中,只提供“Night: 晚上”这样的示例,隐含的指令是进行英语到中文的翻译。指令有时也简称为“意图”,明确告诉 LLM 需要做什么。它是一个动词短语,清楚地表达了任务的目标和期望。 "},{"type":"text","marks":[{"type":"textStyle","attrs":{"color":"","background":""}},{"type":"bold"}],"text":"重要性:"},{"type":"text","text":" 指令的清晰程度直接决定了 LLM 理解任务的能力。"}]}]},{"type":"listItem","attrs":{"id":"4a8645fc-758f-4463-8c96-84d8776378f9"},"content":[{"type":"paragraph","attrs":{"id":"80efa43f-6301-4ac1-8a43-4a1fbac6a0ce","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","marks":[{"type":"textStyle","attrs":{"color":"","background":""}},{"type":"bold"}],"text":"示例 (Examples):"},{"type":"text","text":" 示例也称为范例或样本 (exemplars or shots),它们是任务完成的示范,引导生成式AI完成任务。示例的数量可以是零 (zero-shot prompting)、一个 (one-shot prompting) 或多个 (few-shot prompting)。示例的质量、数量、顺序、标签分布和格式都会影响模型的性能。"}]}]},{"type":"listItem","attrs":{"id":"5897bde5-bacb-4184-ba2f-cec87ad8e388"},"content":[{"type":"paragraph","attrs":{"id":"31becfd8-f07d-4af9-8ff1-0834aa790ee8","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","marks":[{"type":"textStyle","attrs":{"color":"","background":""}},{"type":"bold"}],"text":"输出格式 (Output Formatting):"},{"type":"text","text":" 为了获得特定格式的输出,用户可以在prompt中指定输出格式,例如CSV、Markdown、XML或自定义格式。指定输出格式可以提高某些任务的性能,但也有可能降低其他任务的性能。"}]}]},{"type":"listItem","attrs":{"id":"ef9b8997-f5fe-4afe-9538-d87b3bf93aef"},"content":[{"type":"paragraph","attrs":{"id":"18ff11ff-bbf3-452e-9d02-007a80a50028","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","marks":[{"type":"textStyle","attrs":{"color":"","background":""}},{"type":"bold"}],"text":"角色设定 (Role):"},{"type":"text","text":" 角色设定,也称为角色扮演 (persona),为生成式AI赋予特定的角色或身份,例如“一位牧羊人”、“一位旅行作家”等。这可以影响生成的文本风格和内容,并在某些任务中提高准确性。"}]}]},{"type":"listItem","attrs":{"id":"68a682eb-b955-4b06-9148-461724d903c5"},"content":[{"type":"paragraph","attrs":{"id":"bda6d206-1483-494b-a6c1-fa518083e838","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","marks":[{"type":"textStyle","attrs":{"color":"","background":""}},{"type":"bold"}],"text":"附加信息 (Additional Information):"},{"type":"text","text":" 除了指令、示例和角色设定外,prompt中还可以包含其他相关信息,以提供更多上下文或约束条件。例如,如果指令是写一封电子邮件,那么附加信息可能包括发件人的姓名、职位、收件人信息等。这些信息有时也被称为“上下文 (context)”,但由于该词在prompting领域中含义较为模糊,因此作者建议避免使用。"}]}]}]},{"type":"paragraph","attrs":{"id":"a1c52593-6fc1-4690-835f-1f745ba47d85","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","text":"一个高质量的 Prompt 并非简单地抛出一个问题,而是由多个精心设计的组成部分构成,协同作用,才能有效地引导 LLM 产生期望的结果。"}]},{"type":"heading","attrs":{"id":"465f3ab0-7d16-4d70-838a-2fb28acf95cc","textAlign":"inherit","indent":0,"level":2,"isHoverDragHandle":false},"content":[{"type":"text","text":"2.3、Prompt 模板"}]},{"type":"paragraph","attrs":{"id":"e153c291-91a9-4570-ac9e-7117ea63c761","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","text":"Prompt 模板 (Prompt Template) "},{"type":"text","marks":[{"type":"textStyle","attrs":{"color":"","background":""}},{"type":"bold"}],"text":"是一个包含一个或多个变量的函数,这些变量会被一些媒体(通常是文本)替换,从而创建一个 Prompt"},{"type":"text","text":"。 换句话说,它是一个Prompt的蓝图,定义了Prompt的结构和组成部分。 这些变量充当占位符,在创建Prompt实例时会被实际内容替换。旨在简化 Prompt 的创建过程,提高 Prompt 的一致性,并增强 Prompt 的可维护性。"}]},{"type":"paragraph","attrs":{"id":"e3ceb390-542b-4410-b2ab-6d178036afdb","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","text":"假如需要经常让 LLM 生成不同产品的描述。 每次都从头开始编写 Prompt 很费时费力。 使用 Prompt 模板,就可以创建一个通用的 Prompt 结构,例如:"}]},{"type":"codeBlock","attrs":{"id":"74ab02b9-c4b6-4505-8ba3-431b4c48998a","language":"bash","theme":"atom-one-dark","runtimes":0,"isHoverDragHandle":false,"key":"","languageByAi":"bash"},"content":[{"type":"text","text":"[角色设定:你是一位专业的文案撰写人]\n[指令:请为以下产品撰写一段吸引人的描述]\n\n产品名称:[产品名称]\n产品特点:[产品特点]\n目标受众:[目标受众]\n字数限制:[字数限制]\n"}]},{"type":"paragraph","attrs":{"id":"0b330f06-43c2-4cd6-8ba5-b30578c03b9a","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","text":"这个模板定义了角色设定、指令,以及需要填充的变量(产品名称、产品特点、目标受众、字数限制)。 每次需要生成新产品的描述时,只需要将这些变量替换为具体的值,就可以快速生成一个完整的 Prompt。"}]},{"type":"paragraph","attrs":{"id":"48639296-bd6c-42f1-bc66-951176a1b5d0","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","text":"Prompt 模板的"},{"type":"text","marks":[{"type":"textStyle","attrs":{"color":"","background":""}},{"type":"bold"}],"text":"主要作用"},{"type":"text","text":"是简化和标准化Prompt的创建过程。通过预先定义Prompt的结构,可以使用模板快速生成大量不同的Prompt,而无需每次都手动编写。这在需要处理大量数据或进行大规模实验时尤其有用。 它使得Prompt Engineering更加高效,易于进行实验和迭代。"}]},{"type":"bulletList","attrs":{"id":"33646aa7-2311-4b0c-a7e9-28e604e39b5f","isHoverDragHandle":false},"content":[{"type":"listItem","attrs":{"id":"e9bef09b-7e63-4a28-a7c7-02ee6ac2662a"},"content":[{"type":"paragraph","attrs":{"id":"fbf15c12-f68b-4dff-9832-b8f58f5e0597","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","text":"减少重复劳动,快速生成 Prompt 实例。"}]}]},{"type":"listItem","attrs":{"id":"02b10048-77cb-4a54-b3c0-acbc317786dd"},"content":[{"type":"paragraph","attrs":{"id":"c3f4d6f7-8e3a-4c87-97d2-2c5946675a0d","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","text":"保证 Prompt 的结构和风格一致,提高输出质量的可预测性。"}]}]},{"type":"listItem","attrs":{"id":"4b19a401-b1dd-4bb3-bd98-71d1d15affb0"},"content":[{"type":"paragraph","attrs":{"id":"009804a9-f659-4147-8557-6c2ad0960d1e","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","text":"方便对 Prompt 进行修改和更新,例如修改角色设定或指令。"}]}]},{"type":"listItem","attrs":{"id":"186407af-c08e-4600-8387-4d0904b32b39"},"content":[{"type":"paragraph","attrs":{"id":"2081f38c-b631-4665-9fff-b544b62bbaf3","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","text":"方便团队成员共享和使用 Prompt,降低学习成本。"}]}]},{"type":"listItem","attrs":{"id":"beba3628-36bb-4d5a-b7ba-dc29f708a0a2"},"content":[{"type":"paragraph","attrs":{"id":"71ac6536-1ee4-4426-bfa2-6b2d8a29e4cb","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","text":"使用变量来动态生成 Prompt,提高灵活性。"}]}]},{"type":"listItem","attrs":{"id":"d879dfda-3f28-4624-bbf7-4ac13ec92d7e"},"content":[{"type":"paragraph","attrs":{"id":"2161dca2-4d65-4434-bff0-7c7a628de362","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","text":"一旦创建了适用于特定任务的模板,便可以重复使用它来创建许多相似的 Prompts。"}]}]}]},{"type":"paragraph","attrs":{"id":"f64dfaee-2306-47d8-af1d-18e85f3dae5c","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","marks":[{"type":"textStyle","attrs":{"color":"","background":""}},{"type":"bold"}],"text":"如何使用模板创建 Prompt 实例?"}]},{"type":"paragraph","attrs":{"id":"71af6cea-c06f-4aa7-963f-a66b75ca620e","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","marks":[{"type":"textStyle","attrs":{"color":"","background":""}},{"type":"bold"}],"text":"创建一个Prompt实例"},{"type":"text","text":"的过程是将实际内容替换到Prompt模板中的变量。 例如,论文中给出的一个二元分类tweet的Prompt模板:"}]},{"type":"blockquote","attrs":{"id":"36ebccb6-936e-4e5a-92ff-efa3454279cd","textAlign":"inherit","isHoverDragHandle":false},"content":[{"type":"paragraph","attrs":{"id":"369b7c29-b8eb-4cd3-9479-928e768ab096","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","text":"Classify the tweet as positive or negative:"},{"type":"hardBreak","attrs":{"id":"f09f394c-a126-4c5f-9986-4f1db3d08a43"}},{"type":"text","text":"{TWEET}"}]}]},{"type":"paragraph","attrs":{"id":"9e458f8d-866b-42f2-9b9b-14ae6db44d16","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","text":"在这个模板中,“"},{"type":"text","marks":[{"type":"code"}],"text":"{TWEET}"},{"type":"text","text":"”就是一个变量。要创建一个Prompt实例,只需将一个具体的"},{"type":"text","marks":[{"type":"code"}],"text":"tweet"},{"type":"text","text":"文本替换到“"},{"type":"text","marks":[{"type":"code"}],"text":"{TWEET}"},{"type":"text","text":"”中即可。例如:"}]},{"type":"blockquote","attrs":{"id":"ac0184d3-c06a-44fa-821a-3228fd31bfb5","textAlign":"inherit","isHoverDragHandle":false},"content":[{"type":"paragraph","attrs":{"id":"cbeb3200-ba2e-4947-ae58-01c9d7177fff","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","text":"Classify the tweet as positive or negative:"},{"type":"hardBreak","attrs":{"id":"096c28d5-58ca-4210-9f21-969068af193e"}},{"type":"text","text":"“This is a wonderful day!”"}]}]},{"type":"paragraph","attrs":{"id":"c56f055d-85db-4daf-9afd-bc4e8ad5f7b8","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","text":"这便是一个根据模板生成的Prompt实例。 一个Prompt模板可以生成无数个Prompt实例,只需要改变模板中的变量值即可。 这对于自动化Prompt生成和A/B测试不同Prompt策略至关重要。"}]},{"type":"paragraph","attrs":{"id":"c909f7d1-596c-4381-b1d3-db0637d7ff84","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","text":"流程:"}]},{"type":"image","attrs":{"id":"6429a02f-5924-4491-8d67-1344f89425b1","src":"https://developer.qcloudimg.com/editor/image/11218869/20250404-4b367aed.png","extension":"png","align":"center","alt":"","showAlt":false,"href":"","boxShadow":"","width":758,"aspectRatio":"0.984416","status":"success","showText":true,"isPercentage":false,"percentage":0,"isHoverDragHandle":false}},{"type":"paragraph","attrs":{"id":"f01716c6-0d6a-4e1f-b73d-20e2073aff4f","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false}},{"type":"orderedList","attrs":{"id":"4346103f-c89c-4977-a434-cd181bb7fe3d","start":1,"isHoverDragHandle":false},"content":[{"type":"listItem","attrs":{"id":"dff0fd4e-8dfe-4023-975b-ed87ba7e9f72"},"content":[{"type":"paragraph","attrs":{"id":"7fa552ce-904f-4f39-a56c-aadd1832409e","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","text":"确定 Prompt 的关键组成部分,并使用占位符表示可变的部分。"}]}]},{"type":"listItem","attrs":{"id":"fc2e36c7-83d4-4428-b5ca-363dc7f5a96e"},"content":[{"type":"paragraph","attrs":{"id":"32e1debd-c1d9-4b70-bcd7-ff41dc4d4e69","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","text":"明确每个占位符的含义和数据类型。"}]}]},{"type":"listItem","attrs":{"id":"17033dbf-ac05-4d4d-8039-f5aa835fccd3"},"content":[{"type":"paragraph","attrs":{"id":"e68a8af1-1fe5-48d7-baa0-399bc1c9f684","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","text":"将占位符替换为具体的值,生成 Prompt 实例。"}]}]},{"type":"listItem","attrs":{"id":"32bcca3a-c3c3-4c41-af0b-aad8d3933a04"},"content":[{"type":"paragraph","attrs":{"id":"a9528527-9fb1-4c70-a333-6e0c19a15e4c","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","text":"使用生成的 Prompt 实例进行测试,并根据结果对模板进行优化。"}]}]}]},{"type":"paragraph","attrs":{"id":"1260c608-aa3b-47dc-a1a3-257b02a65354","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","marks":[{"type":"textStyle","attrs":{"color":"","background":""}},{"type":"bold"}],"text":"Prompt 模板的优势:"}]},{"type":"bulletList","attrs":{"id":"f855b6f3-8cda-454c-b7d7-1d007fa73982","isHoverDragHandle":false},"content":[{"type":"listItem","attrs":{"id":"993ca8ae-598a-43ee-a5e8-b118a88ad912"},"content":[{"type":"paragraph","attrs":{"id":"435e0a11-5b7d-4a6e-a434-63a055f09a4a","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","text":"确保所有 Prompt 都遵循相同的结构和风格。"}]}]},{"type":"listItem","attrs":{"id":"0c37903c-45c8-4d76-8fd0-f6d2d62b1013"},"content":[{"type":"paragraph","attrs":{"id":"046e27c6-62b7-41b2-af63-9a767a28698d","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","text":"易于修改和更新 Prompt 的各个部分。"}]}]},{"type":"listItem","attrs":{"id":"6a95616e-768a-462a-95aa-c3a73dddb109"},"content":[{"type":"paragraph","attrs":{"id":"b76b5c8d-ff71-4b59-8b79-cadb1b18e4a1","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","text":"方便添加新的功能和特性。"}]}]},{"type":"listItem","attrs":{"id":"0729d07d-d845-4c32-a4c8-1ef9316fcb8a"},"content":[{"type":"paragraph","attrs":{"id":"39031b3a-88e1-4878-9e96-291693530a1e","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","text":"可以结合编程语言和工具,自动生成 Prompt 实例。"}]}]}]},{"type":"heading","attrs":{"id":"367d70bb-b9f9-4e63-96dc-a391bac96f47","textAlign":"inherit","indent":0,"level":2,"isHoverDragHandle":false},"content":[{"type":"text","text":"2.4、关键术语"}]},{"type":"paragraph","attrs":{"id":"fc74b5a3-e1d6-4156-93df-6e298f322d4a","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","text":"论文对 Prompt Engineering 领域进行了系统的综述,定义了许多关键术语,不仔细区分容易造成混淆。"}]},{"type":"image","attrs":{"id":"a5f684da-714a-4b09-8c0c-cb938ddfd6dd","src":"https://developer.qcloudimg.com/editor/image/11218869/20250404-1ec101d5.png","extension":"png","align":"center","alt":"","showAlt":false,"href":"","boxShadow":"","width":1100,"aspectRatio":"1.567237","status":"success","showText":true,"isPercentage":false,"percentage":0,"isHoverDragHandle":false}},{"type":"paragraph","attrs":{"id":"aba71a1c-bf47-431e-a1a3-23a02d4625c3","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false}},{"type":"orderedList","attrs":{"id":"c56a1c19-72d5-4d9a-99eb-ef1bea9853a5","start":1,"isHoverDragHandle":false},"content":[{"type":"listItem","attrs":{"id":"5b7111ab-e129-4e49-b06b-5862ee9b1d3e"},"content":[{"type":"paragraph","attrs":{"id":"4189e457-a24a-4ca6-b8bb-5309b74c0cdf","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","marks":[{"type":"textStyle","attrs":{"color":"","background":""}},{"type":"bold"}],"text":"Prompt (提示词):"},{"type":"text","text":" 对生成式AI模型的输入,用于指导模型的输出。提示词可以是文本、图像、音频、视频或它们的组合。通常包含文本成分,但随着非文本模态的普及,这可能会改变。"}]}]},{"type":"listItem","attrs":{"id":"c9206a90-4e4f-42b7-b8b0-41e7a66cc0cc"},"content":[{"type":"paragraph","attrs":{"id":"d77977f1-b1c2-4858-931b-601cdea43a9e","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","marks":[{"type":"textStyle","attrs":{"color":"","background":""}},{"type":"bold"}],"text":"Prompt Template (提示词模板):"},{"type":"text","text":" 包含一个或多个变量的函数,这些变量会被一些媒体(通常是文本)替换,从而创建提示词。提示词可以被认为是模板的一个实例。例如,"},{"type":"text","marks":[{"type":"code"}],"text":"“将以下推文分类为正面或负面:{TWEET}”"},{"type":"text","text":"就是一个提示词模板,其中 "},{"type":"text","marks":[{"type":"code"}],"text":"{TWEET}"},{"type":"text","text":" 是变量。"}]}]},{"type":"listItem","attrs":{"id":"6802a73e-62ec-4bc2-8412-eecdc8f453c5"},"content":[{"type":"paragraph","attrs":{"id":"bcd73fe7-2f0e-4fac-8aee-787111bd4477","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","marks":[{"type":"textStyle","attrs":{"color":"","background":""}},{"type":"bold"}],"text":"Prompt Chaining (提示词链):"},{"type":"text","text":" 将两个或多个提示词模板连续使用。第一个提示词模板生成的输出被用来参数化第二个模板,依此类推,直到所有模板都用完。"}]}]},{"type":"listItem","attrs":{"id":"6a6f10cb-1d8b-4c15-bf3d-28187072fe1e"},"content":[{"type":"paragraph","attrs":{"id":"3b3c01cc-7d39-4569-b9be-4d65efbf9233","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","marks":[{"type":"textStyle","attrs":{"color":"","background":""}},{"type":"bold"}],"text":"Prompting Technique (提示词技术):"},{"type":"text","text":" 描述如何构建提示词、提示词序列或多个提示词动态序列的蓝图。提示词技术可以包含条件或分支逻辑、并行性或跨越多个提示词的其他架构考虑因素。例如,少样本提示、零样本提示、思维链提示等都属于提示词技术。"}]}]},{"type":"listItem","attrs":{"id":"44dc7c3d-e529-44f4-80e4-081a48dc8027"},"content":[{"type":"paragraph","attrs":{"id":"15298b45-5cf9-40d0-9fbc-68e0beccfa92","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","marks":[{"type":"textStyle","attrs":{"color":"","background":""}},{"type":"bold"}],"text":"Prompt Engineering Technique (提示词工程技术):"},{"type":"text","text":" 改进提示词的策略。文献中通常指自动化技术,但在用户场景中,用户通常手动进行提示词工程,无需任何辅助工具。例如,元提示、自动提示词工程师等都属于提示词工程技术。"}]}]},{"type":"listItem","attrs":{"id":"bc9503db-68b1-420d-8795-0fde3b5b6829"},"content":[{"type":"paragraph","attrs":{"id":"08eb8133-6b58-488e-a92a-06ca93cf62e9","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","marks":[{"type":"textStyle","attrs":{"color":"","background":""}},{"type":"bold"}],"text":"Prompt Engineering (提示词工程):"},{"type":"text","text":" 通过修改或更改所使用的提示词技术来迭代开发提示词的过程。它是一个迭代过程,包括:1) 对数据集进行推理;2) 评估性能;3) 修改提示词模板。"}]}]},{"type":"listItem","attrs":{"id":"bcb9c0d9-b67e-450a-82bf-04a7f66b6be5"},"content":[{"type":"paragraph","attrs":{"id":"09b12f5e-8ab8-4537-9911-9110fa2f4275","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","marks":[{"type":"textStyle","attrs":{"color":"","background":""}},{"type":"bold"}],"text":"Exemplar (示例):"},{"type":"text","text":" 在提示词中向模型展示的任务完成示例。用于指导模型完成任务。"}]}]},{"type":"listItem","attrs":{"id":"e7a297f5-e9e3-4619-bf25-51c2a88efbb2"},"content":[{"type":"paragraph","attrs":{"id":"573a0328-7f51-4c69-a686-e8e6f8a0b109","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","marks":[{"type":"textStyle","attrs":{"color":"","background":""}},{"type":"bold"}],"text":"In-Context Learning (ICL,上下文学习):"},{"type":"text","text":" 通过在提示词中提供示例和/或相关指令来指导生成式AI学习技能和任务的能力,无需更新模型权重/重新训练。 论文中指出“学习”一词具有误导性,ICL 可能是任务规范,技能可能并非全新的,可能已经在训练数据中包含了。"}]}]},{"type":"listItem","attrs":{"id":"a1e606ee-4b1c-4464-acc0-8d8ea14c6ef5"},"content":[{"type":"paragraph","attrs":{"id":"4f478614-30db-469d-b341-8318872c919a","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","marks":[{"type":"textStyle","attrs":{"color":"","background":""}},{"type":"bold"}],"text":"Few-Shot Prompting (少样本提示):"},{"type":"text","text":" 使用少量示例(示例)来指导生成式AI完成任务,属于上下文学习的一种特例。"}]}]},{"type":"listItem","attrs":{"id":"94029665-9909-4dbc-adbd-067cbb383a98"},"content":[{"type":"paragraph","attrs":{"id":"289ec675-fe08-41a1-a90c-8cae793cde9c","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","marks":[{"type":"textStyle","attrs":{"color":"","background":""}},{"type":"bold"}],"text":"Zero-Shot Prompting (零样本提示):"},{"type":"text","text":" 使用零示例来指导生成式AI完成任务,属于上下文学习的一种特例。"}]}]},{"type":"listItem","attrs":{"id":"8e59191a-c03c-44dd-b0e4-ede38f707ffc"},"content":[{"type":"paragraph","attrs":{"id":"ab986a7a-7097-4e9f-9bae-f3f3d9f31104","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","marks":[{"type":"textStyle","attrs":{"color":"","background":""}},{"type":"bold"}],"text":"Chain-of-Thought (CoT,思维链):"},{"type":"text","text":" 一种提示词技术,鼓励LLM在给出最终答案之前阐明其推理过程。它通常包括一个包含问题、推理路径和正确答案的示例。"}]}]},{"type":"listItem","attrs":{"id":"3c7617df-93ee-4ae6-aa4b-2cc551488dbe"},"content":[{"type":"paragraph","attrs":{"id":"cd26b551-1d5d-4188-9311-3b3c6607acfa","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","marks":[{"type":"textStyle","attrs":{"color":"","background":""}},{"type":"bold"}],"text":"Answer Engineering (答案工程):"},{"type":"text","text":" 迭代开发或选择算法,从LLM输出中提取精确答案的过程。它包括三个设计决策:答案空间、答案形状和答案提取器。"}]}]},{"type":"listItem","attrs":{"id":"cec24146-51dc-46be-8929-6e80d2e45b72"},"content":[{"type":"paragraph","attrs":{"id":"c8ae4066-c1cf-4b14-a31c-63e62dee5bcf","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","marks":[{"type":"textStyle","attrs":{"color":"","background":""}},{"type":"bold"}],"text":"Verbalizer (言语器):"},{"type":"text","text":" 一种答案工程组件,用于将标记、跨度或其他类型的输出映射到标签,反之亦然。"}]}]},{"type":"listItem","attrs":{"id":"07a4162f-0662-4ae1-a14a-695673051814"},"content":[{"type":"paragraph","attrs":{"id":"0f8278bc-e1b9-424f-a7d0-dae181f0f883","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","marks":[{"type":"textStyle","attrs":{"color":"","background":""}},{"type":"bold"}],"text":"Agent (智能体):"},{"type":"text","text":" 通过与生成式AI自身之外的系统交互来实现用户目标的生成式AI系统。通常使用LLM作为核心,并与计算器、搜索引擎等外部工具交互。"}]}]},{"type":"listItem","attrs":{"id":"b27beecf-4097-4965-925b-427d5f4d5a29"},"content":[{"type":"paragraph","attrs":{"id":"7a2370cc-cfd8-4b6d-b324-3a02e8f3f03c","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","marks":[{"type":"textStyle","attrs":{"color":"","background":""}},{"type":"bold"}],"text":"Retrieval Augmented Generation (RAG,检索增强生成):"},{"type":"text","text":" 从外部资源检索信息并将其插入到提示词中,增强知识密集型任务的性能。当检索本身用作外部工具时,RAG 系统被认为是智能体。"}]}]}]},{"type":"heading","attrs":{"id":"47295bd7-3bfb-4321-8375-672f386d70b9","textAlign":"inherit","indent":0,"level":1,"isHoverDragHandle":false},"content":[{"type":"text","text":"三、核心 Prompting 技术"}]},{"type":"paragraph","attrs":{"id":"1cc118bc-061b-4e1c-806e-54d1dd8aaf70","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","text":"提示领域的类别是相互关联的。论文讨论了 7 个核心类别。"}]},{"type":"image","attrs":{"id":"01b6e668-b31f-4cae-ab7e-ce11b1044440","src":"https://developer.qcloudimg.com/editor/image/11218869/20250404-d43cf080.png","extension":"png","align":"center","alt":"","showAlt":false,"href":"","boxShadow":"","width":848,"aspectRatio":"1.174515","status":"success","showText":true,"isPercentage":false,"percentage":0,"isHoverDragHandle":false}},{"type":"paragraph","attrs":{"id":"f4ea906c-08d2-4521-98ab-1394f7762250","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false}},{"type":"heading","attrs":{"id":"3823fe2c-32d7-4bbd-be71-6634f5988583","textAlign":"inherit","indent":0,"level":2,"isHoverDragHandle":false},"content":[{"type":"text","text":"3.1、基于文本的技术"}]},{"type":"paragraph","attrs":{"id":"2821eea0-c664-43d0-b60f-1f498c142e6e","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","text":"论文的核心部分是基于文本的提示工程技术。论文将这些技术分为六大类:In-Context Learning (ICL)、Chain-of-Thought (CoT)、Decomposition、Ensembling、Self-Criticism以及其他一些方法。"}]},{"type":"paragraph","attrs":{"id":"faa295cc-df17-4ce3-a408-21ec0aa6fe18","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","marks":[{"type":"textStyle","attrs":{"color":"","background":""}},{"type":"bold"}],"text":"In-Context Learning (ICL):"},{"type":"text","text":" ICL 指的是大型语言模型 (LLM) 通过在提示中提供示例和/或相关指令来学习技能和任务的能力,而无需更新模型权重/重新训练。它根据提供的示例数量分为零样本、少样本和多样本学习:"}]},{"type":"bulletList","attrs":{"id":"ba725e65-6013-4aa5-b7c9-71dd696b1cb8","isHoverDragHandle":false},"content":[{"type":"listItem","attrs":{"id":"7ae2ab6d-0d38-44f9-8820-e0850b2d0a8f"},"content":[{"type":"paragraph","attrs":{"id":"642fb557-f05d-44f6-aa22-b9310a8952c3","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","marks":[{"type":"textStyle","attrs":{"color":"","background":""}},{"type":"bold"}],"text":"零样本 (Zero-Shot):"},{"type":"text","text":" 不提供任何示例,仅依靠指令引导模型。"}]},{"type":"codeBlock","attrs":{"id":"7c7fc8c2-caa2-4701-ad44-ab0409d9400f","language":"bash","theme":"atom-one-dark","runtimes":0,"isHoverDragHandle":false,"key":""},"content":[{"type":"text","text":"指令: 将“苹果”翻译成法语。\n"}]}]},{"type":"listItem","attrs":{"id":"64e8a836-5f17-4779-8392-e0bbc7f486b4"},"content":[{"type":"paragraph","attrs":{"id":"3a81bce4-29ec-4661-817b-f603ea8398da","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","marks":[{"type":"textStyle","attrs":{"color":"","background":""}},{"type":"bold"}],"text":"少样本 (Few-Shot):"},{"type":"text","text":" 提供少量示例来指导模型。"}]},{"type":"codeBlock","attrs":{"id":"53213044-62c9-4c46-919e-349ae4e90e8c","language":"bash","theme":"atom-one-dark","runtimes":0,"isHoverDragHandle":false,"key":""},"content":[{"type":"text","text":"示例:\n英文: 猫,法语: chat\n英文: 狗,法语: chien\n英文: 苹果,法语: ?\n\n"}]}]},{"type":"listItem","attrs":{"id":"01e3f6e6-dee5-4356-bf1d-d48c596dcafe"},"content":[{"type":"paragraph","attrs":{"id":"e8cd9b5d-707c-45d0-b5ef-9f23bfe38766","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","marks":[{"type":"textStyle","attrs":{"color":"","background":""}},{"type":"bold"}],"text":"多样本 (Many-Shot):"},{"type":"text","text":" 提供大量示例。 这在论文中没有明确区分,而是被认为是少样本学习的扩展,随着示例数量的增加,性能通常也会提升,但效率会受到上下文窗口大小的限制。"}]}]}]},{"type":"paragraph","attrs":{"id":"2598f6b2-2097-4da1-9387-7987370000d8","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","text":"ICL 的应用非常广泛,例如文本分类、翻译、问答等。 论文中还讨论了几个影响少样本学习效果的设计决策,例如示例数量、顺序、标签分布、质量和相似性等。"}]},{"type":"paragraph","attrs":{"id":"7bd7458e-d36a-4860-a0db-d80983f26fc5","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","text":"设计示例:"}]},{"type":"image","attrs":{"id":"8bf92a9b-f0d4-4a10-9343-6fce66a17a75","src":"https://developer.qcloudimg.com/editor/image/11218869/20250404-aaf29980.png","extension":"png","align":"center","alt":"","showAlt":false,"href":"","boxShadow":"","width":545,"aspectRatio":"0.696041","status":"success","showText":true,"isPercentage":false,"percentage":0,"isHoverDragHandle":false}},{"type":"paragraph","attrs":{"id":"9ce1372e-60e3-4b05-be8a-ac0522f86f4d","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false}},{"type":"paragraph","attrs":{"id":"e5b4af02-23ef-4965-8dcf-96f8de9cd976","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","marks":[{"type":"textStyle","attrs":{"color":"","background":""}},{"type":"bold"}],"text":"Chain-of-Thought (CoT):"},{"type":"text","text":" 一种提示工程技术,它鼓励 LLM 在给出最终答案之前阐明其推理过程。核心思想是将复杂问题分解成多个步骤,逐步推理,最终得出答案。"}]},{"type":"bulletList","attrs":{"id":"13768662-9f7a-4887-8f7f-8e128e906c59","isHoverDragHandle":false},"content":[{"type":"listItem","attrs":{"id":"9b4a76db-d9a7-46d8-9937-c891546f89d6"},"content":[{"type":"paragraph","attrs":{"id":"b518eb00-91bb-4b0c-a1dc-d3e50b2467a4","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","marks":[{"type":"textStyle","attrs":{"color":"","background":""}},{"type":"bold"}],"text":"零样本 CoT (Zero-Shot CoT):"},{"type":"text","text":" 直接在提示中添加引导词,例如 “让我们一步一步地思考。”"}]},{"type":"codeBlock","attrs":{"id":"e9bd5578-b7e5-490d-b58e-223f688d3311","language":"javascript","theme":"atom-one-dark","runtimes":0,"isHoverDragHandle":false,"key":""},"content":[{"type":"text","text":"问题:如果 A 比 B 多 3,B 比 C 少 2,那么 A 比 C 多多少?\n提示:让我们一步一步地思考。首先,B 比 C 少 2。然后,A 比 B 多 3。因此,A 比 C 多 3 + 2 = 5。\n"}]}]},{"type":"listItem","attrs":{"id":"2b72759a-2a5b-4a6f-90eb-056994f934fe"},"content":[{"type":"paragraph","attrs":{"id":"45fd314e-fc85-4ea5-acdb-c2b9e4c198c1","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","marks":[{"type":"textStyle","attrs":{"color":"","background":""}},{"type":"bold"}],"text":"少样本 CoT (Few-Shot CoT):"},{"type":"text","text":" 提供包含推理步骤的示例。"}]},{"type":"codeBlock","attrs":{"id":"05239095-4d9f-4028-bc09-1cf9a547fdd4","language":"javascript","theme":"atom-one-dark","runtimes":0,"isHoverDragHandle":false,"key":""},"content":[{"type":"text","text":"示例:\n问题:2 + 2 * 2 = ?\n推理:首先计算 2 * 2 = 4,然后计算 2 + 4 = 6。\n答案:6\n\n问题:3 + 5 * 2 = ?\n推理:首先计算 5 * 2 = 10,然后计算 3 + 10 = 13。\n答案:13\n\n问题:1 + 2 * 3 = ?\n推理:?\n答案:?\n"}]}]}]},{"type":"paragraph","attrs":{"id":"0188eaf8-6d9e-4add-9a5a-f500107758c0","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","marks":[{"type":"textStyle","attrs":{"color":"","background":""}},{"type":"bold"}],"text":"分解法 (Decomposition):"},{"type":"text","text":" 分解法将复杂问题分解成更简单的子问题,逐个解决,最终组合得到最终答案。论文中介绍了多种分解方法,例如:"}]},{"type":"bulletList","attrs":{"id":"3ac5c872-95a7-4ca6-acb3-4195eb65c67f","isHoverDragHandle":false},"content":[{"type":"listItem","attrs":{"id":"18fd0df8-9319-46da-828c-94a255af8479"},"content":[{"type":"paragraph","attrs":{"id":"fae6ba49-3a52-4ed3-8ff7-dab4aa18a36d","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","marks":[{"type":"textStyle","attrs":{"color":"","background":""}},{"type":"bold"}],"text":"Least-to-Most:"},{"type":"text","text":" 从最简单的子问题开始解决,逐步增加难度。"}]}]},{"type":"listItem","attrs":{"id":"6f7ced95-e775-4233-b4b3-08a54fa0802d"},"content":[{"type":"paragraph","attrs":{"id":"0d2c9dbf-2a86-44a5-b055-55fa138c99a7","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","marks":[{"type":"textStyle","attrs":{"color":"","background":""}},{"type":"bold"}],"text":"Tree-of-Thought:"},{"type":"text","text":" 以树状结构探索不同的解决路径,选择最佳路径。"}]}]},{"type":"listItem","attrs":{"id":"8ec71af4-adff-4c43-97b0-467384bbc0fa"},"content":[{"type":"paragraph","attrs":{"id":"3bc533ad-a4bb-4794-9ee4-c8c4c92614e8","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","marks":[{"type":"textStyle","attrs":{"color":"","background":""}},{"type":"bold"}],"text":"Program-of-Thought:"},{"type":"text","text":" 将问题转化为程序代码,由代码执行得到答案。"}]}]}]},{"type":"paragraph","attrs":{"id":"2595fd96-1f7c-40ec-8654-734a6b8fc0b1","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","marks":[{"type":"textStyle","attrs":{"color":"","background":""}},{"type":"bold"}],"text":"集成方法 (Ensembling):"},{"type":"text","text":" 集成方法通过结合多个提示的结果来提高准确性。 常见方法包括:"}]},{"type":"bulletList","attrs":{"id":"3aaa6627-25c0-4aef-9b5c-2e25697cea69","isHoverDragHandle":false},"content":[{"type":"listItem","attrs":{"id":"b4778627-fc0c-45c2-aecc-1f4c7de23eee"},"content":[{"type":"paragraph","attrs":{"id":"64173cef-aecb-44f5-bced-6528e2b9f73e","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","marks":[{"type":"textStyle","attrs":{"color":"","background":""}},{"type":"bold"}],"text":"Self-Consistency:"},{"type":"text","text":" 多次生成不同的推理路径,选择出现频率最高的答案。"}]}]},{"type":"listItem","attrs":{"id":"44ad069d-19cf-44b4-97db-8af7c4714bab"},"content":[{"type":"paragraph","attrs":{"id":"48f4405f-2b14-41ae-9a6c-e11576514811","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","marks":[{"type":"textStyle","attrs":{"color":"","background":""}},{"type":"bold"}],"text":"Demonstration Ensembling:"},{"type":"text","text":" 使用不同的示例子集生成多个提示,然后聚合结果。"}]}]},{"type":"listItem","attrs":{"id":"76049e8d-c960-4f34-8294-af2f91d4fbfa"},"content":[{"type":"paragraph","attrs":{"id":"d8276956-36b8-4104-a3ee-10e369c6894e","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","marks":[{"type":"textStyle","attrs":{"color":"","background":""}},{"type":"bold"}],"text":"Mixture of Reasoning Experts:"},{"type":"text","text":" 使用不同的提示策略生成多个答案,选择最佳答案。"}]}]}]},{"type":"paragraph","attrs":{"id":"f07bf3d9-5c0e-4155-a1f1-d7e7db421ee9","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","marks":[{"type":"textStyle","attrs":{"color":"","background":""}},{"type":"bold"}],"text":"自我批评 (Self-Criticism):"},{"type":"text","text":" 自我批评技术让 LLM 对自身的输出进行评估和改进。 例如:"}]},{"type":"bulletList","attrs":{"id":"51d0223e-5bfc-42bb-af54-6c4bae5901dc","isHoverDragHandle":false},"content":[{"type":"listItem","attrs":{"id":"f5cbea81-e896-4f5c-a27e-b20c3b09bf30"},"content":[{"type":"paragraph","attrs":{"id":"9a00bef8-d4df-498d-9601-75c014f46980","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","marks":[{"type":"textStyle","attrs":{"color":"","background":""}},{"type":"bold"}],"text":"Self-Refine:"},{"type":"text","text":" 迭代地改进答案,LLM 生成初始答案后,再对答案进行反馈,并根据反馈改进答案,直到满足停止条件。"}]}]},{"type":"listItem","attrs":{"id":"cd2b16a2-f90f-491d-b5c6-3ca024afacb4"},"content":[{"type":"paragraph","attrs":{"id":"9f90e9b7-1093-4d90-a59c-7a6152836fa5","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","marks":[{"type":"textStyle","attrs":{"color":"","background":""}},{"type":"bold"}],"text":"Chain-of-Verification:"},{"type":"text","text":" 生成答案后,生成一系列验证问题,并根据验证结果修改答案。"}]}]}]},{"type":"heading","attrs":{"id":"38349054-d2b2-4432-a031-f3de28e02d36","textAlign":"inherit","indent":0,"level":2,"isHoverDragHandle":false},"content":[{"type":"text","text":"3.2、多语言技术"}]},{"type":"paragraph","attrs":{"id":"23ea94b1-c3b2-4dd3-937f-c10840c0102c","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","text":"最先进的生成式 AI 模型通常主要使用英语数据集进行训练,导致其在英语以外的语言(尤其是资源匮乏的语言)中的输出质量存在显著差异。这使得在非英语环境中获得与英语相当的性能变得困难。"}]},{"type":"image","attrs":{"id":"97758c6d-0817-4893-84bb-f4430f19a9b5","src":"https://developer.qcloudimg.com/editor/image/11218869/20250404-6b32fdc6.png","extension":"png","align":"center","alt":"","showAlt":false,"href":"","boxShadow":"","width":1081,"aspectRatio":"1.447122","status":"success","showText":true,"isPercentage":false,"percentage":0,"isHoverDragHandle":false}},{"type":"paragraph","attrs":{"id":"5a947471-0c31-4027-bb9b-4cffaade71be","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","text":"为了改善非英语环境下的模型性能,研究人员开发了几种多语言提示工程技术,这些技术主要围绕几个方面:"}]},{"type":"bulletList","attrs":{"id":"526f3954-7473-4f86-bb00-8ecaaae47e50","isHoverDragHandle":false},"content":[{"type":"listItem","attrs":{"id":"88e5b5b9-8f6c-4272-8aed-5a5667b2928b"},"content":[{"type":"paragraph","attrs":{"id":"70d68116-c02c-4bd0-b82d-790486a90dba","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","marks":[{"type":"textStyle","attrs":{"color":"","background":""}},{"type":"bold"}],"text":"翻译优先提示:"},{"type":"text","text":" 这是最简单的策略,它首先将非英语输入示例翻译成英语。通过将输入翻译成英语,模型可以利用其在英语方面的优势来更好地理解内容。翻译工具的选择有很多种,例如外部机器翻译系统、多语言大型语言模型或直接提示大型语言模型进行翻译。"}]}]},{"type":"listItem","attrs":{"id":"910a1666-b5bb-49de-9fac-6a92b7291e35"},"content":[{"type":"paragraph","attrs":{"id":"da353f85-95a8-4373-8822-6f6c4948394e","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","marks":[{"type":"textStyle","attrs":{"color":"","background":""}},{"type":"bold"}],"text":"思维链 (CoT):"},{"type":"text","text":" 思维链提示技术也被扩展到多语言环境中。例如,“跨语言思维 (XLT)”提示技术使用一个由六个单独指令组成的提示模板,包括角色分配、跨语言思维和思维链。 “跨语言自洽提示 (CLSP)”则是一种集成技术,它构建不同语言的推理路径来回答同一个问题。"}]}]},{"type":"listItem","attrs":{"id":"b9e4d263-199d-4304-9970-0de7a9413aac"},"content":[{"type":"paragraph","attrs":{"id":"46a6069e-2e57-4610-95af-55716b3cc535","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","marks":[{"type":"textStyle","attrs":{"color":"","background":""}},{"type":"bold"}],"text":"上下文学习 (ICL):"},{"type":"text","text":" 上下文学习也被扩展到多语言环境。例如,“X-InSTA”提示技术探索了三种不同的方法来对齐上下文示例与输入句子,以用于分类任务;“In-CLT”提示则利用源语言和目标语言来创建上下文示例,而不是传统的使用源语言示例。"}]}]},{"type":"listItem","attrs":{"id":"e69955ee-e547-4c47-863f-9ff6c09903cd"},"content":[{"type":"paragraph","attrs":{"id":"0908e212-2367-4238-99e1-442c215fccb7","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","marks":[{"type":"textStyle","attrs":{"color":"","background":""}},{"type":"bold"}],"text":"上下文示例选择:"},{"type":"text","text":" 上下文示例的选择对大型语言模型的多语言性能有很大影响。选择与源文本语义相似的上下文示例非常重要,但使用语义上不相似的示例有时也能提高性能。对于歧义句子,选择具有多义词或罕见词义的示例可能会提高性能。“PARC”框架则从高资源语言中检索相关的示例,以增强跨语言迁移性能,特别是在低资源目标语言方面。"}]}]},{"type":"listItem","attrs":{"id":"aae6d58d-d503-41e7-a738-d32a090a7482"},"content":[{"type":"paragraph","attrs":{"id":"170b0a07-844b-4139-929c-d9c54dc2dbd5","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","marks":[{"type":"textStyle","attrs":{"color":"","background":""}},{"type":"bold"}],"text":"提示模板语言选择:"},{"type":"text","text":" 提示模板语言的选择会显著影响模型性能。使用英语提示模板通常比使用任务语言更有效,这可能是因为大型语言模型的预训练中英语数据占主导地位。"}]}]}]},{"type":"heading","attrs":{"id":"9477affa-18c0-4ce0-ae18-693137883ca4","textAlign":"inherit","indent":0,"level":2,"isHoverDragHandle":false},"content":[{"type":"text","text":"3.3、多模态技术"}]},{"type":"paragraph","attrs":{"id":"47222fba-b9fb-4113-ab4b-85a87f3185e5","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","text":"论文的“多模态技术 (Multimodal Techniques)”部分探讨了如何将不同模态的信息(图像、音频、视频等)与提示工程结合使用,以提高大型语言模型(LLM)的性能和功能。 它并没有详细介绍每种技术的具体实现细节,而是提供了技术分类和概述。"}]},{"type":"image","attrs":{"id":"9192ee4e-35b1-4b0c-9c9c-d4a1c8843424","src":"https://developer.qcloudimg.com/editor/image/11218869/20250404-0405ea5e.png","extension":"png","align":"center","alt":"","showAlt":false,"href":"","boxShadow":"","width":1100,"aspectRatio":"2.772541","status":"success","showText":true,"isPercentage":false,"percentage":0,"isHoverDragHandle":false}},{"type":"paragraph","attrs":{"id":"30afd3f9-a348-468e-ae0b-2949c4bfe65b","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false}},{"type":"paragraph","attrs":{"id":"7672ceb7-2350-4377-bb6a-549ab78f3de5","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","marks":[{"type":"textStyle","attrs":{"color":"","background":""}},{"type":"bold"}],"text":"多模态提示工程的总体目标"},{"type":"text","text":" 是超越仅限于文本提示的范畴,利用图像、音频和视频等多种模态的信息来指导LLM的输出。 这些多模态提示工程技术是对文本提示技术的扩展,但也有一些是完全新颖的方法。"}]},{"type":"paragraph","attrs":{"id":"5584d310-cde5-4360-9476-5194d23f5ef7","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","marks":[{"type":"textStyle","attrs":{"color":"","background":""}},{"type":"bold"}],"text":"主要的多模态技术分类及举例:"}]},{"type":"bulletList","attrs":{"id":"884973f8-046e-41e7-adc6-b4842c08d537","isHoverDragHandle":false},"content":[{"type":"listItem","attrs":{"id":"1df32758-d822-40a2-9abe-81f2847d208b"},"content":[{"type":"paragraph","attrs":{"id":"2e496127-9083-406d-a44a-18046a32bf92","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","marks":[{"type":"textStyle","attrs":{"color":"","background":""}},{"type":"bold"}],"text":"图像提示 (Image Prompting):"},{"type":"text","text":" 涵盖了照片、绘画或文本截图等数据。常用的任务包括图像生成、标题生成、图像分类和图像编辑。 论文中提到的具体技术包括:"}]},{"type":"bulletList","attrs":{"id":"e1ad036a-ea0d-483d-b6f7-bbc10d347065","isHoverDragHandle":false},"content":[{"type":"listItem","attrs":{"id":"6ff063b9-d1b6-46d1-adf7-4459bf5f0833"},"content":[{"type":"paragraph","attrs":{"id":"c405053e-5dfd-446d-bac5-9bd36dbf5a30","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","marks":[{"type":"textStyle","attrs":{"color":"","background":""}},{"type":"bold"}],"text":"提示修改器 (Prompt Modifiers):"},{"type":"text","text":" 在提示中添加词语来改变生成的图像(例如,“在画布上”、“光线充足的场景”)。"}]}]},{"type":"listItem","attrs":{"id":"855e8cff-ac91-48f7-aedf-7d68f949b1ef"},"content":[{"type":"paragraph","attrs":{"id":"cd24dc04-7cd7-4789-9875-e8f814148920","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","marks":[{"type":"textStyle","attrs":{"color":"","background":""}},{"type":"bold"}],"text":"负面提示 (Negative Prompting):"},{"type":"text","text":" 允许用户对提示中的某些词语进行数值加权,以便模型更重视或更少重视这些词语。"}]}]},{"type":"listItem","attrs":{"id":"fbbf52b8-00ac-4025-8c08-a430e43ab18b"},"content":[{"type":"paragraph","attrs":{"id":"df203982-c2c0-4ece-8176-3ea7b39107f7","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","marks":[{"type":"textStyle","attrs":{"color":"","background":""}},{"type":"bold"}],"text":"多模态上下文学习 (Multimodal In-Context Learning):"},{"type":"text","text":" 利用图像对(例如,变换前后的图像)作为示例,指导模型进行图像转换任务。 这可以包含或不包含文字说明。 文中还提到了“图像作为文本提示 (Image-as-Text Prompting)” 的方法,即将图像转换成文本描述再添加到文本提示中。"}]}]},{"type":"listItem","attrs":{"id":"db1b8ba3-92b5-482e-9c87-2af0c92702f7"},"content":[{"type":"paragraph","attrs":{"id":"e5ec003d-edb8-4171-b26b-38669c260f67","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","marks":[{"type":"textStyle","attrs":{"color":"","background":""}},{"type":"bold"}],"text":"多模态链式思维 (Multimodal Chain-of-Thought):"},{"type":"text","text":" 将链式思维扩展到图像领域,例如,用图像和文字指令“一步一步地解决这个问题”来指导模型进行推理。 文中提到的具体技术包括:链式图像 (Chain-of-Images)、职责区分链式思维 (Duty Distinct CoT) 和多模态图式思维 (MM Graph-of-Thought)。"}]}]}]}]},{"type":"listItem","attrs":{"id":"45550fff-5efd-4910-bfcb-c5a21fd3cd3e"},"content":[{"type":"paragraph","attrs":{"id":"20647109-1ce2-456f-843f-8335ee996e86","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","marks":[{"type":"textStyle","attrs":{"color":"","background":""}},{"type":"bold"}],"text":"音频提示 (Audio Prompting):"},{"type":"text","text":" 该领域的研究尚处于早期阶段,但文中提到了一些尝试将上下文学习应用于音频模型的例子,结果好坏参半。"}]}]},{"type":"listItem","attrs":{"id":"fc2a1583-b5fc-451e-b4ab-10c3720944b6"},"content":[{"type":"paragraph","attrs":{"id":"b8a3ac8e-b9ab-411f-b1b8-86cbdd321fa1","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","marks":[{"type":"textStyle","attrs":{"color":"","background":""}},{"type":"bold"}],"text":"视频提示 (Video Prompting):"},{"type":"text","text":" 用于文本到视频生成、视频编辑和视频到文本生成等任务。文中提到图像相关的技术,例如提示修改器,也常用于视频生成。 文中还提到了视频生成技术 (Video Gen.)。"}]}]},{"type":"listItem","attrs":{"id":"dbb158f7-a1a3-4ba8-8af8-9533de9d630b"},"content":[{"type":"paragraph","attrs":{"id":"fe5875a2-0d93-4c0b-a6af-2b4488f261eb","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","marks":[{"type":"textStyle","attrs":{"color":"","background":""}},{"type":"bold"}],"text":"分割提示 (Segmentation Prompting):"},{"type":"text","text":" 用于图像分割任务,例如语义分割。"}]}]},{"type":"listItem","attrs":{"id":"566ed289-eb31-482b-88f5-7d80f57d3968"},"content":[{"type":"paragraph","attrs":{"id":"43f8d625-7de6-4016-a7bd-0ca639a8534e","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","marks":[{"type":"textStyle","attrs":{"color":"","background":""}},{"type":"bold"}],"text":"3D 提示 (3D Prompting):"},{"type":"text","text":" 用于3D建模领域,包括3D物体合成、3D表面纹理和4D场景生成(3D场景动画)。 输入提示的模态包括文本、图像、用户标注(边界框、点、线)和3D物体。"}]}]}]},{"type":"heading","attrs":{"id":"fe5a2663-f998-4d0b-80e0-b5f2655f8501","textAlign":"inherit","indent":0,"level":1,"isHoverDragHandle":false},"content":[{"type":"text","text":"四、Prompt Engineering 的高级应用"}]},{"type":"paragraph","attrs":{"id":"d2bae329-cf07-4a0d-a69d-fb8054f3f7da","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","text":"LLM Agent 是一个能够通过与外部系统交互来实现用户目标的生成式AI系统;这个系统以大型语言模型(LLM)为核心。Agent 的核心在于它能够超越 LLM 自身的局限,仅仅依靠 LLM 自身的知识库,往往难以解决需要特定领域知识或实际操作的任务;通过利用外部工具来增强其能力,例如进行复杂的计算、推理或访问外部知识。 这需要精心设计的提示和提示链来指导 Agent 的行为。"}]},{"type":"image","attrs":{"id":"7056c2d2-87ac-45a6-9bc5-ac21fa3a026d","src":"https://developer.qcloudimg.com/editor/image/11218869/20250404-77b2fc2a.png","extension":"png","align":"center","alt":"","showAlt":false,"href":"","boxShadow":"","width":1100,"aspectRatio":"2.191851","status":"success","showText":true,"isPercentage":false,"percentage":0,"isHoverDragHandle":false}},{"type":"paragraph","attrs":{"id":"cc6e28b6-47fd-4dbb-b7fa-2511662fef73","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false}},{"type":"paragraph","attrs":{"id":"6f0d80b9-05c0-4bb2-b839-11d04797413f","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","text":"简单来说,Agent 将 LLM 的文本处理能力与执行行动的能力相结合,使其能够解决现实世界的问题。"}]},{"type":"paragraph","attrs":{"id":"29282868-de3b-48ff-b91c-88611896b1c0","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","text":"一些主要的 Agent 技术:"}]},{"type":"orderedList","attrs":{"id":"49ddbd9b-d041-4251-805f-8d75ab74872b","start":1,"isHoverDragHandle":false},"content":[{"type":"listItem","attrs":{"id":"992432e5-3929-4aca-9c88-b8ac84fade4d"},"content":[{"type":"paragraph","attrs":{"id":"f1c8022f-bdff-42a2-8aa4-688f4b618d55","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","marks":[{"type":"textStyle","attrs":{"color":"","background":""}},{"type":"bold"}],"text":"工具使用代理:"},{"type":"text","text":" 这些 Agent 使用外部工具来辅助 LLM 完成任务。工具可以是符号化的(例如计算器、代码解释器)或神经网络类型的(例如另一个 LLM)。 一个关键的挑战在于路由问题:选择哪个工具来使用。"}]},{"type":"bulletList","attrs":{"id":"ccf2340a-ee51-4989-a2f9-a64bc498a163","isHoverDragHandle":false},"content":[{"type":"listItem","attrs":{"id":"f964915f-48ee-4a30-b349-a28d41688736"},"content":[{"type":"paragraph","attrs":{"id":"e841f298-af89-42ca-a2d8-513b78a392df","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","marks":[{"type":"textStyle","attrs":{"color":"","background":""}},{"type":"bold"}],"text":"Modular Reasoning, Knowledge, and Language (MRKL) System:"},{"type":"text","text":" 这是一个相对简单的 Agent,包含一个 LLM 路由器,可以访问多个工具(如天气 API 或日期 API),并将获取的信息整合到最终回复中。 许多类似的系统,例如 Toolformer, Gorilla, Act-1 等,都采用了类似的方法,当然了,很多都涉及某种程度的微调。"}]}]},{"type":"listItem","attrs":{"id":"2ff4a69e-a0a7-47af-9312-6b20a097d729"},"content":[{"type":"paragraph","attrs":{"id":"a1ea8d7e-9858-4371-80fd-5bf6efa48269","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","marks":[{"type":"textStyle","attrs":{"color":"","background":""}},{"type":"bold"}],"text":"Self-Correcting with Tool-Interactive Critiquing (CRITIC):"},{"type":"text","text":" CRITIC 先让 LLM 生成一个回答,然后 LLM 自我批评可能存在的错误,最后利用工具(如互联网搜索或代码解释器)来验证或修改回答的部分内容。"}]}]}]}]},{"type":"listItem","attrs":{"id":"5b17ebc6-d4ef-433d-9e6c-4499238fa06f"},"content":[{"type":"paragraph","attrs":{"id":"657b7b48-6e06-4cdf-b7c2-4416152cadb0","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","marks":[{"type":"textStyle","attrs":{"color":"","background":""}},{"type":"bold"}],"text":"代码生成代理 :"},{"type":"text","text":" 这些 Agent 通过生成并执行代码来解决问题。 它们将问题转化为代码,然后由代码解释器执行代码并返回结果。"}]},{"type":"bulletList","attrs":{"id":"dd4f2f14-b24f-435f-b651-5761670a6247","isHoverDragHandle":false},"content":[{"type":"listItem","attrs":{"id":"2008d059-e61e-433a-95b2-8e010436bee7"},"content":[{"type":"paragraph","attrs":{"id":"499e1491-6ad3-487a-b07b-7803ddbb1164","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","marks":[{"type":"textStyle","attrs":{"color":"","background":""}},{"type":"bold"}],"text":"Program-aided Language Model (PAL):"},{"type":"text","text":" 直接将问题转换为代码,然后发送给 Python 解释器。"}]}]},{"type":"listItem","attrs":{"id":"a013f2f0-5806-4f0b-b7fd-a326978c666f"},"content":[{"type":"paragraph","attrs":{"id":"9a4072f1-1da6-480b-87ef-8e2e3ed1be51","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","marks":[{"type":"textStyle","attrs":{"color":"","background":""}},{"type":"bold"}],"text":"Tool-Integrated Reasoning Agent (ToRA):"},{"type":"text","text":" 在解决问题的过程中交替进行代码生成和推理步骤。"}]}]},{"type":"listItem","attrs":{"id":"c83ad777-2e9a-4113-bea3-4079ed81dc5d"},"content":[{"type":"paragraph","attrs":{"id":"a3ad23c9-da61-4d86-b2d4-6d558b1b27d5","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","marks":[{"type":"textStyle","attrs":{"color":"","background":""}},{"type":"bold"}],"text":"TaskWeaver:"},{"type":"text","text":" 将用户请求转换为代码,还可以使用用户定义的插件。"}]}]}]}]},{"type":"listItem","attrs":{"id":"9638904f-7c89-4d2a-8d74-8ec863d458c6"},"content":[{"type":"paragraph","attrs":{"id":"76e88d2b-a69b-4f52-a5bc-ffa6274281db","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","marks":[{"type":"textStyle","attrs":{"color":"","background":""}},{"type":"bold"}],"text":"基于观察的代理:"},{"type":"text","text":" 这些 Agent 通过与模拟环境(如游戏环境)交互来解决问题。 Agent 接收环境的观察结果,将其整合到提示中,并根据观察结果采取行动。"}]},{"type":"bulletList","attrs":{"id":"ae463703-77d3-4537-bd47-9c57a78bffe0","isHoverDragHandle":false},"content":[{"type":"listItem","attrs":{"id":"051d780f-b17c-4bea-afb1-edc0b6ea2e10"},"content":[{"type":"paragraph","attrs":{"id":"a54437a9-8447-4f69-8004-9eeba63a2fbd","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","marks":[{"type":"textStyle","attrs":{"color":"","background":""}},{"type":"bold"}],"text":"Reasoning and Acting (ReAct):"},{"type":"text","text":" 在解决问题的过程中循环执行“思考-行动-观察”的过程,并将这些信息存储在提示中作为记忆。"}]}]},{"type":"listItem","attrs":{"id":"91b78e8e-a8d3-45d4-b2c4-6ca513d461fb"},"content":[{"type":"paragraph","attrs":{"id":"5fa7a869-0be1-4ec3-9d14-5d789648301f","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","marks":[{"type":"textStyle","attrs":{"color":"","background":""}},{"type":"bold"}],"text":"Reflexion:"},{"type":"text","text":" 在 ReAct 的基础上增加了反思步骤,根据行动结果进行自我反思,并将反思添加到提示中作为工作记忆。"}]}]}]}]},{"type":"listItem","attrs":{"id":"0775dd22-d026-4d1e-a7c5-b64c0e4162cd"},"content":[{"type":"paragraph","attrs":{"id":"5feffb8b-61f7-4679-a033-8a35e17e5fe6","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","marks":[{"type":"textStyle","attrs":{"color":"","background":""}},{"type":"bold"}],"text":"检索增强生成 (RAG):"},{"type":"text","text":" RAG 从外部知识库中检索信息,并将检索到的信息添加到提示中,从而增强 LLM 的知识和推理能力。 当检索本身被用作外部工具时,RAG 系统就被认为是 Agent。"}]},{"type":"bulletList","attrs":{"id":"8b5650aa-c933-4340-8054-43e8434ab073","isHoverDragHandle":false},"content":[{"type":"listItem","attrs":{"id":"3dc25e43-7700-4125-b82c-2443757523d6"},"content":[{"type":"paragraph","attrs":{"id":"55990a6c-5c9e-4b08-ab8a-db50f0f4faf5","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","marks":[{"type":"textStyle","attrs":{"color":"","background":""}},{"type":"bold"}],"text":"Verify-and-Edit:"},{"type":"text","text":" 生成多个推理链,然后通过检索相关信息来编辑这些链,并最终选择最佳答案。"}]}]},{"type":"listItem","attrs":{"id":"ecf648f9-a9ed-4440-a76b-328804af57f4"},"content":[{"type":"paragraph","attrs":{"id":"972ff857-1420-43dd-8ae2-0301c3d057ea","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","marks":[{"type":"textStyle","attrs":{"color":"","background":""}},{"type":"bold"}],"text":"Demonstrate-Search-Predict:"},{"type":"text","text":" 将问题分解成子问题,使用查询来解决子问题,并结合其结果生成最终答案。"}]}]},{"type":"listItem","attrs":{"id":"afe9e66a-9a4c-4443-814e-73e506c5f08d"},"content":[{"type":"paragraph","attrs":{"id":"eda4d34f-6d98-4ff5-ab79-b7198cfd330a","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","marks":[{"type":"textStyle","attrs":{"color":"","background":""}},{"type":"bold"}],"text":"Interleaved Retrieval guided by Chain-of-Thought (IRCoT):"},{"type":"text","text":" 交替进行 CoT 推理和信息检索,CoT 指导检索哪些文档,检索结果帮助规划 CoT 的推理步骤。"}]}]},{"type":"listItem","attrs":{"id":"570fda0a-0afa-4541-9992-009e9d77ecd3"},"content":[{"type":"paragraph","attrs":{"id":"63aec0d6-5588-4a47-afde-7f1e857f0e4d","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","marks":[{"type":"textStyle","attrs":{"color":"","background":""}},{"type":"bold"}],"text":"Iterative Retrieval Augmentation (例如 FLARE 和 IRP):"},{"type":"text","text":" 在长篇生成过程中多次执行检索,通常迭代执行三个步骤:1) 生成临时句子作为下一个输出句子的内容计划;2) 使用临时句子作为查询检索外部知识;3) 将检索到的知识注入临时句子以创建下一个输出句子。"}]}]}]}]}]},{"type":"paragraph","attrs":{"id":"9d903f19-d60c-4871-9e68-9a3b1fd834ba","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","text":"Agent 技术的优势:"}]},{"type":"bulletList","attrs":{"id":"32b5429f-ced2-415b-bfac-9c948b5b699f","isHoverDragHandle":false},"content":[{"type":"listItem","attrs":{"id":"4395b83c-35b6-4f7c-9aaa-f1d49e67f8e2"},"content":[{"type":"paragraph","attrs":{"id":"38101c2e-0e1e-425d-9782-bbad5e35fd47","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","text":"能够解决 LLM 自身无法解决的问题。"}]}]},{"type":"listItem","attrs":{"id":"9bd15902-3d6b-4e4a-91fb-8fdf8eb31373"},"content":[{"type":"paragraph","attrs":{"id":"f9f756bb-c6ed-40f3-8ce0-37524be02960","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","text":"能够自动化执行复杂任务。"}]}]},{"type":"listItem","attrs":{"id":"2fd55324-ee22-4d8d-9f6c-c04e805144b9"},"content":[{"type":"paragraph","attrs":{"id":"fd080ec5-aa62-4b22-af19-c78b35c12b88","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","text":"能够利用外部信息做出更明智的决策。"}]}]},{"type":"listItem","attrs":{"id":"bc82751c-3509-42f7-8d16-6b591a7dd4ec"},"content":[{"type":"paragraph","attrs":{"id":"1edddf27-2dff-447d-b00d-761aa14d25d2","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","text":"可以将 LLM 应用于更广泛的领域。"}]}]}]},{"type":"paragraph","attrs":{"id":"c23810a4-bf17-49e1-9afe-d2c01eb4d89b","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","text":"论文介绍了多种评估 Prompt 的有效性和生成输出质量的方法,主要分为四个方面:"}]},{"type":"orderedList","attrs":{"id":"a852f157-3a2f-4eea-ad84-8ea9e1225935","start":1,"isHoverDragHandle":false},"content":[{"type":"listItem","attrs":{"id":"63cc7dc6-0fb8-48db-8359-0bf2db468262"},"content":[{"type":"paragraph","attrs":{"id":"558bd048-37f1-4d61-96e7-9d8d0c18143d","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","marks":[{"type":"textStyle","attrs":{"color":"","background":""}},{"type":"bold"}],"text":"Prompting 技术本身的评估:"}]},{"type":"bulletList","attrs":{"id":"c183c6d8-efc6-47e4-b6a2-8b1de59c76ab","isHoverDragHandle":false},"content":[{"type":"listItem","attrs":{"id":"0ee1237b-e6d2-46b1-8239-eb67fbaeb2cb"},"content":[{"type":"paragraph","attrs":{"id":"0f3bfe22-b807-4279-aea1-38b7439405ea","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","marks":[{"type":"textStyle","attrs":{"color":"","background":""}},{"type":"bold"}],"text":"Chain-of-Thought (CoT) 和 In-Context Learning (ICL) 的评估:"},{"type":"text","text":" 这两种技术在评估 Prompt 中被频繁使用,其有效性本身也需要评估。 通过观察在不同任务和模型上的表现来评估其有效性。"}]}]},{"type":"listItem","attrs":{"id":"1dd03f86-48c5-4cb4-8582-16a061624c63"},"content":[{"type":"paragraph","attrs":{"id":"a6629bca-ff80-4c37-9d8a-9eea259cbc50","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","marks":[{"type":"textStyle","attrs":{"color":"","background":""}},{"type":"bold"}],"text":"基于角色的评估 (Role-based Evaluation):"},{"type":"text","text":" 通过赋予 LLM 不同的角色来进行评估,从而获得多样化的评估结果。"}]}]},{"type":"listItem","attrs":{"id":"a20d88a2-ac15-4411-80e2-2aff73626787"},"content":[{"type":"paragraph","attrs":{"id":"ec8f8e1d-5199-4f49-8517-8b315f9ba950","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","marks":[{"type":"textStyle","attrs":{"color":"","background":""}},{"type":"bold"}],"text":"模型生成的指导原则 (Model-Generated Guidelines):"},{"type":"text","text":" 让 LLM 生成评估的指导原则,以减少评分标准和输出空间不明确导致的评估不一致问题。"}]}]}]}]},{"type":"listItem","attrs":{"id":"59c658e7-b87f-468b-b934-b4a1acb6edd1"},"content":[{"type":"paragraph","attrs":{"id":"27d56ae5-9a6a-42c0-a4e5-ff269519bead","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","marks":[{"type":"textStyle","attrs":{"color":"","background":""}},{"type":"bold"}],"text":"输出格式的评估:"},{"type":"text","text":" 评估方法会根据 LLM 输出的格式而有所不同。常见的输出格式包括:"}]},{"type":"bulletList","attrs":{"id":"07920a9f-2967-4b3b-ab60-2f9b7f2f80e7","isHoverDragHandle":false},"content":[{"type":"listItem","attrs":{"id":"45712962-2fef-475c-ad56-bce238dc4cf7"},"content":[{"type":"paragraph","attrs":{"id":"282eb383-15c9-46e1-b71d-b85cbf51d7d2","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","marks":[{"type":"textStyle","attrs":{"color":"","background":""}},{"type":"bold"}],"text":"二元评分 (Binary Score):"},{"type":"text","text":" 例如 Yes/No 或 True/False,适合简单的分类任务。"}]}]},{"type":"listItem","attrs":{"id":"04403681-1da7-40f6-a32d-b64571ea0a99"},"content":[{"type":"paragraph","attrs":{"id":"d87f0c6a-854d-48c6-8aaf-400739d95b03","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","marks":[{"type":"textStyle","attrs":{"color":"","background":""}},{"type":"bold"}],"text":"李克特量表 (Likert Scale):"},{"type":"text","text":" 例如 1-5 或 1-10 的等级评分,可以更细致地评估输出质量。"}]}]},{"type":"listItem","attrs":{"id":"72e49d88-5447-492f-83d2-af94a6aba43d"},"content":[{"type":"paragraph","attrs":{"id":"b29a28bc-3694-46c0-9d99-aadf09e82824","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","marks":[{"type":"textStyle","attrs":{"color":"","background":""}},{"type":"bold"}],"text":"线性量表 (Linear Scale):"},{"type":"text","text":" 类似李克特量表,但可以是连续的数值。"}]}]},{"type":"listItem","attrs":{"id":"9b54eacc-efdc-405d-ae53-6db11e12bbbf"},"content":[{"type":"paragraph","attrs":{"id":"7cfbd31d-8a32-4978-bf09-98e75b2b9345","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","marks":[{"type":"textStyle","attrs":{"color":"","background":""}},{"type":"bold"}],"text":"样式化输出 (Styling):"},{"type":"text","text":" 使用 XML 或 JSON 等结构化格式,方便对 LLM 输出进行解析和评估。"}]}]}]}]},{"type":"listItem","attrs":{"id":"673d1879-0b60-4bc5-8fca-7f8f3026beb8"},"content":[{"type":"paragraph","attrs":{"id":"90e0ce07-91cf-47bb-8156-d0ad2c938252","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","text":"论文中提到了几种评估框架:"}]},{"type":"bulletList","attrs":{"id":"93c74e61-6161-41a6-9194-c56fd929237e","isHoverDragHandle":false},"content":[{"type":"listItem","attrs":{"id":"eeef4e96-2064-4ce3-95ad-3f2374b5a66e"},"content":[{"type":"paragraph","attrs":{"id":"a76e8157-dcba-43b0-b5ca-401023d21100","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","marks":[{"type":"textStyle","attrs":{"color":"","background":""}},{"type":"bold"}],"text":"LLM-EVAL:"},{"type":"text","text":" 一个简单的框架,使用单个 Prompt 包含多个评估变量(例如语法、相关性等),LLM 为每个变量输出特定范围内的分数。"}]}]},{"type":"listItem","attrs":{"id":"5d7e1f84-33df-4751-b70f-e980259d40b1"},"content":[{"type":"paragraph","attrs":{"id":"98478515-d8b0-4e05-8bdc-76434921ac1a","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","marks":[{"type":"textStyle","attrs":{"color":"","background":""}},{"type":"bold"}],"text":"G-EVAL:"},{"type":"text","text":" 在 LLM-EVAL 的基础上,在 Prompt 中加入 AutoCoT 步骤,根据评估指令生成并插入最终 Prompt 中。"}]}]},{"type":"listItem","attrs":{"id":"95b54ab8-3cc9-46ae-8768-607efa68f5bb"},"content":[{"type":"paragraph","attrs":{"id":"c252d508-ce5a-4fb4-9fc7-a4693dfe2a08","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","marks":[{"type":"textStyle","attrs":{"color":"","background":""}},{"type":"bold"}],"text":"ChatEval:"},{"type":"text","text":" 使用多智能体辩论框架,每个智能体具有不同的角色,对输出进行评估。"}]}]}]}]},{"type":"listItem","attrs":{"id":"bcd401d2-beba-45df-91c3-dcc5f243ccf9"},"content":[{"type":"paragraph","attrs":{"id":"1ad926dd-0cf8-4f41-83a3-2b3eb0c812ac","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","text":"除了直接 Prompt LLM 生成质量评估外,还有一些间接的评估方法:"}]},{"type":"bulletList","attrs":{"id":"34862143-7f4f-4444-9343-26ad40dd46f2","isHoverDragHandle":false},"content":[{"type":"listItem","attrs":{"id":"eb5a34e3-2fac-4aea-a03f-c4e6d53d24f8"},"content":[{"type":"paragraph","attrs":{"id":"10720fcf-cf25-4f34-8da9-77c2a4aabcef","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","marks":[{"type":"textStyle","attrs":{"color":"","background":""}},{"type":"bold"}],"text":"批量 Prompting (Batch Prompting):"},{"type":"text","text":" 同时评估多个实例,提高计算效率,但可能降低性能。"}]}]},{"type":"listItem","attrs":{"id":"0ab14174-a4e8-47ae-8e3a-43eef57d930b"},"content":[{"type":"paragraph","attrs":{"id":"4c643246-52d8-42b8-af9e-788f9a5ebb0c","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","marks":[{"type":"textStyle","attrs":{"color":"","background":""}},{"type":"bold"}],"text":"成对评估 (Pairwise Evaluation):"},{"type":"text","text":" 直接比较两个文本的质量,但顺序可能会影响结果。"}]}]},{"type":"listItem","attrs":{"id":"4678a0d3-4e8a-43cb-abce-cec7def5b817"},"content":[{"type":"paragraph","attrs":{"id":"429d7766-9f4b-4691-84a5-7887ea3ec260","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","marks":[{"type":"textStyle","attrs":{"color":"","background":""}},{"type":"bold"}],"text":"隐式评分 (Implicit Scoring):"},{"type":"text","text":" 通过模型的预测置信度、生成输出的可能性或模型的解释来推断输出质量。"}]}]}]}]}]},{"type":"image","attrs":{"id":"26952eb8-cb93-4221-916d-c8c732713055","src":"https://developer.qcloudimg.com/editor/image/11218869/20250404-02179474.png","extension":"png","align":"center","alt":"","showAlt":false,"href":"","boxShadow":"","width":1100,"aspectRatio":"1.792880","status":"success","showText":true,"isPercentage":false,"percentage":0,"isHoverDragHandle":false}},{"type":"paragraph","attrs":{"id":"576c3f50-06f0-4ec0-9e84-79600b5bda5a","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false}},{"type":"paragraph","attrs":{"id":"16393125-98ed-44b6-a618-f672ac9011ce","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","text":"虽然论文没有明确列出所有指标,但文中提到的指标包括:准确率 (Accuracy)、F1 分数 (F1 score)、精确率 (Precision)、召回率 (Recall)。 在实际应用中,选择合适的评估指标需要根据具体任务和应用场景来确定,例如在评估自杀风险预测时,召回率可能比精确率更重要,因为漏报的代价更高。"}]},{"type":"image","attrs":{"id":"e72a0e4b-c090-4cb0-843b-b8de5efed7f7","src":"https://developer.qcloudimg.com/editor/image/11218869/20250404-f11db9f6.png","extension":"png","align":"center","alt":"","showAlt":false,"href":"","boxShadow":"","width":1002,"aspectRatio":"1.313237","status":"success","showText":true,"isPercentage":false,"percentage":0,"isHoverDragHandle":false}},{"type":"paragraph","attrs":{"id":"c4abaa46-54f4-4d6d-85ce-037131f0b071","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false}},{"type":"heading","attrs":{"id":"ab81aab0-57bd-443b-9110-8559eeb7be8f","textAlign":"inherit","indent":0,"level":1,"isHoverDragHandle":false},"content":[{"type":"text","text":"五、总结"}]},{"type":"paragraph","attrs":{"id":"e2d07ae2-6b26-4b0c-b240-5d8733d54ef5","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","text":"《Prompt Report: A Systematic Survey of Prompt Engineering Techniques》论文阐述了Prompt的概念、术语和简史,区分了Prompt和Prompt Template,并定义了Prompting、Prompt Chain、Prompting Technique和Prompt Engineering等关键术语。"}]},{"type":"paragraph","attrs":{"id":"b7f43872-218e-4c10-90a6-de463cb36a22","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","text":"核心部分是对Prompting技术的全面分类和分析。论文基于PRISMA流程,系统地回顾了相关文献,构建了一个包含58种基于文本的Prompting技术和40种其他模态(多语言、多模态)Prompting技术的分类体系。这些技术涵盖了零样本、少样本Prompting,以及Chain-of-Thought、分解、集成、自我批评等多种高级Prompting策略。论文还探讨了多语言和多模态Prompting技术,以及Agent技术。"}]},{"type":"image","attrs":{"id":"ea9f88e1-b506-44c4-8f42-135416da8c67","src":"https://developer.qcloudimg.com/editor/image/11218869/20250404-e85a92fb.png","extension":"png","align":"center","alt":"","showAlt":false,"href":"","boxShadow":"","width":1080,"aspectRatio":"3.600000","status":"success","showText":true,"isPercentage":false,"percentage":0,"isHoverDragHandle":false}},{"type":"paragraph","attrs":{"id":"e916f668-c9d3-4c51-a1c4-c85645a63a1e","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false}}]}

下一篇
举报
领券