Experiment with input formats and writing styles
尝试不同的输入格式与写作风格
不同模型、模型配置、提示格式、措辞选择及提交方式可能产生不同结果。因此,尝试提示属性(如风格、措辞及提示类型 —— 零样本、少样本、系统提示)的实验至关重要。
例如:以生成革命性游戏主机世嘉 Dreamcast 相关内容为目标的提示,可通过疑问句、陈述句或指令形式呈现,从而获得不同输出:
- 提问:世嘉 Dreamcast 是什么?为什么它是一款具有革命性的游戏机?
- 陈述:世嘉 Dreamcast 是世嘉公司于 1999 年发布的第六代家用游戏机。它 ...
- 指令:用一段话描述世嘉 Dreamcast 游戏机,并解释其革命性意义。
针对分类任务的小样本提示,需混合不同类别
一般来说,小样本示例的顺序影响不大。但在处理分类任务时,务必确保在示例中混合可能的响应类别。这是因为若不这样做,可能会过度拟合特定示例顺序。通过混合可能的响应类别,可以确保模型学习识别每个类别的关键特征,而非简单记忆示例顺序。这将使模型在未见数据上表现更稳健且更具泛化能力。
全站分卷索引 · 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