Anthropic Engineering Blog 中文翻译

create: 2025-03-20
update: 2026-08-10
author: thinkycx
title: 【译】Think 工具:让 Claude 在复杂工具调用场景中停下来思考
description: Anthropic 介绍了"think"工具——一种让 Claude 在复杂工具调用场景中"停下来思考"的技术。通过在工具调用链中为模型提供结构化的思考空间,该方法在策略遵循、一致性决策和多步骤推理方面带来了显著提升,在 tau-bench 航空领域提高了 54% 的性能。
category: translation
tags: anthropic, engineering, translation, tool-use

"Think" 工具:让 Claude 在复杂工具调用场景中停下来思考

原文发布于 2025 年 3 月 20 日

2025 年 12 月 15 日更新: Extended thinking 能力已经大幅改进,Anthropic 现在建议在大多数场景中使用 extended thinking 替代专门的 think 工具,因为它能提供类似的收益——给 Claude 空间来推理复杂问题——同时具有更好的集成度和性能表现。


什么是 "think" 工具?

"think" 工具为 Claude 在生成响应的过程中提供一个专属的结构化思考空间,特别适用于需要逐步获取信息的复杂工具调用场景。 这个工具本身不会获取新信息或修改任何数据,只是在对话日志中记录一次思考过程。它让 Claude 能在收到工具返回结果后"停下来想一想",评估已有信息是否足够、下一步该怎么做。

"Think" 工具 vs Extended Thinking

维度 Extended Thinking Think 工具
触发时机 响应生成之前 响应生成过程中
作用 深度思考,迭代制定计划 暂停评估,判断是否具备足够信息继续
推理深度 全面、综合性推理 更聚焦于新发现的信息
适用信息 用户查询中已包含所有必要信息 需要通过工具调用逐步获取信息

各自适用场景

场景 推荐方案
简单工具调用 Extended Thinking
非顺序性工具调用 Extended Thinking
直接的指令跟随 Extended Thinking
不涉及工具的编程/数学/物理 Extended Thinking
复杂工具调用 Think 工具
长调用链中分析工具输出 Think 工具
策略密集型环境 Think 工具
顺序决策,错误代价高 Think 工具

工具定义示例(来自 tau-bench)

{
  "name": "think",
  "description": "Use the tool to think about something. It will not obtain new information or change the database, but just append the thought to the log. Use it when complex reasoning or some cache memory is needed.",
  "input_schema": {
    "type": "object",
    "properties": {
      "thought": {
        "type": "string",
        "description": "A thought to think about."
      }
    },
    "required": ["thought"]
  }
}

tau-Bench 上的性能表现

在模拟客服的 tau-bench 测试中,think 工具结合优化后的 prompt 在航空领域带来了 54% 的相对性能提升。 tau-bench 是一个测试模型在真实客服场景中使用工具能力的基准测试。它评估 Claude 与模拟用户对话、遵循复杂策略指南、使用工具访问和操作数据库的能力。

评估指标: pass^k 衡量的是"对某个任务进行 k 次独立试验全部成功的概率,取所有任务的平均值"——它考察的是一致性和可靠性,而不仅仅是单次成功率。

测试配置

配置 说明
Baseline 无 think 工具,无 extended thinking
Extended thinking 仅开启 extended thinking
Think 工具 仅添加 think 工具
Think + 优化 Prompt Think 工具 + 领域针对性优化的 prompt

航空领域结果

Claude 3.7 Sonnet 在 tau-bench 航空领域的性能表现

配置 k=1 k=2 k=3 k=4 k=5
Think + 优化 Prompt 0.584 0.444 0.384 0.356 0.340
Think 工具 0.404 0.254 0.186 0.140 0.100
Extended thinking 0.412 0.290 0.232 0.192 0.160
Baseline 0.332 0.206 0.148 0.116 0.100

航空领域的策略文档非常复杂,think 工具配合优化 prompt 的效果尤为突出。

优化后的系统 Prompt 示例(航空领域)

## Using the think tool

Before taking any action or responding to the user after receiving tool results, use the think tool as a scratchpad to:
- List the specific rules that apply to the current request
- Check if all required information is collected
- Verify that the planned action complies with all policies
- Iterate over tool results for correctness 

Here are some examples of what to iterate over inside the think tool:
<think_tool_example_1>
User wants to cancel flight ABC123
- Need to verify: user ID, reservation ID, reason
- Check cancellation rules:
  * Is it within 24h of booking?
  * If not, check ticket class and insurance
- Verify no segments flown or are in the past
- Plan: collect missing info, verify rules, get confirmation
</think_tool_example_1>

<think_tool_example_2>
User wants to book 3 tickets to NYC with 2 checked bags each
- Need user ID to check:
  * Membership tier for baggage allowance
  * Which payments methods exist in profile
- Baggage calculation:
  * Economy class × 3 passengers
  * If regular member: 1 free bag each  3 extra bags = $150
  * If silver member: 2 free bags each  0 extra bags = $0
  * If gold member: 3 free bags each  0 extra bags = $0
- Payment rules to verify:
  * Max 1 travel certificate, 1 credit card, 3 gift cards
  * All payment methods must be in profile
  * Travel certificate remainder goes to waste
- Plan:
1. Get user ID
2. Verify membership level for bag fees
3. Check which payment methods in profile and if their combination is allowed
4. Calculate total: ticket price + any bag fees
5. Get explicit confirmation for booking
</think_tool_example_2>

零售领域结果

Claude 3.7 Sonnet 在 tau-bench 零售领域的性能表现

配置 k=1 k=2 k=3 k=4 k=5
Think 工具(无额外 prompt) 0.812 0.735 0.685 0.650 0.626
Extended thinking 0.770 0.681 0.623 0.581 0.548
Baseline 0.783 0.695 0.643 0.607 0.583

零售领域的策略相比航空领域明显简单。Claude 仅靠"有一个思考空间"就能获得提升,不需要额外的 prompt 引导。

核心发现

1. 困难领域中 prompt 的优化至关重要。 在航空这类策略复杂的领域,单纯添加 think 工具的效果有限,需要配合针对性的 prompt 来引导模型使用 think 工具进行系统化的规则检查。而对于零售这类简单领域,仅提供思考空间就已足够。

2. 跨试验的一致性显著提升。 性能改进在 pass^k(k 从 1 到 5)上都保持了一致,说明模型对边界情况的处理更加稳定可靠。


SWE-Bench 上的性能表现

Think 工具为 Claude 3.7 Sonnet 在 SWE-bench 上取得 0.623 的最佳成绩做出了贡献。 在代码修复场景中,think 工具的定义更侧重于"发现 bug 后头脑风暴修复方案"和"分析测试结果后思考改进方向"。

SWE-bench 中的工具定义

{
  "name": "think",
  "description": "Use the tool to think about something. It will not obtain new information or make any changes to the repository, but just log the thought. Use it when complex reasoning or brainstorming is needed. For example, if you explore the repo and discover the source of a bug, call this tool to brainstorm several unique ways of fixing the bug, and assess which change(s) are likely to be simplest and most effective. Alternatively, if you receive some test results, call this tool to brainstorm ways to fix the failing tests.",
  "input_schema": {
    "type": "object",
    "properties": {
      "thought": {
        "type": "string",
        "description": "Your thoughts."
      }
    },
    "required": ["thought"]
  }
}

实验结果(包含 think 工具:n=30,不含:n=144)表明,单独引入该工具平均提升了 1.6% 的性能,并达到统计显著性:Welch's t-test: t(38.89) = 6.71, p < .001, d = 1.47。


何时使用 "think" 工具

Think 工具最适合需要在工具调用链中进行中间推理、策略合规检查或高风险顺序决策的场景。

场景 说明
工具输出分析 处理前一次工具调用的结果后再行动,可能需要回溯
策略密集型环境 遵循详细的业务指南,在操作前验证合规性
顺序决策 每一步建立在前一步之上,错误代价高且难以撤回

实施最佳实践

1. 结合领域特定示例进行策略性 prompt 设计。 在系统 prompt 中提供清晰的指导,告诉模型何时以及如何使用 think 工具,并附上示例展示:
- 推理过程应有的详细程度
- 如何拆解复杂指令
- 常见场景的决策树
- 如何检查是否已收集所有必要信息

2. 将复杂指导放在系统 prompt 中。 对于关于 think 工具的冗长或复杂指令,放在系统 prompt 中比放在工具描述中更有效。


何时不需要 "think" 工具

如果工具调用简单、无需顺序推理,则 think 工具不会带来明显收益。

不适用场景 原因
非顺序工具调用 单次或并行的工具调用不太可能从中间思考中获益
简单指令跟随 约束条件少、默认行为即可满足需求时无需额外思考

快速上手

添加 think 工具的风险极低,性能下降的可能性几乎没有。 推荐步骤:

  1. 找到痛点——测试 Claude 在策略合规或复杂推理方面表现不佳的 agentic 场景
  2. 添加工具定义——根据你的领域定制工具描述,在系统 prompt 中加入使用说明和示例
  3. 监控与迭代——观察 Claude 如何使用 think 工具,持续优化 prompt 和示例

总结

Think 工具不是万能方案,但在正确的场景下能显著提升 Claude 处理复杂任务的能力。 在需要策略遵循和长工具调用链推理的任务中,它为 Claude 3.7 Sonnet 带来了显著的性能提升。对于需要 Claude 在执行每一步之前进行审慎思考的场景,这是一个简单但强大的优化手段。

注: 虽然实验主要聚焦于 Claude 3.7 Sonnet,但实验表明 Claude 3.5 Sonnet(New)在相同配置下也能获得性能提升,说明这一改进对其他 Claude 模型同样有效。