第二十二篇 Experience
第69章 Experience
在前面的章节中,已经建立了:
Information
→ Perception
→ Cognition
→ Understanding
→ Memory
→ Reasoning
→ Decision
→ Behavior
→ Action
→ Feedback
其中,Feedback 描述行为执行之后发生的结果。
第69章进一步解决一个问题:
这些已经发生过的行为和结果,如何成为以后可以使用的 Experience?
Experience 不是简单保存一条历史记录,而是把一次实际经历中的条件、行为、过程、结果和反馈组织成可查询、可比较、可复用的经验对象。
核心模型:
Condition
+
Action
+
Process
+
Result
+
Feedback
→
Experience
1. Experience 定义
Experience(经验)是 SAI 在实际行为、环境交互或任务执行过程中形成的、经过整理后可以被再次查询和使用的历史认知资源。
简单表示:
Experience
=
Condition
+
Action
+
Process
+
Result
+
Feedback
例如:
条件:
Room.temperature = 32
行为:
Fan_A.powerOn
结果:
Fan_A = ON
反馈:
temperature = 29
这些信息组合起来:
Experience
{
task: "reduce_temperature",
condition:
{
temperature: 32
},
action:
{
device: "Fan_A",
method: "powerOn"
},
result:
{
state: "ON"
},
feedback:
{
temperature: 29
}
}
这才构成一个完整经验。
因此:
Experience 不是单独的 Result,而是一次“条件 → 行为 → 结果 → 反馈”的完整历史过程。
2. Experience 与 Fact
Fact 和 Experience 都属于 SAI 的认知资源,但两者表示的内容不同。
Fact
Fact 主要表示:
已经确认的事实是什么。
例如:
Fan_A.state = ON
或者:
Motor_A.speed = 1500
结构:
Fact
{
subject
predicate
value
source
state
}
Experience
Experience 表示:
曾经发生过什么,以及发生之后产生了什么结果。
例如:
Experience
{
condition:
{
temperature: 32
},
action:
{
device: "Fan_A",
method: "powerOn"
},
result:
{
state: "ON"
},
feedback:
{
temperature: 29
}
}
因此:
Fact
→ 事实
Experience
→ 经历
两者的区别可以表示为:
Fact:
Fan_A = ON
Experience:
温度32℃
→ 启动Fan_A
→ Fan_A = ON
→ 温度下降到29℃
所以:
Fact 回答“是什么”,Experience 回答“发生过什么”。
3. Experience 与 Memory
Experience 与 Memory 之间是包含与承载关系。
Memory 是记忆机制。
Experience 是 Memory 中的一种具体内容。
可以表示:
Memory
├── InformationMemory
├── ElementMemory
├── ObjectMemory
├── RelationMemory
├── FactMemory
└── ExperienceMemory
因此:
Experience
↓
ExperienceMemory
Experience 本身描述一次经历。
ExperienceMemory 负责保存、查询、更新这些经历。
例如:
Experience
{
id: "EXP_1001",
task: "reduce_temperature",
action: "Fan_A.powerOn",
result: "temperature_down"
}
保存:
ExperienceMemory
{
id: "EXP_1001",
...
}
所以:
Experience ≠ Memory
更准确地说:
Experience = 被记住的经历对象
ExperienceMemory = 保存和管理 Experience 的记忆机制
4. Experience 与 Learning
Experience 是 Learning 的重要输入。
但是:
Experience ≠ Learning
Experience 是历史经历。
Learning 是从这些信息中获取、整理和更新知识的过程。
基本关系:
Action
↓
Result
↓
Feedback
↓
Experience
↓
Learning
↓
Knowledge / Ability Resource
例如:
Experience 1:
温度32℃
→ 开风扇
→ 温度29℃
→ 成功
如果以后又出现:
Experience 2:
温度31℃
→ 开风扇
→ 温度28℃
→ 成功
Learning 可以从多个 Experience 中形成更加稳定的知识:
Knowledge
{
condition: "temperature >= 30",
action: "Fan_A.powerOn",
result: "temperature_reduction"
}
所以:
Experience 是 Learning 的历史材料,Learning 是对经验进行获取、整理、验证和更新的过程。
同时不能简单认为:
一次 Experience = Knowledge
一次经历可能:
- 有效
- 无效
- 偶然
- 冲突
- 不完整
- 需要进一步验证
因此 Experience 必须经过判断之后才能成为可靠的知识资源。
5. 成功经验
成功经验是行为达到预期结果,或者满足预定目标的 Experience。
例如:
Condition:
temperature = 32
Action:
Fan_A.powerOn
Result:
Fan_A = ON
Feedback:
temperature = 29
Outcome:
SUCCESS
形成:
Experience
{
task: "reduce_temperature",
condition:
{
temperature: 32
},
action:
{
device: "Fan_A",
method: "powerOn"
},
result:
{
state: "ON"
},
feedback:
{
temperature: 29
},
outcome: "SUCCESS"
}
成功经验可以在后续 Reasoning 和 Decision 中作为历史依据。
例如:
Current Condition
↓
Experience Query
↓
找到类似成功经验
↓
Condition Matching
↓
Experience Evaluation
↓
Decision Reference
注意:
成功经验是参考依据,不是直接命令。
过去成功,并不代表当前一定成功。
6. 失败经验
失败经验表示一次行为没有达到目标,或者执行过程中产生异常结果。
例如:
Condition:
Motor_A.temperature = 80
Action:
Motor_A.start
Result:
FAILED
Feedback:
temperature = 95
Outcome:
OVERHEAT
形成:
Experience
{
task: "start_motor",
condition:
{
temperature: 80
},
action:
{
device: "Motor_A",
method: "start"
},
result:
{
state: "FAILED"
},
feedback:
{
temperature: 95,
error: "OVERHEAT"
},
outcome: "FAILURE"
}
失败经验同样具有价值。
例如以后再次出现:
Motor_A.temperature = 80
系统查询历史经验:
过去:
80℃
→ START
→ OVERHEAT
→ FAILURE
那么 Reasoning 可以把这个历史经验作为风险判断依据。
例如:
RiskScore ↑
然后:
Decision
→ 不执行 START
或者:
Decision
→ 先降低温度
因此:
失败经验不是无用数据,而是避免重复错误的重要历史资源。
7. 行为经验
行为经验关注:
以前采取过什么行为,以及行为产生了什么结果。
例如:
Behavior:
Fan_A.powerOn
Result:
SUCCESS
Feedback:
temperature decreased
形成:
BehaviorExperience
{
behavior: "powerOn",
target: "Fan_A",
condition:
{
temperature: 32
},
result: "SUCCESS",
feedback:
{
temperature: 29
}
}
行为经验可以用于:
行为比较
行为选择
行为风险判断
行为优先级
行为结果预测
例如存在两个历史行为:
Experience A:
Fan_A.powerOn
→ 温度下降3℃
Experience B:
Fan_B.powerOn
→ 温度下降1℃
当前条件相近时,可以将两种历史经验提供给 Decision:
Candidate A
Candidate B
↓
Experience Matching
↓
Result Comparison
↓
Decision
8. 环境经验
环境经验关注:
过去某种环境条件下发生了什么。
例如:
Environment:
temperature = 32
humidity = 70
people = 5
执行:
Fan_A.powerOn
结果:
temperature = 29
humidity = 65
可以保存:
EnvironmentExperience
{
environment:
{
temperature: 32,
humidity: 70,
people: 5
},
action:
{
device: "Fan_A",
method: "powerOn"
},
result:
{
temperature: 29,
humidity: 65
},
state: "SUCCESS"
}
环境经验的价值在于:
Current Environment
↓
Environment Matching
↓
Historical Experience
↓
Result Comparison
例如过去:
温度 > 30
人员 > 3
启动风扇效果较好。
当前环境:
温度 = 31
人员 = 4
那么历史环境经验可以成为当前 Decision 的参考。
但仍然必须重新检查当前条件。
9. Experience 保存
Experience 形成之后,需要经过整理、验证和保存。
完整过程:
Action
↓
Result
↓
Feedback
↓
Experience Formation
↓
Validation
↓
Classification
↓
Duplicate Check
↓
Conflict Check
↓
ExperienceMemory
Experience 基本结构:
Experience
{
id
task
condition
environment
action
process
result
feedback
outcome
state
source
created_at
updated_at
}
例如:
Experience
{
id: "EXP_1001",
task: "reduce_temperature",
condition:
{
temperature: 32
},
environment:
{
room: "Office_A"
},
action:
{
device: "Fan_A",
method: "powerOn"
},
process:
[
"POWER_ON",
"RUNNING"
],
result:
{
device_state: "ON"
},
feedback:
{
temperature_before: 32,
temperature_after: 29
},
outcome: "SUCCESS",
state: "ACTIVE",
source: "DEVICE_FEEDBACK"
}
Experience 状态
Experience 可以具有自己的生命周期状态:
NEW
ACTIVE
VERIFIED
UNCERTAIN
CONFLICT
INVALID
ARCHIVED
DELETED
其中尤其需要区分:
SUCCESS ≠ VERIFIED
例如一次操作虽然成功:
Fan_A ON
但并不能证明:
Fan_A ON
在所有相同条件下都一定有效。
因此:
Outcome = SUCCESS
表示这一次成功。
而:
State = VERIFIED
表示该经验经过进一步验证后具有较高可靠性。
10. Experience 查询
Experience 的价值最终体现在:
以后还能不能找到并使用以前的经历。
查询过程:
Current Condition
↓
Experience Query
↓
Experience Matching
↓
Experience Filtering
↓
Experience Evaluation
↓
Relevant Experience
例如当前:
temperature = 31
查询:
ExperienceMemory
找到:
EXP_1001
temperature = 32
Fan_A.powerOn
temperature 32 → 29
SUCCESS
系统进行条件匹配:
Current:
31
Historical:
32
如果属于允许范围:
MatchState = STRONG
则经验可以进入 Reasoning。
Experience 查询条件
可以根据:
task
condition
environment
object
action
result
feedback
outcome
state
time
source
进行查询。
例如:
ExperienceQuery
{
task: "reduce_temperature",
condition:
{
temperature:
{
operator: ">=",
value: 30
}
},
outcome: "SUCCESS",
state: "ACTIVE"
}
查询结果:
ExperienceResult
[
EXP_1001,
EXP_1005,
EXP_1012
]
然后进一步进行匹配:
Experience
↓
Condition Matching
↓
Environment Matching
↓
Action Matching
↓
Result Matching
↓
Experience Score
这里的 Score 是离散规则和权重计算结果,不是训练参数。
Experience 查询与直接执行的区别
非常重要:
查询经验
≠
执行经验
例如历史记录:
temperature = 32
→ Fan_A ON
→ SUCCESS
当前:
temperature = 31
系统不能直接:
Experience
→ Action
而应该:
Experience
↓
Matching
↓
Evaluation
↓
Reasoning
↓
Decision
↓
Behavior
↓
Action
因此 Experience 始终属于历史依据。
Experience 的完整生命周期
环境 / 当前条件
↓
行为
↓
行动
↓
结果
↓
反馈
↓
Experience Formation
↓
Validation
↓
ExperienceMemory
↓
Experience Query
↓
Condition Matching
↓
Reasoning
↓
Decision
↓
新的行为
形成循环:
Experience
↓
Reasoning
↓
Decision
↓
Action
↓
Feedback
↓
Experience
而 Learning 位于经验积累和知识更新之间:
Experience
↓
Learning
↓
Knowledge / Ability Resource
↓
Reasoning / Decision
Fact、Memory、Experience、Learning 四者关系
可以统一为:
Fact
│
├── 描述已经确认的事实
│
Memory
│
├── 保存和管理历史认知资源
│
Experience
│
├── 描述过去发生过的经历
│
Learning
│
└── 从信息和经历中获取、整理、验证并更新知识
进一步形成:
Information
↓
Perception
↓
Cognition
↓
Fact
↓
Memory
以及:
Action
↓
Result
↓
Feedback
↓
Experience
↓
Learning
↓
Knowledge
最终汇合到:
Reasoning
↓
Decision
本章核心模型
Condition
↓
Behavior
↓
Action
↓
Result
↓
Feedback
↓
Experience
├──→ ExperienceMemory
└──→ Learning
↓
Knowledge
↓
Reasoning
↓
Decision
同时:
Experience
↓
Query
↓
Matching
↓
Evaluation
↓
Reasoning
本章核心定义
Experience 是 SAI 在实际行为和环境交互过程中,由条件、行为、过程、结果和反馈形成的历史经历对象。Experience 可以保存于 ExperienceMemory,并通过查询、匹配和评价为 Reasoning、Decision 和 Learning 提供历史依据。
最重要的边界是:
Fact → 记住事实
Memory → 保存记忆
Experience→ 记住经历
Learning → 从信息和经历中获取、整理和更新知识
因此,第69章的核心链条是:
行为
↓
结果
↓
反馈
↓
经验
↓
记忆
↓
学习
↓
知识更新
↓
推理
↓
决策
↓
新的行为
这使 Experience 成为 SAI 从“一次行为”走向“历史积累”,再从“历史积累”进入 Learning 的关键中间层。