置信度门控(Confidence-Gated Routing)

一句话定义:把置信度(Confidence)当作答案之外的第二条决策轴——答案告诉你”做什么”,置信度告诉你”该不该做”。 它不改变分类结果,只决定这个结果够不够格触发动作。

1. 官方的一句话定位

“Use confidence as a second axis. The answer tells you what; confidence tells you whether to act.”

翻译:把置信度当作第二条轴。答案告诉你”是什么”,置信度告诉你”要不要动手”。

模式表里的定位是:“Utilize confidence as a second decision axis to build safer systems”(把置信度当作第二条决策轴,构建更安全的系统),收益一栏写的是可靠性(Reliability)、安全(Safety)。

2. 置信度从哪来

confidence.md 说明:每个选择题(Choice)和打分题(Score)的答案都带一个 probabilities 属性,表示在各选项(或各档位)上的概率分布。

“The shape of that distribution is what tells you how certain the model is: concentrated on one outcome means a confident answer, spread out means an uncertain one.”

翻译:这个分布的形状才说明模型有多确定——集中在一个结果上就是有把握,摊得越开就是越不确定。

答案的 confidence 属性把这个形状压成一个 0 到 1 的数。官方给的近似换算(以 3 个选项为例):(3 × 最高概率 − 1) / 2;全部押在一个选项上 = 1.0,摊得越均匀越低。三个必须记住的点:

  • 只有选择题和打分题给置信度,是非题(Noul)不给——它本来只有”是/否”两种结果,那个 0–1 的数已经把话说完了。
  • 置信度高 ≠ 一定对。官方原话:“置信度 1.0 描述的是模型的答案,而不是答案正确的保证。”
  • 官方说 confidence 只是一个”合适的默认值”,你没有被锁死在它的定义上——所以它把完整的 probabilities 也给你。

3. 为什么”我不知道”是重要信号

“If an intelligent system, whether human or machine, cannot express honest uncertainty, the system cannot be trusted.”

翻译:如果一个智能系统——无论人还是机器——无法表达诚实的不确定性,这个系统就不可信。

官方把它落实成三段式用法,分界线画在哪里取决于这件事的赌注大小:

置信度区间系统行为
高自动执行,无需人工介入
中谨慎推进:请用户确认、标记复核、或先补信息
低不行动:转人工、请求澄清、或回退到另一套系统

4. 核心铁律:阈值不是一个数,是一组数

“A confidence threshold is not one number. Different actions within the same system should be gated at different levels depending on the consequences of getting it wrong.”

翻译:置信度阈值不是一个数字。 同一个系统里的不同动作,应该根据”做错了的后果”分别设置不同的门槛。

confidence.md 的示例代码(门槛是 0.5 与 0.9,高于语音银行示例):confidence < 0.5 一律转人工;check_balance 这种只读、可恢复的动作直接执行;approve_transfer 这种有破坏性的动作,要求 confidence > 0.9 才自动执行。

“The 0.5 confidence floor catches anything the model reports as genuinely uncertain. Above that, the threshold for acting without confirmation is higher for a destructive operation than for a read-only one. Your code encodes the risk tolerance.”

翻译:0.5 这条地板线兜住所有模型自认”真的不确定”的情况。地板线以上,破坏性操作免确认执行的门槛要高于只读操作。你的代码在编码风险容忍度。

5. 官方语音银行示例:0.6 与 0.85

模式页给的语音银行(Voice Banking)示例把”一组数”讲得最清楚:

action = response.answers["intent"]
 
# Below 0.6 confidence on any action, route to a human
if action.confidence < 0.6:
    route_to_support_agent(account_id)
 
elif action.choice == "check_balance":
    show_balance(account_id)          # 低风险,0.6 就够
 
elif action.choice == "approve_transfer":
    if action.confidence > 0.85:
        approve_transfer(account_id)  # 高风险 + 高把握 → 自动执行
    else:
        ask_user_to_confirm("Just to confirm: you would like to approve this transfer, is that correct?")
动作风险阈值门槛行为
任意动作—< 0.6转人工客服
check_balance低≥ 0.6直接播报余额
approve_transfer高0.6 ~ 0.85先请用户口头确认
approve_transfer高> 0.85自动批准

“The 0.6 floor catches anything the model is genuinely uncertain about. Above that floor, each action type has its own threshold based on the consequences of acting on a wrong classification.”

翻译:0.6 这条地板线兜住所有模型真正犹豫的情况。地板线以上,每种动作有自己的阈值,依据是”分类错了会怎样”。同一个示例还说明,虽然解读意图时总希望有合理把握,但某些动作风险更高,因此要求更高的置信度阈值。

6. 阈值必须自己测出来

“The correct threshold values depend on your domain and the performance of the model for your use case. Start with conservative thresholds, test with your own data, and adjust as you observe results.”

翻译:正确的阈值取决于你的业务领域,以及模型在你这个场景上的表现。先用保守的阈值,用你自己的数据去测,再根据结果调整。

concepts__how-to-build-with-system-one.md 也强调同样做法:“Test thresholds by plotting confidence against accuracy on your data.”(用你自己的数据把置信度对准确率画出来,去测阈值。)

7. 怎么和路由配合

两条轴各管一件事:模型路由 用答案本身决定”走哪条分支”;置信度门控决定”这条分支要不要执行、要不要升级给更强模型或人”。在客服路由示例中两者已经合流:intent.confidence < 0.5 把人拉进来,complexity.confidence < 0.5 又对”难度判断”本身做了一次门控。实现上通常一次调用就把意图与配套的打分问题问完,靠 投机式扇出 避免串行往返。

8. 工程要点

  • 别只拿最高概率当答案,把它和 confidence 一起看——同一个 score 可能来自完全不同的概率分布。
  • 每个动作单独设阈值,按后果排序:只读 < 可恢复写入 < 不可逆操作。
  • 给中等把握留一条”请用户确认”的路,不要只有”自动执行”和”转人工”两极;每问一个问题都顺带检查它的置信度,包括”难度""严重度”这类辅助判断。
  • 阈值上线后用真实数据回头校准,不要照抄官方示例里的 0.5 / 0.6 / 0.85。

相关来源

  • processed/jev-原始资料/官方-文档/patterns__confidence-routing.md(语音银行 0.6 / 0.85)
  • processed/jev-原始资料/官方-文档/confidence.md(置信度来源、三段式用法、阈值随风险缩放)
  • processed/jev-原始资料/官方-文档/patterns.md(官方模式定位)
  • processed/jev-原始资料/官方-文档/concepts__how-to-build-with-system-one.md(Route on uncertainty 步骤)
  • wiki/synthesis/Jev 知识.md(面向阅读的综合讲解)