注意:如果您使用 ChatGPT API,可以通过 temperature 设置控制随机性(0 = 稳定一致,1 = 更具创造性),并设置适用于整段对话的 system 消息。对于大多数使用网页界面的用户来说,关键是在提示词中尽可能具体。
按类别分类的 ChatGPT 提示词示例
我将这些示例按类别整理。每个部分先解释在该领域提示词为何有效,然后给出可复制并按需改写的示例。
写作类提示词
有效要点:
明确受众、语气与格式
设定字数或结构限制
清楚定义目标
示例 1:博客开头
Write a 100-word blog introduction explaining why SQL remains essential for data analysis despite the rise of Python and R. Target audience: data analysts considering which skills to prioritize.技术支持
示例 2:专业邮件
Draft a 150-word email to a client explaining a project delay. Tone: professional but empathetic. Include a revised timeline and one proactive solution to minimize impact.技术支持
示例 3:社交媒体内容
Write three LinkedIn post variations (under 200 characters each) announcing a new data visualization course. Emphasize practical skills over theory. Use a conversational, encouraging tone.技术支持
示例 4:技术文档
Rewrite this API error message for non-technical users: "Authentication token expired. Error 401." Make it clear what happened and what action to take.技术支持
示例 5:创意写作
Write a 200-word product description for noise-canceling headphones. Target remote workers. Focus on productivity benefits, not technical specs. Conversational tone.技术支持
Write a Python function that takes a list of dictionaries and returns a new list containing only items where the 'status' key equals 'active'. Include error handling for missing keys.技术支持
示例 2:调试
This Python function is supposed to calculate the median of a list, but it fails on even-length lists. Identify the bug and provide a corrected version:
def median(numbers):
sorted_nums = sorted(numbers)
mid = len(sorted_nums) // 2
return sorted_nums[mid]技术支持
示例 3:代码解释
Explain what this SQL query does, identify any performance concerns, and suggest an optimized version:
SELECT * FROM orders WHERE customer_id IN (SELECT id FROM customers WHERE region = 'West')技术支持
示例 4:重构
Refactor this JavaScript code to use async/await instead of promise chaining. Maintain the same error handling logic:
[paste code here]技术支持
示例 5:边界情况识别
Review this Python function for edge cases it doesn't handle. List each edge case and suggest how to fix it:
def divide_list(numbers, divisor):
return [n / divisor for n in numbers]技术支持
提示:调试时可补充“请逐步解释你的推理”,以捕捉仅靠生成代码可能忽略的逻辑错误。
数据分析类提示词
有效要点:
描述数据集结构
要求解释与推理
请求可视化建议
示例 1:探索性分析
I have a sales dataset with columns: date, product_category, revenue, region. Suggest five exploratory questions I should investigate first, and explain why each matters for business decisions.技术支持
示例 2:趋势识别
This dataset shows monthly website traffic for 18 months: [paste data]. Identify three meaningful trends and explain what might be causing each one.技术支持
示例 3:可视化建议
I need to present quarterly revenue by product line (5 categories) to executives. Suggest the best chart type and explain why it's more effective than alternatives.技术支持
示例 4:统计方法
I want to test whether a new checkout process increased conversion rates. I have before/after data for 1,000 users. What statistical test should I use and why? What assumptions do I need to verify first?技术支持
示例 5:数据质量评估
Review this customer dataset summary: 10,000 rows, 15% missing email addresses, age ranges from 18-120, some negative purchase amounts. Prioritize the three most critical data quality issues and suggest fixes.技术支持
商务类提示词
有效要点:
结合业务背景分配角色
请求结构化、可执行的输出
设置清晰的限制条件与场景
示例 1:市场分析
You are a market analyst. Summarize the top three risks for a U.S.-based SaaS company expanding to the European market. For each risk, provide one specific mitigation strategy. Keep the response under 200 words.技术支持
示例 2:竞争定位
Compare three project management tools - Asana, Monday.com, and Trello - for a 50-person marketing team. Focus on collaboration features and pricing. Present findings as a decision matrix.技术支持
示例 3:商业案例撰写
Draft a business case for implementing automated customer support chatbots. Include expected cost savings, implementation timeline, and two potential risks. Target audience: CFO and operations director.技术支持
示例 4:会议准备
I'm presenting Q3 results to the board. Revenue is up 12% but customer acquisition cost increased 18%. Prepare three talking points that acknowledge the CAC increase while emphasizing overall growth trajectory.技术支持
示例 5:流程改进
Our sales team spends 10 hours weekly manually updating CRM records. Suggest three automation solutions, ranked by implementation difficulty and potential time savings.技术支持
学习与教学类提示词
有效要点:
说明学习者当前水平
请求类比和具体示例
要求分步骤讲解
示例 1:用类比解释概念
Explain gradient descent to someone learning machine learning for the first time. Use a hiking analogy. Keep it under 150 words.技术支持
示例 2:适合初学者的拆解
I'm learning Python and don't understand decorators. Explain what they do, why they're useful, and show one simple example. Assume I understand functions but not advanced concepts.技术支持
示例 3:测验生成
Create five multiple-choice questions testing understanding of SQL joins. Include one question each for: inner join, left join, right join, full outer join, and cross join. Provide explanations for correct answers.技术支持
示例 4:步骤式教程
Teach me how to create a pivot table in Excel. I've never used them before. Break it into numbered steps with one clear action per step. Use a sample sales dataset as the example.技术支持
示例 5:概念对比
Explain the difference between supervised and unsupervised learning as if teaching a business analyst with no machine learning background. Use real-world business examples for each.技术支持
如何写出更好的 ChatGPT 提示词
优秀的提示词在清晰度与上下文之间取得平衡。以下是经过验证、能提升结果的技巧:
零样例(Zero-shot)提示
零样例提示就是不提供示例,直接发问。适合简单任务:
Summarize this paragraph in one sentence: [paste text]技术支持
单样例(One-shot)提示
单样例提示给出一个示例,以示范所需的语气或格式:
Convert these technical terms to plain language. Example: "API" becomes "a way for software programs to communicate with each other."
Now convert: "OAuth authentication"技术支持
少样例(Few-shot)提示
少样例提示给出多个示例,以教授一种模式:
Convert these product names to URL-friendly slugs:
"Premium Wireless Headphones" → "premium-wireless-headphones"
"4K Ultra HD Monitor" → "4k-ultra-hd-monitor"
Now convert: "Ergonomic Standing Desk Pro"技术支持
Generate three approaches to reducing customer churn for a SaaS company, each in 2 sentences. Then compare them in 3 sentences and recommend the best one.技术支持
反思型提示可发现错误:
Review your previous answer for accuracy, clarity, and completeness. Identify any gaps or potential improvements.技术支持
元提示(Meta-prompting)
让 ChatGPT 为您设计提示词:
I need to summarize academic papers. Generate three reusable prompt templates: one for methodology, one for key findings, and one for limitations. Keep each template under 20 words.技术支持
上下文窗口管理
在长对话中通过重申目标让 ChatGPT 保持聚焦:
Reminder: We're designing a data pipeline for real-time analytics. All suggestions should prioritize low latency over storage efficiency.
Now, how should we handle schema changes?技术支持
在长对话中,我每隔几轮就重申一次主要目标。这样能让 ChatGPT 始终与我的真实诉求保持一致。
多轮与模块化提示
将大型任务拆分为连续步骤:
技术文章写作的示例工作流:
提示 1:
Generate an outline for a 2,000-word article on API rate limiting. Include 5 main sections with 2-3 subsections each.技术支持
提示 2:
Using the outline you just created, write a 200-word introduction that explains why rate limiting matters for API developers.技术支持
提示 3:
Now expand the "Implementation Strategies" section. Include code examples in Python.技术支持
逐步检查并在每一步调整,而不是一次性生成全部内容。若要实现自动化,开发者可以使用 OpenAI API 编排这些序列。
角色与视角叠加
组合多个角色以获得更均衡的答案:
You are both a data scientist and a project manager. Explain how to prioritize machine learning projects. Address both technical feasibility and business impact.技术支持
[After receiving a response]
Rate your previous answer on these dimensions:
- Clarity (1-10)
- Accuracy (1-10)
- Completeness (1-10)
For any score below 8, explain what's missing and provide an improved version.技术支持
提示词模板与复用
为高频任务构建可复用模板:
数据集分析模板:
Analyze this [DATASET TYPE] dataset with [NUMBER] rows and [NUMBER] columns.
Provide:
1. Overview: Key characteristics and data types
2. Trends: Three meaningful patterns
3. Outliers: Unusual values or anomalies
4. Visualizations: Suggest three charts with rationale
Dataset: [PASTE DATA OR DESCRIPTION]技术支持
常见错误与修正方法
错误 1:提示词含糊或过于宽泛
糟糕示例:Tell me about Python
问题所在:ChatGPT 不知道您具体想要什么,输出会很泛。
修正:
Explain how Python's list comprehension syntax works. Include three examples: filtering a list, transforming values, and nested comprehensions.技术支持
错误 2:一次提出多个不相关问题
糟糕示例:Explain machine learning, recommend a Python course, and help me debug this code
问题所在:ChatGPT 的注意力被分散到三个任务上,每个答案都会很浅。
修正:拆分为独立提示词,一次只做一件事。
错误 3:忽视模型局限
糟糕示例: What were Apple's exact revenue figures for Q3 2025?
问题所在:ChatGPT 无法访问实时数据,可能编造看似合理的数字。
修正:
Explain how to interpret a company's quarterly revenue report. What metrics should I focus on beyond top-line revenue?技术支持
错误 4:未设限制或指定格式
糟糕示例:Summarize this article: [paste long article]
问题所在:没有长度、重点或受众方面的指引。
修正:
Summarize this article in three bullet points. Focus on actionable takeaways for data analysts. Maximum 150 words total.技术支持
错误 5:假定 ChatGPT 会长期记住上下文
糟糕示例:Use the approach we discussed earlier(经过 20 轮对话后)
修正:
Use the Python pandas approach we discussed for handling missing values (forward fill method). Apply it to this new dataset: [paste data]技术支持
我常想,有多少人试用了一次 ChatGPT,失望后就放弃了。上周我有位同事让它“帮助做数据分析”。她得到的回复是一些清理数据集、检查离群值的泛泛建议。从技术上说没错,但对她的实际问题毫无用处。我帮她换了种问法:“分析这个销售数据集的季节性趋势,并建议哪些产品品类表现下滑。”这一次,她在几秒钟内就拿到了有价值的洞见。
差别不在于 AI,而在于提示词。提示词就是您给 ChatGPT 的指令,它几乎决定了输出的一切。模糊的提示词会产生模糊的答案,具体的提示词会带来有用的结果,这当然没错。但远不止如此。我会带您逐步了解
在这篇文章里,我将分享我编写高效 ChatGPT 提示词的经验,并展示真正有效的具体技巧。您将看到面向写作、编码、数据分析、商务任务和学习的实用示例,以及处理复杂工作流与自动化的高级方法。
ChatGPT 提示词基础
提示词就是您在 ChatGPT 中输入的内容。它可以是一个问题(“什么是梯度下降?”)、一条指令(“请总结这段文字”),或者包含更多上下文的说明(“您是一位 SQL 讲师。向初学者解释连接(join)”)。
简单提示词与结构化提示词的差异非常明显。请看下面这两个:
简单提示词:
结构化提示词:
第一个几乎不给 ChatGPT 任何发挥空间。第二个则明确了受众、篇幅和表达方式。您将得到截然不同的结果。
提示词工程是一种为 AI 设计高效输入的技能。它不是编程,而是沟通。核心是基于 ChatGPT 处理语言的方式来给出清晰的指令。
我不再把提示词当作搜索查询,而是当作明确的指令。完成这种转变后,我的结果有了质的提升。
ChatGPT 如何理解提示词
ChatGPT 会基于上下文、角色、语气和结构来解读您的指令。它并不具有人类那样的“理解”,而是依据训练中学到的模式预测最合理的回应。这就是为什么清晰度如此重要。
有三个关键因素会影响 ChatGPT 如何解读您的提示词:
指定角色会改变 ChatGPT 的回应方式。写上“您是一名金融分析师”,它会自动调整语言与深度。这是因为模型见过大量金融分析师的沟通示例。
语气同样重要。要求“正式的商务摘要”与“给朋友的轻松解释”,风格会迥然不同。
注意:如果您使用 ChatGPT API,可以通过 temperature 设置控制随机性(0 = 稳定一致,1 = 更具创造性),并设置适用于整段对话的 system 消息。对于大多数使用网页界面的用户来说,关键是在提示词中尽可能具体。
按类别分类的 ChatGPT 提示词示例
我将这些示例按类别整理。每个部分先解释在该领域提示词为何有效,然后给出可复制并按需改写的示例。
写作类提示词
有效要点:
示例 1:博客开头
示例 2:专业邮件
示例 3:社交媒体内容
示例 4:技术文档
示例 5:创意写作
看出规律了吗?每个提示词都说明了读者是谁、写作目的是什么、以及需要的格式。没有猜谜空间。您能直接获得可用的初稿。
编码类提示词
有效要点:
示例 1:代码生成
示例 2:调试
示例 3:代码解释
示例 4:重构
示例 5:边界情况识别
提示:调试时可补充“请逐步解释你的推理”,以捕捉仅靠生成代码可能忽略的逻辑错误。
数据分析类提示词
有效要点:
示例 1:探索性分析
示例 2:趋势识别
示例 3:可视化建议
示例 4:统计方法
示例 5:数据质量评估
商务类提示词
有效要点:
示例 1:市场分析
示例 2:竞争定位
示例 3:商业案例撰写
示例 4:会议准备
示例 5:流程改进
学习与教学类提示词
有效要点:
示例 1:用类比解释概念
示例 2:适合初学者的拆解
示例 3:测验生成
示例 4:步骤式教程
示例 5:概念对比
如何写出更好的 ChatGPT 提示词
优秀的提示词在清晰度与上下文之间取得平衡。以下是经过验证、能提升结果的技巧:
零样例(Zero-shot)提示
零样例提示就是不提供示例,直接发问。适合简单任务:
单样例(One-shot)提示
单样例提示给出一个示例,以示范所需的语气或格式:
少样例(Few-shot)提示
少样例提示给出多个示例,以教授一种模式:
提示:把最好的少样例提示词存起来。维护一份模板文档,涵盖代码评审、数据分析与报告写作,便于反复复用。
思维链(Chain-of-thought)提示
思维链提示要求 ChatGPT 按步骤推理:
角色提示
角色提示用来设定专业领域与沟通风格:
通过限制条件与格式要求可使回答更聚焦:
我很少第一次就写对。我的流程是:先从简单开始,检查输出,再在下一次尝试里增加 2-3 个具体细节。通常两三轮就能到位。
高级提示词技巧
下面我将演示一些能在复杂任务中提升 ChatGPT 推理力、一致性与自动化能力的方法。
自洽与反思型提示
让 ChatGPT 生成多个方案并进行比较:
反思型提示可发现错误:
元提示(Meta-prompting)
让 ChatGPT 为您设计提示词:
上下文窗口管理
在长对话中通过重申目标让 ChatGPT 保持聚焦:
在长对话中,我每隔几轮就重申一次主要目标。这样能让 ChatGPT 始终与我的真实诉求保持一致。
多轮与模块化提示
将大型任务拆分为连续步骤:
技术文章写作的示例工作流:
提示 1:
提示 2:
提示 3:
逐步检查并在每一步调整,而不是一次性生成全部内容。若要实现自动化,开发者可以使用 OpenAI API 编排这些序列。
角色与视角叠加
组合多个角色以获得更均衡的答案:
我发现把“数据科学家与业务分析师”等角色组合起来,在需要技术深度与实用性兼备时,往往能得到更均衡的回答。
评估与自我批判型提示
让 ChatGPT 给自己的输出打分:
提示词模板与复用
为高频任务构建可复用模板:
数据集分析模板:
常见错误与修正方法
错误 1:提示词含糊或过于宽泛
糟糕示例:
Tell me about Python问题所在:ChatGPT 不知道您具体想要什么,输出会很泛。
修正:
错误 2:一次提出多个不相关问题
糟糕示例:
Explain machine learning, recommend a Python course, and help me debug this code问题所在:ChatGPT 的注意力被分散到三个任务上,每个答案都会很浅。
修正:拆分为独立提示词,一次只做一件事。
错误 3:忽视模型局限
糟糕示例:
What were Apple's exact revenue figures for Q3 2025?问题所在:ChatGPT 无法访问实时数据,可能编造看似合理的数字。
修正:
错误 4:未设限制或指定格式
糟糕示例:
Summarize this article: [paste long article]问题所在:没有长度、重点或受众方面的指引。
修正:
错误 5:假定 ChatGPT 会长期记住上下文
糟糕示例:
Use the approach we discussed earlier(经过 20 轮对话后)修正:
结语
高质量的 ChatGPT 提示词归根到底是清晰的沟通。优秀与一般结果的分水岭在于具体性:说明您的受众、设置边界条件,并清楚表达您的需求。
我从基础做起——分配角色、少样例示范、思维链推理——并将其融入我的工作。我留意哪些提示词有效、哪些无效,如此持续改进。
这些技巧适用于不同领域,因为它们契合 ChatGPT 的语言处理方式。无论是编程、数据分析,还是撰写商务文档,同样的原则都适用:清晰、具体,并根据结果迭代。
若想提升您的 AI 与数据技能,请查看我们的 Introduction to ChatGPT 课程和 AI Fundamentals 学习路径。若想在数据工作中亲手练习提示词,请参见 Working with the OpenAI API