Prompt 公式的力量
虽然每次 ChatGPT 对话都是独特的,但某些 prompt 结构能持续产出更好的结果。这些 "公式" 提供了可适应任何场景的框架,既节省时间又提升输出质量。本指南介绍了经过实战检验的常见任务模板。
把这些公式想象成食谱:基本结构不变,但你可以根据具体需求调整配料。掌握这些模式后,你将能在任何领域更高效地与 ChatGPT 沟通。
RTF 公式:角色-任务-格式
最通用且广泛适用的公式:
结构:
"Act as [角色]. [任务描述]. Format your response as [格式]."
示例:
"Act as an experienced marketing copywriter. Write a product description for a sustainable bamboo water bottle targeting eco-conscious millennials. Format your response as a 150-word paragraph with a catchy headline."
为什么有效:设定角色让 ChatGPT 预设相关专业知识。清晰的任务定义避免歧义。格式要求确保输出可直接使用。
变体:
- 添加语气:"...in a friendly, conversational tone"
- 添加约束:"...avoid jargon and keep sentences under 20 words"
- 添加示例:"...similar to Apple's product descriptions"
CTE 公式:上下文-任务-示例
当示例有助于定义期望时非常适用:
结构:
"Context: [背景]. Task: [需要什么]. Examples of what I'm looking for: [示例]."
示例:
"Context: I'm a teacher creating a quiz for 8th-grade students about the American Revolution. Task: Generate 10 multiple-choice questions with 4 options each. Examples of what I'm looking for: Questions that test understanding rather than just memorization, like 'What was the PRIMARY reason colonists opposed the Stamp Act?' rather than 'In what year was the Stamp Act passed?'"
为什么有效:上下文提供必要背景。示例展示了质量和风格期望。当难以用语言解释你想要什么时,这个公式特别好用。
问题-解决方案公式
非常适合获取可执行的建议:
结构:
"Problem: [描述问题]. What I've tried: [之前的尝试]. What I need: [期望结果]. Constraints: [限制条件]."
示例:
"Problem: Our email newsletter has a 12% open rate, well below industry average of 21%. What I've tried: Changing send times, A/B testing subject lines with emojis vs. without. What I need: 5 specific, actionable strategies to improve open rates. Constraints: We have a small team and limited budget, so solutions should be implementable within our current email platform."
为什么有效:分享你已尝试过的方法可以避免重复建议。约束条件防止不切实际的推荐。明确的结果定义聚焦了回复方向。
分步公式
适用于需要详细指导的复杂任务:
结构:
"I need to [目标]. Please provide step-by-step instructions for [具体任务]. Include [具体要求]. Format as numbered steps with explanations."
示例:
"I need to set up a CI/CD pipeline for my Node.js application. Please provide step-by-step instructions for deploying to AWS using GitHub Actions. Include code snippets for the workflow file, necessary IAM permissions, and common troubleshooting tips. Format as numbered steps with explanations for each step."
为什么有效:将复杂任务分解为可管理的步骤。明确列出的需求确保全面覆盖。结构化的格式便于实施。
对比分析公式
适用于均衡评估和决策:
结构:
"Compare [选项A] and [选项B] for [使用场景]. Include: pros and cons of each, key differences, and a recommendation based on [评判标准]."
示例:
"Compare React and Vue.js for building a medium-sized e-commerce website. Include: pros and cons of each framework, key differences in learning curve, ecosystem, and performance, and a recommendation based on a team of developers with JavaScript experience but no framework experience."
为什么有效:均衡的结构防止片面分析。具体的评判标准将对比聚焦在对你重要的方面。推荐请求推动得出可执行的结论。
改进公式
适用于优化现有内容:
结构:
"Here is [内容类型]: [粘贴内容]. Please improve it by [具体改进方向]. Maintain [需要保留的元素]. Target audience: [受众]."
示例:
"Here is my LinkedIn summary: [粘贴文字]. Please improve it by making it more engaging, highlighting my leadership experience more prominently, and adding a clear call to action. Maintain the professional tone and focus on tech industry experience. Target audience: Tech recruiters and hiring managers."
为什么有效:提供现有内容让 ChatGPT 有具体材料可以处理。具体的改进方向引导修改。保留指令防止丢失已有的好内容。
专家访谈公式
适用于深入探讨复杂话题:
结构:
"You are an expert in [领域]. I'm going to ask you questions about [话题]. Please provide detailed, nuanced answers as if you were a leading authority in the field. First question: [问题]"
示例:
"You are an expert in behavioral economics. I'm going to ask you questions about decision-making biases in consumer behavior. Please provide detailed, nuanced answers as if you were a leading authority in the field. First question: How does loss aversion specifically affect online purchase decisions?"
为什么有效:专家框架鼓励深度和细微差别。多问题设置支持后续深入探索。访谈格式允许自然的对话流程。
输出模板公式
适用于一致的、结构化的输出:
结构:
"Generate [内容类型] using this exact template:\n[带占位符的模板]\nFill in based on: [输入信息]"
示例:
"Generate a meeting summary using this exact template:\n\n**Meeting Title:** [title]\n**Date:** [date]\n**Attendees:** [list]\n**Key Decisions:** [bullet points]\n**Action Items:** [bullet points with owners and deadlines]\n**Next Steps:** [paragraph]\n\nFill in based on: [粘贴会议笔记]"
为什么有效:精确的模板确保一致的输出格式。非常适合需要保持一致性的重复任务。减少后期编辑时间。
思维链公式
适用于复杂推理和分析:
结构:
"[问题/问题描述]. Think through this step-by-step, showing your reasoning at each stage before reaching a conclusion."
示例:
"A company has $100,000 to invest in marketing. They can choose between social media ads ($30 CPA, 60% conversion rate to paid), Google ads ($45 CPA, 75% conversion rate), or influencer marketing ($25 CPA, 40% conversion rate, but 2x customer lifetime value). Which option maximizes ROI? Think through this step-by-step, showing your reasoning at each stage before reaching a conclusion."
为什么有效:明确的推理指令提高了复杂问题的准确性。可见的思维过程允许你验证逻辑。减少因草率得出结论而导致的错误。
Formula Quick Reference
| Formula | Structure | Best For | Difficulty |
|---|---|---|---|
| RTF | Role + Task + Format | General tasks, content creation | Beginner |
| CTE | Context + Task + Examples | Complex or nuanced tasks | Beginner |
| Problem-Solution | Problem + Tried + Need + Constraints | Troubleshooting, advice | Intermediate |
| Step-by-Step | Goal + Instructions + Requirements | Tutorials, technical guides | Beginner |
| Comparative | Options + Use Case + Criteria | Decision-making, evaluations | Intermediate |
| Improvement | Content + Improvements + Keep + Audience | Editing, refining drafts | Beginner |
| Expert Interview | Expert Role + Topic + Questions | Research, deep dives | Intermediate |
| Output Template | Content Type + Template + Input | Recurring tasks, consistency | Intermediate |
| Chain-of-Thought | Problem + Step-by-step reasoning | Math, logic, analysis | Advanced |
Decision Guide: Which Formula Should I Use?
Writing content from scratch? Start with RTF (Role-Task-Format)
Solving a specific problem? Use the Problem-Solution formula
Comparing options? Use the Comparative Analysis formula
Improving existing work? Use the Improvement formula
Need consistent output? Use the Output Template formula
Complex reasoning needed? Use Chain-of-Thought
Not sure? RTF works for 80% of tasks. Start there and adapt.
组合使用公式
这些公式组合使用效果很好:
RTF + 问题-解决方案:"Act as a senior UX designer. Problem: Our checkout flow has a 67% abandonment rate..."
CTE + 分步:"Context: I'm launching a podcast... Task: Provide step-by-step guide for the first episode... Examples: I like the interview style of Lex Fridman..."
专家 + 思维链:"You are an expert in financial modeling. Think through step-by-step how you would approach valuing a SaaS company..."
结语
这些公式不是死板的规则——它们是起点。根据你的需求进行调整,创造性地组合它们,发展出你自己的变体。关键是为 ChatGPT 提供清晰的结构、相关的上下文和明确的方向。
从最匹配你任务的公式开始,针对你的具体情况进行定制,并根据结果不断迭代。随着时间推移,你会建立起直觉,知道哪种结构最适合不同的场景。
保存对你有效的 prompt 作为个人模板。建立你的 prompt 库可以加速未来的工作,确保类似任务的一致质量。祝 prompt 写作愉快!