一、核心结论
Agent 的规划能力不是单一来源,而是 LLM 原生序列推理能力 + 推理时计算范式 + 外部环境反馈 + 记忆与工具 + 搜索/验证/约束机制 的多层叠加。
更准确地说:
LLM 提供的是"隐式的、单轨迹的、基于语料先验的步骤生成能力",它让 Agent 具备"看起来会规划"的起点;真正的可靠规划来自外部化:把目标、状态、动作、约束、验证器、搜索与执行反馈显式化,形成"生成---执行---验证---修正"的闭环。
LLM 原生规划的核心局限可概括为:
无显式世界模型、无可靠价值函数、无系统性搜索、无强验证能力、长程误差累积、规划与执行存在 grounding gap。 因此原生规划适合短程、低风险、可验证的任务;长程、高风险、强约束任务必须引入外部规划器、工具反馈、验证器与人工兜底。
二、规划能力的来源分层
1. 总览架构
#mermaid-svg-s2l9hYvYnLq7D3RP{font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:16px;fill:#333;}@keyframes edge-animation-frame{from{stroke-dashoffset:0;}}@keyframes dash{to{stroke-dashoffset:0;}}#mermaid-svg-s2l9hYvYnLq7D3RP .edge-animation-slow{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 50s linear infinite;stroke-linecap:round;}#mermaid-svg-s2l9hYvYnLq7D3RP .edge-animation-fast{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 20s linear infinite;stroke-linecap:round;}#mermaid-svg-s2l9hYvYnLq7D3RP .error-icon{fill:#552222;}#mermaid-svg-s2l9hYvYnLq7D3RP .error-text{fill:#552222;stroke:#552222;}#mermaid-svg-s2l9hYvYnLq7D3RP .edge-thickness-normal{stroke-width:1px;}#mermaid-svg-s2l9hYvYnLq7D3RP .edge-thickness-thick{stroke-width:3.5px;}#mermaid-svg-s2l9hYvYnLq7D3RP .edge-pattern-solid{stroke-dasharray:0;}#mermaid-svg-s2l9hYvYnLq7D3RP .edge-thickness-invisible{stroke-width:0;fill:none;}#mermaid-svg-s2l9hYvYnLq7D3RP .edge-pattern-dashed{stroke-dasharray:3;}#mermaid-svg-s2l9hYvYnLq7D3RP .edge-pattern-dotted{stroke-dasharray:2;}#mermaid-svg-s2l9hYvYnLq7D3RP .marker{fill:#333333;stroke:#333333;}#mermaid-svg-s2l9hYvYnLq7D3RP .marker.cross{stroke:#333333;}#mermaid-svg-s2l9hYvYnLq7D3RP svg{font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:16px;}#mermaid-svg-s2l9hYvYnLq7D3RP p{margin:0;}#mermaid-svg-s2l9hYvYnLq7D3RP .label{font-family:"trebuchet ms",verdana,arial,sans-serif;color:#333;}#mermaid-svg-s2l9hYvYnLq7D3RP .cluster-label text{fill:#333;}#mermaid-svg-s2l9hYvYnLq7D3RP .cluster-label span{color:#333;}#mermaid-svg-s2l9hYvYnLq7D3RP .cluster-label span p{background-color:transparent;}#mermaid-svg-s2l9hYvYnLq7D3RP .label text,#mermaid-svg-s2l9hYvYnLq7D3RP span{fill:#333;color:#333;}#mermaid-svg-s2l9hYvYnLq7D3RP .node rect,#mermaid-svg-s2l9hYvYnLq7D3RP .node circle,#mermaid-svg-s2l9hYvYnLq7D3RP .node ellipse,#mermaid-svg-s2l9hYvYnLq7D3RP .node polygon,#mermaid-svg-s2l9hYvYnLq7D3RP .node path{fill:#ECECFF;stroke:#9370DB;stroke-width:1px;}#mermaid-svg-s2l9hYvYnLq7D3RP .rough-node .label text,#mermaid-svg-s2l9hYvYnLq7D3RP .node .label text,#mermaid-svg-s2l9hYvYnLq7D3RP .image-shape .label,#mermaid-svg-s2l9hYvYnLq7D3RP .icon-shape .label{text-anchor:middle;}#mermaid-svg-s2l9hYvYnLq7D3RP .node .katex path{fill:#000;stroke:#000;stroke-width:1px;}#mermaid-svg-s2l9hYvYnLq7D3RP .rough-node .label,#mermaid-svg-s2l9hYvYnLq7D3RP .node .label,#mermaid-svg-s2l9hYvYnLq7D3RP .image-shape .label,#mermaid-svg-s2l9hYvYnLq7D3RP .icon-shape .label{text-align:center;}#mermaid-svg-s2l9hYvYnLq7D3RP .node.clickable{cursor:pointer;}#mermaid-svg-s2l9hYvYnLq7D3RP .root .anchor path{fill:#333333!important;stroke-width:0;stroke:#333333;}#mermaid-svg-s2l9hYvYnLq7D3RP .arrowheadPath{fill:#333333;}#mermaid-svg-s2l9hYvYnLq7D3RP .edgePath .path{stroke:#333333;stroke-width:2.0px;}#mermaid-svg-s2l9hYvYnLq7D3RP .flowchart-link{stroke:#333333;fill:none;}#mermaid-svg-s2l9hYvYnLq7D3RP .edgeLabel{background-color:rgba(232,232,232, 0.8);text-align:center;}#mermaid-svg-s2l9hYvYnLq7D3RP .edgeLabel p{background-color:rgba(232,232,232, 0.8);}#mermaid-svg-s2l9hYvYnLq7D3RP .edgeLabel rect{opacity:0.5;background-color:rgba(232,232,232, 0.8);fill:rgba(232,232,232, 0.8);}#mermaid-svg-s2l9hYvYnLq7D3RP .labelBkg{background-color:rgba(232, 232, 232, 0.5);}#mermaid-svg-s2l9hYvYnLq7D3RP .cluster rect{fill:#ffffde;stroke:#aaaa33;stroke-width:1px;}#mermaid-svg-s2l9hYvYnLq7D3RP .cluster text{fill:#333;}#mermaid-svg-s2l9hYvYnLq7D3RP .cluster span{color:#333;}#mermaid-svg-s2l9hYvYnLq7D3RP div.mermaidTooltip{position:absolute;text-align:center;max-width:200px;padding:2px;font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:12px;background:hsl(80, 100%, 96.2745098039%);border:1px solid #aaaa33;border-radius:2px;pointer-events:none;z-index:100;}#mermaid-svg-s2l9hYvYnLq7D3RP .flowchartTitleText{text-anchor:middle;font-size:18px;fill:#333;}#mermaid-svg-s2l9hYvYnLq7D3RP rect.text{fill:none;stroke-width:0;}#mermaid-svg-s2l9hYvYnLq7D3RP .icon-shape,#mermaid-svg-s2l9hYvYnLq7D3RP .image-shape{background-color:rgba(232,232,232, 0.8);text-align:center;}#mermaid-svg-s2l9hYvYnLq7D3RP .icon-shape p,#mermaid-svg-s2l9hYvYnLq7D3RP .image-shape p{background-color:rgba(232,232,232, 0.8);padding:2px;}#mermaid-svg-s2l9hYvYnLq7D3RP .icon-shape .label rect,#mermaid-svg-s2l9hYvYnLq7D3RP .image-shape .label rect{opacity:0.5;background-color:rgba(232,232,232, 0.8);fill:rgba(232,232,232, 0.8);}#mermaid-svg-s2l9hYvYnLq7D3RP .label-icon{display:inline-block;height:1em;overflow:visible;vertical-align:-0.125em;}#mermaid-svg-s2l9hYvYnLq7D3RP .node .label-icon path{fill:currentColor;stroke:revert;stroke-width:revert;}#mermaid-svg-s2l9hYvYnLq7D3RP :root{--mermaid-font-family:"trebuchet ms",verdana,arial,sans-serif;} Agent规划能力
LLM原生层
推理时计算层
外部环境层
记忆与经验层
搜索与验证层
编排与约束层
预训练程序性知识
自回归序列建模
指令微调与偏好对齐
上下文学习
Chain-of-Thought
ReAct
Plan-and-Execute
Tree of Thoughts
Self-Refine/Reflexion
工具调用
检索与知识库
代码执行/仿真器
环境观测与反馈
短期上下文
长期记忆
经验库/案例库
采样与树搜索
验证器/奖励模型
形式化检查
工作流编排
策略与权限
约束解码/护栏
2. 各层来源解析
| 层级 | 来源 | 提供的规划能力 | 边界 |
|---|---|---|---|
| LLM 原生层 | 预训练语料中的教程、代码、流程、攻略 | 程序性知识、步骤生成、常识补全 | 隐式、不可验证、易幻觉 |
| 推理时计算层 | CoT、ReAct、Plan-Execute、ToT、Reflexion | 显式分解、交替推理与行动、多路径探索、反思修正 | 依赖提示设计,搜索成本高 |
| 外部环境层 | 工具、检索、代码执行、仿真器 | grounding、动作后果观测、事实校验 | 工具覆盖有限,反馈有噪声 |
| 记忆与经验层 | 上下文、长期记忆、案例库 | 跨轮一致性、经验复用、减少重复规划 | 检索质量与记忆污染 |
| 搜索与验证层 | 采样、树搜索、奖励模型、形式化检查 | 多候选比较、剪枝、约束满足 | 验证器本身可能不准 |
| 编排与约束层 | 工作流、策略引擎、权限护栏 | 把开放规划收敛为受控流程 | 灵活性下降,需人工设计 |
三、LLM 原生规划的原理
1. 为什么 LLM "看起来会规划"
LLM 原生规划能力主要来自四个机制:
- 程序性知识的语料先验:预训练语料包含大量"先做什么、再做什么"的文本,如教程、代码、操作手册、攻略、论文方法节。模型学到的是步骤之间的统计关联。
- 自回归序列建模:规划被建模为"给定目标与前文,逐 token 生成后续步骤"。CoT 本质是把隐式计算外化为中间 token。
- 指令微调与偏好对齐:通过"先分析再回答""给出计划"等格式训练,诱导模型形成规划式输出。
- 上下文学习:few-shot 示例提供规划模板,模型在上下文中模仿分解方式与粒度。
2. 原生规划的本质特征
| 特征 | 说明 |
|---|---|
| 隐式性 | 没有显式状态空间、动作空间、转移函数 |
| 单轨迹 | 默认生成一条计划,缺少系统性分支比较 |
| 贪心性 | 逐步生成,局部合理不等于全局最优 |
| 概率性 | 同一目标多次生成可能不同 |
| 无保证 | 不保证可执行、不保证约束满足 |
| 反思弱 | 自我评估易受确认偏差与过度自信影响 |
四、推理时规划范式对比
| 范式 | 核心机制 | 优点 | 局限 | 适用 |
|---|---|---|---|---|
| CoT | 生成中间推理步骤 | 简单、提升多步推理 | 仍是单轨迹,易中间错误传播 | 短程推理、数学/逻辑题 |
| ReAct | 推理与行动交替,观察反馈 | grounding 强,可纠偏 | 循环风险、工具依赖、时延高 | 检索问答、工具调用 |
| Plan-and-Execute | 先出计划再逐步执行 | 全局视角、易审计 | 计划可能过时,需重规划 | 多步任务、流程型任务 |
| Tree of Thoughts | 多分支生成与评估剪枝 | 探索多路径,提升复杂题表现 | 计算成本高,评估器关键 | 搜索型推理、难题求解 |
| Self-Refine | 生成后自我批评再修正 | 低成本改进 | 自我评估不可靠,可能越改越差 | 低风险文本优化 |
| Reflexion | 失败后总结教训写入记忆 | 跨试次学习 | 依赖失败信号质量,记忆可能污染 | 可试错环境、游戏/代码任务 |
五、ReAct 与 Plan-Execute 的时序差异
1. ReAct:边想边做
上下文 工具/环境 LLM 上下文 工具/环境 LLM #mermaid-svg-eKXFqDeLSiOXEWx0{font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:16px;fill:#333;}@keyframes edge-animation-frame{from{stroke-dashoffset:0;}}@keyframes dash{to{stroke-dashoffset:0;}}#mermaid-svg-eKXFqDeLSiOXEWx0 .edge-animation-slow{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 50s linear infinite;stroke-linecap:round;}#mermaid-svg-eKXFqDeLSiOXEWx0 .edge-animation-fast{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 20s linear infinite;stroke-linecap:round;}#mermaid-svg-eKXFqDeLSiOXEWx0 .error-icon{fill:#552222;}#mermaid-svg-eKXFqDeLSiOXEWx0 .error-text{fill:#552222;stroke:#552222;}#mermaid-svg-eKXFqDeLSiOXEWx0 .edge-thickness-normal{stroke-width:1px;}#mermaid-svg-eKXFqDeLSiOXEWx0 .edge-thickness-thick{stroke-width:3.5px;}#mermaid-svg-eKXFqDeLSiOXEWx0 .edge-pattern-solid{stroke-dasharray:0;}#mermaid-svg-eKXFqDeLSiOXEWx0 .edge-thickness-invisible{stroke-width:0;fill:none;}#mermaid-svg-eKXFqDeLSiOXEWx0 .edge-pattern-dashed{stroke-dasharray:3;}#mermaid-svg-eKXFqDeLSiOXEWx0 .edge-pattern-dotted{stroke-dasharray:2;}#mermaid-svg-eKXFqDeLSiOXEWx0 .marker{fill:#333333;stroke:#333333;}#mermaid-svg-eKXFqDeLSiOXEWx0 .marker.cross{stroke:#333333;}#mermaid-svg-eKXFqDeLSiOXEWx0 svg{font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:16px;}#mermaid-svg-eKXFqDeLSiOXEWx0 p{margin:0;}#mermaid-svg-eKXFqDeLSiOXEWx0 .actor{stroke:hsl(259.6261682243, 59.7765363128%, 87.9019607843%);fill:#ECECFF;}#mermaid-svg-eKXFqDeLSiOXEWx0 text.actor>tspan{fill:black;stroke:none;}#mermaid-svg-eKXFqDeLSiOXEWx0 .actor-line{stroke:hsl(259.6261682243, 59.7765363128%, 87.9019607843%);}#mermaid-svg-eKXFqDeLSiOXEWx0 .innerArc{stroke-width:1.5;stroke-dasharray:none;}#mermaid-svg-eKXFqDeLSiOXEWx0 .messageLine0{stroke-width:1.5;stroke-dasharray:none;stroke:#333;}#mermaid-svg-eKXFqDeLSiOXEWx0 .messageLine1{stroke-width:1.5;stroke-dasharray:2,2;stroke:#333;}#mermaid-svg-eKXFqDeLSiOXEWx0 #arrowhead path{fill:#333;stroke:#333;}#mermaid-svg-eKXFqDeLSiOXEWx0 .sequenceNumber{fill:white;}#mermaid-svg-eKXFqDeLSiOXEWx0 #sequencenumber{fill:#333;}#mermaid-svg-eKXFqDeLSiOXEWx0 #crosshead path{fill:#333;stroke:#333;}#mermaid-svg-eKXFqDeLSiOXEWx0 .messageText{fill:#333;stroke:none;}#mermaid-svg-eKXFqDeLSiOXEWx0 .labelBox{stroke:hsl(259.6261682243, 59.7765363128%, 87.9019607843%);fill:#ECECFF;}#mermaid-svg-eKXFqDeLSiOXEWx0 .labelText,#mermaid-svg-eKXFqDeLSiOXEWx0 .labelText>tspan{fill:black;stroke:none;}#mermaid-svg-eKXFqDeLSiOXEWx0 .loopText,#mermaid-svg-eKXFqDeLSiOXEWx0 .loopText>tspan{fill:black;stroke:none;}#mermaid-svg-eKXFqDeLSiOXEWx0 .loopLine{stroke-width:2px;stroke-dasharray:2,2;stroke:hsl(259.6261682243, 59.7765363128%, 87.9019607843%);fill:hsl(259.6261682243, 59.7765363128%, 87.9019607843%);}#mermaid-svg-eKXFqDeLSiOXEWx0 .note{stroke:#aaaa33;fill:#fff5ad;}#mermaid-svg-eKXFqDeLSiOXEWx0 .noteText,#mermaid-svg-eKXFqDeLSiOXEWx0 .noteText>tspan{fill:black;stroke:none;}#mermaid-svg-eKXFqDeLSiOXEWx0 .activation0{fill:#f4f4f4;stroke:#666;}#mermaid-svg-eKXFqDeLSiOXEWx0 .activation1{fill:#f4f4f4;stroke:#666;}#mermaid-svg-eKXFqDeLSiOXEWx0 .activation2{fill:#f4f4f4;stroke:#666;}#mermaid-svg-eKXFqDeLSiOXEWx0 .actorPopupMenu{position:absolute;}#mermaid-svg-eKXFqDeLSiOXEWx0 .actorPopupMenuPanel{position:absolute;fill:#ECECFF;box-shadow:0px 8px 16px 0px rgba(0,0,0,0.2);filter:drop-shadow(3px 5px 2px rgb(0 0 0 / 0.4));}#mermaid-svg-eKXFqDeLSiOXEWx0 .actor-man line{stroke:hsl(259.6261682243, 59.7765363128%, 87.9019607843%);fill:#ECECFF;}#mermaid-svg-eKXFqDeLSiOXEWx0 .actor-man circle,#mermaid-svg-eKXFqDeLSiOXEWx0 line{stroke:hsl(259.6261682243, 59.7765363128%, 87.9019607843%);fill:#ECECFF;stroke-width:2px;}#mermaid-svg-eKXFqDeLSiOXEWx0 :root{--mermaid-font-family:"trebuchet ms",verdana,arial,sans-serif;} Thought 当前该做什么Action 调用工具Observation 返回结果写入观察Thought 根据反馈调整Action 下一步Observation判断是否完成
特点:反应式、强 grounding、适合动态环境;但缺少全局计划,容易局部最优或循环。
2. Plan-and-Execute:先规划再执行
工具/环境 验证器 执行器 规划器 工具/环境 验证器 执行器 规划器 #mermaid-svg-LWaKnJPEKl1e32QV{font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:16px;fill:#333;}@keyframes edge-animation-frame{from{stroke-dashoffset:0;}}@keyframes dash{to{stroke-dashoffset:0;}}#mermaid-svg-LWaKnJPEKl1e32QV .edge-animation-slow{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 50s linear infinite;stroke-linecap:round;}#mermaid-svg-LWaKnJPEKl1e32QV .edge-animation-fast{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 20s linear infinite;stroke-linecap:round;}#mermaid-svg-LWaKnJPEKl1e32QV .error-icon{fill:#552222;}#mermaid-svg-LWaKnJPEKl1e32QV .error-text{fill:#552222;stroke:#552222;}#mermaid-svg-LWaKnJPEKl1e32QV .edge-thickness-normal{stroke-width:1px;}#mermaid-svg-LWaKnJPEKl1e32QV .edge-thickness-thick{stroke-width:3.5px;}#mermaid-svg-LWaKnJPEKl1e32QV .edge-pattern-solid{stroke-dasharray:0;}#mermaid-svg-LWaKnJPEKl1e32QV .edge-thickness-invisible{stroke-width:0;fill:none;}#mermaid-svg-LWaKnJPEKl1e32QV .edge-pattern-dashed{stroke-dasharray:3;}#mermaid-svg-LWaKnJPEKl1e32QV .edge-pattern-dotted{stroke-dasharray:2;}#mermaid-svg-LWaKnJPEKl1e32QV .marker{fill:#333333;stroke:#333333;}#mermaid-svg-LWaKnJPEKl1e32QV .marker.cross{stroke:#333333;}#mermaid-svg-LWaKnJPEKl1e32QV svg{font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:16px;}#mermaid-svg-LWaKnJPEKl1e32QV p{margin:0;}#mermaid-svg-LWaKnJPEKl1e32QV .actor{stroke:hsl(259.6261682243, 59.7765363128%, 87.9019607843%);fill:#ECECFF;}#mermaid-svg-LWaKnJPEKl1e32QV text.actor>tspan{fill:black;stroke:none;}#mermaid-svg-LWaKnJPEKl1e32QV .actor-line{stroke:hsl(259.6261682243, 59.7765363128%, 87.9019607843%);}#mermaid-svg-LWaKnJPEKl1e32QV .innerArc{stroke-width:1.5;stroke-dasharray:none;}#mermaid-svg-LWaKnJPEKl1e32QV .messageLine0{stroke-width:1.5;stroke-dasharray:none;stroke:#333;}#mermaid-svg-LWaKnJPEKl1e32QV .messageLine1{stroke-width:1.5;stroke-dasharray:2,2;stroke:#333;}#mermaid-svg-LWaKnJPEKl1e32QV #arrowhead path{fill:#333;stroke:#333;}#mermaid-svg-LWaKnJPEKl1e32QV .sequenceNumber{fill:white;}#mermaid-svg-LWaKnJPEKl1e32QV #sequencenumber{fill:#333;}#mermaid-svg-LWaKnJPEKl1e32QV #crosshead path{fill:#333;stroke:#333;}#mermaid-svg-LWaKnJPEKl1e32QV .messageText{fill:#333;stroke:none;}#mermaid-svg-LWaKnJPEKl1e32QV .labelBox{stroke:hsl(259.6261682243, 59.7765363128%, 87.9019607843%);fill:#ECECFF;}#mermaid-svg-LWaKnJPEKl1e32QV .labelText,#mermaid-svg-LWaKnJPEKl1e32QV .labelText>tspan{fill:black;stroke:none;}#mermaid-svg-LWaKnJPEKl1e32QV .loopText,#mermaid-svg-LWaKnJPEKl1e32QV .loopText>tspan{fill:black;stroke:none;}#mermaid-svg-LWaKnJPEKl1e32QV .loopLine{stroke-width:2px;stroke-dasharray:2,2;stroke:hsl(259.6261682243, 59.7765363128%, 87.9019607843%);fill:hsl(259.6261682243, 59.7765363128%, 87.9019607843%);}#mermaid-svg-LWaKnJPEKl1e32QV .note{stroke:#aaaa33;fill:#fff5ad;}#mermaid-svg-LWaKnJPEKl1e32QV .noteText,#mermaid-svg-LWaKnJPEKl1e32QV .noteText>tspan{fill:black;stroke:none;}#mermaid-svg-LWaKnJPEKl1e32QV .activation0{fill:#f4f4f4;stroke:#666;}#mermaid-svg-LWaKnJPEKl1e32QV .activation1{fill:#f4f4f4;stroke:#666;}#mermaid-svg-LWaKnJPEKl1e32QV .activation2{fill:#f4f4f4;stroke:#666;}#mermaid-svg-LWaKnJPEKl1e32QV .actorPopupMenu{position:absolute;}#mermaid-svg-LWaKnJPEKl1e32QV .actorPopupMenuPanel{position:absolute;fill:#ECECFF;box-shadow:0px 8px 16px 0px rgba(0,0,0,0.2);filter:drop-shadow(3px 5px 2px rgb(0 0 0 / 0.4));}#mermaid-svg-LWaKnJPEKl1e32QV .actor-man line{stroke:hsl(259.6261682243, 59.7765363128%, 87.9019607843%);fill:#ECECFF;}#mermaid-svg-LWaKnJPEKl1e32QV .actor-man circle,#mermaid-svg-LWaKnJPEKl1e32QV line{stroke:hsl(259.6261682243, 59.7765363128%, 87.9019607843%);fill:#ECECFF;stroke-width:2px;}#mermaid-svg-LWaKnJPEKl1e32QV :root{--mermaid-font-family:"trebuchet ms",verdana,arial,sans-serif;} loop每个步骤 目标分解为步骤计划下发计划执行动作返回结果校验结果通过/失败失败或环境变化重规划
特点:全局视角、可审计、适合长任务;但计划可能与环境脱节,需要重规划机制。
六、LLM 原生规划的核心局限
1. 无显式世界模型
LLM 学到的是文本共现,不是因果转移模型。它难以精确预测"执行动作 A 后状态如何变化",因此计划常"语法合理、语义可行、执行失败"。
2. 规划幻觉
模型会生成不存在工具、不存在 API、不存在前置条件的步骤。表现是步骤看似专业,但不可执行或违反约束。
3. 长程误差累积与目标漂移
多步规划中,早期小错误会向后传播;上下文变长后,模型可能遗忘初始目标或约束,出现目标漂移。
4. 局部贪心,缺乏系统性搜索
原生生成是单轨迹贪心,没有显式搜索树、剪枝、回溯保证。复杂任务需要多候选比较时,原生规划不足。
5. 自我验证与反思不可靠
LLM 的自我评估存在确认偏差、过度自信、评分漂移。没有外部验证器时,"反思"可能强化错误而非纠正错误。
6. 规划与执行脱节
计划是文本,执行是环境动作。二者之间缺少形式化契约,导致计划粒度不适配工具、参数缺失、状态不一致。
7. 约束满足能力弱
对预算、权限、时间窗、依赖关系、资源上限等硬约束,LLM 难以保证满足;需要约束求解器或策略引擎兜底。
8. 不确定性与不可复现
同一目标多次生成不同计划,给测试、审计、回归带来困难。生产系统需固定种子、评测集与护栏。
9. 上下文与记忆限制
长计划超出上下文窗口时,早期约束丢失;长期记忆检索不准会引入污染,导致错误经验复用。
10. 成本、时延与循环风险
多轮规划与工具调用放大时延和费用;ReAct 类范式可能陷入"思考---调用---再思考"的循环。
七、局限的根源对比
| 局限 | 根源 | 工程缓解 |
|---|---|---|
| 规划幻觉 | 无环境 grounding | 工具白名单、Schema 校验、执行前 dry-run |
| 长程误差累积 | 单轨迹自回归 | 分层规划、检查点、重规划、验证器 |
| 局部贪心 | 无显式搜索 | 树搜索、多采样、候选评估 |
| 自我验证弱 | 无独立价值函数 | 外部验证器、单测、规则检查、人工审批 |
| 约束不满足 | 无形式化约束求解 | 策略引擎、约束解码、求解器 |
| 目标漂移 | 上下文遗忘 | 目标复述、状态摘要、记忆管理 |
| 不可复现 | 采样随机性 | 温度控制、评测集、轨迹审计 |
| 循环风险 | 缺少终止判定 | 步数上限、预算上限、循环检测 |
八、可靠规划的工程化路径
#mermaid-svg-QPRcsx9JRIudnCmq{font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:16px;fill:#333;}@keyframes edge-animation-frame{from{stroke-dashoffset:0;}}@keyframes dash{to{stroke-dashoffset:0;}}#mermaid-svg-QPRcsx9JRIudnCmq .edge-animation-slow{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 50s linear infinite;stroke-linecap:round;}#mermaid-svg-QPRcsx9JRIudnCmq .edge-animation-fast{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 20s linear infinite;stroke-linecap:round;}#mermaid-svg-QPRcsx9JRIudnCmq .error-icon{fill:#552222;}#mermaid-svg-QPRcsx9JRIudnCmq .error-text{fill:#552222;stroke:#552222;}#mermaid-svg-QPRcsx9JRIudnCmq .edge-thickness-normal{stroke-width:1px;}#mermaid-svg-QPRcsx9JRIudnCmq .edge-thickness-thick{stroke-width:3.5px;}#mermaid-svg-QPRcsx9JRIudnCmq .edge-pattern-solid{stroke-dasharray:0;}#mermaid-svg-QPRcsx9JRIudnCmq .edge-thickness-invisible{stroke-width:0;fill:none;}#mermaid-svg-QPRcsx9JRIudnCmq .edge-pattern-dashed{stroke-dasharray:3;}#mermaid-svg-QPRcsx9JRIudnCmq .edge-pattern-dotted{stroke-dasharray:2;}#mermaid-svg-QPRcsx9JRIudnCmq .marker{fill:#333333;stroke:#333333;}#mermaid-svg-QPRcsx9JRIudnCmq .marker.cross{stroke:#333333;}#mermaid-svg-QPRcsx9JRIudnCmq svg{font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:16px;}#mermaid-svg-QPRcsx9JRIudnCmq p{margin:0;}#mermaid-svg-QPRcsx9JRIudnCmq .label{font-family:"trebuchet ms",verdana,arial,sans-serif;color:#333;}#mermaid-svg-QPRcsx9JRIudnCmq .cluster-label text{fill:#333;}#mermaid-svg-QPRcsx9JRIudnCmq .cluster-label span{color:#333;}#mermaid-svg-QPRcsx9JRIudnCmq .cluster-label span p{background-color:transparent;}#mermaid-svg-QPRcsx9JRIudnCmq .label text,#mermaid-svg-QPRcsx9JRIudnCmq span{fill:#333;color:#333;}#mermaid-svg-QPRcsx9JRIudnCmq .node rect,#mermaid-svg-QPRcsx9JRIudnCmq .node circle,#mermaid-svg-QPRcsx9JRIudnCmq .node ellipse,#mermaid-svg-QPRcsx9JRIudnCmq .node polygon,#mermaid-svg-QPRcsx9JRIudnCmq .node path{fill:#ECECFF;stroke:#9370DB;stroke-width:1px;}#mermaid-svg-QPRcsx9JRIudnCmq .rough-node .label text,#mermaid-svg-QPRcsx9JRIudnCmq .node .label text,#mermaid-svg-QPRcsx9JRIudnCmq .image-shape .label,#mermaid-svg-QPRcsx9JRIudnCmq .icon-shape .label{text-anchor:middle;}#mermaid-svg-QPRcsx9JRIudnCmq .node .katex path{fill:#000;stroke:#000;stroke-width:1px;}#mermaid-svg-QPRcsx9JRIudnCmq .rough-node .label,#mermaid-svg-QPRcsx9JRIudnCmq .node .label,#mermaid-svg-QPRcsx9JRIudnCmq .image-shape .label,#mermaid-svg-QPRcsx9JRIudnCmq .icon-shape .label{text-align:center;}#mermaid-svg-QPRcsx9JRIudnCmq .node.clickable{cursor:pointer;}#mermaid-svg-QPRcsx9JRIudnCmq .root .anchor path{fill:#333333!important;stroke-width:0;stroke:#333333;}#mermaid-svg-QPRcsx9JRIudnCmq .arrowheadPath{fill:#333333;}#mermaid-svg-QPRcsx9JRIudnCmq .edgePath .path{stroke:#333333;stroke-width:2.0px;}#mermaid-svg-QPRcsx9JRIudnCmq .flowchart-link{stroke:#333333;fill:none;}#mermaid-svg-QPRcsx9JRIudnCmq .edgeLabel{background-color:rgba(232,232,232, 0.8);text-align:center;}#mermaid-svg-QPRcsx9JRIudnCmq .edgeLabel p{background-color:rgba(232,232,232, 0.8);}#mermaid-svg-QPRcsx9JRIudnCmq .edgeLabel rect{opacity:0.5;background-color:rgba(232,232,232, 0.8);fill:rgba(232,232,232, 0.8);}#mermaid-svg-QPRcsx9JRIudnCmq .labelBkg{background-color:rgba(232, 232, 232, 0.5);}#mermaid-svg-QPRcsx9JRIudnCmq .cluster rect{fill:#ffffde;stroke:#aaaa33;stroke-width:1px;}#mermaid-svg-QPRcsx9JRIudnCmq .cluster text{fill:#333;}#mermaid-svg-QPRcsx9JRIudnCmq .cluster span{color:#333;}#mermaid-svg-QPRcsx9JRIudnCmq div.mermaidTooltip{position:absolute;text-align:center;max-width:200px;padding:2px;font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:12px;background:hsl(80, 100%, 96.2745098039%);border:1px solid #aaaa33;border-radius:2px;pointer-events:none;z-index:100;}#mermaid-svg-QPRcsx9JRIudnCmq .flowchartTitleText{text-anchor:middle;font-size:18px;fill:#333;}#mermaid-svg-QPRcsx9JRIudnCmq rect.text{fill:none;stroke-width:0;}#mermaid-svg-QPRcsx9JRIudnCmq .icon-shape,#mermaid-svg-QPRcsx9JRIudnCmq .image-shape{background-color:rgba(232,232,232, 0.8);text-align:center;}#mermaid-svg-QPRcsx9JRIudnCmq .icon-shape p,#mermaid-svg-QPRcsx9JRIudnCmq .image-shape p{background-color:rgba(232,232,232, 0.8);padding:2px;}#mermaid-svg-QPRcsx9JRIudnCmq .icon-shape .label rect,#mermaid-svg-QPRcsx9JRIudnCmq .image-shape .label rect{opacity:0.5;background-color:rgba(232,232,232, 0.8);fill:rgba(232,232,232, 0.8);}#mermaid-svg-QPRcsx9JRIudnCmq .label-icon{display:inline-block;height:1em;overflow:visible;vertical-align:-0.125em;}#mermaid-svg-QPRcsx9JRIudnCmq .node .label-icon path{fill:currentColor;stroke:revert;stroke-width:revert;}#mermaid-svg-QPRcsx9JRIudnCmq :root{--mermaid-font-family:"trebuchet ms",verdana,arial,sans-serif;} 是
否
目标
分层规划
高层目标/子目标/原子动作
外部化状态
结构化任务状态
工具与执行
受控动作空间
验证器
规则/单测/奖励模型
通过?
推进下一步
诊断与重规划
记忆与审计
关键原则:
- 规划粒度分层:高层由 LLM 分解,低层由工作流或程序执行。
- 状态外部化:把任务状态、约束、已完成步骤写入结构化存储,而非只靠上下文。
- 动作空间受控:工具白名单、参数 Schema、权限与预算约束。
- 验证独立化:验证器与生成器分离,避免"自己判自己"。
- 搜索可选化:高价值任务引入多候选与树搜索,低价值任务保持单轨迹。
- 反思有依据:反思必须基于执行反馈或外部信号,而非纯自我批评。
- 终止可判定:步数、预算、时间、循环检测四类上限。
九、边界:什么时候原生规划够用
| 场景 | 原生规划是否够用 | 原因 |
|---|---|---|
| 短程、低风险、可人工检查 | 基本够用 | 错误成本低,可快速修正 |
| 输入输出清晰、工具少 | 够用 | 动作空间小,grounding 容易 |
| 长程多步、强依赖 | 不够 | 误差累积、状态复杂 |
| 高风险写操作 | 不够 | 需审批、事务、回滚 |
| 强约束资源调度 | 不够 | 需约束求解器 |
| 开放动态环境 | 部分够用 | 需 ReAct + 重规划 + 护栏 |
| 需要可复现审计 | 不够 | 需固定流程与轨迹审计 |
十、面试高分总结
Agent 的规划能力来自多层叠加:LLM 原生层提供基于语料先验的步骤生成,推理时范式把隐式推理外化为 CoT/ReAct/Plan-Execute/树搜索,外部环境层提供 grounding,记忆层提供跨轮一致性,验证与编排层把开放规划收敛为可执行、可审计的流程。
LLM 原生规划的本质是"隐式、单轨迹、贪心、概率性"的步骤生成,缺乏显式世界模型、可靠价值函数、系统性搜索与独立验证,因此存在规划幻觉、长程误差累积、目标漂移、约束不满足、自我反思不可靠、规划执行脱节等局限。
高级岗的关键判断是:原生规划只适合短程、低风险、可验证任务;生产级 Agent 必须把规划外部化------分层分解、状态显式化、动作受控、验证独立、搜索可选、反思有据、终止可判定,并由传统程序与人工审批兜底高风险环节。