Claude 的思考能力

Claude 模型入门

Nikhil Rangarajan

Data Scientist

什么是 Claude 的思考模式?

  • 通过 thinking 参数启用
  • 复杂问题的高级推理
  • 按步骤进行逻辑处理
  • 反思与决策
  • 思路透明可见

大脑示意图

Claude 模型入门

何时使用思考能力

$$

  • 多步问题求解
  • 需要推理链的分析
  • 权衡取舍的决策
  • 复杂逻辑谜题

拼图

Claude 模型入门

思考任务类型

  • 分析型:
    • 拆解复杂信息
  • 策略型:
    • 规划与决策
  • 创新型:
    • 探索可能与方案
  • 逻辑型:
    • 跟随推理链

手持放大镜的人物图标,表示复杂任务.jpg

Claude 模型入门

示例:战略规划

user_prompt = "Think through this business decision:
Should we launch our new product in Q1 or Q2?"
response = client.messages.create(
    model="claude-2",
    messages=[{"role": "user", 
               "content": user_prompt}],
    thinking={"type": "enabled", 
              "budget_tokens": 1024},
    max_tokens=1300)
  • 结构化的决策请求
  • thinking 参数启用逐步推理
  • budget_tokens 至少为 1024,max_tokens 必须大于预算
Claude 模型入门

示例:战略规划

"""
Based on the above analysis, I recommend 
a phased global expansion strategy. 
Start by launching in one or two 
high-potential markets first (perhaps 
as pilot programs in Q1). Learn and 
adapt from those initial launches, then 
gradually expand to additional regions 
over the year once strategies are 
refined. This approach balances rapid 
growth with risk management, allowing 
adjustments for cultural fit and ...
"""
  • 两部分回复:

    • 思考块
    • 最终答案
  • 最终答案基于内部思考逻辑

Claude 模型入门

让我们一起练习吧!

Claude 模型入门

Preparing Video For Download...