← 返回目录

Experiment together with other prompt engineers

第 31 / 34 卷日期:

接着,您可以提供一个符合此模式的 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 卷
  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