Experiment together with other prompt engineers
接着,您可以提供一个符合此模式的 JSON 对象作为实际产品数据:
{ "name": "Wireless Headphones", "category": "Electronics", "price": 99.99, "features": ["Noise cancellation", "Bluetooth 5.0", "20-hour battery life"], "release_date": "2023-10-27"
}
片段 6. 来自大语言模型的结构化输出
通过对数据进行预处理,并仅提供模式和数据而非完整文档,您使大语言模型能清晰理解产品的属性(包括发布日期),从而更有可能生成准确且相关的描述。这种结构化输入方法能引导大语言模型关注相关字段,在处理海量数据或将大语言模型集成到复杂应用中时尤为宝贵。
与其他提示工程师共同实验
若您正面临需要构思优质提示的处境,不妨召集多人共同尝试。当每个人都遵循本章所述的最佳实践时,您将观察到不同提示方案之间的性能差异。
全站分卷索引 · 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