📘 第 6 课:What is thinking?(什么是思考)
所属课程:the AI Platform 101(课程 003) 官方课时定位:Section 2「Teaching your Agent」— Lesson 6 / 共 12 课时 ID:
486256| 官方地址:https://anthropic.skilljar.com/claude-platform-101/486256形式:Video(视频课 + 文稿) 针对认证:CCAR-P(架构师 Professional) 整理日期:2026-10-14 ⚠️ 语料来源:官方 Skilljar 课程正文(用户提供,需登录)。CC BY-NC-SA 4.0,仅供个人学习。 ⭐⭐ 本课权重提示:参数位置课。本课信息量最小但最易出题:官方明确点了一个gotcha(effort在output_config里,不在thinking旁边)、给了五档枚举(low/medium/high/xhigh/max)、以及一张用与不用的判据清单。命中领域 2(13%)+ 领域 4(16%)。
🎯 本课学习目标
⚠️ 本课官方未提供
What you'll learn区块;但本课的开篇自带目标句(见下): "In this lesson, we'll look at what thinking is, how to turn it on, and when it actually helps."
- 能说清 extended thinking 是什么、它产生什么、是否可见。
- ⭐ 能说出 adaptive(自适应) 意味着什么(不需要 token budget)。
- ⭐⭐ 能正确写出开启方式与
effort的所在位置(本课官方点名的gotcha)。 - 能背出五档 effort 及其默认值。
- ⭐⭐ 能列出该用与该跳过的四类/三类任务。
📖 一、视频导读:要避免的失效模式
官方原句: Some tasks need more than a quick answer. the AI can work through a problem before responding — a feature called extended thinking. In this lesson, we'll look at what thinking is, how to turn it on, and when it actually helps. Here's the failure mode we're trying to avoid.* Ask a model a multi-step question and have it answer immediately, and it can confidently get it wrong*:
精译:有些任务需要的不是一个快速答案。AI 可以在回应之前先把问题推演一遍 —— 这个特性叫扩展思考(extended thinking)。这一课我们看思考是什么、怎么开启、以及它什么时候真的有用。 这就是我们要避免的失效模式。 问一个模型一个多步问题并让它立刻回答,它可能自信地答错:
⭐⭐
it can confidently get it wrong(它可能自信地答错) —— 这是本课的问题陈述,也是全考纲反复出现的那个失效模式: * 呼应课程 002 第 3 课:预训练学模式 → 幻觉(hallucination);微调教「乐于遵循指令」→ 过度自信(overconfidence)。 * 呼应考纲领域 5「识别 LLM 系统的风险、局限与失效模式」。 * ⭐ 关键修饰是confidently(自信地) —— 错得没有信号。这正是「看输出判断对错」不可靠的原因,也是课程 002Discernment(判断力)存在的理由。记忆锚:多步问题 + 立刻作答 = 自信地答错。给它推理的空间。
🧠 二、⭐ 什么是扩展思考(What is extended thinking)
官方原句: Extended thinking lets the AI reason step by step before producing a final response.* When it's enabled, the AI generates internal reasoning tokens — often called a chain of thought — and then delivers the answer. The reasoning isn't hidden: you can see it in the response alongside the final text.***
精译: 扩展思考让 AI 在产出最终回应之前先一步步推理。 开启后,AI 会生成内部推理 token —— 通常被称为思维链(chain of thought) —— 然后交付答案。这份推理并不隐藏:你可以在响应里、与最终文本并排看到它。
| 要素 | 官方口径 |
|---|---|
| 机制 | reason step by step before producing a final response |
| 产物 | ⭐ internal reasoning tokens(内部推理 token),又名 chain of thought |
| ⭐⭐ 可见性 | ⭐ The reasoning isn't hidden —— 在响应里与最终文本并排可见 |
⭐⭐
The reasoning isn't hidden(推理并不隐藏)是本节最可考的一句: * 对应考纲领域 4「诊断系统问题」:你能看见它怎么想的,所以答错时能定位在哪一步偏了 —— 这与第 3 课response.usage一样,是可观测性的一部分。 * 对应领域 5「透明性」:呼应课程 002 的transparency与"输出可能被误读或误用"。 * ⭐ 呼应第 2 课:响应是 block 数组,官方当时就列出了三种类型 ——text/tool_use/thinking。本课终于把第三种展开了:thinkingblock 就是这里说的「可见的推理」。 * 记忆锚:思考是可见的 block,不是黑箱。
⚠️ 一个必须做的辨析(我的分析,非官方原话)
| 提示词层的 CoT | 本课的 extended thinking | |
|---|---|---|
| 怎么做 | 在提示词里写「请一步步思考」 | ⭐ API 参数开启(thinking + output_config) |
| 产物 | 模型自己写出的文字 | ⭐ 平台生成的 thinking block(内部推理 token) |
| 考纲落点 | 领域 2 的 chain-of-thought 技法 |
领域 2 的平台能力 |
💡 注意:
chain of thought这个词两处都用。题干若说「在提示词里要求模型逐步推理」,那是提示技法;若说「开启扩展思考」,那是平台参数。两者都叫 CoT,但落点不同。
🎛️ 三、⭐⭐ 当前模型上的自适应思考(Adaptive thinking)
官方原句: With the current model, thinking is adaptive.* You don't pick a token budget. You just turn it on, and the AI decides dynamically when to think and how much*.
精译:在当前模型上,思考是自适应的。 你不需要挑一个 token 预算。你只要把它打开,AI 会动态地决定何时思考、思考多少。
| 特性 | 说明 |
|---|---|
⭐ adaptive |
自适应 |
| ⭐无 token budget | You don't pick a token budget |
| ⭐AI 自主决定 | the AI decides dynamically when to think and how much** |
⭐⭐ 这是一个「反配置直觉」的考点:此前(以及许多其他平台)的扩展思考需要你指定一个思考 token 预算。官方明确说这里不用。 考点:题干给「为思考设置 5000 token 的预算」→ 这不是本平台的当前做法;正解是开启 adaptive,让 AI 自己决定。 呼应第 5 课 Tool Runner 的同一条设计哲学:平台在替你收走配置负担(区别在于本课收走的是预算,Tool Runner 收走的是循环与 schema)。
⭐⭐ 本课官方点名的 gotcha(必考)
官方原句: To control how much the AI thinks, use the effort parameter. One gotcha: it goes inside
output_config, not next to thethinkingblock. The levels are: *low*medium*high(the default) *xhigh(extra high) *max
精译:要控制 AI 思考多少,用 effort 参数。这里有个坑:它放在 output_config 里面,而不是挨着 thinking 块。可选级别是……
| ⭐ 五档 | 中文 | 备注 |
|---|---|---|
low |
低 | |
medium |
中 | |
⭐ high |
高 | ⭐⭐ 默认值(the default) |
xhigh |
超高 | 官方注明 = extra high |
max |
最大 |
⭐⭐
One gotcha: it goes insideoutput_config, not next to thethinkingblock.这是全课最像真题的一句话。 官方用gotcha(坑)这个词主动提示,几乎等于在出题。
✅ 正确 ❌ 错误(官方点名的坑) output_config={"effort": "high"}把 effort与thinking平级写thinking={"type": "adaptive"}单独放thinking={"type": "adaptive", "effort": "high"}记忆锚:开关在
thinking,深浅在output_config。两处别合并。⭐ 枚举题提示:五档里
high是默认值 —— 题干问「不指定 effort 时是哪一档」→high。
✅❌ 四、⭐⭐ 什么时候用、什么时候跳过
官方原句:Extended thinking helps with: * Math and multi-step logic * Code debugging * Regulatory analysis * Anything that involves trade-offs or comparing options Skip it for simple classification, extraction, or boilerplate. For those tasks it just adds latency and cost without actually improving the results.
⭐ 该用(四类)
| 类别 | 中文 |
|---|---|
| Math and multi-step logic | 数学与多步逻辑 |
| Code debugging | 代码调试 |
| Regulatory analysis | ⭐ 监管/合规分析 |
| Anything that involves trade-offs or comparing options | ⭐ 任何涉及权衡或方案比较的事 |
⭐ 该跳过(三类 + 官方理由)
| 类别 | 中文 |
|---|---|
| simple classification | 简单分类 |
| extraction | 抽取 |
| boilerplate | 样板内容 |
⭐⭐ 官方理由(必背原句): For those tasks it just adds latency and cost without actually improving the results. (对那些任务,它只是增加延迟与成本,而没有真正改善结果。)
⭐⭐ 与第 3 课合成的一条强规则(跨课综合,重点)
第 3 课说
classification, extraction, routing→ 用 Haiku; 本课说classification, extraction, boilerplate→ 跳过 thinking。两课的清单几乎完全重合,合起来是一条可直接用于综合题的规则:
| 任务特征 | 模型档位 | 是否开 thinking | 依据 |
|---|---|---|---|
| 简单分类 / 抽取 / 路由 / 样板 | ⭐ Haiku | ⭐ 不开 | 第 3 课 Haiku 用途 + 本课 skip 清单 |
| 多步逻辑 / 代码调试 / 合规分析 / 方案权衡 | ⭐ Opus(或 Sonnet 起评) | ⭐ 开 | 第 3 课 Opus 用途 + 本课 helps 清单 |
| 日常生产任务 / 起草 | Sonnet | 视是否有权衡而定 | 第 3 课 sweet spot |
⭐⭐ 记忆锚:简单抽取类 = Haiku + 不开思考;权衡分析类 = 强档 + 开思考。 成本逻辑统一:第 3 课的原则是「最便宜的你能交付的那个」;本课的原则是「只在该用的时候付这笔延迟与 token」。两者是同一个成本纪律的两面。
🚗 五、思考实战(Thinking in action)
官方原句:Let's see it work. Here's an agent loop with one weather tool, and we'll ask the AI to plan a road trip out of San Francisco — two stops, weighing weather and drive time. That's a real trade-off, the kind of question where thinking earns its keep.**
精译:我们来看它工作。这里有一个带一个天气工具的智能体循环,我们要 AI 规划一次从旧金山出发的公路旅行 —— 两个停靠点,要权衡天气与车程。这是一个真实的权衡,正是那种「思考能挣回它自己成本」的问题。
⭐ 官方用词
earns its keep(挣回自己的开销) —— 与第 3 课worth paying for(值得为之付费)是同一条经济性判据,只是对象从模型档位换成了思考开关。 也呼应第 3 课 Opus 的polish is wasted(考究被浪费)—— 两处都在说:能力与开销必须匹配任务。
官方代码(保持原样)
import anthropic
client = anthropic.the AI provider()
weather_tool = {
"name": "get_weather",
"description": "Get the current weather for a city.",
"input_schema": {
"type": "object",
"properties": {
"city": {"type": "string", "description": "City name"}
},
"required": ["city"],
},
}
response = client.messages.create(
model="current-model",
max_tokens=16000,
thinking={"type": "adaptive"},
output_config={"effort": "high"}, # low | medium | high | xhigh | max
tools=[weather_tool],
messages=[
{
"role": "user",
"content": "Plan a road trip out of San Francisco with two stops, "
"weighing weather and drive time.",
}
],
)
⚠️ 抓取件说明:
anthropic.the AI provider()与model="current-model"为替换残留;按第 3 课映射,current-model对应 Opus 档。不要背这些字符串。
⭐ 代码里值得注意的三处
| # | 观察 | 说明 |
|---|---|---|
| 1 | ⭐⭐ thinking={"type": "adaptive"} 与 output_config={"effort": "high"} 分列两行 |
⭐ 官方用代码亲自演示了那个 gotcha 的正确写法 |
| 2 | max_tokens=16000 |
⭐ 远高于此前几课的 1024 / 300(分析见下) |
| 3 | tools=[weather_tool] 与 thinking 同时出现 |
⭐ 思考 + 工具可以并存,且思考会穿插在工具调用之间 |
💡 分析(非官方原话):
max_tokens=16000之所以远大于此前,是因为思考本身消耗 output token —— 若沿用 1024,答案还没写完就被截断。 推论(备考用):开启 extended thinking 时,必须相应提高max_tokens,否则会撞上第 5 课提到的「非end_turn也 break」的截断风险。这是本课与第 2/4/5 课在参数上的隐藏耦合。
官方描述的输出结构
When you run this, the output is more interesting than usual. You'll see thinking blocks where the AI works through the trade-offs, followed by tool calls to check each city, and finally a text block with the actual recommendation. The reasoning is visible — that's the whole point.
| 顺序 | 内容 |
|---|---|
| ① | ⭐ thinking blocks —— AI 推演权衡 |
| ② | tool calls —— 逐个查城市天气 |
| ③ | ⭐ text block —— 最终建议 |
⭐⭐
The reasoning is visible — that's the whole point.(推理是可见的 —— 这才是重点。) 官方第二次强调可见性,并用that's the whole point收束。这是本课的中心句。 ⭐ 三种 block 在本课同框出现(thinking/tool_use/text)—— 完整复现了第 2 课预告的三种 block 类型。
🏭 六、⭐⭐ 为什么这在生产里重要(Why this matters in production)
官方原句: In a production app, this is the difference between an agent that finds problems one at a time and an agent that connects them. Take a compliance review app: toggling adaptive thinking on the auto-review call lets the agent reason across report sections — catching things like a wind load spec in section three that conflicts with the material spec elsewhere in the document.
精译:在生产应用里,这就是「一次只发现一个问题的智能体」与「能把问题关联起来的智能体」之间的差别。以一个合规审查应用为例:在自动审查那次调用上打开自适应思考,智能体就能跨报告章节推理 —— 比如抓到第三节的风荷载规格与文档别处的材料规格相互冲突这种问题。
| ❌ 不开思考 | ✅ 开思考 |
|---|---|
| finds problems one at a time**(一次发现一个) | ⭐ connects them(把它们关联起来) |
| 局部检查 | ⭐ reason across report sections(跨章节推理) |
| 能发现单项违规 | ⭐ 能发现跨章节的相互冲突 |
⭐⭐
connects them(把它们连起来)是本课最高价值的一个词。 * 这是「多步问题」在生产里的真实形态:答案不在某一处,而在两处之间的关系里。 * 呼应课程 002 的Discernment(判断力):002 说判断力是分辨细微差别、是Does it work?之外还要问Is it the right thing?;本课给出了平台侧的对应手段 —— 让 AI 有推理空间去发现跨部分的不一致。 * 呼应第 1 课的三层架构:这类「跨章节关联」的结果,最终要靠 Controls 层的evals来稳定检验。 * 具体例子记住:wind load spec(风荷载规格)与material spec(材料规格)分处文档不同位置而相互冲突 —— 这是「需要跨段推理」的教科书案例,很适合作为题干场景。记忆锚:不开思考 = 一次发现一个问题;开了 = 能把问题连起来。
🔑 七、核心要点(Recap)· 官方四条
- Extended thinking gives the AI room to reason before it answers, and the reasoning is visible in the response. 扩展思考给 AI 在回答之前的推理空间,而且推理在响应里是可见的。
- ⭐ With the current model, turn it on with
thinking: {"type": "adaptive"}— no token budget needed; the AI decides when and how much to think. 在当前模型上,用thinking: {"type": "adaptive"}开启它 —— 不需要 token 预算;AI 自己决定何时思考、思考多少。 - ⭐⭐ Dial the depth with the effort parameter inside
output_config:low,medium,high(default),xhigh, ormax. 用output_config里的 effort 参数调节深度:low、medium、high(默认)、xhigh或max。 - ⭐⭐ Use it for hard, trade-off-heavy problems. Skip it for simple ones — there it just costs latency and tokens. 把它用在困难、权衡密集的问题上。简单问题就跳过 —— 在那里它只是消耗延迟与 token。
⭐ 第 3 条把
inside output_config写进了 Recap —— 再次确认这个位置是官方要求记忆的。 ⭐ 第 4 条的trade-off-heavy(权衡密集)是本课的定性判据 —— 与第 3 课的toughest challenges(Opus)在措辞上互相呼应:两者都用「难 + 权衡」作为"值得多花钱"的门槛。
🧠 本课 → CCAR-P 考点映射
| 本课知识点 | 命中考纲条目 | 领域 |
|---|---|---|
⭐⭐ effort 在 output_config 内、五档与默认值 high |
模型与调用配置;提示与输出控制 | 领域 2(13%) |
⭐ thinking: {"type": "adaptive"}、无需 token budget |
平台能力掌握 | 领域 2 |
| ⭐⭐ 该用 / 该跳过的任务判据 | ⭐ 权衡准确率与延迟并论证配置决策 | 领域 4(16%) |
| ⭐ 推理可见 → 可定位在哪一步偏了 | 诊断系统问题 | 领域 4 |
⭐ confidently get it wrong 的失效模式 |
识别 LLM 系统的风险、局限与失效模式 | 领域 5(14%) |
推理可见(The reasoning isn't hidden) |
透明性与可审计性 | 领域 5 |
⭐ connects them(跨部分关联) |
复杂问题分解;评估深度 | 领域 1(17%) |
思考消耗 token、max_tokens 需相应提高 |
成本优化与 token 管理 | 领域 4 + 领域 2 |
| 与第 3 课合成「简单抽取 = Haiku + 不开思考」 | 跨课综合:模型选型 × 特性开关 | 领域 2 + 领域 4 |
🔤 本课新生词(已回灌 30-单词表/03,2026-10-14)
| 词汇 | 音标 | 释义 | 备注 |
|---|---|---|---|
⭐ extended thinking |
— | 扩展思考 | 本课主题 |
work through |
— | 推演、把……做完 | work through a problem |
⭐ turn it on |
— | 开启 | |
actually helps |
— | 真的有用 | |
⭐⭐ failure mode |
— | 失效模式 | ⭐ 考纲领域 5 原词 |
multi-step question |
— | 多步问题 | |
⭐⭐ confidently |
/ˈkɑːnfɪdəntli/ |
自信地 | ⭐ confidently get it wrong |
reason step by step |
— | 逐步推理 | |
⭐ internal reasoning tokens |
— | 内部推理 token | |
⭐ chain of thought |
— | 思维链 | ⭐ 提示技法与平台能力同名,注意辨析 |
deliver the answer |
— | 交付答案 | |
⭐ hidden |
/ˈhɪdn/ |
被隐藏的 | The reasoning isn't hidden |
alongside |
/əˌlɔːŋˈsaɪd/ |
与……并排 | |
⭐⭐ adaptive |
/əˈdæptɪv/ |
自适应的 | ⭐ thinking: {"type": "adaptive"} |
⭐ token budget |
— | token 预算 | ⭐ 明确不需要 |
⭐ dynamically |
/daɪˈnæmɪkli/ |
动态地 | |
when to think and how much |
— | 何时思考、思考多少 | |
⭐⭐ gotcha |
/ˈɡɑːtʃə/ |
坑、易错点 | ⭐ 官方主动点名 |
⭐⭐ effort(参数) |
/ˈefərt/ |
力度、强度 | ⭐ 五档控制 |
⭐⭐ output_config |
— | 输出配置 | ⭐⭐ effort 的所在 |
levels |
— | 级别 | |
extra high(xhigh) |
— | 超高 | |
⭐ the default |
— | 默认值 | ⭐ high 是默认 |
⭐ dial the depth |
— | 调节深度 | dial 作动词 |
multi-step logic |
— | 多步逻辑 | |
code debugging |
— | 代码调试 | |
⭐ regulatory analysis |
— | 监管/合规分析 | 呼应第 3 课 regulatory response |
⭐ trade-off / comparing options |
— | 权衡 / 方案比较 | |
boilerplate |
— | 样板内容 | 第 5 课已收,此处为 skip 场景 |
⭐ adds latency and cost |
— | 增加延迟与成本 | ⭐ 官方 skip 的理由 |
without actually improving |
— | 并未真正改善 | |
⭐ earns its keep |
— | 挣回自己的开销、物有所值 | ⭐ 呼应 worth paying for |
road trip |
— | 公路旅行 | |
two stops |
— | 两个停靠点 | |
weigh(v.) |
/weɪ/ |
权衡 | ⭐ 动词,不是「称重」 |
drive time |
— | 车程 | |
wind load spec |
— | 风荷载规格 | 跨章节冲突例子 |
material spec |
— | 材料规格 | |
conflict with |
— | 与……冲突 | |
⭐ toggle on |
— | 打开(开关) | toggling adaptive thinking on |
auto-review call |
— | 自动审查那次调用 | 呼应第 4 课 auto-review endpoint |
⭐ reason across |
— | 跨……推理 | reason across report sections |
⭐⭐ connects them |
— | 把它们关联起来 | ⭐ 本课最高价值表达 |
⭐ one at a time |
— | 一次一个 | ⭐ 与 connects them 对立 |
room to reason |
— | 推理的空间 | Recap 第 1 条 |
trade-off-heavy |
— | 权衡密集的 | Recap 第 4 条 |
✅ 本课进度
- [x] 全文精译与架构师级拆解(2026-10-14)
- [x] ⭐⭐ 记录
effort在output_config内这一官方gotcha,并在 Recap 处二次确认 - [x] ⭐ 记录五档 effort 与默认值
high - [x] ⭐⭐ 记录该用 / 该跳过的判据,并与第 3 课合成「简单抽取 = Haiku + 不开思考」跨课规则
- [x] ⭐⭐ 记录推理可见性(
isn't hidden/that's the whole point)及其对诊断与透明性的意义 - [x] ⭐⭐ 记录生产论断
connects them与跨章节冲突案例 - [x] 记录
max_tokens=16000与思考耗 token 的隐藏耦合(标注为分析) - [x] 记录 extended thinking 与提示词层 CoT 的辨析(标注为分析)
- [x] 英文原文已存:
21-English-06-What-is-thinking.md - [x] 生词回灌
30-单词表/03-考试核心生词与术语表.md(2026-10-14 建表,301 条入速查区,⭐⭐ 28 条精讲) - [ ] 官方未提供
What you'll learn区块(本课开篇自带目标句,已引)—— 若后续页面补全,需回填
🔗 关联
- 本课英文原文:
21-English-06-What-is-thinking.md✅ 已存 - 前一课:
07-第5课-What-is-tool-use.md(工具调用;本课为「思考 + 工具并存」) - 关键呼应:
05-第3课-Choosing-the-right-model.md(用途清单重合 → 跨课合成规则) - block 类型预告:
04-第2课-Your-first-API-call.md(text/tool_use/thinking三种 block 首次列出) - 呼应课程 002:幻觉与过度自信(第 3 课);
Discernment;transparency - 课程大纲:01-课程导读与大纲全景
- 考纲:00-CCAR-P备考蓝图
⚠️ 语料说明:英文原文中的
anthropic.the AI provider()与model="current-model"为抓取/环境替换残留(按第 3 课映射对应 Opus 档),已在代码段下方说明;其余英文引句与代码均为官方原句,未作改动。