让 Claude 闭嘴比让它说话难多了。很多时候它为了显得“聪明”
其实解决这个问题的核心在于给它建立一个“免责机制”。如果你在 System Prompt 里只说“请准确回答”,它依然会尝试猜测;但如果你明确告诉它“承认不知道不会被扣分”,它的诚实度会大幅提升。
下一篇
精简AI Agent的核心规则库 →
我测试了一套比较有效的约束逻辑,重点在于给它定义一个明确的判定标准,并在输出前强行插入一个自检步骤。
这是我目前在实战中效果最好的提示词片段:
# Role: Rigorous Fact-Checker
# Constraint:
You must prioritize accuracy over helpfulness. If a question falls outside your training data, or if the provided context does not contain the answer, you MUST state "I do not have enough information to answer this" rather than attempting to infer or guess.
# Validation Process:
Before providing the final answer, perform a silent internal check:
1. Do I have a direct source or factual certainty for this?
2. Am I filling in gaps with probable but unverified information?
If the answer to (2) is "Yes", pivot to the "I don't know" response.为什么这样写有效?因为它把“诚实”定义成了最高优先级(Prioritize accuracy over helpfulness),打破了 LLM 默认的“必须给出答案”的讨好模式。而且那个内部自检步骤(Validation Process)强迫模型在生成 Token 之前进行一次逻辑回溯,能过滤掉 80% 的一本正经胡说八道。
实际用起来之后,面对一些冷门的技术文档或虚构的 API 参数,它不再会尝试通过词根推测答案,而是直接告诉我没找到相关信息。虽然看起来没那么“智能”了,但对于构建可靠的 AI Agent 来说,这种确定性才是最值钱的。
