← 返回目录

System, contextual and role prompting

第 9 / 34 卷日期:

系统提示、上下文提示与角色提示

系统提示、上下文提示和角色提示均是用于指导大语言模型生成文本的技术,但各自侧重点不同:

•系统提示为语言模型设定整体语境与目标。它定义了模型应执行任务的 ‘ 宏观框架 ’,例如语言翻译、评论分类等。

情境提示提供与当前对话或任务相关的具体细节或背景信息。它帮助模型理解所提问题的细微差别,并据此调整响应内容。

角色提示为语言模型指定特定的角色或身份。这有助于模型生成符合所分配角色及其相关知识和行为模式的响应。

系统提示、情境提示和角色提示之间可能存在显著重叠。例如,一个为系统分配角色的提示,也可以包含情境信息。

然而,每种提示类型的主要目的略有不同:

  • 系统提示:定义模型的基本能力和总体目标。
  • 上下文提示:提供即时、任务特定的信息以引导响应。它高度针对当前动态任务或输入。
  • 角色提示:设定模型输出的风格和语气。它增加了特定性和个性化层次。
全站分卷索引 · 34 卷
  1. 1Introduction
  2. 2Prompt engineering
  3. 3LLM output configuration
  4. 4Sampling controls
  5. 5Top-K and top-P
  6. 6Putting it all together
  7. 7Prompting techniques
  8. 8One-shot & few-shot
  9. 9System, contextual and role prompting
  10. 10System prompting
  11. 11Role prompting
  12. 12Contextual prompting
  13. 13Step-back prompting
  14. 14Chain of Thought (CoT)
  15. 15Self-consistency
  16. 16Tree of Thoughts (ToT)
  17. 17ReAct (reason & act)
  18. 18Automatic Prompt Engineering
  19. 19Code prompting
  20. 20Prompts for explaining code
  21. 21Prompts for translating code
  22. 22Prompts for debugging and reviewing code
  23. 23What about multimodal prompting?
  24. 24Design with simplicity
  25. 25Be specific about the output
  26. 26Control the max token length
  27. 27Experiment with input formats and writing styles
  28. 28Adapt to model updates
  29. 29JSON Repair
  30. 30Working with Schemas
  31. 31Experiment together with other prompt engineers
  32. 32CoT Best practices
  33. 33Summary
  34. 34Endnotes