System, contextual and role prompting
系统提示、上下文提示与角色提示
系统提示、上下文提示和角色提示均是用于指导大语言模型生成文本的技术,但各自侧重点不同:
•系统提示为语言模型设定整体语境与目标。它定义了模型应执行任务的 ‘ 宏观框架 ’,例如语言翻译、评论分类等。
情境提示提供与当前对话或任务相关的具体细节或背景信息。它帮助模型理解所提问题的细微差别,并据此调整响应内容。
角色提示为语言模型指定特定的角色或身份。这有助于模型生成符合所分配角色及其相关知识和行为模式的响应。
系统提示、情境提示和角色提示之间可能存在显著重叠。例如,一个为系统分配角色的提示,也可以包含情境信息。
然而,每种提示类型的主要目的略有不同:
- 系统提示:定义模型的基本能力和总体目标。
- 上下文提示:提供即时、任务特定的信息以引导响应。它高度针对当前动态任务或输入。
- 角色提示:设定模型输出的风格和语气。它增加了特定性和个性化层次。
全站分卷索引 · 34 卷
- 1Introduction
- 2Prompt engineering
- 3LLM output configuration
- 4Sampling controls
- 5Top-K and top-P
- 6Putting it all together
- 7Prompting techniques
- 8One-shot & few-shot
- 9System, contextual and role prompting
- 10System prompting
- 11Role prompting
- 12Contextual prompting
- 13Step-back prompting
- 14Chain of Thought (CoT)
- 15Self-consistency
- 16Tree of Thoughts (ToT)
- 17ReAct (reason & act)
- 18Automatic Prompt Engineering
- 19Code prompting
- 20Prompts for explaining code
- 21Prompts for translating code
- 22Prompts for debugging and reviewing code
- 23What about multimodal prompting?
- 24Design with simplicity
- 25Be specific about the output
- 26Control the max token length
- 27Experiment with input formats and writing styles
- 28Adapt to model updates
- 29JSON Repair
- 30Working with Schemas
- 31Experiment together with other prompt engineers
- 32CoT Best practices
- 33Summary
- 34Endnotes