首页 理论 架构 工程 文档 白皮书 著作 研究 案例 下载 博客 关于 开始使用 →

第100章 认知方法 Cognitive Method

第100章 Cognitive Method

认知方法

第99章建立了:

Cognitive State
+
Goal
+
Knowledge
+
Experience
+
Constraints
 ↓
Evaluation
 ↓
Choice
 ↓
Decision

机器由此解决了:

“选择什么?”

但是,一个决策形成以后,仍然存在一个更加实际的问题:

机器已经决定做什么,那么它究竟通过什么方法完成这个决定?

例如:

Decision:
选择对象 A

这只是:

What

还没有解决:

How

因此,第100章进入:

Cognitive Method

中文:

认知方法

核心关系:

Goal
 ↓
Decision
 ↓
Method

进一步:

Object
 ↓
Method
 ↓
Action

这也是前面建立的:

对象—方法映射

第一次正式进入机器认知的连续运行体系。


100.1 什么是认知方法

可以定义:

认知方法,是机器根据当前认知状态、目标、决策、对象及其条件,从已有方法结构中选择或形成实现特定目标和决策的行为方式。

简单来说:

Decision
=
做什么

Method
=
怎么做

因此:

Decision
 ↓
Method

是两个不同层次的认知过程。


100.2 为什么 Decision 之后必须存在 Method

如果没有 Method:

Decision
 ↓
?

机器只有:

我要做 A

却不知道:

如何完成 A

因此完整结构必须是:

Goal
 ↓
Decision
 ↓
Method
 ↓
Action

例如:

Goal:
获得信息

Decision:
向人询问

Method:
提出问题

这里:

Goal = 为什么做
Decision = 决定做什么
Method = 决定怎么做

100.3 Method 与 Action 的区别

必须严格区分:

Method

和:

Action

Method 是:

实现目标或决策的一种方式。

Action 是:

方法被实际执行后产生的具体行为。

例如:

Decision:
获取用户信息

Method:
通过提问获取

Action:
“请告诉我您的产品型号。”

因此:

Decision
 ↓
Method
 ↓
Action

而不是:

Decision
 ↓
Action

直接跳过方法。


100.4 Method 的认知位置

前面已经形成:

Perception
 ↓
Cognition
 ↓
Understanding
 ↓
Decision

现在继续:

Decision
 ↓
Method
 ↓
Behavior
 ↓
Action

于是:

Perception
 ↓
Cognition
 ↓
Decision
 ↓
Method
 ↓
Behavior

机器开始从:

认识

进入:

行动准备

100.5 Method 不是普通程序函数

这里必须区分:

Software Function

和:

Cognitive Method

普通程序函数通常是:

function()
 ↓
fixed operation

而认知方法具有:

Context
Object
Goal
Decision
State
Condition

例如:

Method:
询问用户

并不是永远使用同一个动作。

面对不同:

Object
State
Person
Context
Goal

方法可能发生变化。

因此:

认知方法不是固定程序,而是认知系统中的可选择行为方式。


100.6 Method 的基本结构

可以建立:

Method
{
    method_id,
    name,
    purpose,
    target_object,
    preconditions,
    applicable_states,
    required_elements,
    required_relations,
    steps,
    expected_outcome,
    constraints
}

因此 Method 本身也是一个:

Cognitive Object

而不是简单的代码片段。


100.7 Method 的核心组成

一个完整的方法至少包含:

Method
│
├── Purpose
├── Target Object
├── Preconditions
├── Applicable State
├── Required Resources
├── Method Logic
├── Execution Steps
├── Expected Outcome
└── Constraints

因此:

Method

实际上是一种:

目标到结果之间的结构化实现路径。


100.8 Goal 与 Method

同一个目标可能存在多个方法:

Goal
 ↓
Method A
Method B
Method C

例如:

Goal:
获取信息

可以:

Method A:
直接询问

Method B:
读取已有记忆

Method C:
观察当前状态

Method D:
通过已有对象关系推导

所以:

Goal
 ↓
Method Set

而不是:

Goal
 ↓
One Fixed Method

100.9 Decision 与 Method

第99章决定:

What

第100章决定:

How

例如:

Goal:
解决问题

Decision:
采用方案 A

Methods:
Method 1
Method 2
Method 3

机器接下来需要:

Evaluate Methods
 ↓
Select Method

因此第100章内部还可以形成:

Decision
 ↓
Candidate Methods
 ↓
Method Matching
 ↓
Method Evaluation
 ↓
Method Selection

100.10 方法匹配

这与第89章的:

Cognitive Matching

直接连接。

当前:

Object
State
Goal
Decision

与:

Method

进行匹配:

Current Cognitive State
        ↓
Method Matching
        ↓
Applicable Methods

因此:

机器不是简单地寻找“一个方法”,而是在当前认知条件下寻找“适用的方法”。


100.11 Object → Method

这是本章最重要的理论之一:

对象—方法映射

可以表示为:

Object
 ↓
Object State
 ↓
Applicable Method

例如:

Object:
用户

State:
等待回答

Method:
询问

另一个状态:

Object:
用户

State:
已经提供答案

Method:
分析答案

因此:

Same Object
+
Different State
 ↓
Different Method

这说明方法选择不仅取决于对象,还取决于对象当前状态。


100.12 Object → Method Mapping

可以正式定义:

对象—方法映射,是机器根据对象类型、对象属性、对象关系、对象状态以及当前目标和决策,为对象选择适用方法的认知映射机制。

结构:

Object
+
Attributes
+
Relations
+
State
+
Goal
+
Decision
 ↓
Method

因此:

Method = f(Object, State, Goal, Decision, Context)

这里的 f 并不要求是数学函数,也可以是:

Rule
Matching
Mapping
Classification
Selection

构成的认知机制。


100.13 方法不是对象的固有属性

需要进一步区分:

Object

与:

Method

对象本身并不一定“拥有唯一方法”。

例如:

Object:
Document

可以存在:

Read
Analyze
Classify
Store
Compare
Summarize

不同方法。

所以:

Object
 ↓
Method Set

更合理。

然后:

Context
+
Goal
+
State
 ↓
Method Selection

100.14 Method Selection

方法选择可以形成:

Candidate Methods
        ↓
Applicability Check
        ↓
State Matching
        ↓
Goal Matching
        ↓
Constraint Check
        ↓
Method Evaluation
        ↓
Selected Method

因此:

方法选择本身也是一个认知决策过程。

但它与第99章的总体 Decision 不同。

第99章:

选择做什么

第100章:

选择怎么做

100.15 Decision 与 Method 的层级关系

可以形成两个连续决策:

Decision Level 1
What to do
        ↓
Decision Level 2
How to do

也就是:

Goal
 ↓
Action Objective
 ↓
Decision
 ↓
Method Selection
 ↓
Execution

因此:

Method Selection 可以看作决策之后的第二层选择。


100.16 Method Condition

方法不是任何情况下都适用。

例如:

Method A

要求:

State = Available

如果:

State = Unavailable

那么:

Method A

不能使用。

因此每个 Method 应具有:

Precondition

即:

方法适用的前置条件。

结构:

Current State
 ↓
Precondition Check
 ↓
Applicable / Not Applicable

100.17 Method State

方法本身也可以具有状态:

Method
 ↓
Available
 ↓
Selected
 ↓
Prepared
 ↓
Executing
 ↓
Completed

如果失败:

Executing
 ↓
Failed

因此:

Method

也可以成为一个状态对象。


100.18 Method 与对象状态

对象状态改变以后,方法集合也可能改变。

例如:

Object A
State X
 ↓
Methods:
M1
M2

状态变成:

Object A
State Y
 ↓
Methods:
M3
M4

所以:

Object State
 ↓
Method Availability

是一种重要的认知关系。


100.19 Method 与 Relation

方法选择还可能依赖对象关系。

例如:

Object A
Relation:
A belongs to Group B

于是可以选择:

Method:
Group Processing

因此:

Object
+
Relation
 ↓
Method

进一步:

Object
+
Relation
+
State
 ↓
Method

100.20 Method 与 Knowledge

机器需要知道:

哪些方法存在?
哪些方法适用?
哪些方法有效?

这些来自:

Knowledge

例如:

Knowledge:
Object A supports Method M1

那么:

A
 ↓
M1

可以进入方法候选集合。

因此:

Knowledge
 ↓
Method Mapping

100.21 Method 与 Experience

第94章已经建立:

Experience

第95章建立:

Experience Matching

现在经验可以进一步影响方法选择:

Current Situation
 ↓
Experience Matching
 ↓
Past Method
 ↓
Past Outcome
 ↓
Method Evaluation

例如:

Method A
Past Outcome = Good

而:

Method B
Past Outcome = Bad

在相似情境下:

Method A

可能具有更高优先级。

因此:

经验不仅帮助机器决定“做什么”,还可以帮助机器决定“怎么做”。


100.22 Method Experience

可以形成:

Method Experience

结构:

Situation
+
Object
+
State
+
Method
+
Outcome
+
Evaluation

以后再次遇到相似情况:

Current Situation
 ↓
Method Experience Matching
 ↓
Method Selection

100.23 Method 与 Learning

如果某个方法连续失败:

Method A
 ↓
Failure
 ↓
Feedback

机器可以调整:

Method Priority

甚至:

Method Structure

例如:

Old Method:
M1

经过学习:

M1
 ↓
Add Condition
 ↓
M1'

于是:

Experience
 ↓
Learning
 ↓
Method Update

这使方法成为机器个体不断演化的一部分。


100.24 Method Adaptation

认知适应不仅可以改变:

Knowledge

也可以改变:

Method Selection

例如环境变化:

Old Environment
 ↓
Method A effective

环境改变:

New Environment
 ↓
Method A ineffective

机器通过反馈发现:

Method B

更加适合。

于是:

Adaptation
 ↓
Method Mapping Update

100.25 Method 与 Human Interaction

因为本体系从第78章开始就是:

Human
 ↕
Machine

所以人与机器交互过程中,机器的方法也可能不同。

例如:

Person A

偏好:

Short Response

方法:

Concise Communication

而:

Person B

需要:

Detailed Explanation

方法:

Detailed Communication

因此:

Individual
+
Person Context
+
Goal
+
State
 ↓
Method

这进一步体现:

机器不是只针对对象行动,而是针对当前具体交互情境选择方法。


100.26 Method 与 Individual

不同 Individual 可以拥有不同的方法结构。

例如:

Individual A
Method Preference:
M1 > M2

而:

Individual B
Method Preference:
M2 > M1

原因可能来自:

Experience
Learning
Knowledge
Goals
Constraints

所以:

Method

也是个体认知的重要组成部分。


100.27 Method Memory

机器可以记住:

Object
+
Situation
+
Method
+
Outcome

形成:

Method Memory

例如:

Situation X
Object A
Method M1
Outcome Good

以后:

Situation X
Object A

可以优先:

M1

这使方法选择具有历史连续性。


100.28 Method Mapping Memory

甚至可以形成:

Object → Method Mapping History

例如:

Object A
 ├── State X → M1
 ├── State Y → M2
 └── State Z → M3

随着经验增加:

Object A
 ├── State X → M1
 ├── State Y → M2
 ├── State Z → M3
 └── State W → M4

这实际上形成了一种:

动态对象—方法映射结构。


100.29 Method 与 Symbolic Logic

在符号逻辑体系中,可以表达:

Object = A
State = X
Goal = G

如果:

Condition:
A ∧ X ∧ G

满足:

Rule:
A + X + G → M1

则:

Method = M1

因此:

Symbol
 ↓
Element
 ↓
Object
 ↓
State
 ↓
Condition
 ↓
Rule
 ↓
Method

这是符号逻辑从:

“认识”

进入:

“行动方式选择”

的重要一步。


100.30 Method Rule

可以定义:

Method Rule

例如:

IF
Object = User
AND
State = Waiting
AND
Goal = GetInformation

THEN
Method = AskQuestion

这里:

IF

部分属于:

Cognitive Condition

而:

THEN

产生:

Method

因此:

方法可以成为符号逻辑推导的结果。


100.31 Method Mapping Rule

进一步:

Object
+
State
+
Goal
 ↓
Mapping Rule
 ↓
Method

例如:

Object = Document
State = Unknown
Goal = Understand

→ Method = AnalyzeStructure

如果:

State = Structured

则:

→ Method = SemanticInterpretation

因此:

State

直接影响:

Method

100.32 Method 与 Cognitive Structure

第87章建立:

Cognitive Structure

现在可以进一步扩展:

Element
 ↓
Relation
 ↓
Object
 ↓
State
 ↓
Goal
 ↓
Decision
 ↓
Method

形成:

Cognitive Structure

中的行动准备部分。


100.33 Method 不是最终行为

本章必须保持边界。

当前只研究:

Method

因此:

Method
 ↓
?

下一阶段再研究:

Behavior

以及:

Action
Execution

所以本章暂时不把:

Method

和:

Behavior

完全合并。


100.34 Method 与 Behavior

二者关系可以暂时定义为:

Method
 ↓
Behavior Model
 ↓
Behavior

即:

Method
=
行为方式

而:

Behavior
=
实际行为表现

例如:

Method:
AskQuestion

可能产生:

Behavior:
Initiate Human Query

最终:

Action:
提出具体问题

100.35 Method 的工程对象

在软件工程中,可以建立:

Method Object

例如:

Method
{
    id
    name
    goal
    object
    state
    condition
    parameters
    steps
    expected_result
    constraints
    priority
    experience_score
}

这样:

Method

就可以进入数据库、对象模型和状态机。


100.36 Method Repository

如果机器拥有大量方法,可以形成:

Method Repository

结构:

Method Repository
│
├── Communication
├── Observation
├── Analysis
├── Retrieval
├── Comparison
├── Selection
├── Transformation
├── Planning
└── Execution

但这些只是方法分类。

真正决定调用哪个方法的是:

Cognitive Matching

100.37 Method Matching Engine

可以建立:

Method Matching Engine

输入:

Object
State
Goal
Decision
Context
Knowledge
Experience
Constraints

输出:

Candidate Methods

再经过:

Method Evaluation

最终:

Selected Method

100.38 Cognitive Method Engine

进一步:

Cognitive Engine
       ↓
Decision Engine
       ↓
Method Engine

职责:

Decision Engine
=
决定做什么

Method Engine
=
决定怎么做

这两个模块必须保持清晰边界。


100.39 Method Engine 的基本流程

可以定义:

Decision
 ↓
Object Identification
 ↓
State Identification
 ↓
Goal Identification
 ↓
Method Retrieval
 ↓
Method Matching
 ↓
Method Evaluation
 ↓
Constraint Check
 ↓
Method Selection
 ↓
Method Preparation

最终输出:

Selected Method

而不是直接执行 Action。


100.40 Method Evaluation

多个方法同时适用时:

M1
M2
M3

机器需要比较:

Effectiveness
Experience
Cost
Risk
Time
Compatibility
Goal Fit

形成:

Method Evaluation

然后:

M1 = 0.87
M2 = 0.76
M3 = 0.64

选择:

M1

这里再次体现:

Cognitive Decision

的递归结构。


100.41 方法选择也是认知选择

因此:

Decision

并不是只发生一次。

可以形成:

Goal
 ↓
What Decision
 ↓
Method Decision
 ↓
Behavior Decision
 ↓
Action

也就是说:

机器认知可能存在不同层次的选择。

第99章解决:

What

第100章解决:

How

后续还需要继续研究:

How exactly

以及:

Execute

100.42 Method 与 Context

同一个:

Object

在不同:

Context

下可能采用不同方法。

因此:

Object
+
Context
+
State
+
Goal
 ↓
Method

例如:

Object = Person
Context = Emergency

与:

Object = Person
Context = Normal Conversation

显然不应使用完全相同的方法。

所以:

方法不是脱离情境存在的。


100.43 Method Context Model

可以定义:

Method Context
{
    environment,
    person,
    object,
    state,
    goal,
    constraints,
    history
}

然后:

Method Selection
=
Match(Current Context, Method Conditions)

这使方法选择与前面的:

Cognitive Mapping
Cognitive Matching

形成统一体系。


100.44 Method 的可解释性

机器选择:

Method M1

应该能够回答:

Why M1?

例如:

Object:
User

State:
Waiting

Goal:
Get Information

Experience:
M1 successful 8 times

Constraint:
Low interaction cost

Decision:
Ask User

Method:
AskQuestion

因此:

Method Trace

可以追溯:

Method
 ↓
Decision
 ↓
Goal
 ↓
Object
 ↓
State
 ↓
Experience
 ↓
Knowledge

100.45 Method Error

方法选择错误可能来自:

Object Error
State Error
Goal Error
Mapping Error
Matching Error
Knowledge Error
Experience Error
Evaluation Error

例如:

State 判断错误

可能导致:

Wrong Method

所以:

方法错误同样可能是认知链前面的问题,而不只是方法本身的问题。


100.46 Method Feedback

执行之后:

Method
 ↓
Action
 ↓
Outcome

结果可以反馈到:

Method Evaluation

例如:

Method A
 ↓
Outcome Bad

以后:

Method A Priority ↓

因此:

Feedback
 ↓
Method Update

形成方法层面的学习。


100.47 Method Learning

可以形成:

Method Learning

过程:

Method
 ↓
Outcome
 ↓
Evaluation
 ↓
Experience
 ↓
Learning
 ↓
Method Weight Update

长期以后:

Method Selection

会发生变化。

这意味着:

机器不仅学习知识,也可以学习“做事情的方法”。


100.48 Method Evolution

进一步:

Old Method
 ↓
Experience
 ↓
Failure / Improvement
 ↓
Method Modification
 ↓
New Method

形成:

Method Evolution

例如:

M1

最初:

Step A → Step B

经过经验:

Step A
 ↓
Condition Check
 ↓
Step B

形成:

M1'

因此方法本身也可以成为机器认知学习和演化的对象。


100.49 Method 与 Individual Cognition

到这里:

Individual

已经拥有:

Knowledge
Memory
Experience
Goals
Decision
Methods

因此:

Individual Cognitive Space

进一步形成:

Object
State
Decision
Method

之间的个体化关系。

例如:

Individual A
 ↓
Object A
 ↓
State X
 ↓
Decision D1
 ↓
Method M1

而另一个个体:

Individual B
 ↓
Object A
 ↓
State X
 ↓
Decision D2
 ↓
Method M2

即使面对相似对象,也可能产生不同方法。


100.50 Method 的个体性

这说明:

方法也是 Individual Cognitive Model 的组成部分。

因为不同个体:

Experience
Knowledge
Preferences
Goals

不同,所以:

Method Selection

也可能不同。

因此:

Individual Cognition
 ↓
Individual Decision
 ↓
Individual Method

最终形成:

Individual Behavior

100.51 对象—方法映射的完整结构

现在可以正式建立:

Object
 ↓
Object Attributes
 ↓
Object Relations
 ↓
Object State
 ↓
Context
 ↓
Goal
 ↓
Decision
 ↓
Method Matching
 ↓
Method Evaluation
 ↓
Method Selection

核心关系:

Object + State + Context
           ↓
      Method Mapping
           ↓
         Method

如果进一步加入目标:

Object
+
State
+
Context
+
Goal
+
Decision
 ↓
Method

这就是更加完整的:

Object–Method Cognitive Mapping


100.52 Cognitive Method 的核心模型

可以正式定义:

Cognitive Method
=
Object
+
State
+
Context
+
Goal
+
Decision
+
Knowledge
+
Experience
+
Constraints
 ↓
Method Selection

进一步:

Selected Method
 ↓
Behavior Preparation

100.53 机器认知链进一步延伸

前面第91章建立:

Machine Understanding

第99章建立:

Cognitive Decision

现在第100章继续:

Machine Understanding
 ↓
Cognitive Decision
 ↓
Cognitive Method

完整关系:

理解
 ↓
决定做什么
 ↓
决定怎么做

这已经开始形成真正的:

机器认知行为准备过程。


100.54 从 Cognition 到 Action

目前可以形成:

Perception
 ↓
Symbol
 ↓
Element
 ↓
Relation
 ↓
Object
 ↓
State
 ↓
Cognitive Structure
 ↓
Mapping
 ↓
Matching
 ↓
Interpretation
 ↓
Understanding
 ↓
Memory
 ↓
Experience
 ↓
Learning
 ↓
Adaptation
 ↓
Decision
 ↓
Method

下一步自然需要研究:

Method
 ↓
Behavior

以及:

Behavior
 ↓
Action

所以第100章是机器认知由:

Understanding

进入:

Behavior Preparation

的重要节点。


100.55 Cognitive Method 与传统 AI 的区别

传统系统经常:

Input
 ↓
Model
 ↓
Output

而这里形成:

Input
 ↓
Perception
 ↓
Cognitive Structure
 ↓
Understanding
 ↓
Decision
 ↓
Method

方法不是:

Model Output

而是:

Cognitive Object

经过:

Mapping
Matching
Evaluation
Selection

形成的结果。


100.56 Cognitive Method 与程序方法的区别

程序中的:

Method

通常是:

预先定义的执行代码

而 ICAI 中的:

Cognitive Method

强调:

什么时候适用
为什么适用
对什么对象适用
在什么状态下适用
达到什么目标
过去效果如何
当前是否允许

因此:

ICAI 的 Method 是“认知选择出来的方法”,而不仅是“程序员写好的函数”。


100.57 Cognitive Method 的工程闭环

可以形成:

Goal
 ↓
Decision
 ↓
Object Identification
 ↓
State Identification
 ↓
Method Retrieval
 ↓
Method Matching
 ↓
Method Evaluation
 ↓
Method Selection
 ↓
Method Preparation
 ↓
Execution
 ↓
Outcome
 ↓
Feedback
 ↓
Experience
 ↓
Method Learning

其中本章的核心边界停留在:

Method Selection
 ↓
Method Preparation

100.58 本章最重要的理论关系

第100章最终建立三组核心关系:

第一组

Goal
 ↓
Decision

解决:

做什么?

第二组

Decision
 ↓
Method

解决:

怎么做?

第三组

Object
+
State
+
Context
 ↓
Method Mapping

解决:

对什么对象,在什么情况下,采用什么方法?

三者合起来:

Goal
 ↓
Decision
 ↓
Object / State / Context
 ↓
Method Mapping
 ↓
Method

100.59 Cognitive Method 的最终定义

Cognitive Method 是机器个体在特定认知状态、目标、对象和情境下,根据知识、经验、约束以及已有方法结构,通过映射、匹配、评价和选择确定实现当前决策的方式。

简化为:

Cognitive Method
=
How to Achieve the Decision

而:

Object–Method Mapping
=
Which Method Is Applicable to Which Object Under Which State and Context

100.60 第100章的最终认知结构

最终形成:

                    Individual
                         ↓
                 Cognitive Space
                         ↓
                      Goal
                         ↓
                     Cognition
                         ↓
                    Decision
                         ↓
              ┌──────────┴──────────┐
              ↓                     ↓
           Object                 Context
              ↓                     ↓
            State                   ↓
              └──────────┬──────────┘
                         ↓
                  Method Mapping
                         ↓
                  Method Matching
                         ↓
                  Method Evaluation
                         ↓
                  Method Selection
                         ↓
                      Method

因此,第100章真正完成的是:

第99章
Cognitive Decision
        ↓
     做什么

第100章
Cognitive Method
        ↓
     怎么做

并正式把你前面建立的:

Object
 ↓
Method

从普通面向对象程序设计中的“对象调用方法”,提升为:

Cognitive Object
        ↓
Object State
        ↓
Cognitive Mapping
        ↓
Method Matching
        ↓
Method Selection

这一步非常关键。因为从这里开始,Method 不再只是程序代码中的一个函数,而成为机器认知体系中连接“决策”和“行为”的中间认知结构。

下一章就应该专门研究 第101章 Cognitive Behavior(认知行为):不再讨论“选择什么方法”,而只研究机器如何把已经选择的方法转化为可观察的行为

Leave a Reply

Your email address will not be published. Required fields are marked *