LLM output configuration
这些提示可用于实现各类理解与生成任务,如文本摘要、信息抽取、问答系统、文本分类、语言或代码翻译、代码生成、代码文档编写及逻辑推理等。
请随时参考谷歌的提示指南 2,3,其中包含简单高效的提示示例。
进行提示工程时,首先需选择模型。无论您使用 Vertex AI 中的 Gemini 语言模型、 GPT、 Claude,还是 Gemma 或 LLaMA 等开源模型,都可能需要针对特定模型优化提示。
除了提示词外,你还需要调整大语言模型的各种配置参数。
大语言模型输出配置
选定模型后,需进一步调试模型配置。大多数大语言模型提供多种配置选项来控制输出效果。高效的提示词工程要求根据任务需求优化这些参数设置。
输出长度
关键配置项是设定生成响应内容的令牌数量。生成更多令牌会消耗更多算力,导致能耗增加、响应延迟和成本上升。
全站分卷索引 · 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