← 返回目录

Experiment with input formats and writing styles

第 27 / 34 卷日期:

尝试不同的输入格式与写作风格

不同模型、模型配置、提示格式、措辞选择及提交方式可能产生不同结果。因此,尝试提示属性(如风格、措辞及提示类型 —— 零样本、少样本、系统提示)的实验至关重要。

例如:以生成革命性游戏主机世嘉 Dreamcast 相关内容为目标的提示,可通过疑问句、陈述句或指令形式呈现,从而获得不同输出:

  • 提问:世嘉 Dreamcast 是什么?为什么它是一款具有革命性的游戏机?
  • 陈述:世嘉 Dreamcast 是世嘉公司于 1999 年发布的第六代家用游戏机。它 ...
  • 指令:用一段话描述世嘉 Dreamcast 游戏机,并解释其革命性意义。

针对分类任务的小样本提示,需混合不同类别

一般来说,小样本示例的顺序影响不大。但在处理分类任务时,务必确保在示例中混合可能的响应类别。这是因为若不这样做,可能会过度拟合特定示例顺序。通过混合可能的响应类别,可以确保模型学习识别每个类别的关键特征,而非简单记忆示例顺序。这将使模型在未见数据上表现更稳健且更具泛化能力。

全站分卷索引 · 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